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/mpegplay/mainMpegPlay.cpp | 179 ++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 mpeglib/lib/mpegplay/mainMpegPlay.cpp (limited to 'mpeglib/lib/mpegplay/mainMpegPlay.cpp') diff --git a/mpeglib/lib/mpegplay/mainMpegPlay.cpp b/mpeglib/lib/mpegplay/mainMpegPlay.cpp new file mode 100644 index 00000000..1c3d9659 --- /dev/null +++ b/mpeglib/lib/mpegplay/mainMpegPlay.cpp @@ -0,0 +1,179 @@ +/* + * main.c -- + * + * Example program for mpegplay library. + * Build with : + BUILD with:(if you have intel mmx) + + + g++ -DINTEL -I/usr/X11R6/include -I.. \ + -o mpegplay mainMpegPlay.cpp -L/usr/X11R6/lib \ + ../.libs/libmpeg.a -lX11 -lXext -lXv -lXxf86dga \ + -lXxf86dga -lpthread + + */ + + +#include "mpegPlugin.h" +#include "../output/outPlugin.h" +#include "mpegVideoLength.h" + +// Includes for non plugin version +#define _NO_PLUGIN_VERSION +//#define _PLUGIN_VERSION + + +#ifdef _NO_PLUGIN_VERSION + +int main(int argc, char** argv) { + + + + if (argc <= 1) { + printf("Usage:\n\n"); + printf("%s filename\n\n",argv[0]); + exit(0); + } + cout << "open -s 1"<config("performance","true",NULL); + cout << "open -s"<open(argv[1]); + //loader->seek(1024*1024*364+1024*600); + //loader->seek(1024*1024*333); + + MpegVideoLength* mpegVideoLength=new MpegVideoLength(input); + + + cout << "START length calc"<firstInitialize()==false) { + if (input->eof()) { + break; + } + continue; + } + int len=mpegVideoLength->getLength(); + cout << "END length calc"<firstInitialize(mpegVideoHeader)==false) { + + if (input->eof()) { + break; + } + } + + VideoDecoder* video; + mpegVideoHeader->print("start"); + cout << "**************"<getMB_Width()*16; + int height=mpegVideoHeader->getMB_Height()*16; + cout << "width:"<openWindow(width,height,(char*)"kmpg"); + + video= new VideoDecoder(mpegVideoStream,mpegVideoHeader); + + + // init is true + int cnt=0; + while (input->eof()==false){ + pictureArray=output->lockPictureArray(); + video->mpegVidRsrc(pictureArray); + pic=pictureArray->getYUVPictureCallback(); + if (pic == NULL) { + // nothin to display + continue; + } + + output->unlockPictureArray(pictureArray); + pictureArray->setYUVPictureCallback(NULL); + + } + cout << "DestroyVideoDecoder"<open(argv[1]); + cout << "open -s 2"<setOutputPlugin(out); + cout << "open -s 3"<setInputPlugin(in); + cout << "open -s 4"<play(); + int cnt=0; + while(plugin->getStreamState() != _STREAM_STATE_EOF) { + sleep(1); + PluginInfo* pluginInfo=plugin->getPluginInfo(); + pluginInfo->print(); + } + cout << "plugin eof"<close(); + + delete plugin; + delete in; + delete out; + +} + +#endif + -- cgit v1.2.1