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