From a01c0bc3523f1bd9336200616aa9c8f1d48a558b Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Wed, 1 Feb 2017 14:32:45 +0900 Subject: [PATCH] vaapipostproc: set GST_VAAPI_POSTPROC_FLAG_SIZE according to src caps A value of width/height property should be set to out caps, if negotiation had been going properly. So we can use srcpad_info when making decision of scaling. https://bugzilla.gnome.org/show_bug.cgi?id=778010 --- gst/vaapi/gstvaapipostproc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 60b6960d45..dab15bea37 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -982,10 +982,12 @@ gst_vaapipostproc_update_src_caps (GstVaapiPostproc * postproc, GstCaps * caps, postproc->format != DEFAULT_FORMAT) postproc->flags |= GST_VAAPI_POSTPROC_FLAG_FORMAT; - if ((postproc->width || postproc->height) && - postproc->width != GST_VIDEO_INFO_WIDTH (&postproc->sinkpad_info) && - postproc->height != GST_VIDEO_INFO_HEIGHT (&postproc->sinkpad_info)) + if (GST_VIDEO_INFO_WIDTH (&postproc->srcpad_info) != + GST_VIDEO_INFO_WIDTH (&postproc->sinkpad_info) + && GST_VIDEO_INFO_HEIGHT (&postproc->srcpad_info) != + GST_VIDEO_INFO_HEIGHT (&postproc->sinkpad_info)) postproc->flags |= GST_VAAPI_POSTPROC_FLAG_SIZE; + return TRUE; }