va: Add VP9 alpha decode bin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8180>
This commit is contained in:
Cheung Yik Pang 2024-10-29 12:40:04 +08:00 committed by GStreamer Marge Bot
parent fd22a9c090
commit 59104fb3a3

View File

@ -46,6 +46,7 @@
#include "gstvavp9dec.h"
#include "gstvabasedec.h"
#include "gstvacodecalphadecodebin.h"
GST_DEBUG_CATEGORY_STATIC (gst_va_vp9dec_debug);
#ifndef GST_DISABLE_GST_DEBUG
@ -83,6 +84,12 @@ static const gchar *src_caps_str =
static const gchar *sink_caps_str = "video/x-vp9";
static GstStaticPadTemplate alpha_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK, GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-vp9, codec-alpha = (boolean) true, "
"alignment = frame")
);
static guint
_get_rtformat (GstVaVp9Dec * self, GstVP9Profile profile,
GstVp9BitDepth bit_depth, gint subsampling_x, gint subsampling_y)
@ -686,6 +693,21 @@ _register_debug_category (gpointer data)
return NULL;
}
static void
gst_va_codec_vp9_alpha_decode_bin_class_init (GstVaCodecAlphaDecodeBinClass
* klass, gchar * decoder_name)
{
GstElementClass *element_class = (GstElementClass *) klass;
klass->decoder_name = decoder_name;
gst_element_class_add_static_pad_template (element_class, &alpha_template);
gst_element_class_set_static_metadata (element_class,
"VA-API VP9 Alpha Decoder", "Codec/Decoder/Video/Hardware",
"Wrapper bin to decode VP9 with alpha stream.",
"Cheung Yik Pang <pang.cheung@harmonicinc.com>");
}
gboolean
gst_va_vp9_dec_register (GstPlugin * plugin, GstVaDevice * device,
GstCaps * sink_caps, GstCaps * src_caps, guint rank)
@ -730,6 +752,14 @@ gst_va_vp9_dec_register (GstPlugin * plugin, GstVaDevice * device,
ret = gst_element_register (plugin, feature_name, rank, type);
if (ret) {
ret = gst_va_codec_alpha_decode_bin_register (plugin,
(GClassInitFunc) gst_va_codec_vp9_alpha_decode_bin_class_init,
g_strdup (feature_name), "GstVaVp9AlphaDecodeBin",
"GstVaVp9%sAlphaDecodeBin", "vavp9alphadecodebin",
"vavp9%salphadecodebin", device, rank);
}
g_free (type_name);
g_free (feature_name);