2 * Copyright (C) <2021> Collabora Ltd.
3 * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
22 * SECTION:element-vp9alphadecodebin
23 * @title: Wrapper to decode VP9 alpha using vp9dec
25 * Use two `vp9dec` instance in order to decode VP9 alpha channel.
34 #include "gstvp9alphadecodebin.h"
36 static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
39 GST_STATIC_CAPS ("video/x-vp9, codec-alpha = (boolean) true, "
40 "alignment = super-frame")
43 struct _GstVp9AlphaDecodeBin
45 GstAlphaDecodeBin parent;
48 #define gst_vp9_alpha_decode_bin_parent_class parent_class
49 G_DEFINE_TYPE (GstVp9AlphaDecodeBin, gst_vp9_alpha_decode_bin,
50 GST_TYPE_ALPHA_DECODE_BIN);
52 GST_ELEMENT_REGISTER_DEFINE (vp9_alpha_decode_bin, "vp9alphadecodebin",
53 GST_RANK_PRIMARY + GST_ALPHA_DECODE_BIN_RANK_OFFSET,
54 GST_TYPE_VP9_ALPHA_DECODE_BIN);
57 gst_vp9_alpha_decode_bin_class_init (GstVp9AlphaDecodeBinClass * klass)
59 GstAlphaDecodeBinClass *adbin_class = (GstAlphaDecodeBinClass *) klass;
60 GstElementClass *element_class = (GstElementClass *) klass;
62 adbin_class->decoder_name = "vp9dec";
63 gst_element_class_add_static_pad_template (element_class, &sink_template);
65 gst_element_class_set_static_metadata (element_class,
66 "VP9 Alpha Decoder", "Codec/Decoder/Video",
67 "Wrapper bin to decode VP9 with alpha stream.",
68 "Nicolas Dufresne <nicolas.dufresne@collabora.com>");
72 gst_vp9_alpha_decode_bin_init (GstVp9AlphaDecodeBin * self)