1 /* GStreamer H265 encoder plugin
2  * Copyright (C) 2005 Michal Benes <michal.benes@itonis.tv>
3  * Copyright (C) 2005 Josef Zlomek <josef.zlomek@itonis.tv>
4  * Copyright (C) 2014 Thijs Vermeir <thijs.vermeir@barco.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef __GST_X265_ENC_H__
23 #define __GST_X265_ENC_H__
24 
25 #include <gst/gst.h>
26 #include <gst/video/video.h>
27 #include <gst/video/gstvideoencoder.h>
28 #include <x265.h>
29 
30 G_BEGIN_DECLS
31 #define GST_TYPE_X265_ENC \
32   (gst_x265_enc_get_type())
33 #define GST_X265_ENC(obj) \
34   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_X265_ENC,GstX265Enc))
35 #define GST_X265_ENC_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_X265_ENC,GstX265EncClass))
37 #define GST_IS_X265_ENC(obj) \
38   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_X265_ENC))
39 #define GST_IS_X265_ENC_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_X265_ENC))
41 typedef struct _GstX265Enc GstX265Enc;
42 typedef struct _GstX265EncClass GstX265EncClass;
43 
44 struct _GstX265Enc
45 {
46   GstVideoEncoder element;
47 
48   /*< private > */
49   x265_encoder *x265enc;
50   x265_param x265param;
51   GstClockTime dts_offset;
52   gboolean push_header;
53 
54   /* List of frame/buffer mapping structs for
55    * pending frames */
56   GList *pending_frames;
57 
58   /* properties */
59   guint bitrate;
60   gint qp;
61   gint log_level;
62   gint tune;
63   gint speed_preset;
64   gint keyintmax;
65   GString *option_string_prop;  /* option-string property */
66   /*GString *option_string; *//* used by set prop */
67 
68   /* input description */
69   GstVideoCodecState *input_state;
70 
71   /* configuration changed  while playing */
72   gboolean reconfig;
73 
74   /* from the downstream caps */
75   const gchar *peer_profile;
76   gboolean peer_intra_profile;
77   /*const x265_level_t *peer_level; */
78 };
79 
80 struct _GstX265EncClass
81 {
82   GstVideoEncoderClass parent_class;
83 };
84 
85 GType gst_x265_enc_get_type (void);
86 
87 G_END_DECLS
88 #endif /* __GST_X265_ENC_H__ */
89