summaryrefslogtreecommitdiffstats
path: root/sys/oss/gstosssink.c
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2004-03-25 02:43:48 +0000
committerDavid Schleef <ds@schleef.org>2004-03-25 02:43:48 +0000
commitd21f04ca6fb0e4d3f912834542aa13d0d79fdf94 (patch)
tree38abf7a4db2596ba473f8d2faa5a5bf99dd63e5a /sys/oss/gstosssink.c
parentf2ad493ba4ed1fc096c5ebf35545f3e5f2549e8b (diff)
sys/oss/gstosselement.c: Add code to handle rate probing (bug #120883)
Original commit message from CVS: * sys/oss/gstosselement.c: (gst_osselement_sync_parms), (gst_osselement_close_audio), (gst_osselement_probe_caps), (gst_osselement_get_format_structure), (gst_osselement_rate_probe_check), (gst_osselement_rate_add_range), (gst_osselement_rate_check_rate), (gst_osselement_rate_add_rate), (gst_osselement_rate_int_compare): Add code to handle rate probing (bug #120883) * sys/oss/gstosselement.h: same * sys/oss/gstosssink.c: (gst_osssink_init), (gst_osssink_getcaps): Use rate probing provided by osselement. * sys/oss/gstosssrc.c: (gst_osssrc_init), (gst_osssrc_getcaps): same
Diffstat (limited to 'sys/oss/gstosssink.c')
-rw-r--r--sys/oss/gstosssink.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c
index 9d06b064..28a8c44a 100644
--- a/sys/oss/gstosssink.c
+++ b/sys/oss/gstosssink.c
@@ -59,6 +59,7 @@ static gboolean gst_osssink_sink_query (GstPad * pad, GstQueryType type,
GstFormat * format, gint64 * value);
static GstCaps *gst_osssink_sink_fixate (GstPad * pad, const GstCaps * caps);
+static GstCaps *gst_osssink_getcaps (GstPad * pad);
static GstPadLinkReturn gst_osssink_sinkconnect (GstPad * pad,
const GstCaps * caps);
@@ -96,7 +97,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) { 8, 16 }, "
"depth = (int) { 8, 16 }, "
- "rate = (int) [ 1000, 48000 ], " "channels = (int) [ 1, 2 ]")
+ "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]")
);
static GstElementClass *parent_class = NULL;
@@ -202,6 +203,7 @@ gst_osssink_init (GstOssSink * osssink)
(&osssink_sink_factory), "sink");
gst_element_add_pad (GST_ELEMENT (osssink), osssink->sinkpad);
gst_pad_set_link_function (osssink->sinkpad, gst_osssink_sinkconnect);
+ gst_pad_set_getcaps_function (osssink->sinkpad, gst_osssink_getcaps);
gst_pad_set_fixate_function (osssink->sinkpad, gst_osssink_sink_fixate);
gst_pad_set_convert_function (osssink->sinkpad, gst_osssink_convert);
gst_pad_set_query_function (osssink->sinkpad, gst_osssink_sink_query);
@@ -256,6 +258,23 @@ gst_osssink_sink_fixate (GstPad * pad, const GstCaps * caps)
return NULL;
}
+static GstCaps *
+gst_osssink_getcaps (GstPad * pad)
+{
+ GstOssSink *osssink = GST_OSSSINK (gst_pad_get_parent (pad));
+ GstCaps *caps;
+
+ gst_osselement_probe_caps (GST_OSSELEMENT (osssink));
+
+ if (GST_OSSELEMENT (osssink)->probed_caps == NULL) {
+ caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+ } else {
+ caps = gst_caps_copy (GST_OSSELEMENT (osssink)->probed_caps);
+ }
+
+ return caps;
+}
+
static GstPadLinkReturn
gst_osssink_sinkconnect (GstPad * pad, const GstCaps * caps)
{