Commit 874fbae5 authored by Vincent Carrubba's avatar Vincent Carrubba

Adding width and height in LightVideoFrame and using it in blitinrectangle

parent eb8f2eae
...@@ -116,10 +116,10 @@ EffectsEngine::makePatch( void ) ...@@ -116,10 +116,10 @@ EffectsEngine::makePatch( void )
// TRANSITIONS // TRANSITIONS
int i; // int i;
for ( i = 100; i < 100000; i += 100 ) // for ( i = 100; i < 100000; i += 100 )
addTransition( 1, 2, i, i + 50); // addTransition( 1, 2, i, i + 50);
} }
else else
...@@ -197,7 +197,7 @@ EffectsEngine::render( void ) ...@@ -197,7 +197,7 @@ EffectsEngine::render( void )
QWriteLocker wl( &m_rwl ); QWriteLocker wl( &m_rwl );
if ( m_processedInBypassPatch == false ) if ( m_processedInBypassPatch == false )
{ {
configureTransitions(); // configureTransitions();
m_patch->render(); m_patch->render();
} }
else else
......
HEADERS += EffectsEngine.h \
EffectNode.h \
EffectNodeFactory.h \
EffectPluginTypeManager.h \
EffectPluginTypeLoader.h \
SemanticObjectManager.hpp \
SimpleObjectsReferencer.hpp
SOURCES += EffectNodeFactory.cpp \
EffectPluginTypeManager.cpp \
EffectPluginTypeLoader.cpp \
EffectsEngine.cpp \
EffectNode.cpp
...@@ -51,8 +51,8 @@ void BlitInRectangleEffectPlugin::render( void ) ...@@ -51,8 +51,8 @@ void BlitInRectangleEffectPlugin::render( void )
(*m_ien->getStaticVideoInput("src")) >> lvf1; (*m_ien->getStaticVideoInput("src")) >> lvf1;
(*m_ien->getStaticVideoInput("dst")) >> lvf2; (*m_ien->getStaticVideoInput("dst")) >> lvf2;
QImage src( lvf1->frame.octets, 640, 480, QImage::Format_RGB888 ); QImage src( lvf1->frame.octets, lvf1->width, lvf1->height, QImage::Format_RGB888 );
QImage dst( lvf2->frame.octets, 640, 480, QImage::Format_RGB888 ); QImage dst( lvf2->frame.octets, lvf2->width, lvf2->height, QImage::Format_RGB888 );
QPainter p( &dst ); QPainter p( &dst );
p.drawImage( 100, 100, src); p.drawImage( 100, 100, src);
......
...@@ -104,7 +104,7 @@ private: ...@@ -104,7 +104,7 @@ private:
}; };
template<typename T> template<typename T>
T InSlot<T>::s_defaultValue = 0; T InSlot<T>::s_defaultValue;
///////////////////////// /////////////////////////
//// PUBLICS METHODS //// //// PUBLICS METHODS ////
......
...@@ -41,6 +41,9 @@ VideoFrame::VideoFrame( void ) ...@@ -41,6 +41,9 @@ VideoFrame::VideoFrame( void )
frame.octets = NULL; frame.octets = NULL;
nboctets = 0; nboctets = 0;
nbpixels = 0; nbpixels = 0;
width = 0;
height = 0;
ptsDiff = 0;
} }
VideoFrame::VideoFrame( const VideoFrame& tocopy ) : QSharedData( tocopy ) VideoFrame::VideoFrame( const VideoFrame& tocopy ) : QSharedData( tocopy )
...@@ -49,6 +52,8 @@ VideoFrame::VideoFrame( const VideoFrame& tocopy ) : QSharedData( tocopy ) ...@@ -49,6 +52,8 @@ VideoFrame::VideoFrame( const VideoFrame& tocopy ) : QSharedData( tocopy )
{ {
nboctets = tocopy.nboctets; nboctets = tocopy.nboctets;
nbpixels = tocopy.nboctets / Pixel::NbComposantes; nbpixels = tocopy.nboctets / Pixel::NbComposantes;
width = tocopy.width;
height = tocopy.height;
ptsDiff = tocopy.ptsDiff; ptsDiff = tocopy.ptsDiff;
frame.octets = new quint8[tocopy.nboctets]; frame.octets = new quint8[tocopy.nboctets];
...@@ -85,21 +90,25 @@ LightVideoFrame::operator=( const LightVideoFrame& tocopy ) ...@@ -85,21 +90,25 @@ LightVideoFrame::operator=( const LightVideoFrame& tocopy )
return *this; return *this;
} }
LightVideoFrame::LightVideoFrame( quint32 nboctets ) LightVideoFrame::LightVideoFrame( quint32 width, quint32 height )
{ {
m_videoFrame = new VideoFrame; m_videoFrame = new VideoFrame;
m_videoFrame->nboctets = nboctets; m_videoFrame->width = width;
m_videoFrame->nbpixels = nboctets / Pixel::NbComposantes; m_videoFrame->height = height;
m_videoFrame->frame.octets = new quint8[nboctets]; m_videoFrame->nbpixels = m_videoFrame->width * m_videoFrame->height;
m_videoFrame->nboctets = m_videoFrame->nbpixels * Pixel::NbComposantes;
m_videoFrame->frame.octets = new quint8[m_videoFrame->nboctets];
m_videoFrame->ptsDiff = 0; m_videoFrame->ptsDiff = 0;
} }
LightVideoFrame::LightVideoFrame( const quint8 * tocopy, quint32 nboctets ) LightVideoFrame::LightVideoFrame( const quint8 * tocopy, quint32 width, quint32 height )
{ {
m_videoFrame = new VideoFrame; m_videoFrame = new VideoFrame;
m_videoFrame->nboctets = nboctets; m_videoFrame->width = width;
m_videoFrame->nbpixels = nboctets / Pixel::NbComposantes; m_videoFrame->height = height;
m_videoFrame->frame.octets = new quint8[nboctets]; m_videoFrame->nbpixels = m_videoFrame->width * m_videoFrame->height;
m_videoFrame->nboctets = m_videoFrame->nbpixels * Pixel::NbComposantes;
m_videoFrame->frame.octets = new quint8[m_videoFrame->nboctets];
m_videoFrame->ptsDiff = 0; m_videoFrame->ptsDiff = 0;
memcpy( m_videoFrame->frame.octets, tocopy, m_videoFrame->nboctets ); memcpy( m_videoFrame->frame.octets, tocopy, m_videoFrame->nboctets );
......
...@@ -51,6 +51,8 @@ struct VideoFrame : public QSharedData ...@@ -51,6 +51,8 @@ struct VideoFrame : public QSharedData
VideoFrame( const VideoFrame& tocopy); VideoFrame( const VideoFrame& tocopy);
RawVideoFrame frame; RawVideoFrame frame;
quint32 width;
quint32 height;
quint32 nbpixels; quint32 nbpixels;
quint32 nboctets; quint32 nboctets;
qint64 ptsDiff; qint64 ptsDiff;
...@@ -62,8 +64,8 @@ public: ...@@ -62,8 +64,8 @@ public:
LightVideoFrame(); LightVideoFrame();
LightVideoFrame( const LightVideoFrame& tocopy ); LightVideoFrame( const LightVideoFrame& tocopy );
LightVideoFrame( quint32 nboctets ); LightVideoFrame( quint32 width, quint32 height );
LightVideoFrame( const quint8* tocopy, quint32 nboctets ); LightVideoFrame( const quint8* tocopy, quint32 width, quint32 height );
~LightVideoFrame(); ~LightVideoFrame();
LightVideoFrame& operator=( const LightVideoFrame& tocopy ); LightVideoFrame& operator=( const LightVideoFrame& tocopy );
......
...@@ -91,7 +91,9 @@ ImageClipWorkflow::lock(ImageClipWorkflow *cw, void **pp_ret, int size ) ...@@ -91,7 +91,9 @@ ImageClipWorkflow::lock(ImageClipWorkflow *cw, void **pp_ret, int size )
cw->m_renderLock->lock(); cw->m_renderLock->lock();
if ( cw->m_buffer == NULL ) if ( cw->m_buffer == NULL )
{ {
cw->m_buffer = new LightVideoFrame( size ); // cw->m_buffer = new LightVideoFrame( size );
cw->m_buffer = new LightVideoFrame( MainWorkflow::getInstance()->getWidth(),
MainWorkflow::getInstance()->getHeight() );
cw->m_stackedBuffer = new StackedBuffer( cw->m_buffer ); cw->m_stackedBuffer = new StackedBuffer( cw->m_buffer );
} }
*pp_ret = (*(cw->m_buffer))->frame.octets; *pp_ret = (*(cw->m_buffer))->frame.octets;
......
...@@ -71,7 +71,8 @@ MainWorkflow::MainWorkflow( int trackCount ) : ...@@ -71,7 +71,8 @@ MainWorkflow::MainWorkflow( int trackCount ) :
} }
m_outputBuffers = new OutputBuffers; m_outputBuffers = new OutputBuffers;
blackOutput = new LightVideoFrame( m_width * m_height * Pixel::NbComposantes ); blackOutput = new LightVideoFrame( m_width, m_height);
// FIX ME vvvvvv , It doesn't update meta info (nbpixels, nboctets, etc.
memset( (*blackOutput)->frame.octets, 0, (*blackOutput)->nboctets ); memset( (*blackOutput)->frame.octets, 0, (*blackOutput)->nboctets );
} }
......
...@@ -33,9 +33,8 @@ VideoClipWorkflow::VideoClipWorkflow( Clip *clip ) : ...@@ -33,9 +33,8 @@ VideoClipWorkflow::VideoClipWorkflow( Clip *clip ) :
{ {
for ( unsigned int i = 0; i < VideoClipWorkflow::nbBuffers; ++i ) for ( unsigned int i = 0; i < VideoClipWorkflow::nbBuffers; ++i )
{ {
m_availableBuffers.enqueue( new LightVideoFrame( MainWorkflow::getInstance()->getWidth() m_availableBuffers.enqueue( new LightVideoFrame( MainWorkflow::getInstance()->getWidth(),
* MainWorkflow::getInstance()->getHeight() MainWorkflow::getInstance()->getHeight() ) );
* Pixel::NbComposantes ) );
} }
debugType = 2; debugType = 2;
} }
...@@ -122,9 +121,8 @@ VideoClipWorkflow::lock( VideoClipWorkflow *cw, void **pp_ret, int size ) ...@@ -122,9 +121,8 @@ VideoClipWorkflow::lock( VideoClipWorkflow *cw, void **pp_ret, int size )
cw->m_computedBuffersMutex->lock(); cw->m_computedBuffersMutex->lock();
if ( cw->m_availableBuffers.isEmpty() == true ) if ( cw->m_availableBuffers.isEmpty() == true )
{ {
lvf = new LightVideoFrame( MainWorkflow::getInstance()->getWidth() lvf = new LightVideoFrame( MainWorkflow::getInstance()->getWidth(),
* MainWorkflow::getInstance()->getHeight() MainWorkflow::getInstance()->getHeight() );
* Pixel::NbComposantes );
} }
else else
lvf = cw->m_availableBuffers.dequeue(); lvf = cw->m_availableBuffers.dequeue();
......
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