diff options
authorHe Junyan <>2019-12-22 14:35:18 +0800
committerHe Junyan <>2019-12-23 01:28:56 +0800
commit3355cd46917bc092f5f237b8154749cfff5c68b6 (patch)
parent5ad67ea666c96ecd01212caa39ad0b1432e6d726 (diff)
plugin: encode: set allowed_sinkpad_caps to empty.
We now set encode->allowed_sinkpad_caps to NULL if we fail to get surfaces formats. This causes two problem: 1. gst_video_encoder_proxy_getcaps use NULL as its caps parameter, which changes its behavior. It will use encode's sinkpad template rather than empty caps to do the clip job. So even if we fail to set allowed_sinkpad_caps, gst_video_encoder_proxy_getcaps can still return valid caps. 2. We should just set the allowed_sinkpad_caps once. The NULL point make the ensure_allowed_sinkpad_caps function works again and again.
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapiencode.c b/gst/vaapi/gstvaapiencode.c
index c8a29efa..b573e188 100644
--- a/gst/vaapi/gstvaapiencode.c
+++ b/gst/vaapi/gstvaapiencode.c
@@ -441,6 +441,9 @@ ensure_allowed_sinkpad_caps (GstVaapiEncode * encode)
ret = TRUE;
+ if (!encode->allowed_sinkpad_caps)
+ encode->allowed_sinkpad_caps = gst_caps_new_empty ();
if (out_caps)
gst_caps_unref (out_caps);
if (raw_caps)