summaryrefslogtreecommitdiffstats
path: root/ext/jack
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
commitb144bc6c58979f49a6e8e04a04a65f771247297a (patch)
tree648bc437ca5562bc7c67224ad71ef90dfacc12d1 /ext/jack
parent2309d726b7b0c37dbd9c57c653e2053ec6258ac8 (diff)
downloadgst-plugins-bad-b144bc6c58979f49a6e8e04a04a65f771247297a.tar.gz
gst-plugins-bad-b144bc6c58979f49a6e8e04a04a65f771247297a.tar.bz2
gst-plugins-bad-b144bc6c58979f49a6e8e04a04a65f771247297a.zip
Merge CAPS branch
Original commit message from CVS: Merge CAPS branch
Diffstat (limited to 'ext/jack')
-rw-r--r--ext/jack/gstjack.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/ext/jack/gstjack.c b/ext/jack/gstjack.c
index 85d57658..4a987ae1 100644
--- a/ext/jack/gstjack.c
+++ b/ext/jack/gstjack.c
@@ -77,7 +77,7 @@ static GstPadTemplate* gst_jack_sink_request_pad_factory();
static GstPad* gst_jack_request_new_pad (GstElement *element, GstPadTemplate *templ,
const gchar *name);
static GstElementStateReturn gst_jack_change_state (GstElement *element);
-static GstPadLinkReturn gst_jack_link (GstPad *pad, GstCaps *caps);
+static GstPadLinkReturn gst_jack_link (GstPad *pad, const GstCaps *caps);
static void gst_jack_loop (GstElement *element);
@@ -264,11 +264,9 @@ gst_jack_src_request_pad_factory (void)
if (!template) {
GstCaps *caps;
- caps = gst_caps_new ("src",
- "audio/x-raw-float",
- GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_PROPS);
+ caps = gst_caps_from_string (GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS);
template = gst_pad_template_new ("%s", GST_PAD_SRC,
- GST_PAD_REQUEST, caps, NULL);
+ GST_PAD_REQUEST, caps);
}
return template;
@@ -281,11 +279,9 @@ gst_jack_sink_request_pad_factory (void)
if (!template) {
GstCaps *caps;
- caps = gst_caps_new ("sink",
- "audio/x-raw-float",
- GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_PROPS);
+ caps = gst_caps_from_string (GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS);
template = gst_pad_template_new ("%s", GST_PAD_SINK,
- GST_PAD_REQUEST, caps, NULL);
+ GST_PAD_REQUEST, caps);
}
return template;
@@ -397,10 +393,10 @@ gst_jack_change_state (GstElement *element)
while (l) {
pad = GST_JACK_PAD (l);
caps = gst_pad_get_caps (pad->pad);
- gst_caps_set (caps, "rate", GST_PROPS_INT_TYPE,
- (gint)this->bin->rate, NULL);
- gst_caps_set (caps, "buffer-frames", GST_PROPS_INT_TYPE,
- (gint)this->bin->nframes, NULL);
+ gst_caps_set_simple (caps,
+ "rate", G_TYPE_INT, (int)this->bin->rate,
+ "buffer-frames", G_TYPE_INT, (gint)this->bin->nframes,
+ NULL);
if (gst_pad_try_set_caps (pad->pad, caps) <= 0)
return GST_STATE_FAILURE;
l = g_list_next (l);
@@ -421,24 +417,22 @@ gst_jack_change_state (GstElement *element)
}
static GstPadLinkReturn
-gst_jack_link (GstPad *pad, GstCaps *caps)
+gst_jack_link (GstPad *pad, const GstCaps *caps)
{
GstJack *this;
gint rate, buffer_frames;
+ GstStructure *structure;
this = GST_JACK (GST_OBJECT_PARENT (pad));
- if (GST_CAPS_IS_FIXED (caps)) {
- gst_caps_get_int (caps, "rate", &rate);
- gst_caps_get_int (caps, "buffer-frames", &buffer_frames);
- if (this->bin && (rate != this->bin->rate ||
- buffer_frames != this->bin->nframes))
- return GST_PAD_LINK_REFUSED;
-
- return GST_PAD_LINK_OK;
- }
+ structure = gst_caps_get_structure (caps, 0);
+ gst_structure_get_int (structure, "rate", &rate);
+ gst_structure_get_int (structure, "buffer-frames", &buffer_frames);
+ if (this->bin && (rate != this->bin->rate ||
+ buffer_frames != this->bin->nframes))
+ return GST_PAD_LINK_REFUSED;
- return GST_PAD_LINK_DELAYED;
+ return GST_PAD_LINK_OK;
}
static void