svvitch
digital signage player
D:/vs_workspace/switch_sf/src/svvitch/FFVideoDecoder.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <Poco/Logger.h>
00004 #include <Poco/Mutex.h>
00005 #include <Poco/Thread.h>
00006 #include <Poco/Runnable.h>
00007 #include <queue>
00008 
00009 #include "FFBaseDecoder.h"
00010 #include "VideoFrame.h"
00011 
00012 using std::queue;
00013 
00014 
00019 class FFVideoDecoder: public FFBaseDecoder, Poco::Runnable
00020 {
00021 friend class FFMovieContent;
00022 private:
00023     Poco::FastMutex _startLock;
00024 
00025     Poco::Thread _thread;
00026     Poco::Runnable* _worker;
00027 
00028     SwsContext* _swsCtx;
00029     AVFrame* _outFrame;
00030     uint8_t* _buffer;
00031 
00032     AVFrame* _diFrame;
00033     uint8_t* _diBuffer;
00034 
00035     queue<VideoFrame*> _frames;
00036     queue<VideoFrame*> _usedFrames;
00037 
00038     LPD3DXEFFECT _fx;
00039 
00040     int _dw;
00041     int _dh;
00042 
00043     FFVideoDecoder(Renderer& renderer, AVFormatContext* ic, const int streamNo);
00044 
00045     virtual ‾FFVideoDecoder();
00046 
00047 
00048     virtual bool isReady();
00049 
00053     void clearAllFrames();
00054 
00055     void start();
00056 
00057     const float getDisplayAspectRatio() const;
00058 
00059     const UINT bufferedFrames();
00060 
00061     void run();
00062 
00063     VideoFrame* parseAVFrame(AVCodecContext* avctx, AVFrame* frame);
00064 
00065     void pushUsedFrame(VideoFrame* vf);
00066 
00067     VideoFrame* popFrame();
00068 
00069     VideoFrame* frontFrame();
00070 
00071     VideoFrame* viewFrame();
00072 
00073     VideoFrame* popUsedFrame();
00074 };
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines