From 7338e62fe3fc5c6ad0b335441b671ba96d1dde36 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sun, 14 Oct 2012 12:32:40 +0200 Subject: [PATCH] Fix fastforward and backward, some change to pause --- audioomx.cc | 8 ++++++++ audioomx.h | 1 + remotelinux.cc | 2 +- videoomx.cc | 16 +++++++++++++--- videoomx.h | 1 + 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/audioomx.cc b/audioomx.cc index 985ef93..e3bc9b5 100644 --- a/audioomx.cc +++ b/audioomx.cc @@ -1181,6 +1181,9 @@ int AudioOMX::pause() { "OMX_Flush rend in failed %x", error); } + if (!vw->ChangeComponentState(omx_aud_rend,OMX_StateIdle)) { + Log::getInstance()->log("Audio", Log::DEBUG, " pause aud_rend idle ChangeComponentState"); + } } vw->UnlockClock(); vw->clockPause(); @@ -1194,6 +1197,11 @@ int AudioOMX::unPause() if (paused) { paused=false; // may be also change omx clock VideoOMX *vw = (VideoOMX*) Video::getInstance(); + if (omx_running) { + if (!vw->ChangeComponentState(omx_aud_rend,OMX_StateExecuting)) { + Log::getInstance()->log("Audio", Log::DEBUG, " unpause aud_rend idle ChangeComponentState"); + } + } vw->clockUnpause(); } return 1; diff --git a/audioomx.h b/audioomx.h index 5eafae4..23f9b21 100644 --- a/audioomx.h +++ b/audioomx.h @@ -40,6 +40,7 @@ extern "C" { class AudioOMX : public Audio { + friend class VideoOMX; public: AudioOMX(); virtual ~AudioOMX(); diff --git a/remotelinux.cc b/remotelinux.cc index 0149026..f604f9d 100644 --- a/remotelinux.cc +++ b/remotelinux.cc @@ -428,7 +428,7 @@ void RemoteLinux::InitHWCListwithDefaults() translist[W_G_HCW(W_HCW_KC,KEY_FORWARD)] = FORWARD; translist[W_G_HCW(W_HCW_KC,KEY_F)] = FORWARD; translist[W_G_HCW(W_HCW_KC,KEY_BACK)] = REVERSE; - translist[W_G_HCW(W_HCW_KC,KEY_R)] = REVERSE; + translist[W_G_HCW(W_HCW_KC,KEY_T)] = REVERSE; translist[W_G_HCW(W_HCW_KC,KEY_MUTE)] = MUTE; translist[W_G_HCW(W_HCW_KC,KEY_F9)] = VOLUMEUP; translist[W_G_HCW(W_HCW_KC,KEY_F10)] = VOLUMEDOWN; diff --git a/videoomx.cc b/videoomx.cc index 1b26dc3..5cee6fb 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -1476,6 +1476,15 @@ int VideoOMX::WaitForEvent(OMX_HANDLETYPE handle,OMX_U32 event) //needs to be ca } +int VideoOMX::clearEvents() +{ + omx_event_mutex.Lock(); + omx_events.clear(); + omx_event_mutex.Unlock(); + + return 1; +} + int VideoOMX::CommandFinished(OMX_HANDLETYPE handle,OMX_U32 command,OMX_U32 data2) //needs to be called with locked mutex { @@ -1763,6 +1772,7 @@ int VideoOMX::DeAllocateCodecsOMX() cur_input_buf_omx=NULL;//write out old data } clock_mutex.Lock(); + clearEvents(); if (omx_vid_dec) { // first stop the omx elements if (!ChangeComponentState(omx_vid_dec,OMX_StateIdle)) { @@ -2799,9 +2809,9 @@ int VideoOMX::EnterIframePlayback() input_bufs_omx_mutex.Unlock(); Log::getInstance()->log("Video", Log::DEBUG, "EnterIframePlayback 2"); - clock_mutex.Lock(); - FlushRenderingPipe(); - clock_mutex.Unlock(); + ((AudioOMX*)Audio::getInstance())->DeAllocateCodecsOMX(); + DeAllocateCodecsOMX(); + AllocateCodecsOMX(); Log::getInstance()->log("Video", Log::DEBUG, "leave IframePlayback"); diff --git a/videoomx.h b/videoomx.h index 5effb86..ffb4e2c 100644 --- a/videoomx.h +++ b/videoomx.h @@ -194,6 +194,7 @@ class VideoOMX : public Video, public Thread_TYPE int WaitForEvent(OMX_HANDLETYPE handle,OMX_U32 event); int EnablePort(OMX_HANDLETYPE handle,OMX_U32 port,bool wait); int DisablePort(OMX_HANDLETYPE handle,OMX_U32 port,bool wait=true); + int clearEvents(); int setClockExecutingandRunning(); -- 2.39.5