mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
vaapipostproc: fix check for compatible src pad capsfilters.
When an explicit output video format is selected, from an src pad capsfilter, make sure that the downstream element actually supports that format. In particular, fix crash with the following pipelines: ... ! vaapipostproc ! video/x-raw,format=XXX ! xvimagesink ; where XXX is a format not supported by xvimagesink. While doing so, also reduce the set of src pad filter caps to the actual set of allowed src pad caps.
This commit is contained in:
parent
9c888b8b8e
commit
0525f56ac5
1 changed files with 4 additions and 5 deletions
|
@ -1127,18 +1127,17 @@ gst_vaapipostproc_transform_caps_impl (GstBaseTransform * trans,
|
||||||
if (postproc->format != DEFAULT_FORMAT)
|
if (postproc->format != DEFAULT_FORMAT)
|
||||||
out_format = postproc->format;
|
out_format = postproc->format;
|
||||||
else {
|
else {
|
||||||
GstCaps *peer_caps, *filter_caps;
|
GstCaps *peer_caps;
|
||||||
GstVideoInfo peer_vi;
|
GstVideoInfo peer_vi;
|
||||||
filter_caps =
|
|
||||||
gst_caps_from_string (GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL));
|
|
||||||
peer_caps =
|
peer_caps =
|
||||||
gst_pad_peer_query_caps (GST_BASE_TRANSFORM_SRC_PAD (trans),
|
gst_pad_peer_query_caps (GST_BASE_TRANSFORM_SRC_PAD (trans),
|
||||||
filter_caps);
|
postproc->allowed_srcpad_caps);
|
||||||
|
if (gst_caps_is_empty (peer_caps))
|
||||||
|
return peer_caps;
|
||||||
if (!gst_caps_is_fixed (peer_caps))
|
if (!gst_caps_is_fixed (peer_caps))
|
||||||
peer_caps = gst_caps_fixate (peer_caps);
|
peer_caps = gst_caps_fixate (peer_caps);
|
||||||
gst_video_info_from_caps (&peer_vi, peer_caps);
|
gst_video_info_from_caps (&peer_vi, peer_caps);
|
||||||
out_format = GST_VIDEO_INFO_FORMAT (&peer_vi);
|
out_format = GST_VIDEO_INFO_FORMAT (&peer_vi);
|
||||||
gst_caps_unref (filter_caps);
|
|
||||||
if (peer_caps)
|
if (peer_caps)
|
||||||
gst_caps_unref (peer_caps);
|
gst_caps_unref (peer_caps);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue