Changeset 9827
- Timestamp:
- 02/27/09 21:16:08 (4 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 2 added
- 2 removed
- 9 modified
-
include/osg/AudioStream (added)
-
include/osg/ImageStream (modified) (3 diffs)
-
src/osg/AudioStream.cpp (added)
-
src/osg/CMakeLists.txt (modified) (2 diffs)
-
src/osg/ImageStream.cpp (modified) (1 diff)
-
src/osgPlugins/ffmpeg/AudioSinkInterface.hpp (deleted)
-
src/osgPlugins/ffmpeg/CMakeLists.txt (modified) (1 diff)
-
src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (modified) (2 diffs)
-
src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp (modified) (4 diffs)
-
src/osgPlugins/ffmpeg/FFmpegHeaders.hpp (modified) (1 diff)
-
src/osgPlugins/ffmpeg/FFmpegImageStream.cpp (modified) (2 diffs)
-
src/osgPlugins/ffmpeg/FFmpegImageStream.hpp (modified) (4 diffs)
-
src/osgPlugins/ffmpeg/FFmpegSampleFormat.hpp (deleted)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/ImageStream
r8990 r9827 16 16 17 17 #include <osg/Image> 18 #include <osg/AudioStream> 18 19 19 20 namespace osg { … … 87 88 virtual void setVolume(float) {} 88 89 virtual float getVolume() const { return 0.0f; } 90 91 92 typedef std::vector< osg::ref_ptr<osg::AudioStream> > AudioStreams; 93 void setAudioStreams(const AudioStreams& asl) { _audioStreams = asl; } 94 AudioStreams& getAudioStreams() { return _audioStreams; } 95 const AudioStreams& getAudioStreams() const { return _audioStreams; } 89 96 90 97 … … 96 103 StreamStatus _status; 97 104 LoopingMode _loopingMode; 105 106 AudioStreams _audioStreams; 98 107 }; 99 108 -
OpenSceneGraph/trunk/src/osg/CMakeLists.txt
r9671 r9827 26 26 ${HEADER_PATH}/ArgumentParser 27 27 ${HEADER_PATH}/Array 28 ${HEADER_PATH}/AudioStream 28 29 ${HEADER_PATH}/AutoTransform 29 30 ${HEADER_PATH}/Billboard … … 194 195 ArgumentParser.cpp 195 196 Array.cpp 197 AudioStream.cpp 196 198 AutoTransform.cpp 197 199 Billboard.cpp -
OpenSceneGraph/trunk/src/osg/ImageStream.cpp
r8915 r9827 33 33 Image(image,copyop), 34 34 _status(image._status), 35 _loopingMode(image._loopingMode) 35 _loopingMode(image._loopingMode), 36 _audioStreams(image._audioStreams) 36 37 { 37 38 } -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt
r9818 r9827 21 21 22 22 SET(TARGET_H 23 AudioSinkInterface.hpp24 23 BoundedMessageQueue.hpp 25 24 FFmpegClocks.hpp -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp
r9826 r9827 57 57 m_frequency = m_context->sample_rate; 58 58 m_nb_channels = m_context->channels; 59 m_sample_format = FFmpegSampleFormat(m_context->sample_fmt);59 m_sample_format = osg::AudioStream::SampleFormat(m_context->sample_fmt); 60 60 61 61 // Check stream sanity … … 200 200 switch (sampleFormat()) 201 201 { 202 case SAMPLE_FORMAT_U8:202 case osg::AudioStream::SAMPLE_FORMAT_U8: 203 203 sample_size *= 1; 204 204 break; 205 205 206 case SAMPLE_FORMAT_S16:206 case osg::AudioStream::SAMPLE_FORMAT_S16: 207 207 sample_size *= 2; 208 208 break; 209 209 210 case SAMPLE_FORMAT_S24:210 case osg::AudioStream::SAMPLE_FORMAT_S24: 211 211 sample_size *= 3; 212 212 break; 213 213 214 case SAMPLE_FORMAT_S32:214 case osg::AudioStream::SAMPLE_FORMAT_S32: 215 215 sample_size *= 4; 216 216 break; 217 217 218 case SAMPLE_FORMAT_F32:218 case osg::AudioStream::SAMPLE_FORMAT_F32: 219 219 sample_size *= 4; 220 220 break; -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp
r9826 r9827 7 7 #include "FFmpegClocks.hpp" 8 8 #include "FFmpegPacket.hpp" 9 #include "FFmpegSampleFormat.hpp"10 9 11 #include "AudioSinkInterface.hpp" 10 #include <osg/AudioStream> 11 12 12 #include "BoundedMessageQueue.hpp" 13 13 14 14 15 … … 37 38 int frequency() const; 38 39 int nbChannels() const; 39 FFmpegSampleFormat sampleFormat() const;40 osg::AudioStream::SampleFormat sampleFormat() const; 40 41 41 42 private: … … 64 65 int m_frequency; 65 66 int m_nb_channels; 66 FFmpegSampleFormat m_sample_format;67 osg::AudioStream::SampleFormat m_sample_format; 67 68 68 69 SinkPtr m_audio_sink; … … 94 95 95 96 96 inline FFmpegSampleFormat FFmpegDecoderAudio::sampleFormat() const97 inline osg::AudioStream::SampleFormat FFmpegDecoderAudio::sampleFormat() const 97 98 { 98 99 return m_sample_format; -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp
r9816 r9827 3 3 #define HEADER_GUARD_FFMPEG_HEADERS_H 4 4 5 5 6 extern "C" 6 7 { 7 8 #define __STDC_CONSTANT_MACROS 9 #include <stdint.h> 8 10 #include <avcodec.h> 9 11 #include <avformat.h> -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp
r9826 r9827 128 128 129 129 130 void FFmpegImageStream:: fillAudioBuffer(void * const buffer, const size_t size)130 void FFmpegImageStream::consumeAudioBuffer(void * const buffer, const size_t size) 131 131 { 132 132 m_decoder->audio_decoder().fillBuffer(buffer, size); … … 184 184 185 185 186 FFmpegSampleFormat FFmpegImageStream::audioSampleFormat() const186 osg::AudioStream::SampleFormat FFmpegImageStream::audioSampleFormat() const 187 187 { 188 188 return m_decoder->audio_decoder().sampleFormat(); -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.hpp
r9826 r9827 8 8 #include <OpenThreads/Thread> 9 9 10 #include "AudioSinkInterface.hpp"11 #include "FFmpegSampleFormat.hpp"12 13 14 10 15 11 #ifdef _WIN32 … … 19 15 #define OSGFFMPEG_EXPORT_API __declspec(dllexport) 20 16 #else 21 #define OSGFFMPEG_EXPORT_API __declspec(dllimport) 17 #define OSGFFMPEG_EXPORT_API __declspec(dllimport); 22 18 #endif 23 19 #else … … 56 52 virtual void setAudioSink(osg::AudioSinkInterface* audio_sink); 57 53 58 void fillAudioBuffer(void * const buffer, const size_t size); 54 void consumeAudioBuffer(void * const buffer, const size_t size); 55 56 bool audioStream() const; 57 int audioFrequency() const; 58 int audioNbChannels() const; 59 osg::AudioStream::SampleFormat audioSampleFormat() const; 59 60 60 61 double duration() const; … … 64 65 double videoFrameRate() const; 65 66 66 bool audioStream() const;67 int audioFrequency() const;68 int audioNbChannels() const;69 FFmpegSampleFormat audioSampleFormat() const;70 67 71 68 private:
