GstOMXComponent *
gst_omx_component_new (GstObject * parent, const gchar * core_name,
- const gchar * component_name)
+ const gchar * component_name, const gchar * component_role)
{
OMX_ERRORTYPE err;
GstOMXCore *core;
comp->settings_cookie = 0;
comp->reconfigure_out_pending = 0;
+ /* Set component role if any */
+ if (component_role) {
+ OMX_PARAM_COMPONENTROLETYPE param;
+
+ memset (¶m, 0, sizeof (param));
+ param.nSize = sizeof (param);
+ param.nVersion.s.nVersionMajor = 1;
+ param.nVersion.s.nVersionMinor = 1;
+
+ g_strlcpy ((gchar *) param.cRole, component_role, sizeof (param.cRole));
+ err =
+ OMX_SetParameter (comp->handle, OMX_IndexParamStandardComponentRole,
+ ¶m);
+
+ GST_DEBUG_OBJECT (parent, "Setting component role to '%s': %s (0x%08x)",
+ component_role, gst_omx_error_to_string (err), err);
+ }
+
+
OMX_GetState (comp->handle, &comp->state);
return comp;
void gst_omx_core_release (GstOMXCore * core);
-GstOMXComponent * gst_omx_component_new (GstObject *parent, const gchar * core_name, const gchar * component_name);
+GstOMXComponent * gst_omx_component_new (GstObject *parent, const gchar * core_name, const gchar * component_name, const gchar *component_role);
void gst_omx_component_free (GstOMXComponent * comp);
OMX_ERRORTYPE gst_omx_component_set_state (GstOMXComponent * comp, OMX_STATETYPE state);
GKeyFile *config;
const gchar *element_name;
GError *err;
- gchar *core_name, *component_name;
+ gchar *core_name, *component_name, *component_role;
gint in_port_index, out_port_index;
gchar *template_caps;
GstPadTemplate *templ;
g_assert (component_name != NULL);
videodec_class->component_name = component_name;
+ /* If this fails we simply don't set a role */
+ if ((component_role =
+ g_key_file_get_string (config, element_name, "component-role",
+ NULL))) {
+ GST_DEBUG ("Using component-role '%s' for element '%s'", component_role,
+ element_name);
+ videodec_class->component_role = component_role;
+ }
+
+
/* Now set the inport/outport indizes and assume sane defaults */
err = NULL;
in_port_index =
self->component =
gst_omx_component_new (GST_OBJECT_CAST (self), klass->core_name,
- klass->component_name);
+ klass->component_name, klass->component_role);
if (!self->component)
return FALSE;
const gchar *core_name;
const gchar *component_name;
+ const gchar *component_role;
const gchar *default_src_template_caps;
const gchar *default_sink_template_caps;