/
gstencodebin2.c
77 lines (66 loc) · 2.35 KB
/
gstencodebin2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* GStreamer encoding bin
* Copyright (C) 2016 Jan Schmidt <jan@centricular.com>
* (C) 2020 Thibault saunier <tsaunier@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "gstencodingelements.h"
#include "gstencodebasebin.h"
#include "gstencodebin2.h"
/**
* SECTION:element-encodebin2
*
* Encodebin2 is an updated version of #encodebin which has a request srcpad
* instead of having an always source pad. This makes the element more flexible
* and allows supporting muxing sinks for example.
*
* Based on the profile that was set (via the #GstEncodeBaseBin:profile
* property), EncodeBin will internally select and configure the required
* elements (encoders, muxers, but also audio and video converters) so that you
* can provide it raw or pre-encoded streams of data in input and have your
* encoded/muxed/converted stream in output.
*
* Since: 1.20
*/
enum
{
PROP_0,
};
static GstStaticPadTemplate muxer_src_template =
GST_STATIC_PAD_TEMPLATE ("src_%u", GST_PAD_SRC, GST_PAD_SOMETIMES,
GST_STATIC_CAPS_ANY);
struct _GstEncodeBin2
{
GstEncodeBaseBin parent;
};
G_DEFINE_TYPE (GstEncodeBin2, gst_encode_bin2, GST_TYPE_ENCODE_BASE_BIN);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (encodebin2, "encodebin2", GST_RANK_NONE,
gst_encode_bin2_get_type (), encoding_element_init (plugin));
static void
gst_encode_bin2_class_init (GstEncodeBin2Class * klass)
{
GstElementClass *gstelement_klass = (GstElementClass *) klass;
gst_element_class_add_static_pad_template (gstelement_klass,
&muxer_src_template);
}
static void
gst_encode_bin2_init (GstEncodeBin2 * encode_bin)
{
}