summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2014-01-07 16:36:27 +0100
committerThomas Reufer <thomas@reufer.ch>2014-01-07 16:36:27 +0100
commit4e710fc5c2bf2e2e33518eb3c537b7022085bda9 (patch)
treeea4afd9fa90c6c2e15a6b8f8777e6eca087a04fb
parent2741f31236bfbe2087095af7320183cf863ae02e (diff)
downloadvdr-plugin-rpihddevice-0.0.6a.tar.gz
vdr-plugin-rpihddevice-0.0.6a.tar.bz2
2013-12-16: Version 0.0.6a0.0.6a
-------------------------- - fixed: - removed OMX mutex
-rw-r--r--audio.c13
-rw-r--r--omx.c16
-rw-r--r--omxdevice.c10
-rw-r--r--omxdevice.h2
-rw-r--r--rpihddevice.c2
5 files changed, 10 insertions, 33 deletions
diff --git a/audio.c b/audio.c
index 1cb3734..cacc47a 100644
--- a/audio.c
+++ b/audio.c
@@ -649,11 +649,8 @@ int cAudioDecoder::WriteData(const unsigned char *buf, unsigned int length, uint
if (m_parser->Append(buf, length))
{
m_pts = pts;
- if (!m_parser->Empty())
- {
- m_ready = false;
- m_wait->Signal();
- }
+ m_ready = false;
+ m_wait->Signal();
ret = length;
}
m_mutex->Unlock();
@@ -830,8 +827,10 @@ void cAudioDecoder::Action(void)
if (buf && buf->nFilledLen > 0)
bufferFull = true;
else
- if (m_ready)
- m_wait->Wait(50);
+ {
+ m_ready = true;
+ m_wait->Wait(50);
+ }
}
// we have a buffer to empty
diff --git a/omx.c b/omx.c
index fd6e58d..035450b 100644
--- a/omx.c
+++ b/omx.c
@@ -161,17 +161,9 @@ void cOmx::HandlePortSettingsChanged(unsigned int portId)
void cOmx::HandleBufferEmpty(COMPONENT_T *comp)
{
if (comp == m_comp[eVideoDecoder])
- {
- m_mutex->Lock();
m_freeVideoBuffers++;
- m_mutex->Unlock();
- }
else if (comp == m_comp[eAudioRender])
- {
- m_mutex->Lock();
m_freeAudioBuffers++;
- m_mutex->Unlock();
- }
}
void cOmx::OnBufferEmpty(void *instance, COMPONENT_T *comp)
@@ -410,8 +402,6 @@ bool cOmx::IsClockRunning(void)
void cOmx::SetClockState(eClockState clockState)
{
- m_mutex->Lock();
-
dsyslog("rpihddevice: SetClockState(%s)",
clockState == eClockStateRun ? "eClockStateRun" :
clockState == eClockStateStop ? "eClockStateStop" :
@@ -478,8 +468,6 @@ void cOmx::SetClockState(eClockState clockState)
if (OMX_SetConfig(ILC_GET_HANDLE(m_comp[eClock]),
OMX_IndexConfigTimeClockState, &cstate) != OMX_ErrorNone)
esyslog("rpihddevice: failed to set clock state!");
-
- m_mutex->Unlock();
}
void cOmx::SetClockScale(float scale)
@@ -539,8 +527,6 @@ unsigned int cOmx::GetMediaTime(void)
void cOmx::SetClockReference(eClockReference clockReference)
{
- m_mutex->Lock();
-
m_clockReference = clockReference;
OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE refClock;
@@ -554,8 +540,6 @@ void cOmx::SetClockReference(eClockReference clockReference)
else
dsyslog("rpihddevice: set active clock reference to %s",
m_clockReference == eClockRefAudio ? "audio" : "video");
-
- m_mutex->Unlock();
}
void cOmx::SetVolume(int vol)
diff --git a/omxdevice.c b/omxdevice.c
index 24da8bd..456f5b4 100644
--- a/omxdevice.c
+++ b/omxdevice.c
@@ -29,7 +29,8 @@ cOmxDevice::cOmxDevice(void (*onPrimaryDevice)(void)) :
m_trickRequest(0),
m_audioPts(0),
m_videoPts(0)
-{ }
+{
+}
cOmxDevice::~cOmxDevice()
{
@@ -73,13 +74,6 @@ void cOmxDevice::GetOsdSize(int &Width, int &Height, double &PixelAspect)
cRpiSetup::GetDisplaySize(Width, Height, PixelAspect);
}
-bool cOmxDevice::CanReplay(void) const
-{
- dsyslog("rpihddevice: CanReplay");
- // video codec de-initialization done
- return true; //(m_state == eNone);
-}
-
bool cOmxDevice::SetPlayMode(ePlayMode PlayMode)
{
m_mutex->Lock();
diff --git a/omxdevice.h b/omxdevice.h
index 10efea4..797c58d 100644
--- a/omxdevice.h
+++ b/omxdevice.h
@@ -35,11 +35,11 @@ public:
virtual int DeInit(void);
virtual bool HasDecoder(void) const { return true; };
+ virtual bool CanReplay(void) const { return true; };
virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect);
virtual bool SetPlayMode(ePlayMode PlayMode);
- virtual bool CanReplay(void) const;
virtual void StillPicture(const uchar *Data, int Length);
diff --git a/rpihddevice.c b/rpihddevice.c
index 68c78bb..05ce3d0 100644
--- a/rpihddevice.c
+++ b/rpihddevice.c
@@ -12,7 +12,7 @@
#include "setup.h"
#include "types.h"
-static const char *VERSION = "0.0.6";
+static const char *VERSION = "0.0.6a";
static const char *DESCRIPTION = "HD output device for Raspberry Pi";
class cDummyDevice : cDevice