• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-vp8alphadecodebin
23  * @title: Wrapper to decode VP8 alpha using vp8dec
24  *
25  * Use two `vp8dec` instance in order to decode VP8 alpha channel.
26  *
27  * Since: 1.20
28  */
29 
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
33 
34 #include "gstvp8alphadecodebin.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-vp8, codec-alpha = (boolean) true")
40     );
41 
42 struct _GstVp8AlphaDecodeBin
43 {
44   GstAlphaDecodeBin parent;
45 };
46 
47 #define gst_vp8_alpha_decode_bin_parent_class parent_class
48 G_DEFINE_TYPE (GstVp8AlphaDecodeBin, gst_vp8_alpha_decode_bin,
49     GST_TYPE_ALPHA_DECODE_BIN);
50 
51 GST_ELEMENT_REGISTER_DEFINE (vp8_alpha_decode_bin, "vp8alphadecodebin",
52     GST_RANK_PRIMARY + GST_ALPHA_DECODE_BIN_RANK_OFFSET,
53     GST_TYPE_VP8_ALPHA_DECODE_BIN);
54 
55 static void
gst_vp8_alpha_decode_bin_class_init(GstVp8AlphaDecodeBinClass * klass)56 gst_vp8_alpha_decode_bin_class_init (GstVp8AlphaDecodeBinClass * klass)
57 {
58   GstAlphaDecodeBinClass *adbin_class = (GstAlphaDecodeBinClass *) klass;
59   GstElementClass *element_class = (GstElementClass *) klass;
60 
61   adbin_class->decoder_name = "vp8dec";
62   gst_element_class_add_static_pad_template (element_class, &sink_template);
63 
64   gst_element_class_set_static_metadata (element_class,
65       "VP8 Alpha Decoder", "Codec/Decoder/Video",
66       "Wrapper bin to decode VP8 with alpha stream.",
67       "Nicolas Dufresne <nicolas.dufresne@collabora.com>");
68 }
69 
70 static void
gst_vp8_alpha_decode_bin_init(GstVp8AlphaDecodeBin * self)71 gst_vp8_alpha_decode_bin_init (GstVp8AlphaDecodeBin * self)
72 {
73 }
74