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);
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;
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;
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);
}
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