libs: small code style fixes

This a set of small code style fixes detected as-is by gst-indent.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-02-02 17:59:57 +01:00
parent 02c0e6c183
commit 28d01c0857
22 changed files with 118 additions and 105 deletions

View file

@ -76,8 +76,7 @@ gst_vaapi_codec_object_new (const GstVaapiCodecObjectClass * object_class,
GstVaapiCodecObject *obj;
GstVaapiCodecObjectConstructorArgs args;
obj =
(GstVaapiCodecObject *)
obj = (GstVaapiCodecObject *)
gst_vaapi_mini_object_new0 (GST_VAAPI_MINI_OBJECT_CLASS (object_class));
if (!obj)
return NULL;

View file

@ -69,9 +69,9 @@ static inline const GstVaapiMiniObjectClass *
gst_vaapi_coded_buffer_pool_class (void)
{
static const GstVaapiVideoPoolClass GstVaapiCodedBufferPoolClass = {
{ sizeof (GstVaapiCodedBufferPool),
(GDestroyNotify)coded_buffer_pool_finalize },
{sizeof (GstVaapiCodedBufferPool),
(GDestroyNotify) coded_buffer_pool_finalize}
,
.alloc_object = coded_buffer_pool_alloc_object
};
return GST_VAAPI_MINI_OBJECT_CLASS (&GstVaapiCodedBufferPoolClass);

View file

@ -61,7 +61,7 @@ gst_vaapi_coded_buffer_proxy_class (void)
{
static const GstVaapiMiniObjectClass GstVaapiCodedBufferProxyClass = {
sizeof (GstVaapiCodedBufferProxy),
(GDestroyNotify)coded_buffer_proxy_finalize
(GDestroyNotify) coded_buffer_proxy_finalize
};
return &GstVaapiCodedBufferProxyClass;
}

View file

@ -38,8 +38,7 @@
#define DEBUG 1
#include "gstvaapidebug.h"
static void
drop_frame (GstVaapiDecoder * decoder, GstVideoCodecFrame * frame);
static void drop_frame (GstVaapiDecoder * decoder, GstVideoCodecFrame * frame);
static void
parser_state_finalize (GstVaapiParserState * ps)
@ -933,7 +932,8 @@ gst_vaapi_decoder_set_multiview_mode (GstVaapiDecoder * decoder,
if (GST_VIDEO_INFO_VIEWS (info) != views ||
GST_VIDEO_INFO_MULTIVIEW_MODE (info) != mv_mode ||
GST_VIDEO_INFO_MULTIVIEW_FLAGS (info) != mv_flags) {
const gchar *mv_mode_str = gst_video_multiview_mode_to_caps_string (mv_mode);
const gchar *mv_mode_str =
gst_video_multiview_mode_to_caps_string (mv_mode);
GST_DEBUG ("Multiview mode changed to %s flags 0x%x views %d",
mv_mode_str, mv_flags, views);

View file

@ -1102,7 +1102,9 @@ ensure_context (GstVaapiDecoderH265 * decoder, GstH265SPS * sps)
priv->profile = profile;
}
chroma_type = gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc, sps->bit_depth_luma_minus8 + 8);
chroma_type =
gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc,
sps->bit_depth_luma_minus8 + 8);
if (!chroma_type) {
GST_ERROR ("unsupported chroma_format_idc %u", sps->chroma_format_idc);
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;
@ -1885,8 +1887,8 @@ fill_picture (GstVaapiDecoderH265 * decoder, GstVaapiPictureH265 * picture)
COPY_BFM (slice_parsing_fields, pps, cabac_init_present_flag);
COPY_BFM (slice_parsing_fields, pps, output_flag_present_flag);
COPY_BFM (slice_parsing_fields, pps, dependent_slice_segments_enabled_flag);
pic_param->slice_parsing_fields.
bits.pps_slice_chroma_qp_offsets_present_flag =
pic_param->slice_parsing_fields.bits.
pps_slice_chroma_qp_offsets_present_flag =
pps->slice_chroma_qp_offsets_present_flag;
COPY_BFM (slice_parsing_fields, sps, sample_adaptive_offset_enabled_flag);
COPY_BFM (slice_parsing_fields, pps, deblocking_filter_override_enabled_flag);
@ -2472,8 +2474,8 @@ fill_slice (GstVaapiDecoderH265 * decoder,
slice_hdr->temporal_mvp_enabled_flag;
slice_param->LongSliceFlags.fields.slice_deblocking_filter_disabled_flag =
slice_hdr->deblocking_filter_disabled_flag;
slice_param->LongSliceFlags.
fields.slice_loop_filter_across_slices_enabled_flag =
slice_param->LongSliceFlags.fields.
slice_loop_filter_across_slices_enabled_flag =
slice_hdr->loop_filter_across_slices_enabled_flag;
if (!slice_hdr->temporal_mvp_enabled_flag)

View file

@ -211,8 +211,7 @@ gst_vaapi_picture_new_clone (GstVaapiPicture * picture)
object = gst_vaapi_codec_object_new (gst_vaapi_codec_object_get_class
(&picture->parent_instance), GST_VAAPI_CODEC_BASE (decoder), NULL,
picture->param_size, picture, 0,
GST_VAAPI_CREATE_PICTURE_FLAG_CLONE);
picture->param_size, picture, 0, GST_VAAPI_CREATE_PICTURE_FLAG_CLONE);
if (!object)
return NULL;
return GST_VAAPI_PICTURE_CAST (object);

View file

@ -262,7 +262,7 @@ init_picture (GstVaapiDecoderVp8 * decoder, GstVaapiPicture * picture)
picture->structure = GST_VAAPI_PICTURE_STRUCTURE_FRAME;
picture->type = frame_hdr->key_frame ? GST_VAAPI_PICTURE_TYPE_I :
GST_VAAPI_PICTURE_TYPE_P;
picture->pts = GST_VAAPI_DECODER_CODEC_FRAME(decoder)->pts;
picture->pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts;
if (!frame_hdr->show_frame)
GST_VAAPI_PICTURE_FLAG_SET (picture, GST_VAAPI_PICTURE_FLAG_SKIPPED);

View file

@ -1627,8 +1627,8 @@ gst_vaapi_display_get_subpicture_formats (GstVaapiDisplay * display)
if (!ensure_subpicture_formats (display))
return NULL;
return get_formats (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->
subpicture_formats);
return
get_formats (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->subpicture_formats);
}
/**
@ -2146,5 +2146,5 @@ gst_vaapi_display_has_opengl (GstVaapiDisplay * display)
klass = GST_VAAPI_DISPLAY_GET_CLASS (display);
return (klass->display_type == GST_VAAPI_DISPLAY_TYPE_GLX ||
klass->display_type == GST_VAAPI_DISPLAY_TYPE_EGL);
klass->display_type == GST_VAAPI_DISPLAY_TYPE_EGL);
}

View file

@ -551,8 +551,9 @@ get_packed_headers (GstVaapiEncoder * encoder)
if (cdata->codec == GST_VAAPI_CODEC_JPEG) {
#if !VA_CHECK_VERSION(0,37,1)
encoder->packed_headers = VA_ENC_PACKED_HEADER_RAW_DATA;
GST_DEBUG ("Hard coding the packed header flag value to VA_ENC_PACKED_HEADER_RAW_DATA,"
"This is a work around for the driver bug");
GST_DEBUG ("Hard coding the packed header flag value to "
"VA_ENC_PACKED_HEADER_RAW_DATA. This is a work around for the driver "
"bug");
#endif
}
@ -564,7 +565,7 @@ is_chroma_type_supported (GstVaapiEncoder * encoder)
{
GstVaapiContextInfo *const cip = &encoder->context_info;
const GstVideoFormat fmt =
GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
guint format = 0;
if (fmt == GST_VIDEO_FORMAT_ENCODED)
@ -597,7 +598,7 @@ set_context_info (GstVaapiEncoder * encoder)
GstVaapiContextInfo *const cip = &encoder->context_info;
GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;
const GstVideoFormat format =
GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
const GstVaapiEncoderClassData *const cdata =
GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data;

View file

@ -124,7 +124,7 @@ typedef struct _GstVaapiH264ViewReorderPool
GQueue reorder_frame_list;
guint reorder_state;
guint frame_index;
guint frame_count; /* monotonically increasing with in every idr period */
guint frame_count; /* monotonically increasing with in every idr period */
guint cur_frame_num;
guint cur_present_index;
} GstVaapiH264ViewReorderPool;
@ -567,7 +567,8 @@ bs_write_sps (GstBitWriter * bs,
static gboolean
bs_write_subset_sps (GstBitWriter * bs,
const VAEncSequenceParameterBufferH264 * seq_param, GstVaapiProfile profile,
guint num_views, guint16 *view_ids, const VAEncMiscParameterHRD * hrd_params)
guint num_views, guint16 * view_ids,
const VAEncMiscParameterHRD * hrd_params)
{
guint32 i, j, k;
@ -779,7 +780,7 @@ struct _GstVaapiEncoderH264
/* MVC */
gboolean is_mvc;
guint32 view_idx; /* View Order Index (VOIdx) */
guint32 view_idx; /* View Order Index (VOIdx) */
guint32 num_views;
guint16 view_ids[MAX_NUM_VIEWS];
GstVaapiH264ViewRefPool ref_pools[MAX_NUM_VIEWS];
@ -805,11 +806,12 @@ bs_write_sei_buf_period (GstBitWriter * bs,
initial_cpb_removal_delay = encoder->cpb_length * 45;
/* initial_cpb_remvoal_dealy */
WRITE_UINT32 (bs, initial_cpb_removal_delay, initial_cpb_removal_delay_length);
WRITE_UINT32 (bs, initial_cpb_removal_delay,
initial_cpb_removal_delay_length);
/* initial_cpb_removal_delay_offset */
WRITE_UINT32 (bs, initial_cpb_removal_delay_offset,
initial_cpb_removal_delay_length);
initial_cpb_removal_delay_length);
/* VclHrdBpPresentFlag == FALSE */
return TRUE;
@ -1421,8 +1423,8 @@ add_packed_sequence_header_mvc (GstVaapiEncoderH264 * encoder,
WRITE_UINT32 (&bs, 0x00000001, 32); /* start code */
bs_write_nal_header (&bs, GST_H264_NAL_REF_IDC_HIGH, GST_H264_NAL_SUBSET_SPS);
bs_write_subset_sps (&bs, seq_param, encoder->profile, encoder->num_views, encoder->view_ids,
&hrd_params);
bs_write_subset_sps (&bs, seq_param, encoder->profile, encoder->num_views,
encoder->view_ids, &hrd_params);
g_assert (GST_BIT_WRITER_BIT_SIZE (&bs) % 8 == 0);
data_bit_size = GST_BIT_WRITER_BIT_SIZE (&bs);
@ -1503,8 +1505,7 @@ bs_error:
static gboolean
add_packed_sei_header (GstVaapiEncoderH264 * encoder,
GstVaapiEncPicture * picture,
GstVaapiH264SeiPayloadType payloadtype)
GstVaapiEncPicture * picture, GstVaapiH264SeiPayloadType payloadtype)
{
GstVaapiEncPackedHeader *packed_sei;
GstBitWriter bs, bs_buf_period, bs_pic_timing;
@ -1526,9 +1527,8 @@ add_packed_sei_header (GstVaapiEncoderH264 * encoder,
bs_write_sei_buf_period (&bs_buf_period, encoder, picture);
/* Write byte alignment bits */
if (GST_BIT_WRITER_BIT_SIZE (&bs_buf_period) % 8 != 0)
bs_write_trailing_bits(&bs_buf_period);
buf_period_payload_size =
(GST_BIT_WRITER_BIT_SIZE (&bs_buf_period)) / 8;
bs_write_trailing_bits (&bs_buf_period);
buf_period_payload_size = (GST_BIT_WRITER_BIT_SIZE (&bs_buf_period)) / 8;
buf_period_payload = GST_BIT_WRITER_DATA (&bs_buf_period);
}
@ -1538,9 +1538,8 @@ add_packed_sei_header (GstVaapiEncoderH264 * encoder,
bs_write_sei_pic_timing (&bs_pic_timing, encoder, picture);
/* Write byte alignment bits */
if (GST_BIT_WRITER_BIT_SIZE (&bs_pic_timing) % 8 != 0)
bs_write_trailing_bits(&bs_pic_timing);
pic_timing_payload_size =
(GST_BIT_WRITER_BIT_SIZE (&bs_pic_timing)) / 8;
bs_write_trailing_bits (&bs_pic_timing);
pic_timing_payload_size = (GST_BIT_WRITER_BIT_SIZE (&bs_pic_timing)) / 8;
pic_timing_payload = GST_BIT_WRITER_DATA (&bs_pic_timing);
}
@ -1697,7 +1696,8 @@ add_packed_slice_header (GstVaapiEncoderH264 * encoder,
/* pack nal_unit_header_mvc_extension() for the non base view */
if (encoder->is_mvc && encoder->view_idx) {
bs_write_nal_header (&bs, nal_ref_idc, GST_H264_NAL_SLICE_EXT);
bs_write_nal_header_mvc_extension (&bs, picture, encoder->view_ids[encoder->view_idx]);
bs_write_nal_header_mvc_extension (&bs, picture,
encoder->view_ids[encoder->view_idx]);
} else
bs_write_nal_header (&bs, nal_ref_idc, nal_unit_type);
@ -2165,11 +2165,13 @@ ensure_sequence (GstVaapiEncoderH264 * encoder, GstVaapiEncPicture * picture)
/* add subset sps for non-base view and sps for base view */
if (encoder->is_mvc && encoder->view_idx) {
if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_SEQUENCE)
if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_SEQUENCE)
&& !add_packed_sequence_header_mvc (encoder, picture, sequence))
goto error_create_packed_seq_hdr;
} else {
if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_SEQUENCE)
if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_SEQUENCE)
&& !add_packed_sequence_header (encoder, picture, sequence))
goto error_create_packed_seq_hdr;
}
@ -2236,15 +2238,15 @@ ensure_misc_params (GstVaapiEncoderH264 * encoder, GstVaapiEncPicture * picture)
if ((GST_VAAPI_ENC_PICTURE_IS_IDR (picture)) &&
(GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_MISC) &&
!add_packed_sei_header (encoder, picture,
!add_packed_sei_header (encoder, picture,
GST_VAAPI_H264_SEI_BUF_PERIOD | GST_VAAPI_H264_SEI_PIC_TIMING))
goto error_create_packed_sei_hdr;
else if (!GST_VAAPI_ENC_PICTURE_IS_IDR (picture) &&
(GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_MISC) &&
!add_packed_sei_header (encoder, picture,
GST_VAAPI_H264_SEI_PIC_TIMING))
(GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_MISC) &&
!add_packed_sei_header (encoder, picture,
GST_VAAPI_H264_SEI_PIC_TIMING))
goto error_create_packed_sei_hdr;
}
@ -2273,7 +2275,8 @@ ensure_picture (GstVaapiEncoderH264 * encoder, GstVaapiEncPicture * picture,
return FALSE;
if (picture->type == GST_VAAPI_PICTURE_TYPE_I &&
(GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_PICTURE)
(GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_PICTURE)
&& !add_packed_picture_header (encoder, picture)) {
GST_ERROR ("set picture packed header failed");
return FALSE;
@ -2797,8 +2800,10 @@ gst_vaapi_encoder_h264_reconfigure (GstVaapiEncoder * base_encoder)
}
/* Take number of MVC views from input caps if provided */
if (GST_VIDEO_INFO_MULTIVIEW_MODE (vip) == GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME ||
GST_VIDEO_INFO_MULTIVIEW_MODE (vip) == GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME)
if (GST_VIDEO_INFO_MULTIVIEW_MODE (vip) ==
GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME
|| GST_VIDEO_INFO_MULTIVIEW_MODE (vip) ==
GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME)
encoder->num_views = GST_VIDEO_INFO_VIEWS (vip);
encoder->is_mvc = encoder->num_views > 1;
@ -2916,23 +2921,21 @@ gst_vaapi_encoder_h264_set_property (GstVaapiEncoder * base_encoder,
case GST_VAAPI_ENCODER_H264_PROP_NUM_VIEWS:
encoder->num_views = g_value_get_uint (value);
break;
case GST_VAAPI_ENCODER_H264_PROP_VIEW_IDS:
{
guint i;
GValueArray *view_ids = g_value_get_boxed (value);
case GST_VAAPI_ENCODER_H264_PROP_VIEW_IDS:{
guint i;
GValueArray *view_ids = g_value_get_boxed (value);
if (view_ids == NULL) {
for (i = 0; i < encoder->num_views; i++)
encoder->view_ids[i] = i;
}
else {
g_assert (view_ids->n_values <= encoder->num_views);
if (view_ids == NULL) {
for (i = 0; i < encoder->num_views; i++)
encoder->view_ids[i] = i;
} else {
g_assert (view_ids->n_values <= encoder->num_views);
for (i = 0; i < encoder->num_views; i++) {
GValue *val = g_value_array_get_nth (view_ids, i);
encoder->view_ids[i] = g_value_get_uint (val);
}
for (i = 0; i < encoder->num_views; i++) {
GValue *val = g_value_array_get_nth (view_ids, i);
encoder->view_ids[i] = g_value_get_uint (val);
}
}
break;
}
default:

View file

@ -805,9 +805,8 @@ bs_write_slice (GstBitWriter * bs,
(slice_param->slice_fields.bits.slice_sao_luma_flag
|| slice_param->slice_fields.bits.slice_sao_chroma_flag
|| !slice_deblocking_filter_disabled_flag))
WRITE_UINT32 (bs,
slice_param->slice_fields.
bits.slice_loop_filter_across_slices_enabled_flag, 1);
WRITE_UINT32 (bs, slice_param->slice_fields.bits.
slice_loop_filter_across_slices_enabled_flag, 1);
}
@ -1677,8 +1676,8 @@ add_slice_headers (GstVaapiEncoderH265 * encoder, GstVaapiEncPicture * picture,
slice_param->slice_fields.value = 0;
slice_param->slice_fields.
bits.slice_loop_filter_across_slices_enabled_flag = TRUE;
slice_param->slice_fields.bits.
slice_loop_filter_across_slices_enabled_flag = TRUE;
/* set calculation for next slice */
last_ctu_index += cur_slice_ctus;
@ -1725,7 +1724,8 @@ ensure_sequence (GstVaapiEncoderH265 * encoder, GstVaapiEncPicture * picture)
goto error_create_seq_param;
/* add packed vps and sps headers */
if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_SEQUENCE)
if ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_SEQUENCE)
&& !(add_packed_vps_header (encoder, picture, sequence)
&& add_packed_sequence_header (encoder, picture, sequence))) {
goto error_create_packed_seq_hdr;
@ -1769,7 +1769,8 @@ ensure_picture (GstVaapiEncoderH265 * encoder, GstVaapiEncPicture * picture,
return FALSE;
if (picture->type == GST_VAAPI_PICTURE_TYPE_I &&
(GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) & VA_ENC_PACKED_HEADER_PICTURE)
(GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
VA_ENC_PACKED_HEADER_PICTURE)
&& !add_packed_picture_header (encoder, picture)) {
GST_ERROR ("set picture packed header failed");
return FALSE;
@ -2276,7 +2277,7 @@ set_context_info (GstVaapiEncoder * base_encoder)
/* Only YUV 4:2:0 formats are supported for now. */
base_encoder->codedbuf_size += GST_ROUND_UP_32 (vip->width) *
GST_ROUND_UP_32 (vip->height) * 3 / 2;
GST_ROUND_UP_32 (vip->height) * 3 / 2;
return GST_VAAPI_ENCODER_STATUS_SUCCESS;
}

View file

@ -290,7 +290,8 @@ gst_vaapi_enc_q_matrix_new (GstVaapiEncoder * encoder,
/* ------------------------------------------------------------------------- */
#if USE_JPEG_ENCODER
GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiEncHuffmanTable, gst_vaapi_enc_huffman_table);
GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiEncHuffmanTable,
gst_vaapi_enc_huffman_table);
void
gst_vaapi_enc_huffman_table_destroy (GstVaapiEncHuffmanTable * huf_table)

View file

@ -648,7 +648,7 @@ get_operations_ordered (GstVaapiFilter * filter, GPtrArray * default_ops)
if (op_data->va_type != va_type)
continue;
if (op_data->va_cap_size == 0) { /* no caps, like skintone */
if (op_data->va_cap_size == 0) { /* no caps, like skintone */
g_ptr_array_add (ops, op_data_ref (op_data));
continue;
}
@ -907,7 +907,7 @@ op_set_deinterlace (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data,
#if USE_VA_VPP
gboolean
op_set_skintone_unlocked (GstVaapiFilter * filter,
GstVaapiFilterOpData * op_data, gboolean value)
GstVaapiFilterOpData * op_data, gboolean value)
{
VAProcFilterParameterBuffer *buf;
@ -930,7 +930,7 @@ op_set_skintone_unlocked (GstVaapiFilter * filter,
static inline gboolean
op_set_skintone (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data,
gboolean enhance)
gboolean enhance)
{
gboolean success = FALSE;
@ -1870,8 +1870,7 @@ gst_vaapi_filter_set_scaling (GstVaapiFilter * filter,
* otherwise.
**/
gboolean
gst_vaapi_filter_set_skintone (GstVaapiFilter * filter,
gboolean enhance)
gst_vaapi_filter_set_skintone (GstVaapiFilter * filter, gboolean enhance)
{
g_return_val_if_fail (filter != NULL, FALSE);

View file

@ -74,7 +74,8 @@ gst_vaapi_image_pool_class (void)
{
static const GstVaapiVideoPoolClass GstVaapiImagePoolClass = {
{sizeof (GstVaapiImagePool),
(GDestroyNotify) gst_vaapi_video_pool_finalize},
(GDestroyNotify) gst_vaapi_video_pool_finalize}
,
.alloc_object = gst_vaapi_image_pool_alloc_object
};
return GST_VAAPI_MINI_OBJECT_CLASS (&GstVaapiImagePoolClass);

View file

@ -159,7 +159,7 @@ gst_vaapi_surface_create_full (GstVaapiSurface * surface,
extbuf.pixel_format = va_format->fourcc;
extbuf.width = GST_VIDEO_INFO_WIDTH (vip);
extbuf.height = GST_VIDEO_INFO_HEIGHT (vip);
extbuf_needed = !!(flags & GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE);
extbuf_needed = ! !(flags & GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE);
extbuf.num_planes = GST_VIDEO_INFO_N_PLANES (vip);
if (flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES) {

View file

@ -95,7 +95,8 @@ gst_vaapi_surface_pool_class (void)
{
static const GstVaapiVideoPoolClass GstVaapiSurfacePoolClass = {
{sizeof (GstVaapiSurfacePool),
(GDestroyNotify) gst_vaapi_video_pool_finalize},
(GDestroyNotify) gst_vaapi_video_pool_finalize}
,
.alloc_object = gst_vaapi_surface_pool_alloc_object
};
return GST_VAAPI_MINI_OBJECT_CLASS (&GstVaapiSurfacePoolClass);

View file

@ -840,8 +840,7 @@ egl_surface_new_wrapped (EglDisplay * display, EGLSurface gl_surface)
/* ------------------------------------------------------------------------- */
// EGL Context
static void
egl_context_state_get_current (EglContextState * cs);
static void egl_context_state_get_current (EglContextState * cs);
static gboolean
egl_context_state_set_current (EglContextState * new_cs,
@ -1329,10 +1328,22 @@ void
egl_matrix_set_identity (gfloat m[16])
{
#define MAT(m,r,c) (m)[(c) * 4 + (r)]
MAT(m,0,0) = 1.0; MAT(m,0,1) = 0.0; MAT(m,0,2) = 0.0; MAT(m,0,3) = 0.0;
MAT(m,1,0) = 0.0; MAT(m,1,1) = 1.0; MAT(m,1,2) = 0.0; MAT(m,1,3) = 0.0;
MAT(m,2,0) = 0.0; MAT(m,2,1) = 0.0; MAT(m,2,2) = 1.0; MAT(m,2,3) = 0.0;
MAT(m,3,0) = 0.0; MAT(m,3,1) = 0.0; MAT(m,3,2) = 0.0; MAT(m,3,3) = 1.0;
MAT (m, 0, 0) = 1.0;
MAT (m, 0, 1) = 0.0;
MAT (m, 0, 2) = 0.0;
MAT (m, 0, 3) = 0.0;
MAT (m, 1, 0) = 0.0;
MAT (m, 1, 1) = 1.0;
MAT (m, 1, 2) = 0.0;
MAT (m, 1, 3) = 0.0;
MAT (m, 2, 0) = 0.0;
MAT (m, 2, 1) = 0.0;
MAT (m, 2, 2) = 1.0;
MAT (m, 2, 3) = 0.0;
MAT (m, 3, 0) = 0.0;
MAT (m, 3, 1) = 0.0;
MAT (m, 3, 2) = 0.0;
MAT (m, 3, 3) = 1.0;
#undef MAT
}

View file

@ -35,7 +35,7 @@
/** Lookup for substring NAME in string EXT using SEP as separators */
static gboolean
find_string (const gchar *name, const gchar *ext, const gchar *sep)
find_string (const gchar * name, const gchar * ext, const gchar * sep)
{
const gchar *end;
int name_len, n;
@ -635,7 +635,7 @@ typedef void (*GLFuncPtr) (void);
typedef GLFuncPtr (*GLXGetProcAddressProc) (const gchar *);
static GLFuncPtr
get_proc_address_default (const gchar *name)
get_proc_address_default (const gchar * name)
{
return NULL;
}
@ -658,7 +658,7 @@ get_proc_address_func (void)
}
static inline GLFuncPtr
get_proc_address (const gchar *name)
get_proc_address (const gchar * name)
{
static GLXGetProcAddressProc get_proc_func = NULL;
if (!get_proc_func)

View file

@ -281,7 +281,8 @@ gst_vaapi_utils_h265_get_level_limits_table (guint * out_length_ptr)
/** Returns GstVaapiChromaType from H.265 chroma_format_idc value */
GstVaapiChromaType
gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, guint luma_bit_depth)
gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc,
guint luma_bit_depth)
{
GstVaapiChromaType chroma_type = (GstVaapiChromaType) 0;
@ -350,8 +351,7 @@ gst_vaapi_utils_h265_get_tier_from_string (const gchar * str)
const gchar *
gst_vaapi_utils_h265_get_tier_string (GstVaapiTierH265 tier)
{
const struct map *const m =
map_lookup_value (gst_vaapi_h265_tier_map, tier);
const struct map *const m = map_lookup_value (gst_vaapi_h265_tier_map, tier);
return m ? m->name : NULL;
}

View file

@ -53,15 +53,9 @@ x11_untrap_errors (void)
}
// X window management
static const int x11_event_mask =
(KeyPressMask |
KeyReleaseMask |
ButtonPressMask |
ButtonReleaseMask |
PointerMotionMask |
EnterWindowMask |
ExposureMask |
StructureNotifyMask);
static const int x11_event_mask = (KeyPressMask | KeyReleaseMask
| ButtonPressMask | ButtonReleaseMask | PointerMotionMask
| EnterWindowMask | ExposureMask | StructureNotifyMask);
/**
* x11_create_window:

View file

@ -126,7 +126,8 @@ gst_vaapi_window_new (GstVaapiDisplay * display, guint width, guint height)
dpy_class = GST_VAAPI_DISPLAY_GET_CLASS (display);
if (G_UNLIKELY (!dpy_class->create_window))
return NULL;
return dpy_class->create_window (display, GST_VAAPI_ID_INVALID, width, height);
return dpy_class->create_window (display, GST_VAAPI_ID_INVALID, width,
height);
}
/**

View file

@ -397,9 +397,9 @@ do_render_texture (GstVaapiWindowEGL * window, const GstVaapiRectangle * rect)
texcoords[3][1] = y0;
// Target coords in EGL surface
x0 = 2.0f * ((GLfloat) rect->x / tex_width) - 1.0f;
x0 = 2.0f * ((GLfloat) rect->x / tex_width) - 1.0f;
y1 = -2.0f * ((GLfloat) rect->y / tex_height) + 1.0f;
x1 = 2.0f * ((GLfloat) (rect->x + rect->width) / tex_width) - 1.0f;
x1 = 2.0f * ((GLfloat) (rect->x + rect->width) / tex_width) - 1.0f;
y0 = -2.0f * ((GLfloat) (rect->y + rect->height) / tex_height) + 1.0f;
positions[0][0] = x0;
positions[0][1] = y0;