dshowsrcwrapper: add some helpful debug statements
authorJoshua M. Doe <oss@nvl.army.mil>
Thu, 11 Oct 2018 16:58:35 +0000 (12:58 -0400)
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>
Fri, 9 Nov 2018 09:52:40 +0000 (09:52 +0000)
sys/dshowsrcwrapper/gstdshow.cpp
sys/dshowsrcwrapper/gstdshowvideosrc.cpp

index 58e3387..a7d78e5 100644 (file)
@@ -335,7 +335,8 @@ gst_dshow_getdevice_from_devicename (const GUID * device_category,
             wcslen (varFriendlyName.bstrVal), NULL, NULL, NULL);
 
         devidx++;
-        GST_DEBUG ("Found device idx=%d: %s", devidx, friendly_name);
+        GST_DEBUG ("Found device idx=%d: device-name='%s'",
+            devidx, friendly_name);
 
         if (!*device_name && devidx == *device_index) {
           *device_name = g_strdup (friendly_name);
index 722bb06..5145480 100644 (file)
@@ -401,11 +401,14 @@ gst_dshowvideosrc_get_caps (GstBaseSrc * basesrc, GstCaps * filter)
               GstCaps *caps =
                   gst_dshowvideosrc_getcaps_from_streamcaps (src, capture_pin);
               if (caps) {
+                GST_DEBUG_OBJECT (src, "Caps supported by device: %" GST_PTR_FORMAT, caps);
                 gst_caps_append (src->caps, caps);
               } else {
                 caps = gst_dshowvideosrc_getcaps_from_enum_mediatypes (src, capture_pin);
-                if (caps)
+                if (caps) {
+                  GST_DEBUG_OBJECT (src, "Caps supported by device: %" GST_PTR_FORMAT, caps);
                   gst_caps_append (src->caps, caps);
+                }
               }
             }
           }
@@ -651,6 +654,8 @@ gst_dshowvideosrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
         gchar *caps_string = NULL;
         gchar *src_caps_string = NULL;
 
+        GST_DEBUG_OBJECT (src, "Default: %dx%d@%d", pin_mediatype->defaultWidth, pin_mediatype->defaultHeight, pin_mediatype->defaultFPS);
+
         /* retrieve the desired video size */
         VIDEOINFOHEADER *video_info = NULL;
         gint width = 0;