Commit 02b8d3cc authored by Vincent Carrubba's avatar Vincent Carrubba
Browse files

Correction of some bugs.Now, you can see a video with a green filter, :D

parent 596d1fb5
...@@ -83,7 +83,7 @@ MixerEffect::~MixerEffect() ...@@ -83,7 +83,7 @@ MixerEffect::~MixerEffect()
void MixerEffect::render( void ) void MixerEffect::render( void )
{ {
LightVideoFrame tmp; quint32 i;
QHash< QString, InSlot<LightVideoFrame> >::iterator it = m_videoInputs.begin(); QHash< QString, InSlot<LightVideoFrame> >::iterator it = m_videoInputs.begin();
QHash< QString, InSlot<LightVideoFrame> >::iterator end = m_videoInputs.end(); QHash< QString, InSlot<LightVideoFrame> >::iterator end = m_videoInputs.end();
...@@ -94,6 +94,14 @@ void MixerEffect::render( void ) ...@@ -94,6 +94,14 @@ void MixerEffect::render( void )
const VideoFrame& lvf = static_cast<VideoFrame>( static_cast<LightVideoFrame>( ( it.value() ) ) ); const VideoFrame& lvf = static_cast<VideoFrame>( static_cast<LightVideoFrame>( ( it.value() ) ) );
if ( lvf.rvf.raw != NULL ) if ( lvf.rvf.raw != NULL )
{ {
// qDebug() << "PONEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEY";
// for ( i = 0; i < lvf.nboctets; ++i )
// {
// qDebug() << "DUMP MIXER"
// << "lvf.rvf.raw[" << i << "] = "
// << lvf.rvf.raw[i];
// }
m_videoOutputs["out"] << it.value(); m_videoOutputs["out"] << it.value();
} }
++it; ++it;
......
...@@ -25,10 +25,32 @@ void PouetEffect::render( void ) ...@@ -25,10 +25,32 @@ void PouetEffect::render( void )
// m_videoOutputs["out"] << m_videoInputs["in"]; // m_videoOutputs["out"] << m_videoInputs["in"];
( m_videoInputs["in"] ) >> tmp; ( m_videoInputs["in"] ) >> tmp;
// for ( i = 0; i < tmp.nboctets; ++i )
// {
// qDebug() << "DUMP"
// << "tmp.rvf.raw[" << i << "] = "
// << tmp.rvf.raw[i];
// }
for ( i = 0; i < tmp.nbpixels; ++i ) for ( i = 0; i < tmp.nbpixels; ++i )
{ {
// qDebug() << "BEFORE MODIFIYING COLORS"
// << "tmp.rvf.pixel[i].Red = "
// << tmp.rvf.pixel[i].Red
// << '\n'
// << "tmp.rvf.pixel[i].Blue = "
// << tmp.rvf.pixel[i].Blue
// << "\n-----------------------";
tmp.rvf.pixel[i].Red = 0; tmp.rvf.pixel[i].Red = 0;
tmp.rvf.pixel[i].Blue = 0; tmp.rvf.pixel[i].Blue = 0;
// qDebug() << "AFTER MODIFIYING COLORS"
// << "tmp.rvf.pixel[i].Red = "
// << tmp.rvf.pixel[i].Red
// << '\n'
// << "tmp.rvf.pixel[i].Blue = "
// << tmp.rvf.pixel[i].Blue
// << "\n-----------------------";
} }
(m_videoOutputs["out"]) << tmp; (m_videoOutputs["out"]) << tmp;
qDebug() << "End of PouetEffect"; qDebug() << "End of PouetEffect";
......
...@@ -15,8 +15,6 @@ VideoFrame::VideoFrame() ...@@ -15,8 +15,6 @@ VideoFrame::VideoFrame()
VideoFrame::VideoFrame( quint32 nboctets ) VideoFrame::VideoFrame( quint32 nboctets )
{ {
quint32 i;
this->nboctets = nboctets; this->nboctets = nboctets;
this->nbpixels = nboctets / Pixel::NbComposantes; this->nbpixels = nboctets / Pixel::NbComposantes;
this->rvf.raw = new quint8[nboctets]; this->rvf.raw = new quint8[nboctets];
...@@ -79,12 +77,21 @@ VideoFrame & VideoFrame::operator=( VideoFrame const & tocopy ) ...@@ -79,12 +77,21 @@ VideoFrame & VideoFrame::operator=( VideoFrame const & tocopy )
VideoFrame::VideoFrame( VideoFrame const & tocopy ) VideoFrame::VideoFrame( VideoFrame const & tocopy )
{ {
quint32 i; if (tocopy.rvf.raw != NULL)
{
quint32 i;
this->nboctets = tocopy.nboctets; this->nboctets = tocopy.nboctets;
this->nbpixels = tocopy.nboctets / Pixel::NbComposantes; this->nbpixels = tocopy.nboctets / Pixel::NbComposantes;
this->rvf.raw = new quint8[tocopy.nboctets]; this->rvf.raw = new quint8[tocopy.nboctets];
for ( i = 0; i < this->nboctets; ++i ) for ( i = 0; i < this->nboctets; ++i )
this->rvf.raw[i] = tocopy.rvf.raw[i]; this->rvf.raw[i] = tocopy.rvf.raw[i];
}
else
{
this->nboctets = 0;
this->nbpixels = 0;
this->rvf.raw = NULL;
}
} }
...@@ -38,8 +38,7 @@ MainWorkflow::MainWorkflow( int trackCount ) : ...@@ -38,8 +38,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
"MainWorkflow constructor", "Can't have more than one MainWorkflow instance" ); "MainWorkflow constructor", "Can't have more than one MainWorkflow instance" );
m_instance = this; m_instance = this;
MainWorkflow::blackOutput = new VideoFrame( VIDEOHEIGHT * VIDEOWIDTH * 3 ); MainWorkflow::blackOutput = new VideoFrame();
memset( MainWorkflow::blackOutput->rvf.raw, 0, VIDEOHEIGHT * VIDEOWIDTH * 3 );
m_tracks = new Toggleable<TrackWorkflow*>[trackCount]; m_tracks = new Toggleable<TrackWorkflow*>[trackCount];
for ( int i = 0; i < trackCount; ++i ) for ( int i = 0; i < trackCount; ++i )
......
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