- Timestamp:
- 03/04/09 17:03:28 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
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
