diff options
| author | Thomas Reufer <thomas@reufer.ch> | 2014-02-26 17:34:43 +0100 |
|---|---|---|
| committer | Thomas Reufer <thomas@reufer.ch> | 2014-02-26 17:34:43 +0100 |
| commit | 7f64c0f3be9587e3abb0cac4f6d1d28a99c7dc44 (patch) | |
| tree | 7672431ce90075b33f72cd702b65c3f6d4215bba | |
| parent | 0cb297dc5742ba818f544b3581e2520f3c2a0b3c (diff) | |
| download | vdr-plugin-rpihddevice-7f64c0f3be9587e3abb0cac4f6d1d28a99c7dc44.tar.gz vdr-plugin-rpihddevice-7f64c0f3be9587e3abb0cac4f6d1d28a99c7dc44.tar.bz2 | |
fix port definition of video decoder and audio render and increase video buffers to 40
| -rw-r--r-- | omx.c | 55 |
1 files changed, 30 insertions, 25 deletions
@@ -334,31 +334,6 @@ int cOmx::Init(void) ilclient_change_component_state(m_comp[eVideoFx], OMX_StateIdle); ilclient_change_component_state(m_comp[eAudioRender], OMX_StateIdle); - // set up the number and size of buffers for audio render - m_freeAudioBuffers = 8; - - OMX_PARAM_PORTDEFINITIONTYPE param; - OMX_INIT_STRUCT(param); - param.nPortIndex = 100; - if (OMX_GetParameter(ILC_GET_HANDLE(m_comp[eAudioRender]), - OMX_IndexParamPortDefinition, ¶m) != OMX_ErrorNone) - ELOG("failed to get audio render port parameters!"); - param.nBufferSize = KILOBYTE(160); - param.nBufferCountActual = m_freeAudioBuffers; - if (OMX_SetParameter(ILC_GET_HANDLE(m_comp[eAudioRender]), - OMX_IndexParamPortDefinition, ¶m) != OMX_ErrorNone) - ELOG("failed to set audio render port parameters!"); - - OMX_INIT_STRUCT(param); - param.nPortIndex = 130; - if (OMX_GetParameter(ILC_GET_HANDLE(m_comp[eVideoDecoder]), - OMX_IndexParamPortDefinition, ¶m) != OMX_ErrorNone) - ELOG("failed to get video decoder port parameters!"); - m_freeVideoBuffers = param.nBufferCountActual; - - DBG("started with %d video and %d audio buffers", - m_freeVideoBuffers, m_freeAudioBuffers); - SetClockLatencyTarget(); SetBufferStall(1500); @@ -845,6 +820,20 @@ int cOmx::SetVideoCodec(cVideoCodec::eCodec codec, eDataUnitType dataUnit) OMX_IndexParamVideoPortFormat, &videoFormat) != OMX_ErrorNone) ELOG("failed to set video decoder parameters!"); + OMX_PARAM_PORTDEFINITIONTYPE param; + OMX_INIT_STRUCT(param); + param.nPortIndex = 130; + if (OMX_GetParameter(ILC_GET_HANDLE(m_comp[eVideoDecoder]), + OMX_IndexParamPortDefinition, ¶m) != OMX_ErrorNone) + ELOG("failed to get video decoder port parameters!"); + + param.nBufferCountActual = 40; + m_freeVideoBuffers = param.nBufferCountActual; + + if (OMX_SetParameter(ILC_GET_HANDLE(m_comp[eVideoDecoder]), + OMX_IndexParamPortDefinition, ¶m) != OMX_ErrorNone) + ELOG("failed to set video decoder port parameters!"); + // start with valid frames only if codec is MPEG2 SetVideoErrorConcealment(codec == cVideoCodec::eMPEG2); SetVideoDataUnitType(dataUnit); @@ -973,6 +962,22 @@ int cOmx::SetupAudioRender(cAudioCodec::eCodec outputFormat, int channels, OMX_IndexConfigBrcmAudioDestination, &audioDest) != OMX_ErrorNone) ELOG("failed to set audio destination!"); + // set up the number and size of buffers for audio render + OMX_PARAM_PORTDEFINITIONTYPE param; + OMX_INIT_STRUCT(param); + param.nPortIndex = 100; + if (OMX_GetParameter(ILC_GET_HANDLE(m_comp[eAudioRender]), + OMX_IndexParamPortDefinition, ¶m) != OMX_ErrorNone) + ELOG("failed to get audio render port parameters!"); + + param.nBufferSize = KILOBYTE(160); + param.nBufferCountActual = 8; + m_freeAudioBuffers = param.nBufferCountActual; + + if (OMX_SetParameter(ILC_GET_HANDLE(m_comp[eAudioRender]), + OMX_IndexParamPortDefinition, ¶m) != OMX_ErrorNone) + ELOG("failed to set audio render port parameters!"); + if (ilclient_enable_port_buffers(m_comp[eAudioRender], 100, NULL, NULL, NULL) != 0) ELOG("failed to enable port buffer on audio render!"); |
