Commit 67eea920 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

libs: drop GST_VAAPI_IS_xxx() helper macros.

Drop obsolete GST_VAAPI_IS_xxx() helper macros since we are no longer
deriving from GObject and so those were only checking for whether the
argument was NULL or not. This is now irrelevant, and even confusing
to some extent, because we no longer have type checking.

Note: this incurs more type checking (review) but the libgstvaapi is
rather small, so this is manageable.
parent f77e1642
...@@ -5,7 +5,6 @@ GstVaapiSurfacePool ...@@ -5,7 +5,6 @@ GstVaapiSurfacePool
gst_vaapi_surface_pool_new gst_vaapi_surface_pool_new
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_SURFACE_POOL GST_VAAPI_SURFACE_POOL
GST_VAAPI_IS_SURFACE_POOL
gst_vaapi_surface_pool_get_type gst_vaapi_surface_pool_get_type
</SECTION> </SECTION>
...@@ -24,7 +23,6 @@ gst_vaapi_video_pool_get_size ...@@ -24,7 +23,6 @@ gst_vaapi_video_pool_get_size
gst_vaapi_video_pool_reserve gst_vaapi_video_pool_reserve
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_VIDEO_POOL GST_VAAPI_VIDEO_POOL
GST_VAAPI_IS_VIDEO_POOL
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -37,7 +35,6 @@ gst_vaapi_display_x11_get_display ...@@ -37,7 +35,6 @@ gst_vaapi_display_x11_get_display
gst_vaapi_display_x11_get_screen gst_vaapi_display_x11_get_screen
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_DISPLAY_X11 GST_VAAPI_DISPLAY_X11
GST_VAAPI_IS_DISPLAY_X11
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -51,7 +48,6 @@ gst_vaapi_window_x11_get_xid ...@@ -51,7 +48,6 @@ gst_vaapi_window_x11_get_xid
gst_vaapi_window_x11_is_foreign_xid gst_vaapi_window_x11_is_foreign_xid
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_WINDOW_X11 GST_VAAPI_WINDOW_X11
GST_VAAPI_IS_WINDOW_X11
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -62,7 +58,6 @@ gst_vaapi_display_glx_new ...@@ -62,7 +58,6 @@ gst_vaapi_display_glx_new
gst_vaapi_display_glx_new_with_display gst_vaapi_display_glx_new_with_display
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_DISPLAY_GLX GST_VAAPI_DISPLAY_GLX
GST_VAAPI_IS_DISPLAY_GLX
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -109,7 +104,6 @@ gst_vaapi_display_get_render_mode ...@@ -109,7 +104,6 @@ gst_vaapi_display_get_render_mode
gst_vaapi_display_set_render_mode gst_vaapi_display_set_render_mode
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_DISPLAY GST_VAAPI_DISPLAY
GST_VAAPI_IS_DISPLAY
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -119,7 +113,6 @@ GstVaapiImagePool ...@@ -119,7 +113,6 @@ GstVaapiImagePool
gst_vaapi_image_pool_new gst_vaapi_image_pool_new
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_IMAGE_POOL GST_VAAPI_IMAGE_POOL
GST_VAAPI_IS_IMAGE_POOL
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -150,7 +143,6 @@ gst_vaapi_window_set_size ...@@ -150,7 +143,6 @@ gst_vaapi_window_set_size
gst_vaapi_window_put_surface gst_vaapi_window_put_surface
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_WINDOW GST_VAAPI_WINDOW
GST_VAAPI_IS_WINDOW
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -163,7 +155,6 @@ gst_vaapi_object_unlock_display ...@@ -163,7 +155,6 @@ gst_vaapi_object_unlock_display
gst_vaapi_object_get_id gst_vaapi_object_get_id
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_OBJECT GST_VAAPI_OBJECT
GST_VAAPI_IS_OBJECT
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -194,7 +185,6 @@ gst_vaapi_image_get_raw ...@@ -194,7 +185,6 @@ gst_vaapi_image_get_raw
gst_vaapi_image_update_from_buffer gst_vaapi_image_update_from_buffer
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_IMAGE GST_VAAPI_IMAGE
GST_VAAPI_IS_IMAGE
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -219,7 +209,6 @@ gst_vaapi_surface_sync ...@@ -219,7 +209,6 @@ gst_vaapi_surface_sync
gst_vaapi_surface_query_status gst_vaapi_surface_query_status
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_SURFACE GST_VAAPI_SURFACE
GST_VAAPI_IS_SURFACE
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -236,7 +225,6 @@ gst_vaapi_subpicture_get_image ...@@ -236,7 +225,6 @@ gst_vaapi_subpicture_get_image
gst_vaapi_subpicture_set_image gst_vaapi_subpicture_set_image
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_SUBPICTURE GST_VAAPI_SUBPICTURE
GST_VAAPI_IS_SUBPICTURE
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -300,7 +288,6 @@ gst_vaapi_context_get_surface_count ...@@ -300,7 +288,6 @@ gst_vaapi_context_get_surface_count
gst_vaapi_context_apply_composition gst_vaapi_context_apply_composition
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_CONTEXT GST_VAAPI_CONTEXT
GST_VAAPI_IS_CONTEXT
</SECTION> </SECTION>
<SECTION> <SECTION>
...@@ -319,7 +306,6 @@ gst_vaapi_decoder_parse ...@@ -319,7 +306,6 @@ gst_vaapi_decoder_parse
gst_vaapi_decoder_decode gst_vaapi_decoder_decode
<SUBSECTION Standard> <SUBSECTION Standard>
GST_VAAPI_DECODER GST_VAAPI_DECODER
GST_VAAPI_IS_DECODER
</SECTION> </SECTION>
<SECTION> <SECTION>
......
...@@ -788,7 +788,7 @@ gst_vaapi_context_reset_full(GstVaapiContext *context, ...@@ -788,7 +788,7 @@ gst_vaapi_context_reset_full(GstVaapiContext *context,
GstVaapiID GstVaapiID
gst_vaapi_context_get_id(GstVaapiContext *context) gst_vaapi_context_get_id(GstVaapiContext *context)
{ {
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), VA_INVALID_ID); g_return_val_if_fail(context != NULL, VA_INVALID_ID);
return GST_VAAPI_OBJECT_ID(context); return GST_VAAPI_OBJECT_ID(context);
} }
...@@ -804,7 +804,7 @@ gst_vaapi_context_get_id(GstVaapiContext *context) ...@@ -804,7 +804,7 @@ gst_vaapi_context_get_id(GstVaapiContext *context)
GstVaapiProfile GstVaapiProfile
gst_vaapi_context_get_profile(GstVaapiContext *context) gst_vaapi_context_get_profile(GstVaapiContext *context)
{ {
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), 0); g_return_val_if_fail(context != NULL, 0);
return context->info.profile; return context->info.profile;
} }
...@@ -824,7 +824,7 @@ gst_vaapi_context_get_profile(GstVaapiContext *context) ...@@ -824,7 +824,7 @@ gst_vaapi_context_get_profile(GstVaapiContext *context)
gboolean gboolean
gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile) gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile)
{ {
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), FALSE); g_return_val_if_fail(context != NULL, FALSE);
g_return_val_if_fail(profile, FALSE); g_return_val_if_fail(profile, FALSE);
return gst_vaapi_context_reset(context, return gst_vaapi_context_reset(context,
...@@ -845,7 +845,7 @@ gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile) ...@@ -845,7 +845,7 @@ gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile)
GstVaapiEntrypoint GstVaapiEntrypoint
gst_vaapi_context_get_entrypoint(GstVaapiContext *context) gst_vaapi_context_get_entrypoint(GstVaapiContext *context)
{ {
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), 0); g_return_val_if_fail(context != NULL, 0);
return context->info.entrypoint; return context->info.entrypoint;
} }
...@@ -865,7 +865,7 @@ gst_vaapi_context_get_size( ...@@ -865,7 +865,7 @@ gst_vaapi_context_get_size(
guint *pheight guint *pheight
) )
{ {
g_return_if_fail(GST_VAAPI_IS_CONTEXT(context)); g_return_if_fail(context != NULL);
if (pwidth) if (pwidth)
*pwidth = context->info.width; *pwidth = context->info.width;
...@@ -892,7 +892,7 @@ gst_vaapi_context_get_size( ...@@ -892,7 +892,7 @@ gst_vaapi_context_get_size(
GstVaapiSurfaceProxy * GstVaapiSurfaceProxy *
gst_vaapi_context_get_surface_proxy(GstVaapiContext *context) gst_vaapi_context_get_surface_proxy(GstVaapiContext *context)
{ {
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), NULL); g_return_val_if_fail(context != NULL, NULL);
return gst_vaapi_surface_proxy_new_from_pool( return gst_vaapi_surface_proxy_new_from_pool(
GST_VAAPI_SURFACE_POOL(context->surfaces_pool)); GST_VAAPI_SURFACE_POOL(context->surfaces_pool));
...@@ -909,7 +909,7 @@ gst_vaapi_context_get_surface_proxy(GstVaapiContext *context) ...@@ -909,7 +909,7 @@ gst_vaapi_context_get_surface_proxy(GstVaapiContext *context)
guint guint
gst_vaapi_context_get_surface_count(GstVaapiContext *context) gst_vaapi_context_get_surface_count(GstVaapiContext *context)
{ {
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), 0); g_return_val_if_fail(context != NULL, 0);
return gst_vaapi_video_pool_get_size(context->surfaces_pool); return gst_vaapi_video_pool_get_size(context->surfaces_pool);
} }
...@@ -937,7 +937,7 @@ gst_vaapi_context_apply_composition( ...@@ -937,7 +937,7 @@ gst_vaapi_context_apply_composition(
guint i, n_rectangles; guint i, n_rectangles;
gboolean reassociate = FALSE; gboolean reassociate = FALSE;
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), FALSE); g_return_val_if_fail(context != NULL, FALSE);
if (!context->surfaces) if (!context->surfaces)
return FALSE; return FALSE;
......
...@@ -34,9 +34,6 @@ G_BEGIN_DECLS ...@@ -34,9 +34,6 @@ G_BEGIN_DECLS
#define GST_VAAPI_CONTEXT(obj) \ #define GST_VAAPI_CONTEXT(obj) \
((GstVaapiContext *)(obj)) ((GstVaapiContext *)(obj))
#define GST_VAAPI_IS_CONTEXT(obj) \
((obj) != NULL)
typedef struct _GstVaapiContext GstVaapiContext; typedef struct _GstVaapiContext GstVaapiContext;
typedef struct _GstVaapiContextInfo GstVaapiContextInfo; typedef struct _GstVaapiContextInfo GstVaapiContextInfo;
......
...@@ -516,7 +516,7 @@ gst_vaapi_decoder_new(const GstVaapiDecoderClass *klass, ...@@ -516,7 +516,7 @@ gst_vaapi_decoder_new(const GstVaapiDecoderClass *klass,
{ {
GstVaapiDecoder *decoder; GstVaapiDecoder *decoder;
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); g_return_val_if_fail(display != NULL, NULL);
g_return_val_if_fail(GST_IS_CAPS(caps), NULL); g_return_val_if_fail(GST_IS_CAPS(caps), NULL);
decoder = (GstVaapiDecoder *) decoder = (GstVaapiDecoder *)
...@@ -587,7 +587,7 @@ gst_vaapi_decoder_replace(GstVaapiDecoder **old_decoder_ptr, ...@@ -587,7 +587,7 @@ gst_vaapi_decoder_replace(GstVaapiDecoder **old_decoder_ptr,
gpointer gpointer
gst_vaapi_decoder_get_user_data(GstVaapiDecoder *decoder) gst_vaapi_decoder_get_user_data(GstVaapiDecoder *decoder)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), NULL); g_return_val_if_fail(decoder != NULL, NULL);
return decoder->user_data; return decoder->user_data;
} }
...@@ -603,7 +603,7 @@ gst_vaapi_decoder_get_user_data(GstVaapiDecoder *decoder) ...@@ -603,7 +603,7 @@ gst_vaapi_decoder_get_user_data(GstVaapiDecoder *decoder)
void void
gst_vaapi_decoder_set_user_data(GstVaapiDecoder *decoder, gpointer user_data) gst_vaapi_decoder_set_user_data(GstVaapiDecoder *decoder, gpointer user_data)
{ {
g_return_if_fail(GST_VAAPI_IS_DECODER(decoder)); g_return_if_fail(decoder != NULL);
decoder->user_data = user_data; decoder->user_data = user_data;
} }
...@@ -619,7 +619,7 @@ gst_vaapi_decoder_set_user_data(GstVaapiDecoder *decoder, gpointer user_data) ...@@ -619,7 +619,7 @@ gst_vaapi_decoder_set_user_data(GstVaapiDecoder *decoder, gpointer user_data)
GstVaapiCodec GstVaapiCodec
gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder) gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), (GstVaapiCodec)0); g_return_val_if_fail(decoder != NULL, (GstVaapiCodec)0);
return decoder->codec; return decoder->codec;
} }
...@@ -637,7 +637,7 @@ gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder) ...@@ -637,7 +637,7 @@ gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder)
GstVideoCodecState * GstVideoCodecState *
gst_vaapi_decoder_get_codec_state(GstVaapiDecoder *decoder) gst_vaapi_decoder_get_codec_state(GstVaapiDecoder *decoder)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), NULL); g_return_val_if_fail(decoder != NULL, NULL);
return GST_VAAPI_DECODER_CODEC_STATE(decoder); return GST_VAAPI_DECODER_CODEC_STATE(decoder);
} }
...@@ -655,7 +655,7 @@ void ...@@ -655,7 +655,7 @@ void
gst_vaapi_decoder_set_codec_state_changed_func(GstVaapiDecoder *decoder, gst_vaapi_decoder_set_codec_state_changed_func(GstVaapiDecoder *decoder,
GstVaapiDecoderStateChangedFunc func, gpointer user_data) GstVaapiDecoderStateChangedFunc func, gpointer user_data)
{ {
g_return_if_fail(GST_VAAPI_IS_DECODER(decoder)); g_return_if_fail(decoder != NULL);
decoder->codec_state_changed_func = func; decoder->codec_state_changed_func = func;
decoder->codec_state_changed_data = user_data; decoder->codec_state_changed_data = user_data;
...@@ -694,7 +694,7 @@ gst_vaapi_decoder_get_caps(GstVaapiDecoder *decoder) ...@@ -694,7 +694,7 @@ gst_vaapi_decoder_get_caps(GstVaapiDecoder *decoder)
gboolean gboolean
gst_vaapi_decoder_put_buffer(GstVaapiDecoder *decoder, GstBuffer *buf) gst_vaapi_decoder_put_buffer(GstVaapiDecoder *decoder, GstBuffer *buf)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), FALSE); g_return_val_if_fail(decoder != NULL, FALSE);
if (buf) { if (buf) {
if (gst_buffer_get_size(buf) == 0) if (gst_buffer_get_size(buf) == 0)
...@@ -725,7 +725,7 @@ gst_vaapi_decoder_get_surface(GstVaapiDecoder *decoder, ...@@ -725,7 +725,7 @@ gst_vaapi_decoder_get_surface(GstVaapiDecoder *decoder,
GstVideoCodecFrame *frame; GstVideoCodecFrame *frame;
GstVaapiDecoderStatus status; GstVaapiDecoderStatus status;
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), g_return_val_if_fail(decoder != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
g_return_val_if_fail(out_proxy_ptr != NULL, g_return_val_if_fail(out_proxy_ptr != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
...@@ -802,7 +802,7 @@ gst_vaapi_decoder_get_frame_with_timeout(GstVaapiDecoder *decoder, ...@@ -802,7 +802,7 @@ gst_vaapi_decoder_get_frame_with_timeout(GstVaapiDecoder *decoder,
{ {
GstVideoCodecFrame *out_frame; GstVideoCodecFrame *out_frame;
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), g_return_val_if_fail(decoder != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
g_return_val_if_fail(out_frame_ptr != NULL, g_return_val_if_fail(out_frame_ptr != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
...@@ -982,7 +982,7 @@ gst_vaapi_decoder_parse(GstVaapiDecoder *decoder, ...@@ -982,7 +982,7 @@ gst_vaapi_decoder_parse(GstVaapiDecoder *decoder,
GstVideoCodecFrame *base_frame, GstAdapter *adapter, gboolean at_eos, GstVideoCodecFrame *base_frame, GstAdapter *adapter, gboolean at_eos,
guint *got_unit_size_ptr, gboolean *got_frame_ptr) guint *got_unit_size_ptr, gboolean *got_frame_ptr)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), g_return_val_if_fail(decoder != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
g_return_val_if_fail(base_frame != NULL, g_return_val_if_fail(base_frame != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
...@@ -1002,7 +1002,7 @@ gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame) ...@@ -1002,7 +1002,7 @@ gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame)
{ {
GstVaapiDecoderStatus status; GstVaapiDecoderStatus status;
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), g_return_val_if_fail(decoder != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
g_return_val_if_fail(frame != NULL, g_return_val_if_fail(frame != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
...@@ -1018,7 +1018,7 @@ gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame) ...@@ -1018,7 +1018,7 @@ gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame)
GstVaapiDecoderStatus GstVaapiDecoderStatus
gst_vaapi_decoder_flush(GstVaapiDecoder *decoder) gst_vaapi_decoder_flush(GstVaapiDecoder *decoder)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), g_return_val_if_fail(decoder != NULL,
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
return do_flush(decoder); return do_flush(decoder);
......
...@@ -34,9 +34,6 @@ G_BEGIN_DECLS ...@@ -34,9 +34,6 @@ G_BEGIN_DECLS
#define GST_VAAPI_DECODER(obj) \ #define GST_VAAPI_DECODER(obj) \
((GstVaapiDecoder *)(obj)) ((GstVaapiDecoder *)(obj))
#define GST_VAAPI_IS_DECODER(obj) \
((obj) != NULL)
typedef struct _GstVaapiDecoder GstVaapiDecoder; typedef struct _GstVaapiDecoder GstVaapiDecoder;
typedef void (*GstVaapiDecoderStateChangedFunc)(GstVaapiDecoder *decoder, typedef void (*GstVaapiDecoderStateChangedFunc)(GstVaapiDecoder *decoder,
const GstVideoCodecState *codec_state, gpointer user_data); const GstVideoCodecState *codec_state, gpointer user_data);
......
...@@ -1071,7 +1071,7 @@ gst_vaapi_display_lock(GstVaapiDisplay *display) ...@@ -1071,7 +1071,7 @@ gst_vaapi_display_lock(GstVaapiDisplay *display)
{ {
GstVaapiDisplayClass *klass; GstVaapiDisplayClass *klass;
g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); g_return_if_fail(display != NULL);
klass = GST_VAAPI_DISPLAY_GET_CLASS(display); klass = GST_VAAPI_DISPLAY_GET_CLASS(display);
if (klass->lock) if (klass->lock)
...@@ -1091,7 +1091,7 @@ gst_vaapi_display_unlock(GstVaapiDisplay *display) ...@@ -1091,7 +1091,7 @@ gst_vaapi_display_unlock(GstVaapiDisplay *display)
{ {
GstVaapiDisplayClass *klass; GstVaapiDisplayClass *klass;
g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); g_return_if_fail(display != NULL);
klass = GST_VAAPI_DISPLAY_GET_CLASS(display); klass = GST_VAAPI_DISPLAY_GET_CLASS(display);
if (klass->unlock) if (klass->unlock)
...@@ -1114,7 +1114,7 @@ gst_vaapi_display_sync(GstVaapiDisplay *display) ...@@ -1114,7 +1114,7 @@ gst_vaapi_display_sync(GstVaapiDisplay *display)
{ {
GstVaapiDisplayClass *klass; GstVaapiDisplayClass *klass;
g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); g_return_if_fail(display != NULL);
klass = GST_VAAPI_DISPLAY_GET_CLASS(display); klass = GST_VAAPI_DISPLAY_GET_CLASS(display);
if (klass->sync) if (klass->sync)
...@@ -1137,7 +1137,7 @@ gst_vaapi_display_flush(GstVaapiDisplay *display) ...@@ -1137,7 +1137,7 @@ gst_vaapi_display_flush(GstVaapiDisplay *display)
{ {
GstVaapiDisplayClass *klass; GstVaapiDisplayClass *klass;
g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); g_return_if_fail(display != NULL);
klass = GST_VAAPI_DISPLAY_GET_CLASS(display); klass = GST_VAAPI_DISPLAY_GET_CLASS(display);
if (klass->flush) if (klass->flush)
...@@ -1155,8 +1155,7 @@ gst_vaapi_display_flush(GstVaapiDisplay *display) ...@@ -1155,8 +1155,7 @@ gst_vaapi_display_flush(GstVaapiDisplay *display)
GstVaapiDisplayType GstVaapiDisplayType
gst_vaapi_display_get_display_type(GstVaapiDisplay *display) gst_vaapi_display_get_display_type(GstVaapiDisplay *display)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), g_return_val_if_fail(display != NULL, GST_VAAPI_DISPLAY_TYPE_ANY);
GST_VAAPI_DISPLAY_TYPE_ANY);
return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->display_type; return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->display_type;
} }
...@@ -1172,7 +1171,7 @@ gst_vaapi_display_get_display_type(GstVaapiDisplay *display) ...@@ -1172,7 +1171,7 @@ gst_vaapi_display_get_display_type(GstVaapiDisplay *display)
VADisplay VADisplay
gst_vaapi_display_get_display(GstVaapiDisplay *display) gst_vaapi_display_get_display(GstVaapiDisplay *display)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); g_return_val_if_fail(display != NULL, NULL);
return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->display; return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->display;
} }
...@@ -1188,7 +1187,7 @@ gst_vaapi_display_get_display(GstVaapiDisplay *display) ...@@ -1188,7 +1187,7 @@ gst_vaapi_display_get_display(GstVaapiDisplay *display)
guint guint
gst_vaapi_display_get_width(GstVaapiDisplay *display) gst_vaapi_display_get_width(GstVaapiDisplay *display)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), 0); g_return_val_if_fail(display != NULL, 0);
return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->width; return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->width;
} }
...@@ -1204,7 +1203,7 @@ gst_vaapi_display_get_width(GstVaapiDisplay *display) ...@@ -1204,7 +1203,7 @@ gst_vaapi_display_get_width(GstVaapiDisplay *display)
guint guint
gst_vaapi_display_get_height(GstVaapiDisplay *display) gst_vaapi_display_get_height(GstVaapiDisplay *display)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), 0); g_return_val_if_fail(display != NULL, 0);
return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->height; return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->height;
} }
...@@ -1244,7 +1243,7 @@ gst_vaapi_display_get_pixel_aspect_ratio( ...@@ -1244,7 +1243,7 @@ gst_vaapi_display_get_pixel_aspect_ratio(
guint *par_d guint *par_d
) )
{ {
g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); g_return_if_fail(display != NULL);
if (par_n) if (par_n)
*par_n = GST_VAAPI_DISPLAY_GET_PRIVATE(display)->par_n; *par_n = GST_VAAPI_DISPLAY_GET_PRIVATE(display)->par_n;
...@@ -1264,7 +1263,7 @@ gst_vaapi_display_get_pixel_aspect_ratio( ...@@ -1264,7 +1263,7 @@ gst_vaapi_display_get_pixel_aspect_ratio(
GstCaps * GstCaps *
gst_vaapi_display_get_decode_caps(GstVaapiDisplay *display) gst_vaapi_display_get_decode_caps(GstVaapiDisplay *display)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); g_return_val_if_fail(display != NULL, NULL);
return get_profile_caps(GST_VAAPI_DISPLAY_GET_PRIVATE(display)->decoders); return get_profile_caps(GST_VAAPI_DISPLAY_GET_PRIVATE(display)->decoders);
} }
...@@ -1287,7 +1286,7 @@ gst_vaapi_display_has_decoder( ...@@ -1287,7 +1286,7 @@ gst_vaapi_display_has_decoder(
GstVaapiEntrypoint entrypoint GstVaapiEntrypoint entrypoint
) )
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); g_return_val_if_fail(display != NULL, FALSE);
return find_config( return find_config(
GST_VAAPI_DISPLAY_GET_PRIVATE(display)->decoders, profile, entrypoint); GST_VAAPI_DISPLAY_GET_PRIVATE(display)->decoders, profile, entrypoint);
...@@ -1304,7 +1303,7 @@ gst_vaapi_display_has_decoder( ...@@ -1304,7 +1303,7 @@ gst_vaapi_display_has_decoder(
GstCaps * GstCaps *
gst_vaapi_display_get_encode_caps(GstVaapiDisplay *display) gst_vaapi_display_get_encode_caps(GstVaapiDisplay *display)
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); g_return_val_if_fail(display != NULL, NULL);
return get_profile_caps(GST_VAAPI_DISPLAY_GET_PRIVATE(display)->encoders); return get_profile_caps(GST_VAAPI_DISPLAY_GET_PRIVATE(display)->encoders);
} }
...@@ -1327,7 +1326,7 @@ gst_vaapi_display_has_encoder( ...@@ -1327,7 +1326,7 @@ gst_vaapi_display_has_encoder(
GstVaapiEntrypoint entrypoint GstVaapiEntrypoint entrypoint
) )
{ {
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE);