encoder: fix indentation.

This commit is contained in:
Gwenole Beauchesne 2014-01-03 16:57:09 +01:00
parent 9548e32cf4
commit 01af353116
9 changed files with 26 additions and 20 deletions

View file

@ -104,7 +104,7 @@ gst_vaapi_encoder_create_coded_buffer (GstVaapiEncoder * encoder)
return NULL; return NULL;
gst_vaapi_coded_buffer_proxy_set_destroy_notify (codedbuf_proxy, gst_vaapi_coded_buffer_proxy_set_destroy_notify (codedbuf_proxy,
(GDestroyNotify)_coded_buffer_proxy_released_notify, encoder); (GDestroyNotify) _coded_buffer_proxy_released_notify, encoder);
return codedbuf_proxy; return codedbuf_proxy;
} }

View file

@ -36,7 +36,8 @@ typedef struct _GstVaapiEncoder GstVaapiEncoder;
* GstVaapiEncoderStatus: * GstVaapiEncoderStatus:
* @GST_VAAPI_ENCODER_STATUS_SUCCESS: Success. * @GST_VAAPI_ENCODER_STATUS_SUCCESS: Success.
* @GST_VAAPI_ENCODER_STATUS_ERROR_NO_SURFACE: No surface left to encode. * @GST_VAAPI_ENCODER_STATUS_ERROR_NO_SURFACE: No surface left to encode.
* @GST_VAAPI_ENCODER_STATUS_ERROR_NO_BUFFER: No coded buffer left to hold the encoded picture. * @GST_VAAPI_ENCODER_STATUS_ERROR_NO_BUFFER: No coded buffer left to
* hold the encoded picture.
* @GST_VAAPI_ENCODER_STATUS_ERROR_UNKNOWN: Unknown error. * @GST_VAAPI_ENCODER_STATUS_ERROR_UNKNOWN: Unknown error.
* @GST_VAAPI_ENCODER_STATUS_ERROR_ALLOCATION_FAILED: No memory left. * @GST_VAAPI_ENCODER_STATUS_ERROR_ALLOCATION_FAILED: No memory left.
* @GST_VAAPI_ENCODER_STATUS_ERROR_INVALID_PARAMETER: Invalid parameter. * @GST_VAAPI_ENCODER_STATUS_ERROR_INVALID_PARAMETER: Invalid parameter.
@ -74,7 +75,8 @@ GstVaapiEncoderStatus
gst_vaapi_encoder_get_codec_data (GstVaapiEncoder * encoder, gst_vaapi_encoder_get_codec_data (GstVaapiEncoder * encoder,
GstBuffer ** out_codec_data_ptr); GstBuffer ** out_codec_data_ptr);
GstCaps *gst_vaapi_encoder_set_format (GstVaapiEncoder * encoder, GstCaps *
gst_vaapi_encoder_set_format (GstVaapiEncoder * encoder,
GstVideoCodecState * state, GstCaps * ref_caps); GstVideoCodecState * state, GstCaps * ref_caps);
GstVaapiEncoderStatus GstVaapiEncoderStatus

View file

@ -331,7 +331,6 @@ _set_key_frame (GstVaapiEncPicture * picture,
_set_idr_frame (picture, encoder); _set_idr_frame (picture, encoder);
} else } else
_set_i_frame (picture, encoder); _set_i_frame (picture, encoder);
} }
gboolean gboolean
@ -1593,7 +1592,8 @@ gst_vaapi_encoder_h264_set_context_info (GstVaapiEncoder * base_encoder)
const guint DEFAULT_SURFACES_COUNT = 3; const guint DEFAULT_SURFACES_COUNT = 3;
/* Maximum sizes for common headers (in bits) */ /* Maximum sizes for common headers (in bits) */
enum { enum
{
MAX_SPS_HDR_SIZE = 16473, MAX_SPS_HDR_SIZE = 16473,
MAX_VUI_PARAMS_SIZE = 210, MAX_VUI_PARAMS_SIZE = 210,
MAX_HRD_PARAMS_SIZE = 4103, MAX_HRD_PARAMS_SIZE = 4103,
@ -1757,7 +1757,7 @@ gst_vaapi_encoder_h264_finalize (GstVaapiEncoder * base)
} }
static inline const GstVaapiEncoderClass * static inline const GstVaapiEncoderClass *
gst_vaapi_encoder_h264_class () gst_vaapi_encoder_h264_class (void)
{ {
static const GstVaapiEncoderClass GstVaapiEncoderH264Class = { static const GstVaapiEncoderClass GstVaapiEncoderH264Class = {
GST_VAAPI_ENCODER_CLASS_INIT (H264, h264), GST_VAAPI_ENCODER_CLASS_INIT (H264, h264),

View file

@ -38,4 +38,5 @@ gboolean
gst_vaapi_encoder_h264_is_avc (GstVaapiEncoderH264 * encoder); gst_vaapi_encoder_h264_is_avc (GstVaapiEncoderH264 * encoder);
G_END_DECLS G_END_DECLS
#endif /*GST_VAAPI_ENCODER_H264_H */ #endif /*GST_VAAPI_ENCODER_H264_H */

View file

@ -104,7 +104,6 @@ struct _GstVaapiEncoderH264
GstBuffer *sps_data; GstBuffer *sps_data;
GstBuffer *pps_data; GstBuffer *pps_data;
}; };
G_END_DECLS G_END_DECLS

View file

@ -50,7 +50,7 @@ gst_bit_writer_write_pps (GstBitWriter * bitwriter,
static void clear_references (GstVaapiEncoderMpeg2 * encoder); static void clear_references (GstVaapiEncoderMpeg2 * encoder);
static void push_reference (GstVaapiEncoderMpeg2 * encoder, static void push_reference (GstVaapiEncoderMpeg2 * encoder,
GstVaapiSurfaceProxy * ref;); GstVaapiSurfaceProxy * ref);
static struct static struct
{ {
@ -58,6 +58,7 @@ static struct
int line_per_frame; int line_per_frame;
int frame_per_sec; int frame_per_sec;
} mpeg2_upper_samplings[2][3] = { } mpeg2_upper_samplings[2][3] = {
/* *INDENT-OFF* */
{ { 0, 0, 0}, { { 0, 0, 0},
{ 720, 576, 30 }, { 720, 576, 30 },
{ 0, 0, 0 }, { 0, 0, 0 },
@ -66,6 +67,7 @@ static struct
{ 720, 576, 30 }, { 720, 576, 30 },
{ 1920, 1152, 60 }, { 1920, 1152, 60 },
} }
/* *INDENT-ON* */
}; };
static gboolean static gboolean
@ -73,6 +75,7 @@ ensure_sampling_desity (GstVaapiEncoderMpeg2 * encoder)
{ {
guint p, l; guint p, l;
float fps; float fps;
p = encoder->profile; p = encoder->profile;
l = encoder->level; l = encoder->level;
fps = GST_VAAPI_ENCODER_FPS_N (encoder) / GST_VAAPI_ENCODER_FPS_D (encoder); fps = GST_VAAPI_ENCODER_FPS_N (encoder) / GST_VAAPI_ENCODER_FPS_D (encoder);
@ -132,6 +135,7 @@ static unsigned char
make_profile_and_level_indication (guint32 profile, guint32 level) make_profile_and_level_indication (guint32 profile, guint32 level)
{ {
guint32 p = 4, l = 8; guint32 p = 4, l = 8;
switch (profile) { switch (profile) {
case GST_ENCODER_MPEG2_PROFILE_SIMPLE: case GST_ENCODER_MPEG2_PROFILE_SIMPLE:
p = 5; p = 5;
@ -256,7 +260,6 @@ fill_picture (GstVaapiEncoderMpeg2 * encoder,
pic->f_code[1][1] = 0xf; pic->f_code[1][1] = 0xf;
pic->forward_reference_picture = VA_INVALID_SURFACE; pic->forward_reference_picture = VA_INVALID_SURFACE;
pic->backward_reference_picture = VA_INVALID_SURFACE; pic->backward_reference_picture = VA_INVALID_SURFACE;
} else if (pic->picture_type == VAEncPictureTypePredictive) { } else if (pic->picture_type == VAEncPictureTypePredictive) {
pic->f_code[0][0] = f_code_x; pic->f_code[0][0] = f_code_x;
pic->f_code[0][1] = f_code_y; pic->f_code[0][1] = f_code_y;
@ -596,7 +599,6 @@ gst_vaapi_encoder_mpeg2_reordering (GstVaapiEncoder * base,
picture->type = GST_VAAPI_PICTURE_TYPE_B; picture->type = GST_VAAPI_PICTURE_TYPE_B;
status = GST_VAAPI_ENCODER_STATUS_NO_SURFACE; status = GST_VAAPI_ENCODER_STATUS_NO_SURFACE;
} }
} }
picture->frame_num = encoder->frame_num++; picture->frame_num = encoder->frame_num++;
@ -614,6 +616,7 @@ static GstVaapiProfile
to_vaapi_profile (guint32 profile) to_vaapi_profile (guint32 profile)
{ {
GstVaapiProfile p; GstVaapiProfile p;
switch (profile) { switch (profile) {
case GST_ENCODER_MPEG2_PROFILE_SIMPLE: case GST_ENCODER_MPEG2_PROFILE_SIMPLE:
p = GST_VAAPI_PROFILE_MPEG2_SIMPLE; p = GST_VAAPI_PROFILE_MPEG2_SIMPLE;
@ -634,7 +637,8 @@ gst_vaapi_encoder_mpeg2_set_context_info (GstVaapiEncoder * base_encoder)
GstVaapiContextInfo *const cip = &base_encoder->context_info; GstVaapiContextInfo *const cip = &base_encoder->context_info;
/* Maximum sizes for common headers (in bytes) */ /* Maximum sizes for common headers (in bytes) */
enum { enum
{
MAX_SEQ_HDR_SIZE = 140, MAX_SEQ_HDR_SIZE = 140,
MAX_SEQ_EXT_SIZE = 10, MAX_SEQ_EXT_SIZE = 10,
MAX_GOP_SIZE = 8, MAX_GOP_SIZE = 8,
@ -709,7 +713,6 @@ gst_vaapi_encoder_mpeg2_set_format (GstVaapiEncoder * base,
error: error:
gst_caps_unref (result); gst_caps_unref (result);
return NULL; return NULL;
} }
static gboolean static gboolean
@ -776,7 +779,7 @@ gst_vaapi_encoder_mpeg2_finalize (GstVaapiEncoder * base)
} }
static inline const GstVaapiEncoderClass * static inline const GstVaapiEncoderClass *
gst_vaapi_encoder_mpeg2_class () gst_vaapi_encoder_mpeg2_class (void)
{ {
static const GstVaapiEncoderClass GstVaapiEncoderMpeg2Class = { static const GstVaapiEncoderClass GstVaapiEncoderMpeg2Class = {
GST_VAAPI_ENCODER_CLASS_INIT (Mpeg2, mpeg2), GST_VAAPI_ENCODER_CLASS_INIT (Mpeg2, mpeg2),
@ -795,6 +798,7 @@ static struct
int code; int code;
float value; float value;
} frame_rate_tab[] = { } frame_rate_tab[] = {
/* *INDENT-OFF* */
{ 1, 23.976 }, { 1, 23.976 },
{ 2, 24.0 }, { 2, 24.0 },
{ 3, 25.0 }, { 3, 25.0 },
@ -803,6 +807,7 @@ static struct
{ 6, 50 }, { 6, 50 },
{ 7, 59.94 }, { 7, 59.94 },
{ 8, 60 } { 8, 60 }
/* *INDENT-ON* */
}; };
static int static int
@ -886,7 +891,6 @@ static gboolean
gst_bit_writer_write_pps (GstBitWriter * bitwriter, gst_bit_writer_write_pps (GstBitWriter * bitwriter,
VAEncPictureParameterBufferMPEG2 * pic) VAEncPictureParameterBufferMPEG2 * pic)
{ {
gst_bit_writer_put_bits_uint32 (bitwriter, START_CODE_PICUTRE, 32); gst_bit_writer_put_bits_uint32 (bitwriter, START_CODE_PICUTRE, 32);
gst_bit_writer_put_bits_uint32 (bitwriter, pic->temporal_reference, 10); gst_bit_writer_put_bits_uint32 (bitwriter, pic->temporal_reference, 10);
gst_bit_writer_put_bits_uint32 (bitwriter, gst_bit_writer_put_bits_uint32 (bitwriter,

View file

@ -304,7 +304,7 @@ gboolean
gst_vaapi_enc_picture_create (GstVaapiEncPicture * picture, gst_vaapi_enc_picture_create (GstVaapiEncPicture * picture,
const GstVaapiCodecObjectConstructorArgs * args) const GstVaapiCodecObjectConstructorArgs * args)
{ {
GstVideoCodecFrame *const frame = (GstVideoCodecFrame *)args->data; GstVideoCodecFrame *const frame = (GstVideoCodecFrame *) args->data;
gboolean success; gboolean success;
g_return_val_if_fail (frame != NULL, FALSE); g_return_val_if_fail (frame != NULL, FALSE);

View file

@ -75,7 +75,7 @@ typedef struct _GstVaapiEncoderClass GstVaapiEncoderClass;
struct _GstVaapiEncoder struct _GstVaapiEncoder
{ {
/*< private > */ /*< private >*/
GstVaapiMiniObject parent_instance; GstVaapiMiniObject parent_instance;
GstVaapiDisplay *display; GstVaapiDisplay *display;
@ -98,6 +98,7 @@ struct _GstVaapiEncoder
struct _GstVaapiEncoderClass struct _GstVaapiEncoderClass
{ {
/*< private >*/
GstVaapiMiniObjectClass parent_class; GstVaapiMiniObjectClass parent_class;
gboolean (*init) (GstVaapiEncoder * encoder); gboolean (*init) (GstVaapiEncoder * encoder);

View file

@ -59,7 +59,6 @@ struct _GstVaapiEncode
GstPadQueryFunction srcpad_query; GstPadQueryFunction srcpad_query;
GstVaapiEncoder *encoder; GstVaapiEncoder *encoder;
GstVaapiRateControl rate_control; GstVaapiRateControl rate_control;
guint32 bitrate; /* kbps */ guint32 bitrate; /* kbps */