summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2017-02-01 17:17:47 +0100
committerWim Taymans <wtaymans@redhat.com>2017-02-01 17:21:59 +0100
commit07c140b5dfebf5860c6e34108fa718417fbed09d (patch)
tree3933766974d527cf0ae47c5fc1c380bc2279a166
parent60818c03c77d075e6f10f011276dfbf7df04f5a5 (diff)
downloadcheese-07c140b5dfebf5860c6e34108fa718417fbed09d.tar.gz
camera: don't use hardcoded format
Use gst_caps_fixate() to select the best format instead of trying to filter out a hardcoded format. Some cameras might not produce this format and thus fail to work.
-rw-r--r--libcheese/cheese-camera.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index 49ac1c01..811bb1d4 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -733,7 +733,7 @@ cheese_camera_set_new_caps (CheeseCamera *camera)
{
CheeseCameraPrivate *priv;
CheeseCameraDevice *device;
- GstCaps *caps, *i420_caps, *video_caps;
+ GstCaps *caps;
gchar *caps_desc;
int width, height;
@@ -761,13 +761,10 @@ cheese_camera_set_new_caps (CheeseCamera *camera)
"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);
+ caps = gst_caps_fixate (caps);
+
+ g_object_set (priv->camerabin, "video-capture-caps", caps, NULL);
- gst_caps_unref (i420_caps);
- gst_caps_unref (video_caps);
gst_caps_unref (caps);
width = priv->current_format->width;