From 113867766e05e97a519ce8d76caf5baecb10c004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 16 Oct 2020 10:35:36 +0200 Subject: [PATCH] codecs: vp9decoder: Add segmentation to picture. VA-API needs AC and DC quant scales for both luma and chroma, and the loop filter level for current frame, but these values are not available outside the private GstVp9Parser structure. And these values may change from frame to frame, so they are picture specific. This patch add GstVp9Segmentation structure array to GstVp9Picture to expose it to derived classes. This approach is safer than passing the parser at picture handling flow. Also, this patch, in order to solve Documentation CI, mark as private the GstVp9Picture structure. Part-of: --- gst-libs/gst/codecs/gstvp9decoder.c | 3 +++ gst-libs/gst/codecs/gstvp9picture.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gst-libs/gst/codecs/gstvp9decoder.c b/gst-libs/gst/codecs/gstvp9decoder.c index 38691924c0..5e3e2cf91c 100644 --- a/gst-libs/gst/codecs/gstvp9decoder.c +++ b/gst-libs/gst/codecs/gstvp9decoder.c @@ -348,6 +348,9 @@ gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder, picture->subsampling_y = priv->parser->subsampling_y; picture->bit_depth = priv->parser->bit_depth; + memcpy (picture->segmentation, priv->parser->segmentation, + sizeof (priv->parser->segmentation)); + if (klass->new_picture) { if (!klass->new_picture (self, frame, picture)) { GST_ERROR_OBJECT (self, "new picture error"); diff --git a/gst-libs/gst/codecs/gstvp9picture.h b/gst-libs/gst/codecs/gstvp9picture.h index 449871b3ff..dc71202769 100644 --- a/gst-libs/gst/codecs/gstvp9picture.h +++ b/gst-libs/gst/codecs/gstvp9picture.h @@ -34,6 +34,7 @@ typedef struct _GstVp9Picture GstVp9Picture; struct _GstVp9Picture { + /*< private >*/ GstMiniObject parent; /* From GstVideoCodecFrame */ @@ -52,6 +53,8 @@ struct _GstVp9Picture gpointer user_data; GDestroyNotify notify; + + GstVp9Segmentation segmentation[GST_VP9_MAX_SEGMENTS]; }; GST_CODECS_API