[cheese/wip/albfan/x-h264] Detect x-h264 cameras




commit f5722eb9d5dd8a10c03fee4874e4a65bbf43696e
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Thu Sep 10 10:34:54 2020 +0200

    Detect x-h264 cameras

 libcheese/cheese-camera-device-monitor.c | 2 ++
 libcheese/cheese-camera-device.c         | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/libcheese/cheese-camera-device-monitor.c b/libcheese/cheese-camera-device-monitor.c
index 19f4ff0b..4b6eab79 100644
--- a/libcheese/cheese-camera-device-monitor.c
+++ b/libcheese/cheese-camera-device-monitor.c
@@ -296,6 +296,8 @@ initable_init (GInitable     *initable,
   gst_bus_add_watch (bus, cheese_camera_device_monitor_bus_func, monitor);
   gst_object_unref (bus);
 
+  caps = gst_caps_new_empty_simple ("video/x-h264");
+  gst_device_monitor_add_filter (priv->monitor, "Video/Source", caps);
   caps = gst_caps_new_empty_simple ("video/x-raw");
   gst_device_monitor_add_filter (priv->monitor, "Video/Source", caps);
   gst_caps_unref (caps);
diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c
index 08a0a26a..6a5770e7 100644
--- a/libcheese/cheese-camera-device.c
+++ b/libcheese/cheese-camera-device.c
@@ -71,6 +71,7 @@ GST_DEBUG_CATEGORY (cheese_camera_device_cat);
 
 static const gchar * const supported_formats[] = {
   "video/x-raw",
+  "video/x-h264",
   NULL
 };
 
@@ -548,7 +549,7 @@ cheese_camera_device_get_caps (CheeseCameraDevice *device)
 
   caps = gst_device_get_caps (priv->device);
   if (caps == NULL)
-    caps = gst_caps_new_empty_simple ("video/x-raw");
+    caps = gst_caps_new_empty_simple ("video/x-h264");
 
   gst_caps_unref (priv->caps);
   priv->caps = cheese_camera_device_filter_caps (device, caps, supported_formats);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]