Merge CAPS branch

Original commit message from CVS:
Merge CAPS branch
This commit is contained in:
David Schleef 2003-12-22 01:47:09 +00:00 committed by Tim-Philipp Müller
parent 93cb77d0f0
commit 9d2631e7d6

View file

@ -77,7 +77,7 @@ static GstPadTemplate* gst_jack_sink_request_pad_factory();
static GstPad* gst_jack_request_new_pad (GstElement *element, GstPadTemplate *templ, static GstPad* gst_jack_request_new_pad (GstElement *element, GstPadTemplate *templ,
const gchar *name); const gchar *name);
static GstElementStateReturn gst_jack_change_state (GstElement *element); 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); static void gst_jack_loop (GstElement *element);
@ -264,11 +264,9 @@ gst_jack_src_request_pad_factory (void)
if (!template) { if (!template) {
GstCaps *caps; GstCaps *caps;
caps = gst_caps_new ("src", caps = gst_caps_from_string (GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS);
"audio/x-raw-float",
GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_PROPS);
template = gst_pad_template_new ("%s", GST_PAD_SRC, template = gst_pad_template_new ("%s", GST_PAD_SRC,
GST_PAD_REQUEST, caps, NULL); GST_PAD_REQUEST, caps);
} }
return template; return template;
@ -281,11 +279,9 @@ gst_jack_sink_request_pad_factory (void)
if (!template) { if (!template) {
GstCaps *caps; GstCaps *caps;
caps = gst_caps_new ("sink", caps = gst_caps_from_string (GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS);
"audio/x-raw-float",
GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_PROPS);
template = gst_pad_template_new ("%s", GST_PAD_SINK, template = gst_pad_template_new ("%s", GST_PAD_SINK,
GST_PAD_REQUEST, caps, NULL); GST_PAD_REQUEST, caps);
} }
return template; return template;
@ -397,10 +393,10 @@ gst_jack_change_state (GstElement *element)
while (l) { while (l) {
pad = GST_JACK_PAD (l); pad = GST_JACK_PAD (l);
caps = gst_pad_get_caps (pad->pad); caps = gst_pad_get_caps (pad->pad);
gst_caps_set (caps, "rate", GST_PROPS_INT_TYPE, gst_caps_set_simple (caps,
(gint)this->bin->rate, NULL); "rate", G_TYPE_INT, (int)this->bin->rate,
gst_caps_set (caps, "buffer-frames", GST_PROPS_INT_TYPE, "buffer-frames", G_TYPE_INT, (gint)this->bin->nframes,
(gint)this->bin->nframes, NULL); NULL);
if (gst_pad_try_set_caps (pad->pad, caps) <= 0) if (gst_pad_try_set_caps (pad->pad, caps) <= 0)
return GST_STATE_FAILURE; return GST_STATE_FAILURE;
l = g_list_next (l); l = g_list_next (l);
@ -421,24 +417,22 @@ gst_jack_change_state (GstElement *element)
} }
static GstPadLinkReturn static GstPadLinkReturn
gst_jack_link (GstPad *pad, GstCaps *caps) gst_jack_link (GstPad *pad, const GstCaps *caps)
{ {
GstJack *this; GstJack *this;
gint rate, buffer_frames; gint rate, buffer_frames;
GstStructure *structure;
this = GST_JACK (GST_OBJECT_PARENT (pad)); this = GST_JACK (GST_OBJECT_PARENT (pad));
if (GST_CAPS_IS_FIXED (caps)) { structure = gst_caps_get_structure (caps, 0);
gst_caps_get_int (caps, "rate", &rate); gst_structure_get_int (structure, "rate", &rate);
gst_caps_get_int (caps, "buffer-frames", &buffer_frames); gst_structure_get_int (structure, "buffer-frames", &buffer_frames);
if (this->bin && (rate != this->bin->rate || if (this->bin && (rate != this->bin->rate ||
buffer_frames != this->bin->nframes)) buffer_frames != this->bin->nframes))
return GST_PAD_LINK_REFUSED; return GST_PAD_LINK_REFUSED;
return GST_PAD_LINK_OK; return GST_PAD_LINK_OK;
}
return GST_PAD_LINK_DELAYED;
} }
static void static void