diff options
author | Wim Taymans <wtaymans@redhat.com> | 2017-02-01 17:17:47 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2017-02-01 17:21:59 +0100 |
commit | 07c140b5dfebf5860c6e34108fa718417fbed09d (patch) | |
tree | 3933766974d527cf0ae47c5fc1c380bc2279a166 | |
parent | 60818c03c77d075e6f10f011276dfbf7df04f5a5 (diff) | |
download | cheese-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.c | 11 |
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; |