diff options
author | scop <scop> | 2005-04-18 19:26:16 +0000 |
---|---|---|
committer | scop <scop> | 2005-04-18 19:26:16 +0000 |
commit | f8a3d81fc0b548a0f76e205fee433e4c94a4ee57 (patch) | |
tree | 2f69513d7d57e15b920c8eb4bb4b4a877d5b0881 /dxr3syncbuffer.h | |
parent | 37c4c7b0a4a388d6c933e95756ddd30dd0cca6fd (diff) | |
download | vdr-plugin-dxr3-f8a3d81fc0b548a0f76e205fee433e4c94a4ee57.tar.gz vdr-plugin-dxr3-f8a3d81fc0b548a0f76e205fee433e4c94a4ee57.tar.bz2 |
Oops, wrong tree... revert.
Diffstat (limited to 'dxr3syncbuffer.h')
-rw-r--r-- | dxr3syncbuffer.h | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/dxr3syncbuffer.h b/dxr3syncbuffer.h index 8c7336f..63c6e1e 100644 --- a/dxr3syncbuffer.h +++ b/dxr3syncbuffer.h @@ -38,101 +38,101 @@ const uint32_t UNKNOWN_ASPECT_RATIO = 0xFFFFFFFF; // ================================== class cFixedLengthFrame { - public: - cFixedLengthFrame(); - ~cFixedLengthFrame(); +public: + cFixedLengthFrame(); + ~cFixedLengthFrame(); - void Init(uint32_t lenght); + void Init(uint32_t lenght); - void CopyFrame(const uint8_t* pStart, int length, uint32_t pts, eFrameType type); - uint8_t* GetData(void); - int GetCount(void); - uint32_t GetPts(void); - void SetPts(uint32_t pts); - void SetChannelCount(uint32_t channelCount) {if (channelCount != UNKNOWN_CHANNEL_COUNT) m_staticAudioChannelCount = m_audioChannelCount = channelCount; else m_audioChannelCount = m_staticAudioChannelCount; }; - void SetDataRate(uint32_t dataRate) {if (m_audioDataRate != UNKNOWN_DATA_RATE) m_staticAudioDataRate = m_audioDataRate = dataRate; else m_audioDataRate = m_staticAudioDataRate;}; - void SetAspectRatio(uint32_t aspectRatio) {m_videoAspectRatio = aspectRatio;}; - uint32_t GetChannelCount(void) {return ((m_audioChannelCount == m_staticAudioChannelCount || !m_staticAudioChannelCount)? m_audioChannelCount : m_staticAudioChannelCount) ;}; - uint32_t GetDataRate(void) {return ((m_audioDataRate == m_staticAudioDataRate || !m_staticAudioDataRate) ? m_audioDataRate : m_staticAudioDataRate);}; - uint32_t GetAspectRatio(void) {return m_videoAspectRatio;}; - eFrameType GetFrameType(void) {return m_type;} + void CopyFrame(const uint8_t* pStart, int length, uint32_t pts, eFrameType type); + uint8_t* GetData(void); + int GetCount(void); + uint32_t GetPts(void); + void SetPts(uint32_t pts); + void SetChannelCount(uint32_t channelCount) {if (channelCount != UNKNOWN_CHANNEL_COUNT) m_staticAudioChannelCount = m_audioChannelCount = channelCount; else m_audioChannelCount = m_staticAudioChannelCount; }; + void SetDataRate(uint32_t dataRate) {if (m_audioDataRate != UNKNOWN_DATA_RATE) m_staticAudioDataRate = m_audioDataRate = dataRate; else m_audioDataRate = m_staticAudioDataRate;}; + void SetAspectRatio(uint32_t aspectRatio) {m_videoAspectRatio = aspectRatio;}; + uint32_t GetChannelCount(void) {return ((m_audioChannelCount == m_staticAudioChannelCount || !m_staticAudioChannelCount)? m_audioChannelCount : m_staticAudioChannelCount) ;}; + uint32_t GetDataRate(void) {return ((m_audioDataRate == m_staticAudioDataRate || !m_staticAudioDataRate) ? m_audioDataRate : m_staticAudioDataRate);}; + uint32_t GetAspectRatio(void) {return m_videoAspectRatio;}; + eFrameType GetFrameType(void) {return m_type;} - static void Clear(void) {m_staticAudioDataRate = 0; m_staticAudioChannelCount = 0;}; + static void Clear(void) {m_staticAudioDataRate = 0; m_staticAudioChannelCount = 0;}; - protected: - uint8_t* m_pData; - int m_count; - int m_length; - uint32_t m_pts; - eFrameType m_type; +protected: + uint8_t* m_pData; + int m_count; + int m_length; + uint32_t m_pts; + eFrameType m_type; - uint32_t m_audioChannelCount; - uint32_t m_audioDataRate; - uint32_t m_videoAspectRatio; + uint32_t m_audioChannelCount; + uint32_t m_audioDataRate; + uint32_t m_videoAspectRatio; - static uint32_t m_staticAudioChannelCount; - static uint32_t m_staticAudioDataRate; + static uint32_t m_staticAudioChannelCount; + static uint32_t m_staticAudioDataRate; - private: - // cFixedLengthFrame(); // you are not allowed to use this constructor - cFixedLengthFrame(cFixedLengthFrame&); // no copy constructor +private: +// cFixedLengthFrame(); // you are not allowed to use this constructor + cFixedLengthFrame(cFixedLengthFrame&); // no copy constructor }; // ================================== class cDxr3SyncBuffer : public cRingBuffer { - public: - enum eSyncBufferException - { - SYNC_BUFFER_OVERRUN +public: + enum eSyncBufferException + { + SYNC_BUFFER_OVERRUN }; - public: - cDxr3SyncBuffer(int frameCount, int frameLength, cDxr3Interface& dxr3Device); - ~cDxr3SyncBuffer(); +public: + cDxr3SyncBuffer(int frameCount, int frameLength, cDxr3Interface& dxr3Device); + ~cDxr3SyncBuffer(); - virtual int Available(void); - cFixedLengthFrame* Push(const uint8_t* pStart, int length, uint32_t pts, eFrameType type = ftUnknown) throw (eSyncBufferException); - void Pop(void); - cFixedLengthFrame* Get(void); - void Clear(void); - void Stop(void) { m_bStopped = true;}; - void Start(void); - void WaitForSysClock(uint32_t pts, uint32_t delta); - void WaitForNextPut(void); - void WakeUp(void); - void WaitForReceiverStopped(void); - void SetDemuxMode(eDxr3DemuxMode demuxMode) {m_demuxMode = demuxMode;}; - eDxr3DemuxMode GetDemuxMode(void) {return m_demuxMode;}; - bool Poll(int TimeoutMs); - bool IsPolled(void) { return m_bPollSync;}; - uint32_t GetFillLevel(void) { return Available() * 100 / Size();}; + virtual int Available(void); + cFixedLengthFrame* Push(const uint8_t* pStart, int length, uint32_t pts, eFrameType type = ftUnknown) throw (eSyncBufferException); + void Pop(void); + cFixedLengthFrame* Get(void); + void Clear(void); + void Stop(void) { m_bStopped = true;}; + void Start(void); + void WaitForSysClock(uint32_t pts, uint32_t delta); + void WaitForNextPut(void); + void WakeUp(void); + void WaitForReceiverStopped(void); + void SetDemuxMode(eDxr3DemuxMode demuxMode) {m_demuxMode = demuxMode;}; + eDxr3DemuxMode GetDemuxMode(void) {return m_demuxMode;}; + bool Poll(int TimeoutMs); + bool IsPolled(void) { return m_bPollSync;}; + uint32_t GetFillLevel(void) { return Available() * 100 / Size();}; - protected: - void ReceiverStopped(void); +protected: + void ReceiverStopped(void); - cFixedLengthFrame* m_pBuffer; - int m_count; - int m_nextFree; - int m_next; - bool m_bWaitPts; - bool m_bPutBlock; - bool m_bGetBlock; - bool m_bStartReceiver; - bool m_bStopped; - uint32_t m_waitPts; - uint32_t m_waitDelta; - uint32_t m_lastPts; - eDxr3DemuxMode m_demuxMode; + cFixedLengthFrame* m_pBuffer; + int m_count; + int m_nextFree; + int m_next; + bool m_bWaitPts; + bool m_bPutBlock; + bool m_bGetBlock; + bool m_bStartReceiver; + bool m_bStopped; + uint32_t m_waitPts; + uint32_t m_waitDelta; + uint32_t m_lastPts; + eDxr3DemuxMode m_demuxMode; - cCondVar receiverStopped; - cMutex receiverStoppedMutex; - cDxr3Interface& m_dxr3Device; - bool m_bPollSync; + cCondVar receiverStopped; + cMutex receiverStoppedMutex; + cDxr3Interface& m_dxr3Device; + bool m_bPollSync; - private: - cDxr3SyncBuffer(); // you are not allowed to use this constructor - cDxr3SyncBuffer(cDxr3SyncBuffer&); // no constructor +private: + cDxr3SyncBuffer(); // you are not allowed to use this constructor + cDxr3SyncBuffer(cDxr3SyncBuffer&); // no constructor }; #endif /*_DXR3SYNCBUFFER_H_*/ |