camerabin: always force image-profile to have variable framerate

image-encodebin can't use videorate as it always store one buffer
to be able to do its timestamps/duration math. As image captures
only push one buffer at a time, this videorate behavior breaks
camerabin usage.
This commit is contained in:
Thiago Santos 2012-05-04 17:05:38 -03:00
parent d3303121c8
commit 95fd9cd277

View file

@ -2215,6 +2215,25 @@ gst_camera_bin_set_property (GObject * object, guint prop_id,
if (camera->image_profile)
gst_encoding_profile_unref (camera->image_profile);
camera->image_profile = (GstEncodingProfile *) g_value_dup_object (value);
/* make sure we set variable framerate here to prevent videorate from
* being used in encodebin. It will always keep a buffer stored
* internally and push it when a second one arrives. This breaks
* the image capture */
if (GST_IS_ENCODING_VIDEO_PROFILE (camera->image_profile))
gst_encoding_video_profile_set_variableframerate (
(GstEncodingVideoProfile *) camera->image_profile, TRUE);
else if (GST_IS_ENCODING_CONTAINER_PROFILE (camera->image_profile)) {
const GList *profs =
gst_encoding_container_profile_get_profiles (
(GstEncodingContainerProfile *) camera->image_profile);
for (; profs; profs = g_list_next (profs)) {
if (GST_IS_ENCODING_VIDEO_PROFILE (profs->data)) {
gst_encoding_video_profile_set_variableframerate (profs->data,
TRUE);
}
}
}
camera->image_profile_switch = TRUE;
break;
case PROP_FLAGS: