Commit 15621fbd authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Fixed non-black output when nothing were to be rendered.

Fixed ************* emacs indentation.
parent 5c706873
......@@ -40,21 +40,21 @@ GreenFilterEffect::~GreenFilterEffect()
void GreenFilterEffect::render( void )
{
quint32 i;
LightVideoFrame tmp;
( m_videoInputs[0] ) >> tmp;
if (tmp->frame.octets != NULL)
{
if (m_enabled)
for ( i = 0; i < tmp->nbpixels; ++i )
{
tmp->frame.pixels[i].Red = 0;
tmp->frame.pixels[i].Blue = 0;
}
quint32 i;
LightVideoFrame tmp;
( m_videoInputs[0] ) >> tmp;
if (tmp->frame.octets != NULL)
{
if (m_enabled)
for ( i = 0; i < tmp->nbpixels; ++i )
{
tmp->frame.pixels[i].Red = 0;
tmp->frame.pixels[i].Blue = 0;
}
}
(m_videoOutputs[0]) << tmp;
}
return ;
return ;
}
void GreenFilterEffect::enable( void )
......
......@@ -39,22 +39,22 @@ VideoFrame::VideoFrame()
VideoFrame::VideoFrame(VideoFrame const & tocopy) : QSharedData( tocopy )
{
if ( tocopy.frame.octets != NULL )
if ( tocopy.frame.octets != NULL )
{
quint32 i;
nboctets = tocopy.nboctets;
nbpixels = tocopy.nboctets / Pixel::NbComposantes;
frame.octets = new quint8[tocopy.nboctets];
for ( i = 0; i < nboctets; ++i )
frame.octets[i] = tocopy.frame.octets[i];
quint32 i;
nboctets = tocopy.nboctets;
nbpixels = tocopy.nboctets / Pixel::NbComposantes;
frame.octets = new quint8[tocopy.nboctets];
for ( i = 0; i < nboctets; ++i )
frame.octets[i] = tocopy.frame.octets[i];
}
else
else
{
nboctets = 0;
nbpixels = 0;
frame.octets = NULL;
nboctets = 0;
nbpixels = 0;
frame.octets = NULL;
}
}
......
......@@ -105,16 +105,18 @@ MixerEffect::~MixerEffect()
void MixerEffect::render( void )
{
qint32 i;
static LightVideoFrame empty;
qint32 i;
for ( i = 63; i >= 0; --i )
{
const LightVideoFrame& lvf = m_videoInputs[i];
if ( lvf->frame.octets != NULL )
{
m_videoOutputs[0] << lvf;
return ;
m_videoOutputs[0] << lvf;
return ;
}
}
m_videoOutputs[0] << empty;
return ;
}
......@@ -32,6 +32,8 @@
//FIXME: remove this !
#include "ClipWorkflow.h"
LightVideoFrame* MainWorkflow::blackOutput = NULL;
MainWorkflow::MainWorkflow( int trackCount ) :
m_currentFrame( 0 ),
m_lengthFrame( 0 ),
......@@ -55,6 +57,9 @@ MainWorkflow::MainWorkflow( int trackCount ) :
connect( m_tracks[i], SIGNAL( allTracksRenderCompleted() ), this, SLOT( tracksRenderCompleted() ) );
}
m_outputBuffers = new OutputBuffers;
blackOutput = new LightVideoFrame( VIDEOHEIGHT * VIDEOWIDTH * Pixel::NbComposantes );
memset( (*blackOutput)->frame.octets, 0, (*blackOutput)->nboctets );
}
MainWorkflow::~MainWorkflow()
......@@ -215,9 +220,14 @@ MainWorkflow::OutputBuffers* MainWorkflow::getSynchroneOutput()
m_synchroneRenderWaitCondition->wait( m_synchroneRenderWaitConditionMutex );
// qDebug() << "Got it";
m_effectEngine->render();
if ( m_effectEngine->getOutputFrame( 0 )->nboctets == 0 )
m_outputBuffers->video = MainWorkflow::blackOutput;
else
m_outputBuffers->video = &( m_effectEngine->getOutputFrame( 0 ) );
m_synchroneRenderWaitConditionMutex->unlock();
m_outputBuffers->video = &( m_effectEngine->getOutputFrame( 0 ) );
// m_outputBuffers->video = reinterpret_cast<LightVideoFrame*>( m_tracks[TrackWorkflow::Video]->getSynchroneOutput() );
// m_outputBuffers->video = reinterpret_cast<LightVideoFrame*>( m_tracks[TrackWorkflow::Video]->getSynchroneOutput() );
// m_outputBuffers->audio = reinterpret_cast<unsigned char*>( m_tracks[TrackWorkflow::Audio]->getSynchroneOutput() );
return m_outputBuffers;
}
......
......@@ -131,6 +131,8 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
void computeLength();
void activateTrack( unsigned int trackId );
static LightVideoFrame* blackOutput;
private:
qint64 m_currentFrame;
qint64 m_lengthFrame;
......
......@@ -292,7 +292,9 @@ void TrackHandler::tracksRenderCompleted( unsigned int trackId )
{
LightVideoFrame* buff = reinterpret_cast<LightVideoFrame*>( m_tracks[trackId]->getSynchroneOutput() );
if ( buff == NULL )
{
m_effectEngine->setInputFrame( *TrackHandler::nullOutput, trackId );
}
else
m_effectEngine->setInputFrame( *buff, trackId );
}
......
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