Merge branch 'master' into 0.11
[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  *
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., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GST_X264_ENC_H__
22 #define __GST_X264_ENC_H__
23
24 #include <gst/gst.h>
25 #include <gst/video/video.h>
26 #include "_stdint.h"
27 #include <x264.h>
28
29 G_BEGIN_DECLS
30
31 #define GST_TYPE_X264_ENC \
32   (gst_x264_enc_get_type())
33 #define GST_X264_ENC(obj) \
34   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_X264_ENC,GstX264Enc))
35 #define GST_X264_ENC_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_X264_ENC,GstX264EncClass))
37 #define GST_IS_X264_ENC(obj) \
38   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_X264_ENC))
39 #define GST_IS_X264_ENC_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_X264_ENC))
41
42 typedef struct _GstX264Enc GstX264Enc;
43 typedef struct _GstX264EncClass GstX264EncClass;
44
45 struct _GstX264Enc
46 {
47   GstElement element;
48
49   /*< private >*/
50   GstPad *sinkpad;
51   GstPad *srcpad;
52   GstSegment segment;
53
54   x264_t *x264enc;
55   x264_param_t x264param;
56   gint current_byte_stream;
57
58   /* properties */
59   guint threads;
60   gboolean sliced_threads;
61   gint sync_lookahead;
62   gint pass;
63   guint quantizer;
64   gchar *mp_cache_file;
65   gboolean byte_stream;
66   guint bitrate;
67   gboolean intra_refresh;
68   gint me;
69   guint subme;
70   guint analyse;
71   gboolean dct8x8;
72   guint ref;
73   guint bframes;
74   gboolean b_adapt;
75   gboolean b_pyramid;
76   gboolean weightb;
77   guint sps_id;
78   gboolean au_nalu;
79   gboolean trellis;
80   guint vbv_buf_capacity;
81   guint keyint_max;
82   gboolean cabac;
83   gfloat ip_factor;
84   gfloat pb_factor;
85   guint qp_min;
86   guint qp_max;
87   guint qp_step;
88   gboolean mb_tree;
89   gint rc_lookahead;
90   guint noise_reduction;
91   gboolean interlaced;
92   gint speed_preset;
93   gint psy_tune;
94   guint tune;
95   GString *tunings;
96   gint profile;
97   GString *option_string_prop; /* option-string property */
98   GString *option_string; /* used by set prop */
99
100   /* input description */
101   GstVideoInfo info;
102
103   /* for b-frame delay handling */
104   GQueue *delay;
105
106   guint8 *buffer;
107   gulong buffer_size;
108
109   /* configuration changed  while playing */
110   gboolean reconfig;
111
112   /* from the downstream caps */
113   const gchar *peer_profile;
114   gboolean peer_intra_profile;
115   const x264_level_t *peer_level;
116
117   GstClockTime pending_key_unit_ts;
118   GstEvent *force_key_unit_event;
119 };
120
121 struct _GstX264EncClass
122 {
123   GstElementClass parent_class;
124 };
125
126 GType gst_x264_enc_get_type (void);
127
128 G_END_DECLS
129
130 #endif /* __GST_X264_ENC_H__ */