GithubHelp home page GithubHelp logo

ogrecave / ogre-audiovideo Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 10.0 6.37 MB

plugins for theora video playback and openAL audio

Home Page: https://ogrecave.github.io/ogre-audiovideo/

License: BSD 3-Clause "New" or "Revised" License

CMake 1.97% C++ 96.69% C 1.17% SWIG 0.17%
ogre3d video openal theora

ogre-audiovideo's Introduction

%Ogre Video and Audio Plugins {#mainpage}

This is the API reference for the Ogre Video and Audio plugins; contained within are the specifications for each class and the methods on those classes which you can refer to when using the library in your code.

OggSound

The %OgreOggSound library is designed to provide a simple, quick and easy method of adding audio to an OGRE based application. Its primarily a wrapper around the OpenAL audio library, but its design focus is seamless integration with OGRE based applications.

It hides all the mundane setup and updating procedures needed by OpenAL, and condenses the functionality down to a clean and simple OGRE-fied interface.

Features

  • .ogg file format support
  • uncompressed .wav file support
  • In memory and streaming support
    • Load whole sound into memory
    • Stream sound from a file
  • Optional multithreaded streaming
  • Multichannel audio support
  • Full 2D/3D audio support
    • spatialized sound support using mono sound files
    • 2D/multichannel support
  • Full control over 3D parameters
    • All 3D properties exposed for customisation
    • Global attenuation model configurable
    • Global sound speed configurable
    • Global doppler effect configurable
  • Playback seeking
  • Cue points - Set 'jump-to' points within sounds
  • Configurable loop points
    • By default a sound would loop from start to end, however a user can customise this by offsetting the start point of the loop per sound.
  • Temporary sounds
    • Allows creation and automatic destruction of single-play/infrequent sounds.
  • Source management
    • Sources are pooled
    • Sources are automatically re-used when a sound requests to play
    • Sounds are re-activated if temporarily stopped.
  • OGRE integration support
    • Sound objects are derived from MovableObject
    • can be attached directly into scene graph via SceneNodes
    • Automatically updates transformations
  • Audio capturing support to WAV file.
  • XRAM hardware buffer support
    • Currently experimental
  • EFX effect support
    • Support for attaching EFX filters/effects to sounds if hardware supported
    • Support for EAX room reverb presets
  • Volume control
  • Pitch control
  • Loop control
  • Fully Documented

Theora Video Plugin

The Theora Video plugin allows referencing theora streams as @ref External-Texture-Sources.

Features

  • Integrates into Ogre3D as a FrameListener
  • Supports loading videos from material files
  • optional yuv->rgb conversion via shader

ogre-audiovideo's People

Contributors

gojeaqui avatar oold avatar paroj avatar rpaciorek avatar sercero avatar yuriazathoth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ogre-audiovideo's Issues

OGGSOUND_THREADED and HAVE_EFX macros

  1. OGGSOUND_THREADED and HAVE_EFX macros change OgreOggSound::OgreOggSoundManager size and data offsets.
  2. OgreOggSound don't store build time values of this macros in installed headers.
    (example: when build with cmake flag USE_EFX=0 in installed headers default value of HAVE_EFX is set to 2)

In effect if you don't manually reproduce values of this macros in your project, you get weird errors (e.g. wrong pointer to listener return by getListener()).

Possible solutions:

  • set build-time values of macros in installed header
  • move macro related members to sub-structure (and always hold pointer to it)
  • display build time error when user don't set those values in compiler options
  • ???

Lots of deprecation warnings

I am compiling against OGRE 1.11.6 and I am getting lots of warnings about deprecated functions:
OGRE_DEPRECATED void bind(T* rep) { shared_ptr::reset(rep); }
OGRE_DEPRECATED bool isNull(void) const { return !shared_ptr::operator bool(); }
OGRE_DEPRECATED void setNull() { shared_ptr::reset(); }

I'm not sure how to fix them myself

OgreOggSound crashes when exiting and threading is enabled

Hello @paroj, I'm trying now to solve another Segmentation fault.

This also happens when exiting an application that is using OgreOggSound, but this time when threading is enabled.

I don't have a complete backtrace, but stepping through the debugger the culprit is this line:

	OgreOggSoundManager::~OgreOggSoundManager()
	{
#if OGGSOUND_THREADED
		mShuttingDown = true;
		
		if ( mUpdateThread )
		{
			mUpdateThread->join();	<--- !!! HERE !!!
			OGRE_FREE(mUpdateThread, Ogre::MEMCATEGORY_GENERAL);
			mUpdateThread = 0;
			mShuttingDown = false;

It seems that when calling for the thread to join it crashes with the following incomplete backtrace:

Thread 24 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 18952.0x5130]
0x000000006782cce8 in soft_oal!alDistanceModel () from D:\OGRE2\Built\openal-soft-1.20.1-bin\bin\Win64\soft_oal.dll
(gdb) bt
#0  0x000000006782cce8 in soft_oal!alDistanceModel () from D:\OGRE2\Built\openal-soft-1.20.1-bin\bin\Win64\soft_oal.dll
#1  0x00000000678aa559 in soft_oal!alcCaptureOpenDevice () from D:\OGRE2\Built\openal-soft-1.20.1-bin\bin\Win64\soft_oal.dll
#2  0x0000000067894ba1 in soft_oal!alcCaptureOpenDevice () from D:\OGRE2\Built\openal-soft-1.20.1-bin\bin\Win64\soft_oal.dll
#3  0x0000000067894e0a in soft_oal!alcCaptureOpenDevice () from D:\OGRE2\Built\openal-soft-1.20.1-bin\bin\Win64\soft_oal.dll
#4  0x00007fffbf849a1d in ntdll!RtlActivateActivationContextUnsafeFast () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x00007fffbf849aff in ntdll!RtlActivateActivationContextUnsafeFast () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x00007fffbf8475a3 in ntdll!LdrShutdownThread () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x00007fffbf88462e in ntdll!RtlExitUserThread () from C:\WINDOWS\SYSTEM32\ntdll.dll
#8  0x00007fffbe4fafa7 in msvcrt!_endthreadex () from C:\WINDOWS\System32\msvcrt.dll
#9  0x0000000064944b19 in pthread_create_wrapper () from D:\OGRE2\CodeBlocks\MinGW\opt\bin\libwinpthread-1.dll
#10 0x00007fffbe4faf5a in msvcrt!_beginthreadex () from C:\WINDOWS\System32\msvcrt.dll
#11 0x00007fffbe4fb02c in msvcrt!_endthreadex () from C:\WINDOWS\System32\msvcrt.dll
#12 0x00007fffbe417034 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#13 0x00007fffbf882651 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#14 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

I have tried naively to add a lock on OgreOggSoundManager::getSingletonPtr()->mMutex or have the thread wait for 10ms after setting mShuttingDown = true without success.

Do you have any ideas?

Thanks!

Use std::thread instead of boost::thread?

Hello @paroj, I'm trying to replace the use of boost::thread with that of std::thread and I want to ask you some questions.

On one hand if you think that boost::thread should remain as a third option or be replaced by std::thread entirely.

Also, can you confirm that this replacement is valid?

//boost::recursive_mutex::scoped_lock soundLock(mSoundMutex);
std::lock_guard<std::recursive_mutex> soundLock(mSoundMutex);

Another thing is that I'm trying to find a replacement for this statement, but it goes over my head:

mUpdateThread = OGRE_NEW_T(boost::thread, Ogre::MEMCATEGORY_GENERAL)(boost::function0<void>(&OgreOggSoundManager::threadUpdate, this));

Can you help?

Thanks.

NOTE: If you want I can submit the pull request and you review there. But I wasn't able to test anything because for now the code is not compiling due to the mUpdateThread creation.

Error while configuring with CMake

I prepared sources with CMake and only changed OGRE_DIR=C:/Work/SDK/Ogre_install/CMake (ogre install dir) and CMake writed this:

Found OGRE
  static     : OFF
  components : Bites;HLMS;MeshLodGenerator;Overlay;Paging;Property;RTShaderSystem;Terrain;Volume
  plugins    : Plugin_BSPSceneManager;Plugin_OctreeSceneManager;Plugin_PCZSceneManager;Plugin_ParticleFX;RenderSystem_GL;RenderSystem_GL3Plus;RenderSystem_Direct3D9;RenderSystem_Direct3D11;Codec_STBI
  media      : C:/Work/SDK/Ogre_install/Media
CMake Error at CMakeLists.txt:4 (find_package):
  Found package configuration file:

    C:/Work/SDK/Ogre_install/CMake/OGREConfig.cmake

  but it set OGRE_FOUND to FALSE so package "OGRE" is considered to be NOT
  FOUND.  Reason given by package:

  Component 'OPTIONAL' is required but was not found



Configuring incomplete, errors occurred!
See also "C:/Work/SDK/OgreVideo_build/CMakeFiles/CMakeOutput.log".

Possible bug introduced by new SceneManager handling

Hey @paroj, I believe there where some changes introduced in Ogre 1.12 that relate to Scene Managers (because this wasn't an issue in OGRE 1.11 or earlier versions of OgreOggSound).

It seems that it produced a bug in OgreOggSound, because I am observing this behaviour:

mRoot->destroySceneManager(mSceneMgr);
mRoot->shutdown();

Produces a Segmentation fault. with the following backtrace:

Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000006fc6e7a6 in libstdc++-6!_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareERKS4_ () from D:\OGRE2\CodeBlocks\MinGW\bin\libstdc++-6.dll
(gdb) bt
#0  0x000000006fc6e7a6 in libstdc++-6!_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareERKS4_ () from D:\OGRE2\CodeBlocks\MinGW\bin\libstdc++-6.dll
#1  0x0000000001fd8960 in std::operator< <char, std::char_traits<char>, std::allocator<char> > (__lhs=<error reading variable: Cannot access memory at address 0xfeeefeeefeeeff16>, __rhs="OgreOggISound")
    at D:/OGRE2/CodeBlocks/MinGW/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/basic_string.h:6097
#2  0x0000000001e43534 in std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::operator() (this=0x17ad93b8, __x=<error reading variable: Cannot access memory at address 0xfeeefeeefeeeff16>,
    __y="OgreOggISound") at D:/OGRE2/CodeBlocks/MinGW/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_function.h:386
#3  0x0000000001f39ca7 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Ogre::SceneManager::MovableObjectCollection*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Ogre::SceneManager::MovableObjectCollection*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Ogre::SceneManager::MovableObjectCollection*> > >::_M_lower_bound (
    this=0x17ad93b8, __x=0xfeeefeeefeeefeee, __y=0x17ad93c0, __k="OgreOggISound") at D:/OGRE2/CodeBlocks/MinGW/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_tree.h:1888
#4  0x0000000001f3a481 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Ogre::SceneManager::MovableObjectCollection*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Ogre::SceneManager::MovableObjectCollection*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Ogre::SceneManager::MovableObjectCollection*> > >::find (this=0x17ad93b8,
    __k="OgreOggISound") at D:/OGRE2/CodeBlocks/MinGW/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_tree.h:2539
#5  0x0000000001ebf600 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, Ogre::SceneManager::MovableObjectCollection*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Ogre::SceneManager::MovableObjectCollection*> > >::find (this=0x17ad93b8, __x="OgreOggISound")
    at D:/OGRE2/CodeBlocks/MinGW/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_map.h:1170
#6  0x0000000001d029e8 in Ogre::SceneManager::getMovableObjectCollection (this=0x17ad9020, typeName="OgreOggISound") at D:\OGRE2\Sources\ogre-1.12.12\OgreMain\src\OgreSceneManager.cpp:3615
#7  0x0000000001d03012 in Ogre::SceneManager::destroyAllMovableObjectsByType (this=0x17ad9020, typeName="OgreOggISound") at D:\OGRE2\Sources\ogre-1.12.12\OgreMain\src\OgreSceneManager.cpp:3718
#8  0x0000000070b04f6e in OgreOggSound::OgreOggSoundManager::~OgreOggSoundManager (this=0x17ad8b90, __in_chrg=<optimized out>) at D:\OGRE2\Sources\ogre-audiovideo\oggsound\src\OgreOggSoundManager.cpp:223
#9  0x0000000070b0adf6 in OgreOggSound::OgreOggSoundPlugin::shutdown (this=0x17abc8b0) at D:\OGRE2\Sources\ogre-audiovideo\oggsound\src\OgreOggSoundPlugin.cpp:77
#10 0x0000000001cf178c in Ogre::Root::shutdownPlugins (this=0x17b86f50) at D:\OGRE2\Sources\ogre-1.12.12\OgreMain\src\OgreRoot.cpp:972
#11 0x0000000001cf0efd in Ogre::Root::shutdown (this=0x17b86f50) at D:\OGRE2\Sources\ogre-1.12.12\OgreMain\src\OgreRoot.cpp:896
#12 0x0000000000403473 in SoundTest::~SoundTest (this=0x82fd40, __in_chrg=<optimized out>) at D:\OGRE2\Dev\SoundTest\SoundTest.cpp:53
#13 0x0000000000404dc2 in WinMain (hInst=0x400000, strCmdLine=0x8e3d71 "") at D:\OGRE2\Dev\SoundTest\SoundTest.cpp:404
#14 0x00000000004013c7 in __tmainCRTStartup ()
#15 0x00000000004014fb in mainCRTStartup ()

It seems that the OgreOggSoundPlugin is being shutdown before the SceneManager.

Can you help me with this?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.