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