/*
*/

#include <gst/gst.h>
#include <gst-phonon/gst-phonon.h>
#include "videodataoutput.h"
#include <kdebug.h>

namespace Phonon
{
namespace Gst
{
VideoDataOutput::VideoDataOutput( QObject* parent )
	: QObject( parent )
{
	//object = gpho_video_data_output_new();
}

VideoDataOutput::~VideoDataOutput()
{
	//gst_object_unref(object);
}

quint32 VideoDataOutput::format() const
{
	return m_fourcc;
}

//X int VideoDataOutput::displayLatency() const
//X {
//X 	return m_latency;
//X }

int VideoDataOutput::frameRate() const
{
	return m_frameRate;
}

void VideoDataOutput::setFrameRate( int frameRate )
{
	m_frameRate = frameRate;
}

QSize VideoDataOutput::naturalFrameSize() const
{
	return QSize( 320, 240 );
}

QSize VideoDataOutput::frameSize() const
{
	return m_frameSize;
}

void VideoDataOutput::setFrameSize( const QSize& frameSize )
{
	m_frameSize = frameSize;
}

void VideoDataOutput::setFormat( quint32 fourcc )
{
	m_fourcc = fourcc;
}

//X void VideoDataOutput::setDisplayLatency( int milliseconds )
//X {
//X 	m_latency = milliseconds;
//X }

void VideoDataOutput::processFrame( Phonon::VideoFrame& frame )
{
	if( frame.fourcc == m_fourcc )
		emit frameReady( frame );
	else
		kError( 604 ) << "format conversion not implemented" << endl;
	// TODO emit endOfMedia
}

}} //namespace Phonon::Gst

#include "videodataoutput.moc"
// vim: sw=4 ts=4
