| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
> |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 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 |
#include "gstencoderbitrateprofilemanager.h" |
| 29 |
|
| 30 |
#ifdef HAVE_STDINT_H |
| 31 |
#include <stdint.h> |
| 32 |
#endif |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
#if defined(_WIN32) && !defined(X264_API_IMPORTS) && !defined(GST_STATIC_COMPILATION) |
| 39 |
# define X264_API_IMPORTS |
| 40 |
#endif |
| 41 |
#include <x264.h> |
| 42 |
|
| 43 |
G_BEGIN_DECLS |
| 44 |
|
| 45 |
#define GST_TYPE_X264_ENC \ |
| 46 |
(gst_x264_enc_get_type()) |
| 47 |
#define GST_X264_ENC(obj) \ |
| 48 |
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_X264_ENC,GstX264Enc)) |
| 49 |
#define GST_X264_ENC_CLASS(klass) \ |
| 50 |
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_X264_ENC,GstX264EncClass)) |
| 51 |
#define GST_IS_X264_ENC(obj) \ |
| 52 |
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_X264_ENC)) |
| 53 |
#define GST_IS_X264_ENC_CLASS(klass) \ |
| 54 |
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_X264_ENC)) |
| 55 |
|
| 56 |
typedef struct _GstX264Enc GstX264Enc; |
| 57 |
typedef struct _GstX264EncClass GstX264EncClass; |
| 58 |
typedef struct _GstX264EncVTable GstX264EncVTable; |
| 59 |
|
| 60 |
struct _GstX264Enc |
| 61 |
{ |
| 62 |
GstVideoEncoder element; |
| 63 |
|
| 64 |
|
| 65 |
GstX264EncVTable *vtable; |
| 66 |
x264_t *x264enc; |
| 67 |
x264_param_t x264param; |
| 68 |
gint current_byte_stream; |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
GList *pending_frames; |
| 73 |
|
| 74 |
|
| 75 |
guint threads; |
| 76 |
gboolean sliced_threads; |
| 77 |
gint sync_lookahead; |
| 78 |
gint pass; |
| 79 |
guint quantizer; |
| 80 |
gchar *mp_cache_file; |
| 81 |
gboolean byte_stream; |
| 82 |
guint bitrate; |
| 83 |
gboolean intra_refresh; |
| 84 |
gint me; |
| 85 |
guint subme; |
| 86 |
guint analyse; |
| 87 |
gboolean dct8x8; |
| 88 |
guint ref; |
| 89 |
guint bframes; |
| 90 |
gboolean b_adapt; |
| 91 |
gboolean b_pyramid; |
| 92 |
gboolean weightb; |
| 93 |
guint sps_id; |
| 94 |
gboolean au_nalu; |
| 95 |
gboolean trellis; |
| 96 |
guint vbv_buf_capacity; |
| 97 |
guint keyint_max; |
| 98 |
gboolean cabac; |
| 99 |
gfloat ip_factor; |
| 100 |
gfloat pb_factor; |
| 101 |
guint qp_min; |
| 102 |
guint qp_max; |
| 103 |
guint qp_step; |
| 104 |
gboolean mb_tree; |
| 105 |
gint rc_lookahead; |
| 106 |
guint noise_reduction; |
| 107 |
gboolean interlaced; |
| 108 |
gint speed_preset; |
| 109 |
gint psy_tune; |
| 110 |
guint tune; |
| 111 |
GString *tunings; |
| 112 |
GString *option_string_prop; |
| 113 |
GString *option_string; |
| 114 |
gint frame_packing; |
| 115 |
gboolean insert_vui; |
| 116 |
gint nal_hrd; |
| 117 |
|
| 118 |
|
| 119 |
GstVideoCodecState *input_state; |
| 120 |
|
| 121 |
|
| 122 |
gboolean reconfig; |
| 123 |
|
| 124 |
|
| 125 |
const gchar *peer_profile; |
| 126 |
gboolean peer_intra_profile; |
| 127 |
gint peer_level_idc; |
| 128 |
|
| 129 |
|
| 130 |
gint x264_nplanes; |
| 131 |
|
| 132 |
GstEncoderBitrateProfileManager *bitrate_manager; |
| 133 |
}; |
| 134 |
|
| 135 |
struct _GstX264EncClass |
| 136 |
{ |
| 137 |
GstVideoEncoderClass parent_class; |
| 138 |
}; |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
typedef enum |
| 152 |
{ |
| 153 |
GST_X264_ENC_NAL_HRD_NONE = 0, |
| 154 |
GST_X264_ENC_NAL_HRD_VBR = 1, |
| 155 |
GST_X264_ENC_NAL_HRD_CBR = 2, |
| 156 |
} GstX264EncNalHrd; |
| 157 |
|
| 158 |
GType gst_x264_enc_get_type (void); |
| 159 |
GST_ELEMENT_REGISTER_DECLARE (x264enc); |
| 160 |
|
| 161 |
G_END_DECLS |
| 162 |
|
| 163 |
#endif |