summaryrefslogtreecommitdiffstats
path: root/ext/esd
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2002-01-13 22:27:25 +0000
committerWim Taymans <wim.taymans@gmail.com>2002-01-13 22:27:25 +0000
commit97454065ce4921877100d0f829d4638438424dfe (patch)
treeb7fba2905e195b55f136e65332777fb96fee3d65 /ext/esd
parent1ea946d2d26998d7056d233548d88b57322ffdcf (diff)
Bring the plugins in sync with the new core capsnego system.
Original commit message from CVS: Bring the plugins in sync with the new core capsnego system. Added some features, enhancements...
Diffstat (limited to 'ext/esd')
-rw-r--r--ext/esd/esdsink.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c
index 16a056b7..b0aba3cb 100644
--- a/ext/esd/esdsink.c
+++ b/ext/esd/esdsink.c
@@ -86,12 +86,14 @@ static gboolean gst_esdsink_open_audio (GstEsdsink *sink);
static void gst_esdsink_close_audio (GstEsdsink *sink);
static GstElementStateReturn gst_esdsink_change_state (GstElement *element);
static gboolean gst_esdsink_sync_parms (GstEsdsink *esdsink);
-static void gst_esdsink_newcaps (GstPad *pad, GstCaps *caps);
+static GstPadConnectReturn gst_esdsink_sinkconnect (GstPad *pad, GstCaps *caps);
static void gst_esdsink_chain (GstPad *pad, GstBuffer *buf);
-static void gst_esdsink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void gst_esdsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void gst_esdsink_set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec);
+static void gst_esdsink_get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec);
#define GST_TYPE_ESDSINK_DEPTHS (gst_esdsink_depths_get_type())
static GType
@@ -190,7 +192,7 @@ gst_esdsink_init(GstEsdsink *esdsink)
GST_PADTEMPLATE_GET (sink_factory), "sink");
gst_element_add_pad(GST_ELEMENT(esdsink), esdsink->sinkpad);
gst_pad_set_chain_function(esdsink->sinkpad, GST_DEBUG_FUNCPTR(gst_esdsink_chain));
- gst_pad_set_newcaps_function(esdsink->sinkpad, gst_esdsink_newcaps);
+ gst_pad_set_connect_function(esdsink->sinkpad, gst_esdsink_sinkconnect);
esdsink->mute = FALSE;
esdsink->fd = -1;
@@ -215,18 +217,24 @@ gst_esdsink_sync_parms (GstEsdsink *esdsink)
return gst_esdsink_open_audio (esdsink);
}
-static void
-gst_esdsink_newcaps (GstPad *pad, GstCaps *caps)
+static GstPadConnectReturn
+gst_esdsink_sinkconnect (GstPad *pad, GstCaps *caps)
{
GstEsdsink *esdsink;
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
+ if (!GST_CAPS_IS_FIXED (caps))
+ return GST_PAD_CONNECT_DELAYED;
+
esdsink->depth = gst_caps_get_int (caps, "depth");
esdsink->channels = gst_caps_get_int (caps, "channels");
esdsink->frequency = gst_caps_get_int (caps, "rate");
- gst_esdsink_sync_parms (esdsink);
+ if (gst_esdsink_sync_parms (esdsink))
+ return GST_PAD_CONNECT_OK;
+
+ return GST_PAD_CONNECT_REFUSED;
}
static void