gst_vaapi_encoder_create_coded_buffer (GstVaapiEncoder * encoder)
{
GstVaapiCodedBufferPool *const pool =
- GST_VAAPI_CODED_BUFFER_POOL (encoder->codedbuf_pool);
+ GST_VAAPI_CODED_BUFFER_POOL (encoder->codedbuf_pool);
GstVaapiCodedBufferProxy *codedbuf_proxy;
g_mutex_lock (&encoder->mutex);
return NULL;
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;
}
* GstVaapiEncoderStatus:
* @GST_VAAPI_ENCODER_STATUS_SUCCESS: Success.
* @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_ALLOCATION_FAILED: No memory left.
* @GST_VAAPI_ENCODER_STATUS_ERROR_INVALID_PARAMETER: Invalid parameter.
gst_vaapi_encoder_get_codec_data (GstVaapiEncoder * encoder,
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);
GstVaapiEncoderStatus
_set_idr_frame (picture, encoder);
} else
_set_i_frame (picture, encoder);
-
}
gboolean
GstVaapiCodedBufferProxy * codedbuf_proxy, GstVaapiSurfaceProxy * surface)
{
GstVaapiCodedBuffer *const codedbuf =
- GST_VAAPI_CODED_BUFFER_PROXY_BUFFER (codedbuf_proxy);
+ GST_VAAPI_CODED_BUFFER_PROXY_BUFFER (codedbuf_proxy);
if (!fill_va_picture_param (encoder, picture, codedbuf, surface))
return FALSE;
const guint DEFAULT_SURFACES_COUNT = 3;
/* Maximum sizes for common headers (in bits) */
- enum {
+ enum
+ {
MAX_SPS_HDR_SIZE = 16473,
MAX_VUI_PARAMS_SIZE = 210,
MAX_HRD_PARAMS_SIZE = 4103,
}
static inline const GstVaapiEncoderClass *
-gst_vaapi_encoder_h264_class ()
+gst_vaapi_encoder_h264_class (void)
{
static const GstVaapiEncoderClass GstVaapiEncoderH264Class = {
GST_VAAPI_ENCODER_CLASS_INIT (H264, h264),
gst_vaapi_encoder_h264_is_avc (GstVaapiEncoderH264 * encoder);
G_END_DECLS
+
#endif /*GST_VAAPI_ENCODER_H264_H */
GstBuffer *sps_data;
GstBuffer *pps_data;
-
};
G_END_DECLS
static void clear_references (GstVaapiEncoderMpeg2 * encoder);
static void push_reference (GstVaapiEncoderMpeg2 * encoder,
- GstVaapiSurfaceProxy * ref;);
+ GstVaapiSurfaceProxy * ref);
static struct
{
int line_per_frame;
int frame_per_sec;
} mpeg2_upper_samplings[2][3] = {
+ /* *INDENT-OFF* */
{ { 0, 0, 0},
{ 720, 576, 30 },
{ 0, 0, 0 },
{ 720, 576, 30 },
{ 1920, 1152, 60 },
}
+ /* *INDENT-ON* */
};
static gboolean
{
guint p, l;
float fps;
+
p = encoder->profile;
l = encoder->level;
fps = GST_VAAPI_ENCODER_FPS_N (encoder) / GST_VAAPI_ENCODER_FPS_D (encoder);
make_profile_and_level_indication (guint32 profile, guint32 level)
{
guint32 p = 4, l = 8;
+
switch (profile) {
case GST_ENCODER_MPEG2_PROFILE_SIMPLE:
p = 5;
pic->f_code[1][1] = 0xf;
pic->forward_reference_picture = VA_INVALID_SURFACE;
pic->backward_reference_picture = VA_INVALID_SURFACE;
-
} else if (pic->picture_type == VAEncPictureTypePredictive) {
pic->f_code[0][0] = f_code_x;
pic->f_code[0][1] = f_code_y;
GstVaapiCodedBufferProxy * codedbuf_proxy, GstVaapiSurfaceProxy * surface)
{
GstVaapiCodedBuffer *const codedbuf =
- GST_VAAPI_CODED_BUFFER_PROXY_BUFFER (codedbuf_proxy);
+ GST_VAAPI_CODED_BUFFER_PROXY_BUFFER (codedbuf_proxy);
if (!fill_picture (encoder, picture, codedbuf, surface))
return FALSE;
picture->type = GST_VAAPI_PICTURE_TYPE_B;
status = GST_VAAPI_ENCODER_STATUS_NO_SURFACE;
}
-
}
picture->frame_num = encoder->frame_num++;
to_vaapi_profile (guint32 profile)
{
GstVaapiProfile p;
+
switch (profile) {
case GST_ENCODER_MPEG2_PROFILE_SIMPLE:
p = GST_VAAPI_PROFILE_MPEG2_SIMPLE;
GstVaapiContextInfo *const cip = &base_encoder->context_info;
/* Maximum sizes for common headers (in bytes) */
- enum {
+ enum
+ {
MAX_SEQ_HDR_SIZE = 140,
MAX_SEQ_EXT_SIZE = 10,
MAX_GOP_SIZE = 8,
error:
gst_caps_unref (result);
return NULL;
-
}
static gboolean
}
static inline const GstVaapiEncoderClass *
-gst_vaapi_encoder_mpeg2_class ()
+gst_vaapi_encoder_mpeg2_class (void)
{
static const GstVaapiEncoderClass GstVaapiEncoderMpeg2Class = {
GST_VAAPI_ENCODER_CLASS_INIT (Mpeg2, mpeg2),
int code;
float value;
} frame_rate_tab[] = {
+ /* *INDENT-OFF* */
{ 1, 23.976 },
{ 2, 24.0 },
{ 3, 25.0 },
{ 6, 50 },
{ 7, 59.94 },
{ 8, 60 }
+ /* *INDENT-ON* */
};
static int
gst_bit_writer_write_pps (GstBitWriter * bitwriter,
VAEncPictureParameterBufferMPEG2 * pic)
{
-
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,
gst_vaapi_enc_picture_create (GstVaapiEncPicture * picture,
const GstVaapiCodecObjectConstructorArgs * args)
{
- GstVideoCodecFrame *const frame = (GstVideoCodecFrame *)args->data;
+ GstVideoCodecFrame *const frame = (GstVideoCodecFrame *) args->data;
gboolean success;
g_return_val_if_fail (frame != NULL, FALSE);
struct _GstVaapiEncoder
{
- /*< private > */
+ /*< private >*/
GstVaapiMiniObject parent_instance;
GstVaapiDisplay *display;
struct _GstVaapiEncoderClass
{
+ /*< private >*/
GstVaapiMiniObjectClass parent_class;
gboolean (*init) (GstVaapiEncoder * encoder);
GstPadQueryFunction srcpad_query;
GstVaapiEncoder *encoder;
-
GstVaapiRateControl rate_control;
guint32 bitrate; /* kbps */