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 )
// TRANSITIONS
int i;
// int i;
for ( i = 100; i < 100000; i += 100 )
addTransition( 1, 2, i, i + 50);
// for ( i = 100; i < 100000; i += 100 )
// addTransition( 1, 2, i, i + 50);
}
else
......@@ -197,7 +197,7 @@ EffectsEngine::render( void )
QWriteLocker wl( &m_rwl );
if ( m_processedInBypassPatch == false )
{
configureTransitions();
// configureTransitions();
m_patch->render();
}
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 )
(*m_ien->getStaticVideoInput("src")) >> lvf1;
(*m_ien->getStaticVideoInput("dst")) >> lvf2;
QImage src( lvf1->frame.octets, 640, 480, QImage::Format_RGB888 );
QImage dst( lvf2->frame.octets, 640, 480, QImage::Format_RGB888 );
QImage src( lvf1->frame.octets, lvf1->width, lvf1->height, QImage::Format_RGB888 );
QImage dst( lvf2->frame.octets, lvf2->width, lvf2->height, QImage::Format_RGB888 );
QPainter p( &dst );
p.drawImage( 100, 100, src);
......
......@@ -104,7 +104,7 @@ private:
};
template<typename T>
T InSlot<T>::s_defaultValue = 0;
T InSlot<T>::s_defaultValue;
/////////////////////////
//// PUBLICS METHODS ////
......
......@@ -41,6 +41,9 @@ VideoFrame::VideoFrame( void )
frame.octets = NULL;
nboctets = 0;
nbpixels = 0;
width = 0;
height = 0;
ptsDiff = 0;
}
VideoFrame::VideoFrame( const VideoFrame& tocopy ) : QSharedData( tocopy )
......@@ -49,6 +52,8 @@ VideoFrame::VideoFrame( const VideoFrame& tocopy ) : QSharedData( tocopy )
{
nboctets = tocopy.nboctets;
nbpixels = tocopy.nboctets / Pixel::NbComposantes;
width = tocopy.width;
height = tocopy.height;
ptsDiff = tocopy.ptsDiff;
frame.octets = new quint8[tocopy.nboctets];
......@@ -85,21 +90,25 @@ LightVideoFrame::operator=( const LightVideoFrame& tocopy )
return *this;
}
LightVideoFrame::LightVideoFrame( quint32 nboctets )
LightVideoFrame::LightVideoFrame( quint32 width, quint32 height )
{
m_videoFrame = new VideoFrame;
m_videoFrame->nboctets = nboctets;
m_videoFrame->nbpixels = nboctets / Pixel::NbComposantes;
m_videoFrame->frame.octets = new quint8[nboctets];
m_videoFrame->width = width;
m_videoFrame->height = height;
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;
}
LightVideoFrame::LightVideoFrame( const quint8 * tocopy, quint32 nboctets )
LightVideoFrame::LightVideoFrame( const quint8 * tocopy, quint32 width, quint32 height )
{
m_videoFrame = new VideoFrame;
m_videoFrame->nboctets = nboctets;
m_videoFrame->nbpixels = nboctets / Pixel::NbComposantes;
m_videoFrame->frame.octets = new quint8[nboctets];
m_videoFrame->width = width;
m_videoFrame->height = height;
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;
memcpy( m_videoFrame->frame.octets, tocopy, m_videoFrame->nboctets );
......
......@@ -51,6 +51,8 @@ struct VideoFrame : public QSharedData
VideoFrame( const VideoFrame& tocopy);
RawVideoFrame frame;
quint32 width;
quint32 height;
quint32 nbpixels;
quint32 nboctets;
qint64 ptsDiff;
......@@ -62,8 +64,8 @@ public:
LightVideoFrame();
LightVideoFrame( const LightVideoFrame& tocopy );
LightVideoFrame( quint32 nboctets );
LightVideoFrame( const quint8* tocopy, quint32 nboctets );
LightVideoFrame( quint32 width, quint32 height );
LightVideoFrame( const quint8* tocopy, quint32 width, quint32 height );
~LightVideoFrame();
LightVideoFrame& operator=( const LightVideoFrame& tocopy );
......
......@@ -91,7 +91,9 @@ ImageClipWorkflow::lock(ImageClipWorkflow *cw, void **pp_ret, int size )
cw->m_renderLock->lock();
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 );
}
*pp_ret = (*(cw->m_buffer))->frame.octets;
......
......@@ -71,7 +71,8 @@ MainWorkflow::MainWorkflow( int trackCount ) :
}
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 );
}
......
......@@ -33,9 +33,8 @@ VideoClipWorkflow::VideoClipWorkflow( Clip *clip ) :
{
for ( unsigned int i = 0; i < VideoClipWorkflow::nbBuffers; ++i )
{
m_availableBuffers.enqueue( new LightVideoFrame( MainWorkflow::getInstance()->getWidth()
* MainWorkflow::getInstance()->getHeight()
* Pixel::NbComposantes ) );
m_availableBuffers.enqueue( new LightVideoFrame( MainWorkflow::getInstance()->getWidth(),
MainWorkflow::getInstance()->getHeight() ) );
}
debugType = 2;
}
......@@ -122,9 +121,8 @@ VideoClipWorkflow::lock( VideoClipWorkflow *cw, void **pp_ret, int size )
cw->m_computedBuffersMutex->lock();
if ( cw->m_availableBuffers.isEmpty() == true )
{
lvf = new LightVideoFrame( MainWorkflow::getInstance()->getWidth()
* MainWorkflow::getInstance()->getHeight()
* Pixel::NbComposantes );
lvf = new LightVideoFrame( MainWorkflow::getInstance()->getWidth(),
MainWorkflow::getInstance()->getHeight() );
}
else
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