• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef GST_CODEC_BIN_H
17 #define GST_CODEC_BIN_H
18 
19 #include "common_utils.h"
20 
21 G_BEGIN_DECLS
22 
23 GType gst_codec_bin_get_type(void);
24 #define GST_TYPE_CODEC_BIN \
25     (gst_codec_bin_get_type())
26 #define GST_CODEC_BIN(obj) \
27     (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_CODEC_BIN, GstCodecBin))
28 #define GST_CODEC_BIN_CLASS(klass) \
29     (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_CODEC_BIN, GstCodecBinClass))
30 #define GST_IS_CODEC_BIN(obj) \
31     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_CODEC_BIN))
32 #define GST_IS_CODEC_BIN_CLASS(klass) \
33     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_CODEC_BIN))
34 #define GST_CODEC_BIN_GET_CLASS(obj) \
35     (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_CODEC_BIN, GstCodecBinClass))
36 
37 struct _GstCodecBin {
38     GstBin parent;
39 
40     /* private */
41     GstElement *src;
42     GstElement *parser;
43     GstElement *src_convert;
44     GstElement *coder;
45     GstElement *sink_convert;
46     GstElement *sink;
47 
48     CodecBinType type;
49     gboolean is_start;
50     gboolean use_software;
51     gchar *coder_name;
52     gboolean need_src_convert;
53     gboolean need_sink_convert;
54     gboolean need_parser;
55     gboolean is_input_surface;
56     gboolean is_output_surface;
57 
58     gint bitrate_mode;
59     gint codec_quality;
60     gint i_frame_interval;
61     gint codec_profile;
62     guint bitrate;
63 };
64 
65 struct _GstCodecBinClass {
66     GstBinClass parent_class;
67 };
68 
69 using GstCodecBin = struct _GstCodecBin;
70 using GstCodecBinClass = struct _GstCodecBinClass;
71 
72 G_GNUC_INTERNAL GType gst_codec_bin_get_type(void);
73 
74 G_END_DECLS
75 #endif // GST_CODEC_BIN_H
76