From: Thiago Santos Date: Fri, 4 May 2012 20:05:38 +0000 (-0300) Subject: camerabin: always force image-profile to have variable framerate X-Git-Tag: 1.19.3~507^2~15597 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95fd9cd2775fb425da4e9afb3845c730583982f5;p=platform%2Fupstream%2Fgstreamer.git 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. --- diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 7c7871832a..a63c8681d5 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -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: