mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
Merge CAPS branch
Original commit message from CVS: Merge CAPS branch
This commit is contained in:
parent
93cb77d0f0
commit
9d2631e7d6
1 changed files with 18 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue