mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
audio: Keep caps features when building the downstream filter
Based on 5fd4e3e0b6
for video
by Alessandro Decina.
This commit is contained in:
parent
5fd4e3e0b6
commit
5b7d9e1954
1 changed files with 5 additions and 1 deletions
|
@ -41,11 +41,13 @@ __gst_audio_element_proxy_caps (GstElement * element, GstCaps * templ_caps,
|
||||||
for (i = 0; i < templ_caps_size; i++) {
|
for (i = 0; i < templ_caps_size; i++) {
|
||||||
GQuark q_name =
|
GQuark q_name =
|
||||||
gst_structure_get_name_id (gst_caps_get_structure (templ_caps, i));
|
gst_structure_get_name_id (gst_caps_get_structure (templ_caps, i));
|
||||||
|
GstCapsFeatures *features = gst_caps_get_features (templ_caps, i);
|
||||||
|
|
||||||
for (j = 0; j < caps_size; j++) {
|
for (j = 0; j < caps_size; j++) {
|
||||||
const GstStructure *caps_s = gst_caps_get_structure (caps, j);
|
const GstStructure *caps_s = gst_caps_get_structure (caps, j);
|
||||||
const GValue *val;
|
const GValue *val;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
|
GstCaps *tmp = gst_caps_new_empty ();
|
||||||
|
|
||||||
s = gst_structure_new_id_empty (q_name);
|
s = gst_structure_new_id_empty (q_name);
|
||||||
if ((val = gst_structure_get_value (caps_s, "rate")))
|
if ((val = gst_structure_get_value (caps_s, "rate")))
|
||||||
|
@ -55,7 +57,9 @@ __gst_audio_element_proxy_caps (GstElement * element, GstCaps * templ_caps,
|
||||||
if ((val = gst_structure_get_value (caps_s, "channels-mask")))
|
if ((val = gst_structure_get_value (caps_s, "channels-mask")))
|
||||||
gst_structure_set_value (s, "channels-mask", val);
|
gst_structure_set_value (s, "channels-mask", val);
|
||||||
|
|
||||||
result = gst_caps_merge_structure (result, s);
|
gst_caps_append_structure_full (tmp, s,
|
||||||
|
gst_caps_features_copy (features));
|
||||||
|
result = gst_caps_merge (result, tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue