openframeworks/openFrameworks — Issue #862: Change gstreamer video initialization process
Author: timscaffidi
Created: 2012-01-03 04:26:08+00:00
State: open

In trying to get the built in iSight to work in an older MBP, pre unibody, I noticed that the initialization routine was where things were going wrong. I looked at the way that it is done in cheese and found that they first set the state to GST_STATE_READY to determine the capabilities of the device, and in oF we set the state to GST_STATE_PLAYING, before even setting the resolution and framerate.

So, in ofGstVideoGrabber.cpp get_device_data(), the iSight had issues with this line, gst_element_set_state (pipeline, GST_STATE_PLAY), where it would return a failure code later on. So I changed it to GST_STATE_READY, and all is good.

I'm not very experienced with gstreamer, so I'm not sure if just changing that one line is enough to be robust, or if there is a reason it was done this way in the first place.

here's the relevant file from the cheese git. http://git.gnome.org/browse/cheese/tree/libcheese/cheese-camera-device.c
cheese_camera_device_get_caps() is the relevant function.