diff options
| author | Thomas Reufer <thomas@reufer.ch> | 2014-02-12 23:00:25 +0100 |
|---|---|---|
| committer | Thomas Reufer <thomas@reufer.ch> | 2014-02-12 23:00:25 +0100 |
| commit | 08fbcd71c6cf464cd0389999709a4653701952b2 (patch) | |
| tree | 9181f5d32d36ef46f6afdf5a23ba8be4ad2051eb | |
| parent | 0094472cda6eefa9b5363ad844daf0fcfd00c326 (diff) | |
| download | vdr-plugin-rpihddevice-08fbcd71c6cf464cd0389999709a4653701952b2.tar.gz vdr-plugin-rpihddevice-08fbcd71c6cf464cd0389999709a4653701952b2.tar.bz2 | |
- fixed:
- suppress buffer stall when clock is halted
| -rw-r--r-- | HISTORY | 3 | ||||
| -rw-r--r-- | omx.c | 23 | ||||
| -rw-r--r-- | omx.h | 1 | ||||
| -rw-r--r-- | omxdevice.c | 3 | ||||
| -rw-r--r-- | omxdevice.h | 3 | ||||
| -rw-r--r-- | rpihddevice.c | 24 | ||||
| -rw-r--r-- | setup.c | 5 | ||||
| -rw-r--r-- | types.h | 67 |
8 files changed, 32 insertions, 97 deletions
@@ -1,6 +1,9 @@ VDR Plugin 'rpihddevice' Revision History ----------------------------------------- +- fixed: + - suppress buffer stall when clock is halted + 2014-02-10: Version 0.0.8 ------------------------- - new: @@ -112,8 +112,15 @@ void cOmx::Action(void) } if (m_stallEvent) { - if (IsBufferStall() && m_onBufferStall) - m_onBufferStall(m_onBufferStallData); + if (IsBufferStall()) + { + OMX_S32 clockScale = 0; + GetClockScale(clockScale); + + // report buffer stall only if clock is not halted + if (clockScale && m_onBufferStall) + m_onBufferStall(m_onBufferStallData); + } m_stallEvent = false; } } @@ -526,6 +533,18 @@ void cOmx::SetClockScale(float scale) ELOG("failed to set clock scale (%d)!", scaleType.xScale); } +void cOmx::GetClockScale(OMX_S32 &scale) +{ + OMX_TIME_CONFIG_SCALETYPE scaleType; + OMX_INIT_STRUCT(scaleType); + + if (OMX_GetConfig(ILC_GET_HANDLE(m_comp[eClock]), + OMX_IndexConfigTimeScale, &scaleType) != OMX_ErrorNone) + ELOG("failed to get clock scale!"); + else + scale = scaleType.xScale; +} + void cOmx::SetStartTime(uint64_t pts) { OMX_TIME_CONFIG_TIMESTAMPTYPE timeStamp; @@ -46,6 +46,7 @@ public: void SetClockState(eClockState clockState); void SetClockScale(float scale); + void GetClockScale(OMX_S32 &scale); void SetStartTime(uint64_t pts); void SetCurrentReferenceTime(uint64_t pts); unsigned int GetMediaTime(void); diff --git a/omxdevice.c b/omxdevice.c index f80a1e2..a02a690 100644 --- a/omxdevice.c +++ b/omxdevice.c @@ -291,7 +291,8 @@ int64_t cOmxDevice::GetSTC(void) return m_omx->GetSTC(); } -uchar *cOmxDevice::GrabImage(int &Size, bool Jpeg, int Quality, int SizeX, int SizeY) +uchar *cOmxDevice::GrabImage(int &Size, bool Jpeg, int Quality, + int SizeX, int SizeY) { DBG("GrabImage(%s, %dx%d)", Jpeg ? "JPEG" : "PNM", SizeX, SizeY); diff --git a/omxdevice.h b/omxdevice.h index ac77823..dce3459 100644 --- a/omxdevice.h +++ b/omxdevice.h @@ -50,7 +50,8 @@ public: virtual int64_t GetSTC(void); - virtual uchar *GrabImage(int &Size, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1); + virtual uchar *GrabImage(int &Size, bool Jpeg = true, int Quality = -1, + int SizeX = -1, int SizeY = -1); #if APIVERSNUM >= 20103 virtual void TrickSpeed(int Speed, bool Forward); diff --git a/rpihddevice.c b/rpihddevice.c index 5f22b39..4a3f597 100644 --- a/rpihddevice.c +++ b/rpihddevice.c @@ -15,29 +15,6 @@ static const char *VERSION = "0.0.8"; static const char *DESCRIPTION = tr("HD output device for Raspberry Pi"); -class cDummyDevice : cDevice -{ - -public: - - cDummyDevice() { } - virtual ~cDummyDevice() { } - virtual bool HasDecoder(void) const { return true; } - virtual bool SetPlayMode(ePlayMode PlayMode) { return true; } - virtual int PlayVideo(const uchar *Data, int Length) { return Length; } - virtual int PlayAudio(const uchar *Data, int Length, uchar Id) { return Length; } - virtual bool Poll(cPoller &Poller, int TimeoutMs = 0) { return true; } - virtual bool Flush(int TimeoutMs = 0) { return true; } - virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect) - { cRpiSetup::GetDisplaySize(Width, Height, PixelAspect); } - - bool Start(void) {return true;} - -protected: - virtual void MakePrimaryDevice(bool On) { if (On) new cRpiOsdProvider(); } - -}; - class cPluginRpiHdDevice : public cPlugin { private: @@ -66,7 +43,6 @@ public: cPluginRpiHdDevice::cPluginRpiHdDevice(void) : m_device(0) { - //new cDummyDevice(); } cPluginRpiHdDevice::~cPluginRpiHdDevice() @@ -139,7 +139,7 @@ bool cRpiSetup::IsAudioFormatSupported(cAudioCodec::eCodec codec, EDID_AudioFormat_ePCM, channels, samplingRate == 32000 ? EDID_AudioSampleRate_e32KHz : samplingRate == 44100 ? EDID_AudioSampleRate_e44KHz : - samplingRate == 88000 ? EDID_AudioSampleRate_e88KHz : + samplingRate == 88200 ? EDID_AudioSampleRate_e88KHz : samplingRate == 96000 ? EDID_AudioSampleRate_e96KHz : samplingRate == 176000 ? EDID_AudioSampleRate_e176KHz : samplingRate == 192000 ? EDID_AudioSampleRate_e192KHz : @@ -173,7 +173,8 @@ bool cRpiSetup::HasAudioSetupChanged(void) cMenuSetupPage* cRpiSetup::GetSetupPage(void) { - return new cRpiSetupPage(&m_audioPort, &m_passthrough, &m_audioSetupChanged); + return new cRpiSetupPage( + &m_audioPort, &m_passthrough, &m_audioSetupChanged); } bool cRpiSetup::Parse(const char *name, const char *value) diff --git a/types.h b/types.h deleted file mode 100644 index 02dcfdb..0000000 --- a/types.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * See the README file for copyright information and how to reach the author. - * - * $Id$ - */ - -#ifndef TYPES_H -#define TYPES_H - -class cAudioCodec -{ -public: - - enum eCodec { - ePCM, - eMPG, - eAC3, - eEAC3, - eAAC, - eADTS, - eNumCodecs, - eInvalid - }; - - static const char* Str(eCodec codec) { - return (codec == ePCM) ? "PCM" : - (codec == eMPG) ? "MPEG" : - (codec == eAC3) ? "AC3" : - (codec == eEAC3) ? "E-AC3" : - (codec == eAAC) ? "AAC" : - (codec == eADTS) ? "ADTS" : "unknown"; - } -}; - -class cVideoCodec -{ -public: - - enum eCodec { - eMPEG2, - eH264, - eNumCodecs, - eInvalid - }; - - static const char* Str(eCodec codec) { - return (codec == eMPEG2) ? "MPEG2" : - (codec == eH264) ? "H264" : "unknown"; - } -}; - -class cAudioPort -{ -public: - - enum ePort { - eLocal, - eHDMI - }; - - static const char* Str(ePort port) { - return (port == eLocal) ? "local" : - (port == eHDMI) ? "HDMI" : "unknown"; - } -}; - -#endif |
