Changeset 9861
- Timestamp:
- 03/04/09 17:03:28 (4 years ago)
- Location:
- OpenSceneGraph/trunk/src/osgPlugins/ffmpeg
- Files:
-
- 4 modified
-
FFmpegDecoderAudio.hpp (modified) (1 diff)
-
FFmpegDecoderVideo.cpp (modified) (5 diffs)
-
FFmpegDecoderVideo.hpp (modified) (2 diffs)
-
FFmpegImageStream.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp
r9847 r9861 42 42 private: 43 43 44 //typedef boost::shared_ptr<AVFrame> FramePtr;45 44 typedef osg::ref_ptr<osg::AudioSink> SinkPtr; 46 45 typedef std::vector<uint8_t> Buffer; -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
r9860 r9861 33 33 FFmpegDecoderVideo::~FFmpegDecoderVideo() 34 34 { 35 osg::notify(osg::NOTICE)<<"Destructing FFmpegDecoderVideo..."<<std::endl; 36 35 37 if (isRunning()) 36 38 { … … 46 48 } 47 49 #endif 50 51 osg::notify(osg::NOTICE)<<"Destructed FFmpegDecoderVideo"<<std::endl; 48 52 } 49 53 … … 261 265 AVPicture * const dst = (AVPicture *) m_frame_rgba.get(); 262 266 263 osg::Timer_t startTick = osg::Timer::instance()->tick();264 265 267 // Assign appropriate parts of the buffer to image planes in m_frame_rgba 266 268 avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB32, width(), height()); … … 273 275 convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width(), height()); 274 276 275 276 // Flip and swap buffer277 // swapBuffers();278 279 280 osg::Timer_t endTick = osg::Timer::instance()->tick();281 osg::notify(osg::NOTICE)<<" time of swapBuffers = "<<osg::Timer::instance()->delta_m(startTick,endTick)<<"ms"<<std::endl;282 283 277 // Wait 'delay' seconds before publishing the picture. 284 278 int i_delay = static_cast<int>(delay * 1000000 + 0.5); … … 300 294 301 295 m_publish_func(* this, m_user_data); 302 }303 304 305 306 void FFmpegDecoderVideo::swapBuffers()307 {308 for (int h = 0; h < height(); ++h)309 memcpy(&(m_buffer_rgba[1-m_writeBuffer])[(height() - h - 1) * width() * 4], &(m_buffer_rgba[m_writeBuffer])[h * width() * 4], width() * 4);310 296 } 311 297 -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
r9860 r9861 9 9 #include "FFmpegPacket.hpp" 10 10 11 #include <boost/shared_ptr.hpp>12 11 #include <OpenThreads/Thread> 13 12 #include <vector> … … 86 85 void findAspectRatio(); 87 86 void publishFrame(double delay); 88 void swapBuffers();89 87 double synchronizeVideo(double pts); 90 88 void yuva420pToRgba(AVPicture *dst, const AVPicture *src, int width, int height); -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp
r9860 r9861 40 40 FFmpegImageStream::~FFmpegImageStream() 41 41 { 42 osg::notify(osg::NOTICE)<<"Destructing FFMpegImageStream..."<<std::endl; 43 42 44 quit(true); 43 45 46 // destroy the decoder and associated threads 47 m_decoder = 0; 48 49 44 50 delete m_commands; 51 52 osg::notify(osg::NOTICE)<<"Destructed FFMpegImageStream."<<std::endl; 45 53 } 46 54
