summaryrefslogtreecommitdiffstats
path: root/gst/law/alaw-decode.c
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2003-12-22 01:47:09 +0000
committerDavid Schleef <ds@schleef.org>2003-12-22 01:47:09 +0000
commitce51f6173ca1c37d90f8e2e316d90316583d7755 (patch)
tree270b121765a11455f5bf8166b526d7ac336dc56c /gst/law/alaw-decode.c
parentf43f0a9fd781bafab689e46bd936af9cb5ed2690 (diff)
Merge CAPS branch
Original commit message from CVS: Merge CAPS branch
Diffstat (limited to 'gst/law/alaw-decode.c')
-rw-r--r--gst/law/alaw-decode.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/gst/law/alaw-decode.c b/gst/law/alaw-decode.c
index d656fdd1..00108948 100644
--- a/gst/law/alaw-decode.c
+++ b/gst/law/alaw-decode.c
@@ -80,31 +80,29 @@ static gint alaw_to_s16(guint8 a_val)
}
static GstPadLinkReturn
-alawdec_link (GstPad *pad, GstCaps *caps)
+alawdec_link (GstPad *pad, const GstCaps *caps)
{
GstCaps* tempcaps;
gint rate, channels;
+ GstStructure *structure;
+ gboolean ret;
GstALawDec* alawdec = GST_ALAWDEC (GST_OBJECT_PARENT (pad));
- if (!GST_CAPS_IS_FIXED (caps))
- return GST_PAD_LINK_DELAYED;
-
- if (!gst_caps_get (caps, "rate", &rate,
- "channels", &channels,
- NULL))
- return GST_PAD_LINK_DELAYED;
+ structure = gst_caps_get_structure (caps, 0);
+
+ ret = gst_structure_get_int (structure, "rate", &rate);
+ ret &= gst_structure_get_int (structure, "channels", &channels);
+ if (!ret) return GST_PAD_LINK_REFUSED;
- tempcaps = GST_CAPS_NEW (
- "alawdec_src_caps",
- "audio/x-raw-int",
- "depth", GST_PROPS_INT (16),
- "width", GST_PROPS_INT (16),
- "signed", GST_PROPS_BOOLEAN (TRUE),
- "endianness", GST_PROPS_INT (G_BYTE_ORDER),
- "rate", GST_PROPS_INT (rate),
- "channels", GST_PROPS_INT (channels),
- NULL);
+ tempcaps = gst_caps_new_simple ( "audio/x-raw-int",
+ "depth", G_TYPE_INT, 16,
+ "width", G_TYPE_INT, 16,
+ "signed", G_TYPE_BOOLEAN, TRUE,
+ "endianness", G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, rate,
+ "channels", G_TYPE_INT, channels,
+ NULL);
return gst_pad_try_set_caps (alawdec->srcpad, tempcaps);
}