From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- mpeglib/lib/yuv/Makefile.am | 28 ++++++++ mpeglib/lib/yuv/yuvPlugin.cpp | 158 ++++++++++++++++++++++++++++++++++++++++++ mpeglib/lib/yuv/yuvPlugin.h | 47 +++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 mpeglib/lib/yuv/Makefile.am create mode 100644 mpeglib/lib/yuv/yuvPlugin.cpp create mode 100644 mpeglib/lib/yuv/yuvPlugin.h (limited to 'mpeglib/lib/yuv') diff --git a/mpeglib/lib/yuv/Makefile.am b/mpeglib/lib/yuv/Makefile.am new file mode 100644 index 00000000..b8d7155d --- /dev/null +++ b/mpeglib/lib/yuv/Makefile.am @@ -0,0 +1,28 @@ +# libplayerplugin - Makefile.am + +INCLUDES = $(all_includes) + +noinst_LTLIBRARIES = libyuvPlugin.la + + +noinst_HEADERS = + +kmpgincludedir = $(includedir)/$(THIS_LIB_NAME)/decoder + +kmpginclude_HEADERS = yuvPlugin.h + +libyuvPlugin_la_SOURCES = yuvPlugin.cpp + + + + + + + + + + + + + + diff --git a/mpeglib/lib/yuv/yuvPlugin.cpp b/mpeglib/lib/yuv/yuvPlugin.cpp new file mode 100644 index 00000000..94697aa8 --- /dev/null +++ b/mpeglib/lib/yuv/yuvPlugin.cpp @@ -0,0 +1,158 @@ +/* + raw yuv stream player + Copyright (C) 2000 Martin Vogt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation. + + For more information look at the file COPYRIGHT in this package + + */ + + +#include "yuvPlugin.h" + +#include + +using namespace std; + + +YUVPlugin::YUVPlugin() { + init(); +} + + +YUVPlugin::~YUVPlugin() { +} + + +void YUVPlugin::init() { + lCalcLength=false; + nWidth=0; + nHeight=0; + imageType=PICTURE_YUVMODE_CR_CB; + picPerSec=1.0; +} + + +void YUVPlugin::decoder_loop() { + + + + cout << "YUVPlugin::decoder_loop() 1"<openWindow(nWidth,nHeight,(char*)"yuv Viewer"); + pictureArray=output->lockPictureArray(); + cout << "pictureArray->setImageType"<setImageType(imageType); + + setStreamState(_STREAM_STATE_INIT); + break; + case _STREAM_STATE_INIT : + setStreamState(_STREAM_STATE_PLAY); + break; + case _STREAM_STATE_PLAY : { + // we read from input raw yuv bytes + // and display them. + pictureArray=output->lockPictureArray(); + // now we have the color info + YUVPicture* pic=pictureArray->getPast(); + unsigned char* dest=pic->getImagePtr(); + input->read((char*)dest,bytes); + pic->setPicturePerSecond(picPerSec); + // now inform subsystem about the frame to display + pictureArray->setYUVPictureCallback(pic); + // display it + output->unlockPictureArray(pictureArray); + + pictureArray->setYUVPictureCallback(NULL); + break; + } + case _STREAM_STATE_WAIT_FOR_END: + // exit while loop + lDecoderLoop=false; + cout << "mpegplugin _STREAM_STATE_WAIT_FOR_END"<flushWindow(); + // copy sequence back if needed + + cout << "delete mpegVideoStream"< + +class KDE_EXPORT YUVPlugin : public DecoderPlugin { + + int lCalcLength; + int nWidth; + int nHeight; + int imageType; + float picPerSec; + + public: + YUVPlugin(); + ~YUVPlugin(); + + void decoder_loop(); + void config(const char* key,const char* value,void* user_data); + + + private: + void init(); + + int getSongLength(); + + +}; + +#endif -- cgit v1.2.1