omxil: bcm: h264: Don't wait for error free frame.
authorJulian Scheel <julian@jusst.de>
Thu, 12 Sep 2013 08:14:13 +0000 (10:14 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 26 Sep 2013 08:48:59 +0000 (11:48 +0300)
The bcm h264 decoder is not able to detect when the first error free frame has
been decoded for certain h264 streams. To avoid not getting any frames out of
the decoder, disable the StartWithValidFrame flag until that is fixed at bcm.
See https://github.com/huceke/omxplayer/issues/96 for details.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
modules/codec/omxil/omxil.c

index 0fafedf..da86e23 100644 (file)
@@ -50,6 +50,7 @@
 /* Defined in the broadcom version of OMX_Index.h */
 #define OMX_IndexConfigRequestCallback 0x7f000063
 #define OMX_IndexParamBrcmPixelAspectRatio 0x7f00004d
+#define OMX_IndexParamBrcmVideoDecodeErrorConcealment 0x7f000080
 
 /* Defined in the broadcom version of OMX_Core.h */
 #define OMX_EventParamOrConfigChanged 0x7F000001
@@ -745,6 +746,21 @@ static OMX_ERRORTYPE InitialiseComponent(decoder_t *p_dec,
         if(omx_error != OMX_ErrorNone) goto error;
     }
 
+    if(!strncmp(p_sys->psz_component, "OMX.broadcom.", 13) &&
+        p_sys->in.p_fmt->i_codec == VLC_CODEC_H264)
+    {
+        OMX_PARAM_BRCMVIDEODECODEERRORCONCEALMENTTYPE concanParam;
+        OMX_INIT_STRUCTURE(concanParam);
+        concanParam.bStartWithValidFrame = OMX_FALSE;
+
+        omx_error = OMX_SetParameter(omx_handle,
+                OMX_IndexParamBrcmVideoDecodeErrorConcealment, &concanParam);
+        if (omx_error == OMX_ErrorNone)
+            msg_Dbg(p_dec, "StartWithValidFrame disabled.");
+        else
+            msg_Dbg(p_dec, "Could not disable StartWithValidFrame.");
+    }
+
     /* Allocate our array for the omx buffers and enable ports */
     for(i = 0; i < p_sys->ports; i++)
     {