Commit c8c6518a authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Copy the rendered buffer before using it for the preview.

parent 47310d7f
......@@ -32,6 +32,7 @@
#ifdef WITH_GUI
WorkflowFileRenderer::WorkflowFileRenderer() :
WorkflowRenderer(),
m_renderVideoFrame( NULL ),
m_image( NULL )
{
}
......@@ -107,7 +108,10 @@ WorkflowFileRenderer::lock( void *datas, qint64 *dts, qint64 *pts, quint32 *flag
if ( self->m_time.isValid() == false ||
self->m_time.elapsed() >= 1000 )
{
self->emit imageUpdated( (uchar*)*buffer );
if ( self->m_renderVideoFrame == NULL )
self->m_renderVideoFrame = new quint8[*bufferSize];
memcpy( self->m_renderVideoFrame, (uchar*)(*buffer), *bufferSize );
self->emit imageUpdated( self->m_renderVideoFrame );
self->m_time.restart();
}
#endif
......
......@@ -51,6 +51,7 @@ public:
virtual float getFps() const;
private:
quint8 *m_renderVideoFrame;
#ifdef WITH_GUI
QImage* m_image;
QTime m_time;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment