From 28eeba3e186b22d3a770371a9e654f3fc3ba7d5a Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 1 Feb 2022 00:50:53 +0900 Subject: [PATCH] nvh265sldec: Fix for decoding 12bits stream We've been exposing main-444-12 profile as a supported profile in its sinkpad template but not actaully. Adding code to covert 12 and 16 bits as well. Part-of: --- subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c index 70f665e..43fc22b 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c @@ -377,6 +377,15 @@ gst_nv_h265_dec_new_sequence (GstH265Decoder * decoder, const GstH265SPS * sps, } else { GST_FIXME_OBJECT (self, "10 bits supports only 4:2:0 or 4:4:4 format"); } + } else if (self->bitdepth == 12 || self->bitdepth == 16) { + if (self->chroma_format_idc == 1) { + out_format = GST_VIDEO_FORMAT_P016_LE; + } else if (self->chroma_format_idc == 3) { + out_format = GST_VIDEO_FORMAT_Y444_16LE; + } else { + GST_FIXME_OBJECT (self, "%d bits supports only 4:2:0 or 4:4:4 format", + self->bitdepth); + } } if (out_format == GST_VIDEO_FORMAT_UNKNOWN) { -- 2.7.4