Commit 89d7c059 authored by Vincent Carrubba's avatar Vincent Carrubba

Weird hack on copy-on-write, but it seems to work, very weird

parent d0b3c258
......@@ -3,8 +3,7 @@
// CTOR & DTOR
EffectsEngine::EffectsEngine( void// quint32 nbinputs, quint32 nboutputs
)
EffectsEngine::EffectsEngine( void )
{
quint32 i;
......@@ -14,12 +13,6 @@ EffectsEngine::EffectsEngine( void// quint32 nbinputs, quint32 nboutputs
for (i = 0; i < 1; ++i)
m_videoOutputs[i];
start();
// quint32 i;
// for (i = 0; i < nbinputs; ++i)
// m_videoInputs[i];
// for (i = 0; i < nboutputs; ++i)
// m_videoOutputs[i];
}
EffectsEngine::~EffectsEngine()
......
......@@ -54,46 +54,61 @@ LightVideoFrame& LightVideoFrame::operator=(LightVideoFrame const & tocopy)
// if ( m_videoFrame->frame.octets == NULL )
// {
// if ( tocopy.m_videoFrame->frame.octets != NULL )
// {
// m_videoFrame->frame.octets = new quint8[tocopy.m_videoFrame->nboctets];
// m_videoFrame->nboctets = tocopy.m_videoFrame->nboctets;
// m_videoFrame->nbpixels = tocopy.m_videoFrame->nboctets / Pixel::NbComposantes;
// quint32 i;
//
// for ( i = 0; i < m_videoFrame->nboctets; ++i )
// m_videoFrame->frame.octets[i] = tocopy.m_videoFrame->frame.octets[i];
// }
// {
// qDebug() << "frame NULL & frame of tocopy not NULL" << "\n"
// << "this pixels = " << m_videoFrame->nbpixels << "\n"
// << "tocopy.m_videoFrame pixels = " << tocopy.m_videoFrame->nbpixels;
// m_videoFrame->frame.octets = new quint8[tocopy.m_videoFrame->nboctets];
// m_videoFrame->nboctets = tocopy.m_videoFrame->nboctets;
// m_videoFrame->nbpixels = tocopy.m_videoFrame->nboctets / Pixel::NbComposantes;
// quint32 i;
// for ( i = 0; i < m_videoFrame->nboctets; ++i )
// m_videoFrame->frame.octets[i] = tocopy.m_videoFrame->frame.octets[i];
// }
// }
// else
// {
// if ( tocopy.m_videoFrame->frame.octets != NULL )
// {
// if ( m_videoFrame->nboctets != tocopy.m_videoFrame->nboctets )
// {
// qDebug() << __LINE__ << "\n"
// << "this pixels = " << m_videoFrame->nbpixels
// << "tocopy.m_videoFrame pixels = " << tocopy.m_videoFrame->nbpixels;
// delete [] m_videoFrame->frame.octets;
// m_videoFrame->frame.octets = new quint8[tocopy.m_videoFrame->nboctets];
// m_videoFrame->nboctets = tocopy.m_videoFrame->nboctets;
// m_videoFrame->nbpixels = tocopy.m_videoFrame->nboctets / Pixel::NbComposantes;
// }
// quint32 i;
//
// for ( i = 0; i < m_videoFrame->nboctets; ++i )
// m_videoFrame->frame.octets[i] = tocopy.m_videoFrame->frame.octets[i];
// }
// {
// qDebug() << "frame not NULL & frame of tocopy not NULL" << "\n"
// << "this pixels = " << m_videoFrame->nbpixels << "\n"
// << "tocopy.m_videoFrame pixels = " << tocopy.m_videoFrame->nbpixels;
// if ( m_videoFrame->nboctets != tocopy.m_videoFrame->nboctets )
// {
// delete [] m_videoFrame->frame.octets;
// m_videoFrame->frame.octets = new quint8[tocopy.m_videoFrame->nboctets];
// m_videoFrame->nboctets = tocopy.m_videoFrame->nboctets;
// m_videoFrame->nbpixels = tocopy.m_videoFrame->nboctets / Pixel::NbComposantes;
// }
// quint32 i;
// for ( i = 0; i < m_videoFrame->nboctets; ++i )
// m_videoFrame->frame.octets[i] = tocopy.m_videoFrame->frame.octets[i];
// }
// else
// {
// delete [] m_videoFrame->frame.octets;
// m_videoFrame->frame.octets = NULL;
// m_videoFrame->nboctets = 0;
// m_videoFrame->nbpixels = 0;
// }
// {
// qDebug() << "frame not NULL & frame of tocopy NULL" << "\n"
// << "this pixels = " << m_videoFrame->nbpixels << "\n"
// << "tocopy.m_videoFrame pixels = " << tocopy.m_videoFrame->nbpixels;
// delete [] m_videoFrame->frame.octets;
// m_videoFrame->frame.octets = NULL;
// m_videoFrame->nboctets = 0;
// m_videoFrame->nbpixels = 0;
// }
// }
//
m_videoFrame = tocopy.m_videoFrame;
return ( *this );
//
//
// #FIXME : WTF!? Why does this holly crap work fine?
//
//
m_videoFrame.detach();
m_videoFrame = tocopy.m_videoFrame;
return ( *this );
};
LightVideoFrame::LightVideoFrame(quint32 nboctets)
......
......@@ -4,6 +4,9 @@
#include <QSharedDataPointer>
#include <QSharedData>
#include <QDebug>
#include <qmutex.h>
#include <QWriteLocker>
#include <QReadLocker>
struct Pixel
{
......@@ -52,7 +55,6 @@ public:
private:
QSharedDataPointer<VideoFrame> m_videoFrame;
};
#endif // VIDEOFRAME_H_
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