omxh264enc: raise a warning if AVCIntraPeriod is not supported
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 3 Jul 2017 08:54:50 +0000 (10:54 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 3 Jul 2017 14:22:20 +0000 (10:22 -0400)
Some platforms may not implement OMX_IndexConfigVideoAVCIntraPeriod and
use OMX_IndexParamVideoAvc instead to configure the GOP pattern.
So raise a warning instead of an error if this API is not implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=784379

omx/gstomxh264enc.c

index 7f202a5..13acdcb 100644 (file)
@@ -434,7 +434,11 @@ set_avc_intra_period (GstOMXH264Enc * self)
   err =
       gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc,
       OMX_IndexConfigVideoAVCIntraPeriod, &config_avcintraperiod);
-  if (err != OMX_ErrorNone) {
+  if (err == OMX_ErrorUnsupportedIndex) {
+    GST_WARNING_OBJECT (self,
+        "OMX_IndexConfigVideoAVCIntraPeriod  not supported by component");
+    return TRUE;
+  } else if (err != OMX_ErrorNone) {
     GST_ERROR_OBJECT (self,
         "can't get OMX_IndexConfigVideoAVCIntraPeriod %s (0x%08x)",
         gst_omx_error_to_string (err), err);