Merging gstreamer-sharp
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / gst / codecalpha / gstvp9alphadecodebin.c
1 /* GStreamer
2  * Copyright (C) <2021> Collabora Ltd.
3  *   Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 /**
22  * SECTION:element-vp9alphadecodebin
23  * @title: Wrapper to decode VP9 alpha using vp9dec
24  *
25  * Use two `vp9dec` instance in order to decode VP9 alpha channel.
26  *
27  * Since: 1.20
28  */
29
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
33
34 #include "gstvp9alphadecodebin.h"
35
36 static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
37     GST_PAD_SINK,
38     GST_PAD_ALWAYS,
39     GST_STATIC_CAPS ("video/x-vp9, codec-alpha = (boolean) true")
40     );
41
42 struct _GstVp9AlphaDecodeBin
43 {
44   GstAlphaDecodeBin parent;
45 };
46
47 #define gst_vp9_alpha_decode_bin_parent_class parent_class
48 G_DEFINE_TYPE (GstVp9AlphaDecodeBin, gst_vp9_alpha_decode_bin,
49     GST_TYPE_ALPHA_DECODE_BIN);
50
51 GST_ELEMENT_REGISTER_DEFINE (vp9_alpha_decode_bin, "vp9alphadecodebin",
52     GST_RANK_PRIMARY + GST_ALPHA_DECODE_BIN_RANK_OFFSET,
53     GST_TYPE_VP9_ALPHA_DECODE_BIN);
54
55 static void
56 gst_vp9_alpha_decode_bin_class_init (GstVp9AlphaDecodeBinClass * klass)
57 {
58   GstAlphaDecodeBinClass *adbin_class = (GstAlphaDecodeBinClass *) klass;
59   GstElementClass *element_class = (GstElementClass *) klass;
60
61   adbin_class->decoder_name = "vp9dec";
62   gst_element_class_add_static_pad_template (element_class, &sink_template);
63
64   gst_element_class_set_static_metadata (element_class,
65       "VP9 Alpha Decoder", "Codec/Decoder/Video",
66       "Wrapper bin to decode VP9 with alpha stream.",
67       "Nicolas Dufresne <nicolas.dufresne@collabora.com>");
68 }
69
70 static void
71 gst_vp9_alpha_decode_bin_init (GstVp9AlphaDecodeBin * self)
72 {
73 }