summaryrefslogtreecommitdiffstats
path: root/examples/seeking
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2003-12-18 09:51:22 +0000
committerDavid Schleef <ds@schleef.org>2003-12-18 09:51:22 +0000
commit92b3b26d6ee76d0d4b488e9e57d3b3424d2649fb (patch)
treefc0bb559cc3d026f5d7d2a6f1e6acd1dbc6dd0ae /examples/seeking
parentef3ed344af7d0eb330f68c85d31acfa9471d1573 (diff)
downloadgst-plugins-bad-92b3b26d6ee76d0d4b488e9e57d3b3424d2649fb.tar.gz
gst-plugins-bad-92b3b26d6ee76d0d4b488e9e57d3b3424d2649fb.tar.bz2
gst-plugins-bad-92b3b26d6ee76d0d4b488e9e57d3b3424d2649fb.zip
Merge HEAD from CAPS-ROOT to CAPS-MERGE-3, plus some caps conversion
Original commit message from CVS: Merge HEAD from CAPS-ROOT to CAPS-MERGE-3, plus some caps conversion
Diffstat (limited to 'examples/seeking')
-rw-r--r--examples/seeking/vorbisfile.c77
1 files changed, 13 insertions, 64 deletions
diff --git a/examples/seeking/vorbisfile.c b/examples/seeking/vorbisfile.c
index 29fc18cf..f191aa7b 100644
--- a/examples/seeking/vorbisfile.c
+++ b/examples/seeking/vorbisfile.c
@@ -12,78 +12,27 @@ struct probe_context {
gint total_ls;
- GstCaps *metadata;
- GstCaps *streaminfo;
- GstCaps *caps;
+ GstCaps2 *metadata;
+ GstCaps2 *streaminfo;
+ GstCaps2 *caps;
};
static void
-print_caps (GstCaps *caps)
+print_caps (GstCaps2 *caps)
{
- if (caps == NULL) return;
- if (!strcmp (gst_caps_get_mime (caps), "application/x-gst-metadata") ||
- !strcmp (gst_caps_get_mime (caps), "application/x-gst-streaminfo"))
- {
- GstProps *props = caps->properties;
- GList *walk;
- /* ugly hack, but ok for now. If needed, fix by individual strcmp */
- g_print (" %s:\n", gst_caps_get_mime (caps) + 18);
- if (props == NULL) {
- g_print (" none\n");
- return;
- }
- walk = props->properties;
-
- while (walk) {
- GstPropsEntry *entry = (GstPropsEntry *) walk->data;
- const gchar *name;
- const gchar *str_val;
- gint int_val;
- GstPropsType type;
-
- name = gst_props_entry_get_name (entry);
- type = gst_props_entry_get_props_type (entry);
- switch (type) {
- case GST_PROPS_STRING_TYPE:
- gst_props_entry_get_string (entry, &str_val);
- g_print (" %s='%s'\n", name, str_val);
- break;
- case GST_PROPS_INT_TYPE:
- gst_props_entry_get_int (entry, &int_val);
- g_print (" %s=%d\n", name, int_val);
- break;
- default:
- break;
- }
- walk = g_list_next (walk);
- }
- }
- else {
- g_print (" unkown caps type\n");
- }
+ char *s;
+ s = gst_caps2_to_string (caps);
+ g_print(" %s\n", s);
+ g_free (s);
}
static void
-print_format (GstCaps *caps)
+print_format (GstCaps2 *caps)
{
- g_print (" format:\n");
- if (!caps || caps->properties == NULL) {
- g_print (" unkown\n");
- return;
- }
- if (!strcmp (gst_caps_get_mime (caps), "audio/raw")) {
- gint channels;
- gint rate;
-
- gst_caps_get_int (caps, "channels", &channels);
- gst_caps_get_int (caps, "rate", &rate);
-
- g_print (" channels: %d\n", channels);
- g_print (" rate: %d\n", rate);
- }
- else {
- g_print (" unkown format\n");
- }
+ char *s;
+ s = gst_caps2_to_string (caps);
+ g_print(" format: %s\n", s);
+ g_free (s);
}
static void