use new style caps

This commit is contained in:
Wim Taymans 2012-03-05 12:03:23 +01:00
parent 8546458617
commit bc9ebb2ff2
3 changed files with 16 additions and 14 deletions

View file

@ -9,7 +9,8 @@ libgstmplex_la_SOURCES = \
libgstmplex_la_CXXFLAGS = \ libgstmplex_la_CXXFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) $(MPLEX_CFLAGS) $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) $(MPLEX_CFLAGS)
libgstmplex_la_LIBADD = \ libgstmplex_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(MPLEX_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) \
$(GST_LIBS) $(MPLEX_LIBS)
libgstmplex_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(MPLEX_LDFLAGS) libgstmplex_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(MPLEX_LDFLAGS)
libgstmplex_la_LIBTOOLFLAGS = --tag=disable-static libgstmplex_la_LIBTOOLFLAGS = --tag=disable-static

View file

@ -54,6 +54,8 @@
#include <string.h> #include <string.h>
#include <gst/glib-compat-private.h> #include <gst/glib-compat-private.h>
#include <gst/audio/audio.h>
#include "gstmplex.hh" #include "gstmplex.hh"
#include "gstmplexoutputstream.hh" #include "gstmplexoutputstream.hh"
#include "gstmplexibitstream.hh" #include "gstmplexibitstream.hh"
@ -93,11 +95,8 @@ static GstStaticPadTemplate audio_sink_templ =
"audio/x-ac3, " "audio/x-ac3, "
COMMON_AUDIO_CAPS "; " COMMON_AUDIO_CAPS "; "
"audio/x-dts; " "audio/x-dts; "
"audio/x-raw-int, " "audio/x-raw, "
"endianness = (int) BIG_ENDIAN, " "format = (string) { S16BE, S20BE, S24BE }, "
"signed = (boolean) TRUE, "
"width = (int) { 16, 20, 24 }, "
"depth = (int) { 16, 20, 24 }, "
"rate = (int) { 48000, 96000 }, " "channels = (int) [ 1, 6 ]") "rate = (int) { 48000, 96000 }, " "channels = (int) [ 1, 6 ]")
); );
@ -324,20 +323,22 @@ gst_mplex_setcaps (GstPad * pad, GstCaps * caps)
type = AC3_AUDIO; type = AC3_AUDIO;
} else if (!strcmp (mime, "audio/x-dts")) { } else if (!strcmp (mime, "audio/x-dts")) {
type = DTS_AUDIO; type = DTS_AUDIO;
} else if (!strcmp (mime, "audio/x-raw-int")) { } else if (!strcmp (mime, "audio/x-raw")) {
LpcmParams *params; LpcmParams *params;
gint bits, chans, rate; gint bits, chans, rate;
gboolean result = TRUE; GstAudioInfo info;
type = LPCM_AUDIO; type = LPCM_AUDIO;
/* set LPCM params */ gst_audio_info_init (&info);
result &= gst_structure_get_int (structure, "depth", &bits); if (!gst_audio_info_from_caps (&info, caps))
result &= gst_structure_get_int (structure, "rate", &rate);
result &= gst_structure_get_int (structure, "channels", &chans);
if (!result)
goto refuse_caps; goto refuse_caps;
rate = GST_AUDIO_INFO_RATE (&info);
chans = GST_AUDIO_INFO_CHANNELS (&info);
bits = GST_AUDIO_INFO_DEPTH (&info);
/* set LPCM params */
params = LpcmParams::Checked (rate, chans, bits); params = LpcmParams::Checked (rate, chans, bits);
mplex->job->lpcm_param.push_back (params); mplex->job->lpcm_param.push_back (params);

View file

@ -57,7 +57,7 @@ enum
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK, GST_PAD_SINK,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb") GST_STATIC_CAPS ("video/x-raw")
); );
/* class initialization */ /* class initialization */