From 5c15caef8eb772dd72b7564154d6f99cf9aa6f37 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Fri, 20 Apr 2012 14:51:34 +0000 Subject: [PATCH] omx: Add hack to disable setting roles to components. Conflicts: omx/gstomx.c --- omx/gstomx.c | 4 +++- omx/gstomx.h | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/omx/gstomx.c b/omx/gstomx.c index 53d300f2d2..8c33561582 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -433,7 +433,7 @@ gst_omx_component_new (GstObject * parent, const GstOMXClassData * cdata) comp->last_error = OMX_ErrorNone; /* Set component role if any */ - if (cdata->component_role) { + if (cdata->component_role && !(cdata->hacks & GST_OMX_HACK_NO_COMPONENT_ROLE)) { OMX_PARAM_COMPONENTROLETYPE param; GST_OMX_INIT_STRUCT (¶m); @@ -1976,6 +1976,8 @@ gst_omx_parse_hacks (gchar ** hacks) hacks_flags |= GST_OMX_HACK_NO_EMPTY_EOS_BUFFER; else if (g_str_equal (*hacks, "drain-may-not-return")) hacks_flags |= GST_OMX_HACK_DRAIN_MAY_NOT_RETURN; + else if (g_str_equal (*hacks, "no-component-role")) + hacks_flags |= GST_OMX_HACK_NO_COMPONENT_ROLE; else GST_WARNING ("Unknown hack: %s", *hacks); hacks++; diff --git a/omx/gstomx.h b/omx/gstomx.h index ed7283b7ee..df91ca1910 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -71,6 +71,11 @@ G_BEGIN_DECLS */ #define GST_OMX_HACK_DRAIN_MAY_NOT_RETURN G_GUINT64_CONSTANT (0x0000000000000040) +/* If the component doesn't allow any component role to be set. + * Happens with Broadcom's OpenMAX implementation. + */ +#define GST_OMX_HACK_NO_COMPONENT_ROLE G_GUINT64_CONSTANT (0x0000000000000080) + typedef struct _GstOMXCore GstOMXCore; typedef struct _GstOMXPort GstOMXPort;