/* * 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