From 3208d6c62ae983a9e883c9055920ef3906fe6c25 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Wed, 30 Jul 2025 15:19:42 -0400 Subject: [PATCH] lcevcdec: Fix LCEVC picture access flags Even though the LCEVC decoder works fine without this, it is recommended to set read access to base pictures that are sent to the decoder, and write access to enhanced pictures that are received from the decoder. Part-of: --- subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdec.c | 4 ++-- .../gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.c | 5 +++-- .../gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdec.c b/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdec.c index b574e6a7ab..1c56d55ec9 100644 --- a/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdec.c +++ b/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdec.c @@ -103,7 +103,7 @@ picture_data_new (LCEVC_DecoderHandle decoder_handle, GstVideoFrame * frame) /* Alloc LCEVC picture handle */ if (!gst_lcevc_dec_utils_alloc_picture_handle (decoder_handle, frame, - &ret->picture_handle)) { + &ret->picture_handle, LCEVC_Access_Write)) { g_free (ret); return NULL; } @@ -574,7 +574,7 @@ send_base_picture (GstLcevcDec * lcevc, GstBuffer * input_buffer) } if (!gst_lcevc_dec_utils_alloc_picture_handle (lcevc->decoder_handle, - &frame, &picture_handle)) { + &frame, &picture_handle, LCEVC_Access_Read)) { GST_ELEMENT_ERROR (lcevc, STREAM, DECODE, (NULL), ("Could not allocate input picture handle %" GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_PTS (input_buffer)))); diff --git a/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.c b/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.c index a8a0f680bf..35510e0ce6 100644 --- a/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.c +++ b/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.c @@ -50,7 +50,8 @@ gst_lcevc_dec_utils_get_color_format (GstVideoFormat format) gboolean gst_lcevc_dec_utils_alloc_picture_handle (LCEVC_DecoderHandle decoder_handle, - GstVideoFrame * frame, LCEVC_PictureHandle * picture_handle) + GstVideoFrame * frame, LCEVC_PictureHandle * picture_handle, + LCEVC_Access access) { LCEVC_PictureDesc picture_desc = { 0, }; LCEVC_PictureBufferDesc buffer_desc = { 0, }; @@ -71,7 +72,7 @@ gst_lcevc_dec_utils_alloc_picture_handle (LCEVC_DecoderHandle decoder_handle, /* Set buffer description */ buffer_desc.data = GST_VIDEO_FRAME_PLANE_DATA (frame, 0); buffer_desc.byteSize = GST_VIDEO_FRAME_SIZE (frame); - buffer_desc.access = LCEVC_Access_Write; + buffer_desc.access = access; /* Set plane description */ for (i = 0; i < GST_VIDEO_FRAME_N_PLANES (frame); i++) { diff --git a/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.h b/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.h index 59f0594f5d..1de570c7a8 100644 --- a/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.h +++ b/subprojects/gst-plugins-bad/ext/lcevcdecoder/gstlcevcdecutils.h @@ -35,7 +35,7 @@ LCEVC_ColorFormat gst_lcevc_dec_utils_get_color_format (GstVideoFormat format); gboolean gst_lcevc_dec_utils_alloc_picture_handle ( LCEVC_DecoderHandle decoder_handle, GstVideoFrame *frame, - LCEVC_PictureHandle *picture_handle); + LCEVC_PictureHandle *picture_handle, LCEVC_Access access); G_END_DECLS