Created
August 14, 2013 19:37
-
-
Save nickdiego/6234737 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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