x264enc: Add configure parameter to specify additional x264 libraries with e.g. diffe...
[platform/upstream/gst-plugins-ugly.git] / ext / x264 / gstx264enc.h
1 /* GStreamer H264 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) 2016 Sebastian Dröge <sebastian@centricular.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_X264_ENC_H__
23 #define __GST_X264_ENC_H__
24
25 #include <gst/gst.h>
26 #include <gst/video/video.h>
27 #include <gst/video/gstvideoencoder.h>
28
29 #ifdef HAVE_STDINT_H
30 #include <stdint.h>
31 #endif
32
33 #include <x264.h>
34
35 G_BEGIN_DECLS
36
37 #define GST_TYPE_X264_ENC \
38   (gst_x264_enc_get_type())
39 #define GST_X264_ENC(obj) \
40   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_X264_ENC,GstX264Enc))
41 #define GST_X264_ENC_CLASS(klass) \
42   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_X264_ENC,GstX264EncClass))
43 #define GST_IS_X264_ENC(obj) \
44   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_X264_ENC))
45 #define GST_IS_X264_ENC_CLASS(klass) \
46   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_X264_ENC))
47
48 typedef struct _GstX264Enc GstX264Enc;
49 typedef struct _GstX264EncClass GstX264EncClass;
50 typedef struct _GstX264EncVTable GstX264EncVTable;
51
52 struct _GstX264Enc
53 {
54   GstVideoEncoder element;
55
56   /*< private >*/
57   GstX264EncVTable *vtable;
58   x264_t *x264enc;
59   x264_param_t x264param;
60   gint current_byte_stream;
61
62   /* List of frame/buffer mapping structs for
63    * pending frames */
64   GList *pending_frames;
65
66   /* properties */
67   guint threads;
68   gboolean sliced_threads;
69   gint sync_lookahead;
70   gint pass;
71   guint quantizer;
72   gchar *mp_cache_file;
73   gboolean byte_stream;
74   guint bitrate;
75   gboolean intra_refresh;
76   gint me;
77   guint subme;
78   guint analyse;
79   gboolean dct8x8;
80   guint ref;
81   guint bframes;
82   gboolean b_adapt;
83   gboolean b_pyramid;
84   gboolean weightb;
85   guint sps_id;
86   gboolean au_nalu;
87   gboolean trellis;
88   guint vbv_buf_capacity;
89   guint keyint_max;
90   gboolean cabac;
91   gfloat ip_factor;
92   gfloat pb_factor;
93   guint qp_min;
94   guint qp_max;
95   guint qp_step;
96   gboolean mb_tree;
97   gint rc_lookahead;
98   guint noise_reduction;
99   gboolean interlaced;
100   gint speed_preset;
101   gint psy_tune;
102   guint tune;
103   GString *tunings;
104   GString *option_string_prop; /* option-string property */
105   GString *option_string; /* used by set prop */
106   gint frame_packing;
107
108   /* input description */
109   GstVideoCodecState *input_state;
110
111   /* configuration changed  while playing */
112   gboolean reconfig;
113
114   /* from the downstream caps */
115   const gchar *peer_profile;
116   gboolean peer_intra_profile;
117   gint peer_level_idc;
118 };
119
120 struct _GstX264EncClass
121 {
122   GstVideoEncoderClass parent_class;
123 };
124
125 GType gst_x264_enc_get_type (void);
126
127 G_END_DECLS
128
129 #endif /* __GST_X264_ENC_H__ */