Show
Ignore:
Timestamp:
03/04/09 15:49:39 (4 years ago)
Author:
robert
Message:

Introduced double buffering of video stream to avoid tearing of image.

Removed swapBufers call and image y inversion.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp

    r9847 r9860  
    5858        const_cast<unsigned char *>(m_decoder->video_decoder().image()), NO_DELETE 
    5959    ); 
     60     
     61    setOrigin(osg::Image::TOP_LEFT); 
    6062 
    6163    m_decoder->video_decoder().setUserData(this); 
     
    265267    FFmpegImageStream * const this_ = reinterpret_cast<FFmpegImageStream*>(user_data); 
    266268 
     269#if 1 
     270    this_->setImage( 
     271        this_->m_decoder->video_decoder().width(), this_->m_decoder->video_decoder().height(), 1, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE, 
     272        const_cast<unsigned char *>(this_->m_decoder->video_decoder().image()), NO_DELETE 
     273    ); 
     274#else 
    267275    /** \bug If viewer.realize() hasn't been already called, this doesn't work? */ 
    268276    this_->dirty(); 
     277#endif 
    269278 
    270279    OpenThreads::ScopedLock<Mutex> lock(this_->m_mutex);