Skip to content

Instantly share code, notes, and snippets.

@nickdiego
Created August 14, 2013 19:37
Show Gist options
  • Select an option

  • Save nickdiego/6234737 to your computer and use it in GitHub Desktop.

Select an option

Save nickdiego/6234737 to your computer and use it in GitHub Desktop.
static GstElement* findDeviceSource(GstElement* autoSrc)
{
GstElement* deviceSrc;
GstChildProxy* childProxy = GST_CHILD_PROXY(autoSrc);
if (!childProxy)
return deviceSrc;
GstStateChangeReturn stateChangeResult = gst_element_set_state(autoSrc, GST_STATE_READY);
if (stateChangeResult != GST_STATE_CHANGE_SUCCESS)
return deviceSrc;
if (gst_child_proxy_get_children_count(childProxy))
deviceSrc = adoptGRef(GST_ELEMENT(gst_child_proxy_get_child_by_index(childProxy, 0)));
gst_element_set_state(autoSrc, GST_STATE_NULL);
return deviceSrc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment