diff options
author | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-05-04 17:05:38 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-05-04 19:50:52 -0300 |
commit | 95fd9cd2775fb425da4e9afb3845c730583982f5 (patch) | |
tree | cd576f213ce37fa7b78add4a416aad1fb6c6b0b1 /gst/camerabin2 | |
parent | d3303121c87af5f42b3d745db22e26f0a0c8eb02 (diff) | |
download | gstreamer-plugins-bad-95fd9cd2775fb425da4e9afb3845c730583982f5.tar.gz |
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.
Diffstat (limited to 'gst/camerabin2')
-rw-r--r-- | gst/camerabin2/gstcamerabin2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 7c7871832..a63c8681d 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: |