mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
basetransform: Always intersect the suggested sink caps with the peer caps
This makes sure that we get correct and complete caps. The suggested caps could be incomplete, e.g. video/x-raw-rgb without any fields, and by intersecting with the peer caps we get something usable. Fixes bug #662199.
This commit is contained in:
parent
c9bd4e4e96
commit
e6d2da7cf8
1 changed files with 18 additions and 16 deletions
|
@ -1882,16 +1882,14 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
||||||
/* check if we actually handle this format on the sinkpad */
|
/* check if we actually handle this format on the sinkpad */
|
||||||
if (sink_suggest) {
|
if (sink_suggest) {
|
||||||
const GstCaps *templ;
|
const GstCaps *templ;
|
||||||
|
|
||||||
if (!gst_caps_is_fixed (sink_suggest)) {
|
|
||||||
GstCaps *peercaps;
|
GstCaps *peercaps;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (trans, "Suggested caps is not fixed: %"
|
/* Always intersect with the peer caps to get correct
|
||||||
GST_PTR_FORMAT, sink_suggest);
|
* and complete caps. The suggested caps could be incomplete,
|
||||||
|
* for example video/x-raw-yuv without any fields at all.
|
||||||
|
*/
|
||||||
peercaps =
|
peercaps =
|
||||||
gst_pad_peer_get_caps_reffed (GST_BASE_TRANSFORM_SINK_PAD (trans));
|
gst_pad_peer_get_caps_reffed (GST_BASE_TRANSFORM_SINK_PAD (trans));
|
||||||
/* try fixating by intersecting with peer caps */
|
|
||||||
if (peercaps) {
|
if (peercaps) {
|
||||||
GstCaps *intersect;
|
GstCaps *intersect;
|
||||||
|
|
||||||
|
@ -1903,6 +1901,10 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
||||||
sink_suggest = intersect;
|
sink_suggest = intersect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!gst_caps_is_fixed (sink_suggest) || gst_caps_is_empty (sink_suggest)) {
|
||||||
|
GST_DEBUG_OBJECT (trans, "Suggested caps is not fixed: %"
|
||||||
|
GST_PTR_FORMAT, sink_suggest);
|
||||||
|
|
||||||
if (gst_caps_is_empty (sink_suggest))
|
if (gst_caps_is_empty (sink_suggest))
|
||||||
goto not_supported;
|
goto not_supported;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue