mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
device-monitor: print caps features in the caps
This commit is contained in:
parent
14ce1ccdd2
commit
1f2028e2ef
1 changed files with 24 additions and 3 deletions
|
@ -159,6 +159,16 @@ print_structure_field (GQuark field_id, const GValue * value,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
print_field (GQuark field, const GValue * value, gpointer unused)
|
||||||
|
{
|
||||||
|
gchar *str = gst_value_serialize (value);
|
||||||
|
|
||||||
|
g_print (", %s=%s", g_quark_to_string (field), str);
|
||||||
|
g_free (str);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_device (GstDevice * device, gboolean modified)
|
print_device (GstDevice * device, gboolean modified)
|
||||||
{
|
{
|
||||||
|
@ -180,9 +190,20 @@ print_device (GstDevice * device, gboolean modified)
|
||||||
g_print ("\tclass : %s\n", device_class);
|
g_print ("\tclass : %s\n", device_class);
|
||||||
for (i = 0; i < size; ++i) {
|
for (i = 0; i < size; ++i) {
|
||||||
GstStructure *s = gst_caps_get_structure (caps, i);
|
GstStructure *s = gst_caps_get_structure (caps, i);
|
||||||
str = gst_structure_to_string (s);
|
GstCapsFeatures *features = gst_caps_get_features (caps, i);
|
||||||
g_print ("\t%s %s\n", (i == 0) ? "caps :" : " ", str);
|
|
||||||
g_free (str);
|
g_print ("\t%s %s", (i == 0) ? "caps :" : " ",
|
||||||
|
gst_structure_get_name (s));
|
||||||
|
if (features && (gst_caps_features_is_any (features) ||
|
||||||
|
!gst_caps_features_is_equal (features,
|
||||||
|
GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY))) {
|
||||||
|
gchar *features_string = gst_caps_features_to_string (features);
|
||||||
|
|
||||||
|
g_print ("(%s)", features_string);
|
||||||
|
g_free (features_string);
|
||||||
|
}
|
||||||
|
gst_structure_foreach (s, print_field, NULL);
|
||||||
|
g_print ("\n");
|
||||||
}
|
}
|
||||||
if (props) {
|
if (props) {
|
||||||
g_print ("\tproperties:");
|
g_print ("\tproperties:");
|
||||||
|
|
Loading…
Reference in a new issue