summaryrefslogtreecommitdiff
path: root/ext/gme
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-03-18 18:33:00 +0100
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-03-18 18:33:00 +0100
commiteea0b288cd111227170beb88c3c92e7ec5815362 (patch)
tree35172ee8fc58373dc8d31ee22d72fcafba9746d6 /ext/gme
parenta3002ad33871fa125008ea15326033edd1f238bf (diff)
downloadgstreamer-plugins-bad-eea0b288cd111227170beb88c3c92e7ec5815362.tar.gz
gme: use new style audio caps
Also do not pretend to negotiate output caps when there is not much in output to begin with.
Diffstat (limited to 'ext/gme')
-rw-r--r--ext/gme/Makefile.am2
-rw-r--r--ext/gme/gstgme.c48
2 files changed, 8 insertions, 42 deletions
diff --git a/ext/gme/Makefile.am b/ext/gme/Makefile.am
index f9a7b139b..6694f0041 100644
--- a/ext/gme/Makefile.am
+++ b/ext/gme/Makefile.am
@@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgstgme.la
libgstgme_la_SOURCES = gstgme.c
-libgstgme_la_CFLAGS = $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GME_CFLAGS)
+libgstgme_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GME_CFLAGS)
libgstgme_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(GME_LIBS)
libgstgme_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstgme_la_LIBTOOLFLAGS = --tag=disable-static
diff --git a/ext/gme/gstgme.c b/ext/gme/gstgme.c
index 1cd6161ac..9ba59e1fa 100644
--- a/ext/gme/gstgme.c
+++ b/ext/gme/gstgme.c
@@ -23,6 +23,7 @@
#endif
#include "gstgme.h"
+#include <gst/audio/audio.h>
#include <string.h>
#include <glib/gprintf.h>
@@ -39,11 +40,10 @@ static GstStaticPadTemplate sink_factory =
static GstStaticPadTemplate src_factory =
GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-int, "
- "endianness = (int) BYTE_ORDER, "
- "signed = (boolean) TRUE, "
- "width = (int) 16, "
- "depth = (int) 16, " "rate = (int) 32000, " "channels = (int) 2"));
+ GST_STATIC_CAPS ("audio/x-raw, "
+ "format = (string) " GST_AUDIO_NE (S16) ", "
+ "layout = (string) interleaved, "
+ "rate = (int) 32000, " "channels = (int) 2"));
#define gst_gme_dec_parent_class parent_class
G_DEFINE_TYPE (GstGmeDec, gst_gme_dec, GST_TYPE_ELEMENT);
@@ -65,45 +65,11 @@ static gboolean gme_setup (GstGmeDec * gme);
static gboolean
gme_negotiate (GstGmeDec * gme)
{
- GstCaps *allowed, *caps;
- GstStructure *structure;
- gint width = 16, depth = 16;
- gboolean sign;
- int rate = 32000;
- int channels = 2;
-
- allowed = gst_pad_get_allowed_caps (gme->srcpad);
- if (!allowed) {
- GST_DEBUG_OBJECT (gme, "couldn't get allowed caps");
- return FALSE;
- }
-
- GST_DEBUG_OBJECT (gme, "allowed caps: %" GST_PTR_FORMAT, allowed);
+ GstCaps *caps;
- structure = gst_caps_get_structure (allowed, 0);
- gst_structure_get_int (structure, "width", &width);
- gst_structure_get_int (structure, "depth", &depth);
-
- if (width && depth && width != depth) {
- GST_DEBUG_OBJECT (gme, "width %d and depth %d are different", width, depth);
- gst_caps_unref (allowed);
- return FALSE;
- }
-
- gst_structure_get_boolean (structure, "signed", &sign);
- gst_structure_get_int (structure, "rate", &rate);
- gst_structure_get_int (structure, "channels", &channels);
-
- caps = gst_caps_new_simple ("audio/x-raw-int",
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "width", G_TYPE_INT, width,
- "depth", G_TYPE_INT, depth,
- "rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, channels, NULL);
+ caps = gst_pad_get_pad_template_caps (gme->srcpad);
gst_pad_set_caps (gme->srcpad, caps);
-
gst_caps_unref (caps);
- gst_caps_unref (allowed);
return TRUE;
}