#include "VideoFrame.h"
{
qDebug("CREATE DATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
data = new VideoDataShared;
if (data == 0)
return;
data->RGB = rgb;
data->Y = y;
data->U = u;
data->V = v;
data->sequence = 0;
data->time_stamp = 0;
m_Number = number;
qDebug(" m_Number is %d and number is %d >>>>>>>>>>>>>>>>>>>>",m_Number, number);
}
CVideoFrame::CVideoFrame(const CVideoFrame &f)
{
qDebug("SECOND CONSTRUCTORRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
data = f.data;
qDebug("time_stamp is %ld", data->time_stamp);
qDebug("sequence is %ld", data->sequence);
if (data != 0)
{
data->ref();
}
}
CVideoFrame::~CVideoFrame()
{
/* if (data && data->deref()) {
delete data;
data = 0;
}
*/
}
// private
uint CVideoFrame::GetRefCount() const
{
// if (data != 0)
// return 0;
return 1;
//// return data->count;
}
// public
CVideoFrame &CVideoFrame::operator =(const CVideoFrame &f)
{
//// if (f.data == 0)
//// return *this;
/* f.data->ref();
if (data && data->deref()) {
delete data;
data = 0;
}
data = f.data;
return *this;
*/
}
const QImage *CVideoFrame
::GetRGB() const {
/// qDebug("qDebuggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg %d",data->RGB);
return data->RGB;
}
const QImage *CVideoFrame
::GetY() const {
/////////// return data->Y;
}
const QImage *CVideoFrame
::GetU() const {
////////////// return data->U;
}
const QImage *CVideoFrame
::GetV() const {
//////////////// return data->V;
}
uint CVideoFrame::GetNumber() const
{
/// qDebug("<<m_Number is ..................%d<<",m_Number);
return m_Number;
}
void CVideoFrame::SetSequence(unsigned long seq)
{
//// data->sequence = seq;
}
/**
\brief Get sequence number
VideoFrames are sequentially numbered as they are fetches from videodevice
or file. The sequence number is a monotonous increasing number.
Note: when fetching frames from a video device, sequence numbers are not
contiguous in case frames are dropped by the capture process.
*/
unsigned long CVideoFrame::GetSequence() const
{
////////////// return data->sequence;
}
void CVideoFrame::SetTimeStamp(unsigned long stamp)
{
//////////////// data->time_stamp = stamp;
}
/**
\brief Get time stamp
\return Time in milliseconds
VideoFrames are time stamped, to make it easier to order/reference them. The
timestamp is measured in milliseconds.
Note: The first video frame of a video sequence is not guaranteed to have a
timestamp of 0! The only guarantee you have is that the timestamp is a monotonous
increasing number.
*/
unsigned long CVideoFrame::GetTimeStamp() const
{
///// return data->time_stamp;
}