diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-09-03 15:56:25 +0200 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2013-09-16 21:45:20 +0100 |
commit | f6b6a7c1db07c9a4d2e7547129864b59a952f50e (patch) | |
tree | ad46354a7f72b04fd7ef987ff6c144418902c46a | |
parent | 34e08c8a34dd17602aea3923c6234375a0a1de29 (diff) |
Fix video recording with GStreamer >= 1.1.4
GStreamer >= 1.1.4 requires fully specifying the video-capture-source caps,
otherwise Cheese prints this:
(cheese:22606): cheese-WARNING **: Filter caps do not completely specify the output format: gstcapsfilter.c(348): gst_capsfilter_prepare_buf (): /GstCameraBin:camerabin/GstCapsFilter:videobin-capsfilter:
Output caps are unfixed: video/x-raw, framerate=(fraction)30/1, width=(int)640, height=(int)480, format=(string){ YUY2, YV12, BGR, RGB, I420 }, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
and video-recording is broken. Fixes bug 707391.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | libcheese/cheese-camera.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c index a625359..ab5490d 100644 --- a/libcheese/cheese-camera.c +++ b/libcheese/cheese-camera.c @@ -743,7 +743,7 @@ cheese_camera_set_new_caps (CheeseCamera *camera) { CheeseCameraPrivate *priv; CheeseCameraDevice *device; - GstCaps *caps; + GstCaps *caps, *i420_caps, *video_caps; gchar *caps_desc; int width, height; @@ -768,8 +768,16 @@ cheese_camera_set_new_caps (CheeseCamera *camera) g_object_set (gst_bin_get_by_name (GST_BIN (priv->video_source), "video_source_filter"), "caps", caps, NULL); g_object_set (priv->camerabin, "viewfinder-caps", caps, - "image-capture-caps", caps, "video-capture-caps", caps, - NULL); + "image-capture-caps", caps, NULL); + + /* GStreamer >= 1.1.4 expects fully-specified video-capture-source caps. */ + i420_caps = gst_caps_new_simple ("video/x-raw", + "format", G_TYPE_STRING, "I420", NULL); + video_caps = gst_caps_intersect (caps, i420_caps); + g_object_set (priv->camerabin, "video-capture-caps", video_caps, NULL); + + gst_caps_unref (i420_caps); + gst_caps_unref (video_caps); gst_caps_unref (caps); width = priv->current_format->width; |