mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
ext: Update for caps/pad template related API changes
This commit is contained in:
parent
6392dfc072
commit
c255019b90
6 changed files with 24 additions and 14 deletions
|
@ -296,7 +296,7 @@ gst_alsasink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
|||
GstElementClass *element_class;
|
||||
GstPadTemplate *pad_template;
|
||||
GstAlsaSink *sink = GST_ALSA_SINK (bsink);
|
||||
GstCaps *caps;
|
||||
GstCaps *caps, *templ_caps;
|
||||
|
||||
if (sink->handle == NULL) {
|
||||
GST_DEBUG_OBJECT (sink, "device not open, using template caps");
|
||||
|
@ -316,8 +316,10 @@ gst_alsasink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
|||
pad_template = gst_element_class_get_pad_template (element_class, "sink");
|
||||
g_return_val_if_fail (pad_template != NULL, NULL);
|
||||
|
||||
templ_caps = gst_pad_template_get_caps (pad_template);
|
||||
caps = gst_alsa_probe_supported_formats (GST_OBJECT (sink), sink->handle,
|
||||
gst_pad_template_get_caps (pad_template));
|
||||
templ_caps);
|
||||
gst_caps_unref (templ_caps);
|
||||
|
||||
if (caps) {
|
||||
sink->cached_caps = gst_caps_ref (caps);
|
||||
|
|
|
@ -412,7 +412,7 @@ gst_alsasrc_getcaps (GstBaseSrc * bsrc, GstCaps * filter)
|
|||
GstElementClass *element_class;
|
||||
GstPadTemplate *pad_template;
|
||||
GstAlsaSrc *src;
|
||||
GstCaps *caps;
|
||||
GstCaps *caps, *templ_caps;
|
||||
|
||||
src = GST_ALSA_SRC (bsrc);
|
||||
|
||||
|
@ -434,8 +434,10 @@ gst_alsasrc_getcaps (GstBaseSrc * bsrc, GstCaps * filter)
|
|||
pad_template = gst_element_class_get_pad_template (element_class, "src");
|
||||
g_return_val_if_fail (pad_template != NULL, NULL);
|
||||
|
||||
templ_caps = gst_pad_template_get_caps (pad_template);
|
||||
caps = gst_alsa_probe_supported_formats (GST_OBJECT (src), src->handle,
|
||||
gst_pad_template_get_caps (pad_template));
|
||||
templ_caps);
|
||||
gst_caps_unref (templ_caps);
|
||||
|
||||
if (caps) {
|
||||
src->cached_caps = gst_caps_ref (caps);
|
||||
|
|
|
@ -279,7 +279,7 @@ gst_visual_getcaps (GstPad * pad, GstCaps * filter)
|
|||
int depths;
|
||||
|
||||
if (!visual->actor) {
|
||||
ret = gst_caps_copy (gst_pad_get_pad_template_caps (visual->srcpad));
|
||||
ret = gst_pad_get_pad_template_caps (visual->srcpad);
|
||||
goto beach;
|
||||
}
|
||||
|
||||
|
|
|
@ -284,6 +284,7 @@ gst_ogm_audio_parse_base_init (GstOgmParseClass * klass)
|
|||
audio_src_templ = gst_pad_template_new ("src",
|
||||
GST_PAD_SRC, GST_PAD_SOMETIMES, caps);
|
||||
gst_element_class_add_pad_template (element_class, audio_src_templ);
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -302,6 +303,7 @@ gst_ogm_video_parse_base_init (GstOgmParseClass * klass)
|
|||
video_src_templ = gst_pad_template_new ("src",
|
||||
GST_PAD_SRC, GST_PAD_SOMETIMES, caps);
|
||||
gst_element_class_add_pad_template (element_class, video_src_templ);
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -320,6 +322,7 @@ gst_ogm_text_parse_base_init (GstOgmParseClass * klass)
|
|||
text_src_templ = gst_pad_template_new ("src",
|
||||
GST_PAD_SRC, GST_PAD_SOMETIMES, caps);
|
||||
gst_element_class_add_pad_template (element_class, text_src_templ);
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1096,8 +1096,7 @@ gst_base_text_overlay_getcaps (GstPad * pad, GstCaps * filter)
|
|||
/* we can do what the peer can */
|
||||
caps = gst_pad_peer_get_caps (otherpad, filter);
|
||||
if (caps) {
|
||||
GstCaps *temp;
|
||||
const GstCaps *templ;
|
||||
GstCaps *temp, *templ;
|
||||
|
||||
GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, caps);
|
||||
|
||||
|
@ -1107,16 +1106,20 @@ gst_base_text_overlay_getcaps (GstPad * pad, GstCaps * filter)
|
|||
temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST);
|
||||
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
||||
gst_caps_unref (caps);
|
||||
gst_caps_unref (templ);
|
||||
/* this is what we can do */
|
||||
caps = temp;
|
||||
} else {
|
||||
/* no peer, our padtemplate is enough then */
|
||||
if (filter)
|
||||
caps =
|
||||
gst_caps_intersect_full (filter, gst_pad_get_pad_template_caps (pad),
|
||||
GST_CAPS_INTERSECT_FIRST);
|
||||
else
|
||||
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
||||
caps = gst_pad_get_pad_template_caps (pad);
|
||||
if (filter) {
|
||||
GstCaps *intersection;
|
||||
|
||||
intersection =
|
||||
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (caps);
|
||||
caps = intersection;
|
||||
}
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (overlay, "returning %" GST_PTR_FORMAT, caps);
|
||||
|
|
|
@ -597,7 +597,7 @@ vorbis_handle_identification_packet (GstVorbisDec * vd)
|
|||
* for mono/stereo and avoid the depth switch in tremor case */
|
||||
vd->copy_samples = get_copy_sample_func (vd->vi.channels, vd->width);
|
||||
|
||||
caps = gst_caps_copy (gst_pad_get_pad_template_caps (vd->srcpad));
|
||||
caps = gst_caps_make_writable (gst_pad_get_pad_template_caps (vd->srcpad));
|
||||
gst_caps_set_simple (caps, "rate", G_TYPE_INT, vd->vi.rate,
|
||||
"channels", G_TYPE_INT, vd->vi.channels,
|
||||
"width", G_TYPE_INT, width, NULL);
|
||||
|
|
Loading…
Reference in a new issue