From 8defcf9b72a4cdd03b94747135038a50704ec918 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Sat, 28 Oct 2023 22:55:04 +0800 Subject: [PATCH] libde265dec: Only decode the main profile The src caps of the libde265 is now fixed to I420, and so if the stream is other format, such as 4:4:4 or 10 bits format, the pipeline will crash because the dowstream element accesses the video buffer as I420 format. We now restrain the input caps to "main" profile, which only contains 4:2:0 8 bits stream. Part-of: --- subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json | 2 +- subprojects/gst-plugins-bad/ext/libde265/libde265-dec.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json index 5b29f25..7ede158 100644 --- a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json +++ b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json @@ -9677,7 +9677,7 @@ "long-name": "HEVC/H.265 decoder", "pad-templates": { "sink": { - "caps": "video/x-h265:\n stream-format: { (string)hvc1, (string)hev1, (string)byte-stream }\n alignment: { (string)au, (string)nal }\n", + "caps": "video/x-h265:\n stream-format: { (string)hvc1, (string)hev1, (string)byte-stream }\n alignment: { (string)au, (string)nal }\n profile: main\n", "direction": "sink", "presence": "always" }, diff --git a/subprojects/gst-plugins-bad/ext/libde265/libde265-dec.c b/subprojects/gst-plugins-bad/ext/libde265/libde265-dec.c index 60b7596..7b0aadb 100644 --- a/subprojects/gst-plugins-bad/ext/libde265/libde265-dec.c +++ b/subprojects/gst-plugins-bad/ext/libde265/libde265-dec.c @@ -55,7 +55,10 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-h265, stream-format=(string) { hvc1, hev1, byte-stream }, " - "alignment=(string) { au, nal }") + "alignment=(string) { au, nal }, " + /* TODO: Can support more profiles by adding the according + output formats in src caps. */ + "profile=(string) main") ); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", -- 2.7.4