diff options
author | Dimitri John Ledkov <dimitri.ledkov@canonical.com> | 2014-02-20 16:10:52 +0000 |
---|---|---|
committer | Dimitri John Ledkov <dimitri.ledkov@canonical.com> | 2014-02-20 19:15:57 +0000 |
commit | d20f4a64eba38690337ac914a04a113de7caf125 (patch) | |
tree | 6828990e93ca5d8847b8cde2f2febb6566b0d53f /src/video/AsyncVideoDecoder.h | |
parent | 28161e9209f21be1a600f637565ecede94855a36 (diff) |
New upstream release. Closes: #721047debian/1.8.0-1
Drop all patches, none are needed with this new upstream release.
Port to dh.
Specify foreign in configure.ac.
Diffstat (limited to 'src/video/AsyncVideoDecoder.h')
-rw-r--r-- | src/video/AsyncVideoDecoder.h | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/src/video/AsyncVideoDecoder.h b/src/video/AsyncVideoDecoder.h index b90c35b..7773831 100644 --- a/src/video/AsyncVideoDecoder.h +++ b/src/video/AsyncVideoDecoder.h @@ -1,6 +1,6 @@ // // libavg - Media Playback Engine. -// Copyright (C) 2003-2011 Ulrich von Zadow +// Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,7 @@ #include "../api.h" #include "VideoDecoder.h" +#include "VideoDemuxerThread.h" #include "VideoDecoderThread.h" #include "AudioDecoderThread.h" #include "VideoMsg.h" @@ -40,76 +41,77 @@ namespace avg { class AVG_API AsyncVideoDecoder: public VideoDecoder { public: - AsyncVideoDecoder(VideoDecoderPtr pSyncDecoder, int queueLength); + AsyncVideoDecoder(int queueLength); virtual ~AsyncVideoDecoder(); - virtual void open(const std::string& sFilename, bool bSyncDemuxer, - bool bUseHardwareAccelleration); + virtual void open(const std::string& sFilename, bool bUseHardwareAcceleration, + bool bEnableSound); virtual void startDecoding(bool bDeliverYCbCr, const AudioParams* pAP); virtual void close(); - virtual DecoderState getState() const; - virtual VideoInfo getVideoInfo() const; - virtual void seek(double destTime); + virtual void seek(float destTime); virtual void loop(); - virtual IntPoint getSize() const; virtual int getCurFrame() const; virtual int getNumFramesQueued() const; - virtual double getCurTime(StreamSelect stream = SS_DEFAULT) const; - virtual double getNominalFPS() const; - virtual double getFPS() const; - virtual void setFPS(double fps); - virtual double getVolume() const; - virtual void setVolume(double volume); - virtual PixelFormat getPixelFormat() const; + virtual float getCurTime() const; + virtual float getFPS() const; + virtual void setFPS(float fps); virtual FrameAvailableCode renderToBmps(std::vector<BitmapPtr>& pBmps, - double timeWanted); - virtual bool isEOF(StreamSelect stream = SS_ALL) const; - virtual void throwAwayFrame(double timeWanted); - - virtual int fillAudioBuffer(AudioBufferPtr pBuffer); - + float timeWanted); + void updateAudioStatus(); + virtual bool isEOF() const; + virtual void throwAwayFrame(float timeWanted); + + AudioMsgQueuePtr getAudioMsgQ(); + AudioMsgQueuePtr getAudioStatusQ() const; + private: - VideoMsgPtr getBmpsForTime(double timeWanted, FrameAvailableCode& frameAvailable); + void setupDemuxer(std::vector<int> streamIndexes); + void deleteDemuxer(); + VideoMsgPtr getBmpsForTime(float timeWanted, FrameAvailableCode& frameAvailable); VideoMsgPtr getNextBmps(bool bWait); void waitForSeekDone(); - void returnFrame(VideoMsgPtr& pFrameMsg); + void checkForSeekDone(); + void handleVSeekMsg(VideoMsgPtr pMsg); + void handleVSeekDone(AudioMsgPtr pMsg); + void handleAudioMsg(AudioMsgPtr pMsg); + void returnFrame(VideoMsgPtr pFrameMsg); + bool isSeeking() const; + bool isVSeeking() const; - DecoderState m_State; - VideoDecoderPtr m_pSyncDecoder; - std::string m_sFilename; int m_QueueLength; + boost::thread* m_pDemuxThread; + std::map<int, VideoMsgQueuePtr> m_PacketQs; + VideoDemuxerThread::CQueuePtr m_pDemuxCmdQ; + boost::thread* m_pVDecoderThread; VideoDecoderThread::CQueuePtr m_pVCmdQ; VideoMsgQueuePtr m_pVMsgQ; boost::thread* m_pADecoderThread; - boost::mutex m_AudioMutex; AudioDecoderThread::CQueuePtr m_pACmdQ; - VideoMsgQueuePtr m_pAMsgQ; - VideoMsgPtr m_pAudioMsg; - unsigned char* m_AudioMsgData; - int m_AudioMsgSize; + AudioMsgQueuePtr m_pAMsgQ; + AudioMsgQueuePtr m_pAStatusQ; - VideoInfo m_VideoInfo; - - IntPoint m_Size; - int m_NumFrames; bool m_bUseStreamFPS; - PixelFormat m_PF; + float m_FPS; + int m_NumSeeksSent; + int m_NumVSeeksDone; + int m_NumASeeksDone; + bool m_bWasVSeeking; + bool m_bWasSeeking; + bool m_bAudioEOF; bool m_bVideoEOF; - bool m_bSeekPending; - boost::mutex m_SeekMutex; - double m_Volume; - double m_LastVideoFrameTime; - double m_LastAudioFrameTime; - - bool m_bUsesVDPAU; + float m_LastVideoFrameTime; + float m_CurVideoFrameTime; + float m_LastAudioFrameTime; }; +typedef boost::shared_ptr<AsyncVideoDecoder> AsyncVideoDecoderPtr; + } #endif |