diff --git a/docs/reference/libs/libs-sections.txt b/docs/reference/libs/libs-sections.txt index 7f4fcba311..423704c1e9 100644 --- a/docs/reference/libs/libs-sections.txt +++ b/docs/reference/libs/libs-sections.txt @@ -5,7 +5,6 @@ GstVaapiSurfacePool gst_vaapi_surface_pool_new GST_VAAPI_SURFACE_POOL -GST_VAAPI_IS_SURFACE_POOL gst_vaapi_surface_pool_get_type @@ -24,7 +23,6 @@ gst_vaapi_video_pool_get_size gst_vaapi_video_pool_reserve GST_VAAPI_VIDEO_POOL -GST_VAAPI_IS_VIDEO_POOL
@@ -37,7 +35,6 @@ gst_vaapi_display_x11_get_display gst_vaapi_display_x11_get_screen GST_VAAPI_DISPLAY_X11 -GST_VAAPI_IS_DISPLAY_X11
@@ -51,7 +48,6 @@ gst_vaapi_window_x11_get_xid gst_vaapi_window_x11_is_foreign_xid GST_VAAPI_WINDOW_X11 -GST_VAAPI_IS_WINDOW_X11
@@ -62,7 +58,6 @@ gst_vaapi_display_glx_new gst_vaapi_display_glx_new_with_display GST_VAAPI_DISPLAY_GLX -GST_VAAPI_IS_DISPLAY_GLX
@@ -109,7 +104,6 @@ gst_vaapi_display_get_render_mode gst_vaapi_display_set_render_mode GST_VAAPI_DISPLAY -GST_VAAPI_IS_DISPLAY
@@ -119,7 +113,6 @@ GstVaapiImagePool gst_vaapi_image_pool_new GST_VAAPI_IMAGE_POOL -GST_VAAPI_IS_IMAGE_POOL
@@ -150,7 +143,6 @@ gst_vaapi_window_set_size gst_vaapi_window_put_surface GST_VAAPI_WINDOW -GST_VAAPI_IS_WINDOW
@@ -163,7 +155,6 @@ gst_vaapi_object_unlock_display gst_vaapi_object_get_id GST_VAAPI_OBJECT -GST_VAAPI_IS_OBJECT
@@ -194,7 +185,6 @@ gst_vaapi_image_get_raw gst_vaapi_image_update_from_buffer GST_VAAPI_IMAGE -GST_VAAPI_IS_IMAGE
@@ -219,7 +209,6 @@ gst_vaapi_surface_sync gst_vaapi_surface_query_status GST_VAAPI_SURFACE -GST_VAAPI_IS_SURFACE
@@ -236,7 +225,6 @@ gst_vaapi_subpicture_get_image gst_vaapi_subpicture_set_image GST_VAAPI_SUBPICTURE -GST_VAAPI_IS_SUBPICTURE
@@ -300,7 +288,6 @@ gst_vaapi_context_get_surface_count gst_vaapi_context_apply_composition GST_VAAPI_CONTEXT -GST_VAAPI_IS_CONTEXT
@@ -319,7 +306,6 @@ gst_vaapi_decoder_parse gst_vaapi_decoder_decode GST_VAAPI_DECODER -GST_VAAPI_IS_DECODER
diff --git a/gst-libs/gst/vaapi/gstvaapicontext.c b/gst-libs/gst/vaapi/gstvaapicontext.c index 174e809a58..a132e82746 100644 --- a/gst-libs/gst/vaapi/gstvaapicontext.c +++ b/gst-libs/gst/vaapi/gstvaapicontext.c @@ -788,7 +788,7 @@ gst_vaapi_context_reset_full(GstVaapiContext *context, GstVaapiID 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); } @@ -804,7 +804,7 @@ gst_vaapi_context_get_id(GstVaapiContext *context) GstVaapiProfile 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; } @@ -824,7 +824,7 @@ gst_vaapi_context_get_profile(GstVaapiContext *context) gboolean 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); return gst_vaapi_context_reset(context, @@ -845,7 +845,7 @@ gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile) GstVaapiEntrypoint 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; } @@ -865,7 +865,7 @@ gst_vaapi_context_get_size( guint *pheight ) { - g_return_if_fail(GST_VAAPI_IS_CONTEXT(context)); + g_return_if_fail(context != NULL); if (pwidth) *pwidth = context->info.width; @@ -892,7 +892,7 @@ gst_vaapi_context_get_size( GstVaapiSurfaceProxy * 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( GST_VAAPI_SURFACE_POOL(context->surfaces_pool)); @@ -909,7 +909,7 @@ gst_vaapi_context_get_surface_proxy(GstVaapiContext *context) guint 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); } @@ -937,7 +937,7 @@ gst_vaapi_context_apply_composition( guint i, n_rectangles; 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) return FALSE; diff --git a/gst-libs/gst/vaapi/gstvaapicontext.h b/gst-libs/gst/vaapi/gstvaapicontext.h index 82f11461f1..2414e9da92 100644 --- a/gst-libs/gst/vaapi/gstvaapicontext.h +++ b/gst-libs/gst/vaapi/gstvaapicontext.h @@ -34,9 +34,6 @@ G_BEGIN_DECLS #define GST_VAAPI_CONTEXT(obj) \ ((GstVaapiContext *)(obj)) -#define GST_VAAPI_IS_CONTEXT(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiContext GstVaapiContext; typedef struct _GstVaapiContextInfo GstVaapiContextInfo; diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c index c11b0f6a2f..787029195b 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder.c @@ -516,7 +516,7 @@ gst_vaapi_decoder_new(const GstVaapiDecoderClass *klass, { 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); decoder = (GstVaapiDecoder *) @@ -587,7 +587,7 @@ gst_vaapi_decoder_replace(GstVaapiDecoder **old_decoder_ptr, gpointer 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; } @@ -603,7 +603,7 @@ gst_vaapi_decoder_get_user_data(GstVaapiDecoder *decoder) void 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; } @@ -619,7 +619,7 @@ gst_vaapi_decoder_set_user_data(GstVaapiDecoder *decoder, gpointer user_data) GstVaapiCodec 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; } @@ -637,7 +637,7 @@ gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder) GstVideoCodecState * 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); } @@ -655,7 +655,7 @@ void gst_vaapi_decoder_set_codec_state_changed_func(GstVaapiDecoder *decoder, 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_data = user_data; @@ -694,7 +694,7 @@ gst_vaapi_decoder_get_caps(GstVaapiDecoder *decoder) gboolean 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 (gst_buffer_get_size(buf) == 0) @@ -725,7 +725,7 @@ gst_vaapi_decoder_get_surface(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame; 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); g_return_val_if_fail(out_proxy_ptr != NULL, GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); @@ -802,7 +802,7 @@ gst_vaapi_decoder_get_frame_with_timeout(GstVaapiDecoder *decoder, { 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); g_return_val_if_fail(out_frame_ptr != NULL, GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); @@ -982,7 +982,7 @@ gst_vaapi_decoder_parse(GstVaapiDecoder *decoder, GstVideoCodecFrame *base_frame, GstAdapter *adapter, gboolean at_eos, 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); g_return_val_if_fail(base_frame != NULL, GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); @@ -1002,7 +1002,7 @@ gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame) { 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); g_return_val_if_fail(frame != NULL, GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER); @@ -1018,7 +1018,7 @@ gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame) GstVaapiDecoderStatus 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); return do_flush(decoder); diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.h b/gst-libs/gst/vaapi/gstvaapidecoder.h index e2854f3920..6dbcb5b83d 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.h +++ b/gst-libs/gst/vaapi/gstvaapidecoder.h @@ -34,9 +34,6 @@ G_BEGIN_DECLS #define GST_VAAPI_DECODER(obj) \ ((GstVaapiDecoder *)(obj)) -#define GST_VAAPI_IS_DECODER(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiDecoder GstVaapiDecoder; typedef void (*GstVaapiDecoderStateChangedFunc)(GstVaapiDecoder *decoder, const GstVideoCodecState *codec_state, gpointer user_data); diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index a8b4e9967b..919f24bd1f 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -1071,7 +1071,7 @@ gst_vaapi_display_lock(GstVaapiDisplay *display) { GstVaapiDisplayClass *klass; - g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); + g_return_if_fail(display != NULL); klass = GST_VAAPI_DISPLAY_GET_CLASS(display); if (klass->lock) @@ -1091,7 +1091,7 @@ gst_vaapi_display_unlock(GstVaapiDisplay *display) { GstVaapiDisplayClass *klass; - g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); + g_return_if_fail(display != NULL); klass = GST_VAAPI_DISPLAY_GET_CLASS(display); if (klass->unlock) @@ -1114,7 +1114,7 @@ gst_vaapi_display_sync(GstVaapiDisplay *display) { GstVaapiDisplayClass *klass; - g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); + g_return_if_fail(display != NULL); klass = GST_VAAPI_DISPLAY_GET_CLASS(display); if (klass->sync) @@ -1137,7 +1137,7 @@ gst_vaapi_display_flush(GstVaapiDisplay *display) { GstVaapiDisplayClass *klass; - g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); + g_return_if_fail(display != NULL); klass = GST_VAAPI_DISPLAY_GET_CLASS(display); if (klass->flush) @@ -1155,8 +1155,7 @@ gst_vaapi_display_flush(GstVaapiDisplay *display) GstVaapiDisplayType gst_vaapi_display_get_display_type(GstVaapiDisplay *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), - GST_VAAPI_DISPLAY_TYPE_ANY); + g_return_val_if_fail(display != NULL, GST_VAAPI_DISPLAY_TYPE_ANY); return GST_VAAPI_DISPLAY_GET_PRIVATE(display)->display_type; } @@ -1172,7 +1171,7 @@ gst_vaapi_display_get_display_type(GstVaapiDisplay *display) VADisplay 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; } @@ -1188,7 +1187,7 @@ gst_vaapi_display_get_display(GstVaapiDisplay *display) guint 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; } @@ -1204,7 +1203,7 @@ gst_vaapi_display_get_width(GstVaapiDisplay *display) guint 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; } @@ -1244,7 +1243,7 @@ gst_vaapi_display_get_pixel_aspect_ratio( guint *par_d ) { - g_return_if_fail(GST_VAAPI_IS_DISPLAY(display)); + g_return_if_fail(display != NULL); if (par_n) *par_n = GST_VAAPI_DISPLAY_GET_PRIVATE(display)->par_n; @@ -1264,7 +1263,7 @@ gst_vaapi_display_get_pixel_aspect_ratio( GstCaps * 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); } @@ -1287,7 +1286,7 @@ gst_vaapi_display_has_decoder( GstVaapiEntrypoint entrypoint ) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); return find_config( GST_VAAPI_DISPLAY_GET_PRIVATE(display)->decoders, profile, entrypoint); @@ -1304,7 +1303,7 @@ gst_vaapi_display_has_decoder( GstCaps * 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); } @@ -1327,7 +1326,7 @@ gst_vaapi_display_has_encoder( GstVaapiEntrypoint entrypoint ) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); return find_config( GST_VAAPI_DISPLAY_GET_PRIVATE(display)->encoders, profile, entrypoint); @@ -1352,7 +1351,7 @@ gst_vaapi_display_has_encoder( GstCaps * gst_vaapi_display_get_image_caps(GstVaapiDisplay *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); + g_return_val_if_fail(display != NULL, NULL); return get_format_caps( GST_VAAPI_DISPLAY_GET_PRIVATE(display)->image_formats); @@ -1373,7 +1372,7 @@ gst_vaapi_display_has_image_format( GstVaapiImageFormat format ) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); g_return_val_if_fail(format, FALSE); if (find_format( @@ -1404,7 +1403,7 @@ gst_vaapi_display_has_image_format( GstCaps * gst_vaapi_display_get_subpicture_caps(GstVaapiDisplay *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); + g_return_val_if_fail(display != NULL, NULL); return get_format_caps( GST_VAAPI_DISPLAY_GET_PRIVATE(display)->subpicture_formats); @@ -1430,7 +1429,7 @@ gst_vaapi_display_has_subpicture_format( { const GstVaapiFormatInfo *fip; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); g_return_val_if_fail(format, FALSE); fip = find_format_info( @@ -1458,7 +1457,7 @@ gst_vaapi_display_has_subpicture_format( gboolean gst_vaapi_display_has_property(GstVaapiDisplay *display, const gchar *name) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); g_return_val_if_fail(name, FALSE); return find_property( @@ -1471,7 +1470,7 @@ gst_vaapi_display_get_property(GstVaapiDisplay *display, const gchar *name, { const GstVaapiProperty *prop; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); g_return_val_if_fail(name != NULL, FALSE); g_return_val_if_fail(out_value != NULL, FALSE); @@ -1520,7 +1519,7 @@ gst_vaapi_display_set_property(GstVaapiDisplay *display, const gchar *name, { const GstVaapiProperty *prop; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); g_return_val_if_fail(name != NULL, FALSE); g_return_val_if_fail(value != NULL, FALSE); @@ -1686,7 +1685,7 @@ gst_vaapi_display_get_render_mode( GstVaapiRenderMode *pmode ) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); /* Try with render-mode attribute */ if (get_render_mode_VADisplayAttribRenderMode(display, pmode)) @@ -1720,7 +1719,7 @@ gst_vaapi_display_set_render_mode( { gint modes, devices; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); if (!get_attribute(display, VADisplayAttribRenderDevice, &devices)) return FALSE; @@ -1762,7 +1761,7 @@ gst_vaapi_display_get_rotation(GstVaapiDisplay *display) { gint value; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), DEFAULT_ROTATION); + g_return_val_if_fail(display != NULL, DEFAULT_ROTATION); if (!get_attribute(display, VADisplayAttribRotation, &value)) value = VA_ROTATION_NONE; @@ -1790,7 +1789,7 @@ gst_vaapi_display_set_rotation( { guint value; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), FALSE); + g_return_val_if_fail(display != NULL, FALSE); value = from_GstVaapiRotation(rotation); if (!set_attribute(display, VADisplayAttribRotation, value)) diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.h b/gst-libs/gst/vaapi/gstvaapidisplay.h index c5f392e7b8..ff6908765d 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay.h @@ -34,9 +34,6 @@ G_BEGIN_DECLS #define GST_VAAPI_DISPLAY(obj) \ ((GstVaapiDisplay *)(obj)) -#define GST_VAAPI_IS_DISPLAY(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiDisplayInfo GstVaapiDisplayInfo; typedef struct _GstVaapiDisplay GstVaapiDisplay; diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_drm.c b/gst-libs/gst/vaapi/gstvaapidisplay_drm.c index da6235c369..641a8ed2b1 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_drm.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_drm.c @@ -417,7 +417,7 @@ gst_vaapi_display_drm_new_with_device(gint device) gint gst_vaapi_display_drm_get_device(GstVaapiDisplayDRM *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_DRM(display), -1); + g_return_val_if_fail(display != NULL, -1); return GST_VAAPI_DISPLAY_DRM_DEVICE(display); } @@ -438,7 +438,7 @@ gst_vaapi_display_drm_get_device(GstVaapiDisplayDRM *display) const gchar * gst_vaapi_display_drm_get_device_path(GstVaapiDisplayDRM *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_DRM(display), NULL); + g_return_val_if_fail(display != NULL, NULL); return get_device_path(GST_VAAPI_DISPLAY_CAST(display)); } diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_drm.h b/gst-libs/gst/vaapi/gstvaapidisplay_drm.h index a0b10428d0..0d946cc879 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_drm.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_drm.h @@ -29,9 +29,6 @@ G_BEGIN_DECLS #define GST_VAAPI_DISPLAY_DRM(obj) \ ((GstVaapiDisplayDRM *)(obj)) -#define GST_VAAPI_IS_DISPLAY_DRM(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiDisplayDRM GstVaapiDisplayDRM; GstVaapiDisplay * diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_glx.h b/gst-libs/gst/vaapi/gstvaapidisplay_glx.h index cf318f5e94..bd46a8c7b5 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_glx.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_glx.h @@ -32,9 +32,6 @@ G_BEGIN_DECLS #define GST_VAAPI_DISPLAY_GLX(obj) \ ((GstVaapiDisplayGLX *)(obj)) -#define GST_VAAPI_IS_DISPLAY_GLX(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiDisplayGLX GstVaapiDisplayGLX; GstVaapiDisplay * diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c index 08e8cf844d..2d9c778c2b 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c @@ -451,7 +451,7 @@ gst_vaapi_display_wayland_new_with_display(struct wl_display *wl_display) struct wl_display * gst_vaapi_display_wayland_get_display(GstVaapiDisplayWayland *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_WAYLAND(display), NULL); + g_return_val_if_fail(display != NULL, NULL); return GST_VAAPI_DISPLAY_WL_DISPLAY(display); } diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.h b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.h index 3f1772888c..730a434aef 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.h @@ -30,9 +30,6 @@ G_BEGIN_DECLS #define GST_VAAPI_DISPLAY_WAYLAND(obj) \ ((GstVaapiDisplayWayland *)(obj)) -#define GST_VAAPI_IS_DISPLAY_WAYLAND(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiDisplayWayland GstVaapiDisplayWayland; GstVaapiDisplay * diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c index cad9251915..7cbc5a6a47 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c @@ -452,7 +452,7 @@ gst_vaapi_display_x11_new_with_display(Display *x11_display) Display * gst_vaapi_display_x11_get_display(GstVaapiDisplayX11 *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_X11(display), NULL); + g_return_val_if_fail(display != NULL, NULL); return GST_VAAPI_DISPLAY_XDISPLAY(display); } @@ -470,7 +470,7 @@ gst_vaapi_display_x11_get_display(GstVaapiDisplayX11 *display) int gst_vaapi_display_x11_get_screen(GstVaapiDisplayX11 *display) { - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_X11(display), -1); + g_return_val_if_fail(display != NULL, -1); return GST_VAAPI_DISPLAY_XSCREEN(display); } @@ -490,7 +490,7 @@ void gst_vaapi_display_x11_set_synchronous(GstVaapiDisplayX11 *display, gboolean synchronous) { - g_return_if_fail(GST_VAAPI_IS_DISPLAY_X11(display)); + g_return_if_fail(display != NULL); set_synchronous(display, synchronous); } diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_x11.h b/gst-libs/gst/vaapi/gstvaapidisplay_x11.h index 68922232fa..5711095779 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_x11.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_x11.h @@ -31,9 +31,6 @@ G_BEGIN_DECLS #define GST_VAAPI_DISPLAY_X11(obj) \ ((GstVaapiDisplayX11 *)(obj)) -#define GST_VAAPI_IS_DISPLAY_X11(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiDisplayX11 GstVaapiDisplayX11; GstVaapiDisplay * diff --git a/gst-libs/gst/vaapi/gstvaapiimage.c b/gst-libs/gst/vaapi/gstvaapiimage.c index 3ed97c3069..72c04ff3ae 100644 --- a/gst-libs/gst/vaapi/gstvaapiimage.c +++ b/gst-libs/gst/vaapi/gstvaapiimage.c @@ -339,7 +339,7 @@ error: GstVaapiID gst_vaapi_image_get_id(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), VA_INVALID_ID); + g_return_val_if_fail(image != NULL, VA_INVALID_ID); return GST_VAAPI_OBJECT_ID(image); } @@ -356,7 +356,7 @@ gst_vaapi_image_get_id(GstVaapiImage *image) gboolean gst_vaapi_image_get_image(GstVaapiImage *image, VAImage *va_image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); if (va_image) *va_image = image->image; @@ -441,7 +441,7 @@ _gst_vaapi_image_set_image(GstVaapiImage *image, const VAImage *va_image) GstVaapiImageFormat gst_vaapi_image_get_format(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); + g_return_val_if_fail(image != NULL, 0); return image->format; } @@ -457,7 +457,7 @@ gst_vaapi_image_get_format(GstVaapiImage *image) guint gst_vaapi_image_get_width(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); + g_return_val_if_fail(image != NULL, 0); return image->width; } @@ -473,7 +473,7 @@ gst_vaapi_image_get_width(GstVaapiImage *image) guint gst_vaapi_image_get_height(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); + g_return_val_if_fail(image != NULL, 0); return image->height; } @@ -489,7 +489,7 @@ gst_vaapi_image_get_height(GstVaapiImage *image) void gst_vaapi_image_get_size(GstVaapiImage *image, guint *pwidth, guint *pheight) { - g_return_if_fail(GST_VAAPI_IS_IMAGE(image)); + g_return_if_fail(image != NULL); if (pwidth) *pwidth = image->width; @@ -511,7 +511,7 @@ gst_vaapi_image_get_size(GstVaapiImage *image, guint *pwidth, guint *pheight) gboolean gst_vaapi_image_is_linear(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); return image->is_linear; } @@ -533,7 +533,7 @@ _gst_vaapi_image_is_mapped(GstVaapiImage *image) gboolean gst_vaapi_image_is_mapped(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); return _gst_vaapi_image_is_mapped(image); } @@ -550,7 +550,7 @@ gst_vaapi_image_is_mapped(GstVaapiImage *image) gboolean gst_vaapi_image_map(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); return _gst_vaapi_image_map(image, NULL); } @@ -607,7 +607,7 @@ map_success: gboolean gst_vaapi_image_unmap(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); return _gst_vaapi_image_unmap(image); } @@ -650,7 +650,7 @@ _gst_vaapi_image_unmap(GstVaapiImage *image) guint gst_vaapi_image_get_plane_count(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); + g_return_val_if_fail(image != NULL, 0); g_return_val_if_fail(_gst_vaapi_image_is_mapped(image), 0); return image->image.num_planes; @@ -669,7 +669,7 @@ gst_vaapi_image_get_plane_count(GstVaapiImage *image) guchar * gst_vaapi_image_get_plane(GstVaapiImage *image, guint plane) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), NULL); + g_return_val_if_fail(image != NULL, NULL); g_return_val_if_fail(_gst_vaapi_image_is_mapped(image), NULL); g_return_val_if_fail(plane < image->image.num_planes, NULL); @@ -689,7 +689,7 @@ gst_vaapi_image_get_plane(GstVaapiImage *image, guint plane) guint gst_vaapi_image_get_pitch(GstVaapiImage *image, guint plane) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); + g_return_val_if_fail(image != NULL, 0); g_return_val_if_fail(_gst_vaapi_image_is_mapped(image), 0); g_return_val_if_fail(plane < image->image.num_planes, 0); @@ -709,7 +709,7 @@ gst_vaapi_image_get_pitch(GstVaapiImage *image, guint plane) guint gst_vaapi_image_get_data_size(GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); + g_return_val_if_fail(image != NULL, 0); return image->image.data_size; } @@ -979,7 +979,7 @@ gst_vaapi_image_get_buffer( GstVaapiImageRaw dst_image, src_image; gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); g_return_val_if_fail(GST_IS_BUFFER(buffer), FALSE); if (!init_image_from_buffer(&dst_image, buffer)) @@ -1022,7 +1022,7 @@ gst_vaapi_image_get_raw( GstVaapiImageRaw src_image; gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); if (!_gst_vaapi_image_map(image, &src_image)) return FALSE; @@ -1057,7 +1057,7 @@ gst_vaapi_image_update_from_buffer( GstVaapiImageRaw dst_image, src_image; gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); g_return_val_if_fail(GST_IS_BUFFER(buffer), FALSE); if (!init_image_from_buffer(&src_image, buffer)) @@ -1101,7 +1101,7 @@ gst_vaapi_image_update_from_raw( GstVaapiImageRaw dst_image; gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(image != NULL, FALSE); if (!_gst_vaapi_image_map(image, &dst_image)) return FALSE; diff --git a/gst-libs/gst/vaapi/gstvaapiimage.h b/gst-libs/gst/vaapi/gstvaapiimage.h index 8b9abf51d9..9def1003da 100644 --- a/gst-libs/gst/vaapi/gstvaapiimage.h +++ b/gst-libs/gst/vaapi/gstvaapiimage.h @@ -33,9 +33,6 @@ G_BEGIN_DECLS #define GST_VAAPI_IMAGE(obj) \ ((GstVaapiImage *)(obj)) -#define GST_VAAPI_IS_IMAGE(obj) \ - ((obj) != NULL) - /** * GST_VAAPI_IMAGE_FORMAT: * @image: a #GstVaapiImage diff --git a/gst-libs/gst/vaapi/gstvaapiimagepool.c b/gst-libs/gst/vaapi/gstvaapiimagepool.c index 311f9f0bec..7f262e972d 100644 --- a/gst-libs/gst/vaapi/gstvaapiimagepool.c +++ b/gst-libs/gst/vaapi/gstvaapiimagepool.c @@ -97,7 +97,7 @@ gst_vaapi_image_pool_new(GstVaapiDisplay *display, GstCaps *caps) { GstVaapiVideoPool *pool; - 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); pool = (GstVaapiVideoPool *) diff --git a/gst-libs/gst/vaapi/gstvaapiimagepool.h b/gst-libs/gst/vaapi/gstvaapiimagepool.h index a56a18a21e..801cdaedd3 100644 --- a/gst-libs/gst/vaapi/gstvaapiimagepool.h +++ b/gst-libs/gst/vaapi/gstvaapiimagepool.h @@ -31,9 +31,6 @@ G_BEGIN_DECLS #define GST_VAAPI_IMAGE_POOL(obj) \ ((GstVaapiImagePool *)(obj)) -#define GST_VAAPI_IS_IMAGE_POOL(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiImagePool GstVaapiImagePool; GstVaapiVideoPool * diff --git a/gst-libs/gst/vaapi/gstvaapiobject.c b/gst-libs/gst/vaapi/gstvaapiobject.c index b270edaf8a..2be82ceb05 100644 --- a/gst-libs/gst/vaapi/gstvaapiobject.c +++ b/gst-libs/gst/vaapi/gstvaapiobject.c @@ -83,7 +83,7 @@ gst_vaapi_object_new(const GstVaapiObjectClass *klass, GstVaapiDisplay *display) GstVaapiObject *object; guint sub_size; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); + g_return_val_if_fail(display != NULL, NULL); object = (GstVaapiObject *)gst_vaapi_mini_object_new(object_class); if (!object) @@ -151,7 +151,7 @@ gst_vaapi_object_replace(gpointer old_object_ptr, gpointer new_object) GstVaapiDisplay * gst_vaapi_object_get_display(GstVaapiObject *object) { - g_return_val_if_fail(GST_VAAPI_IS_OBJECT(object), NULL); + g_return_val_if_fail(object != NULL, NULL); return GST_VAAPI_OBJECT_DISPLAY(object); } @@ -167,7 +167,7 @@ gst_vaapi_object_get_display(GstVaapiObject *object) void gst_vaapi_object_lock_display(GstVaapiObject *object) { - g_return_if_fail(GST_VAAPI_IS_OBJECT(object)); + g_return_if_fail(object != NULL); GST_VAAPI_OBJECT_LOCK_DISPLAY(object); } @@ -183,7 +183,7 @@ gst_vaapi_object_lock_display(GstVaapiObject *object) void gst_vaapi_object_unlock_display(GstVaapiObject *object) { - g_return_if_fail(GST_VAAPI_IS_OBJECT(object)); + g_return_if_fail(object != NULL); GST_VAAPI_OBJECT_UNLOCK_DISPLAY(object); } @@ -199,7 +199,7 @@ gst_vaapi_object_unlock_display(GstVaapiObject *object) GstVaapiID gst_vaapi_object_get_id(GstVaapiObject *object) { - g_return_val_if_fail(GST_VAAPI_IS_OBJECT(object), 0); + g_return_val_if_fail(object != NULL, 0); return GST_VAAPI_OBJECT_ID(object); } diff --git a/gst-libs/gst/vaapi/gstvaapiobject.h b/gst-libs/gst/vaapi/gstvaapiobject.h index cdc59d4fad..081b2c6751 100644 --- a/gst-libs/gst/vaapi/gstvaapiobject.h +++ b/gst-libs/gst/vaapi/gstvaapiobject.h @@ -31,9 +31,6 @@ G_BEGIN_DECLS #define GST_VAAPI_OBJECT(obj) \ ((GstVaapiObject *)(obj)) -#define GST_VAAPI_IS_OBJECT(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiObject GstVaapiObject; gpointer diff --git a/gst-libs/gst/vaapi/gstvaapisubpicture.c b/gst-libs/gst/vaapi/gstvaapisubpicture.c index eb510265de..9e2566aee6 100644 --- a/gst-libs/gst/vaapi/gstvaapisubpicture.c +++ b/gst-libs/gst/vaapi/gstvaapisubpicture.c @@ -135,7 +135,7 @@ gst_vaapi_subpicture_new(GstVaapiImage *image, guint flags) GstVaapiImageFormat format; guint va_flags; - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), NULL); + g_return_val_if_fail(image != NULL, NULL); GST_DEBUG("create from image %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(GST_VAAPI_OBJECT_ID(image))); @@ -273,7 +273,7 @@ gst_vaapi_subpicture_new_from_overlay_rectangle( GstVaapiID gst_vaapi_subpicture_get_id(GstVaapiSubpicture *subpicture) { - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), VA_INVALID_ID); + g_return_val_if_fail(subpicture != NULL, VA_INVALID_ID); return GST_VAAPI_OBJECT_ID(subpicture); } @@ -289,7 +289,7 @@ gst_vaapi_subpicture_get_id(GstVaapiSubpicture *subpicture) guint gst_vaapi_subpicture_get_flags(GstVaapiSubpicture *subpicture) { - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), 0); + g_return_val_if_fail(subpicture != NULL, 0); return subpicture->flags; } @@ -305,7 +305,7 @@ gst_vaapi_subpicture_get_flags(GstVaapiSubpicture *subpicture) GstVaapiImage * gst_vaapi_subpicture_get_image(GstVaapiSubpicture *subpicture) { - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), NULL); + g_return_val_if_fail(subpicture != NULL, NULL); return subpicture->image; } @@ -324,8 +324,8 @@ gboolean gst_vaapi_subpicture_set_image(GstVaapiSubpicture *subpicture, GstVaapiImage *image) { - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(subpicture != NULL, FALSE); + g_return_val_if_fail(image != NULL, FALSE); gst_vaapi_subpicture_destroy(subpicture); return gst_vaapi_subpicture_create(subpicture, image); @@ -342,7 +342,7 @@ gst_vaapi_subpicture_set_image(GstVaapiSubpicture *subpicture, gfloat gst_vaapi_subpicture_get_global_alpha(GstVaapiSubpicture *subpicture) { - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), 1.0); + g_return_val_if_fail(subpicture != NULL, 1.0); return subpicture->global_alpha; } @@ -365,7 +365,7 @@ gst_vaapi_subpicture_set_global_alpha(GstVaapiSubpicture *subpicture, GstVaapiDisplay *display; VAStatus status; - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), FALSE); + g_return_val_if_fail(subpicture != NULL, FALSE); if (!(subpicture->flags & GST_VAAPI_SUBPICTURE_FLAG_GLOBAL_ALPHA)) return FALSE; diff --git a/gst-libs/gst/vaapi/gstvaapisubpicture.h b/gst-libs/gst/vaapi/gstvaapisubpicture.h index c7fb05311a..9a15efdf95 100644 --- a/gst-libs/gst/vaapi/gstvaapisubpicture.h +++ b/gst-libs/gst/vaapi/gstvaapisubpicture.h @@ -33,9 +33,6 @@ G_BEGIN_DECLS #define GST_VAAPI_SUBPICTURE(obj) \ ((GstVaapiSubpicture *)(obj)) -#define GST_VAAPI_IS_SUBPICTURE(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiSubpicture GstVaapiSubpicture; /** diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 1c5992808a..1cfcec245c 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -218,7 +218,7 @@ error: GstVaapiID gst_vaapi_surface_get_id(GstVaapiSurface *surface) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), VA_INVALID_SURFACE); + g_return_val_if_fail(surface != NULL, VA_INVALID_SURFACE); return GST_VAAPI_OBJECT_ID(surface); } @@ -234,7 +234,7 @@ gst_vaapi_surface_get_id(GstVaapiSurface *surface) GstVaapiChromaType gst_vaapi_surface_get_chroma_type(GstVaapiSurface *surface) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), 0); + g_return_val_if_fail(surface != NULL, 0); return surface->chroma_type; } @@ -250,7 +250,7 @@ gst_vaapi_surface_get_chroma_type(GstVaapiSurface *surface) guint gst_vaapi_surface_get_width(GstVaapiSurface *surface) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), 0); + g_return_val_if_fail(surface != NULL, 0); return surface->width; } @@ -266,7 +266,7 @@ gst_vaapi_surface_get_width(GstVaapiSurface *surface) guint gst_vaapi_surface_get_height(GstVaapiSurface *surface) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), 0); + g_return_val_if_fail(surface != NULL, 0); return surface->height; } @@ -286,7 +286,7 @@ gst_vaapi_surface_get_size( guint *pheight ) { - g_return_if_fail(GST_VAAPI_IS_SURFACE(surface)); + g_return_if_fail(surface != NULL); if (pwidth) *pwidth = gst_vaapi_surface_get_width(surface); @@ -310,7 +310,7 @@ gst_vaapi_surface_set_parent_context( GstVaapiContext *context ) { - g_return_if_fail(GST_VAAPI_IS_SURFACE(surface)); + g_return_if_fail(surface != NULL); gst_vaapi_object_replace(&surface->parent_context, context); } @@ -328,7 +328,7 @@ gst_vaapi_surface_set_parent_context( GstVaapiContext * gst_vaapi_surface_get_parent_context(GstVaapiSurface *surface) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), NULL); + g_return_val_if_fail(surface != NULL, NULL); return surface->parent_context; } @@ -364,7 +364,7 @@ gst_vaapi_surface_derive_image(GstVaapiSurface *surface) VAImage va_image; VAStatus status; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), NULL); + g_return_val_if_fail(surface != NULL, NULL); display = GST_VAAPI_OBJECT_DISPLAY(surface); va_image.image_id = VA_INVALID_ID; @@ -403,8 +403,8 @@ gst_vaapi_surface_get_image(GstVaapiSurface *surface, GstVaapiImage *image) VAStatus status; guint width, height; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); + g_return_val_if_fail(image != NULL, FALSE); display = GST_VAAPI_OBJECT_DISPLAY(surface); if (!display) @@ -450,8 +450,8 @@ gst_vaapi_surface_put_image(GstVaapiSurface *surface, GstVaapiImage *image) VAStatus status; guint width, height; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); + g_return_val_if_fail(image != NULL, FALSE); display = GST_VAAPI_OBJECT_DISPLAY(surface); if (!display) @@ -508,8 +508,8 @@ gst_vaapi_surface_associate_subpicture( { gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); + g_return_val_if_fail(subpicture != NULL, FALSE); if (!surface->subpictures) { surface->subpictures = g_ptr_array_new(); @@ -615,8 +615,8 @@ gst_vaapi_surface_deassociate_subpicture( { gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); + g_return_val_if_fail(subpicture != NULL, FALSE); if (!surface->subpictures) return TRUE; @@ -681,7 +681,7 @@ gst_vaapi_surface_sync(GstVaapiSurface *surface) GstVaapiDisplay *display; VAStatus status; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); display = GST_VAAPI_OBJECT_DISPLAY(surface); if (!display) @@ -718,7 +718,7 @@ gst_vaapi_surface_query_status( VASurfaceStatus surface_status; VAStatus status; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); GST_VAAPI_OBJECT_LOCK_DISPLAY(surface); status = vaQuerySurfaceStatus( @@ -758,7 +758,7 @@ gst_vaapi_surface_set_subpictures_from_composition( GstVaapiDisplay *display; guint n, nb_rectangles; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); if (propagate_context && surface->parent_context) return gst_vaapi_context_apply_composition(surface->parent_context, diff --git a/gst-libs/gst/vaapi/gstvaapisurface.h b/gst-libs/gst/vaapi/gstvaapisurface.h index 0d36fe9892..15f8b7da3e 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.h +++ b/gst-libs/gst/vaapi/gstvaapisurface.h @@ -115,9 +115,6 @@ typedef enum { #define GST_VAAPI_SURFACE(obj) \ ((GstVaapiSurface *)(obj)) -#define GST_VAAPI_IS_SURFACE(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiSurface GstVaapiSurface; typedef struct _GstVaapiSurfaceProxy GstVaapiSurfaceProxy; diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.c b/gst-libs/gst/vaapi/gstvaapisurfacepool.c index d57fb849a2..d39588d289 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfacepool.c +++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.c @@ -97,7 +97,7 @@ gst_vaapi_surface_pool_new(GstVaapiDisplay *display, GstCaps *caps) { GstVaapiVideoPool *pool; - 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); pool = (GstVaapiVideoPool *) diff --git a/gst-libs/gst/vaapi/gstvaapisurfacepool.h b/gst-libs/gst/vaapi/gstvaapisurfacepool.h index 635af47dc9..48ea71edc7 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfacepool.h +++ b/gst-libs/gst/vaapi/gstvaapisurfacepool.h @@ -31,9 +31,6 @@ G_BEGIN_DECLS #define GST_VAAPI_SURFACE_POOL(obj) \ ((GstVaapiSurfacePool *)(obj)) -#define GST_VAAPI_IS_SURFACE_POOL(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiSurfacePool GstVaapiSurfacePool; GstVaapiVideoPool * diff --git a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c index 7242e9548a..a2cd002fc3 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c +++ b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c @@ -63,7 +63,7 @@ gst_vaapi_surface_proxy_new_from_pool(GstVaapiSurfacePool *pool) { GstVaapiSurfaceProxy *proxy; - g_return_val_if_fail(GST_VAAPI_IS_SURFACE_POOL(pool), NULL); + g_return_val_if_fail(pool != NULL, NULL); proxy = (GstVaapiSurfaceProxy *) gst_vaapi_mini_object_new(gst_vaapi_surface_proxy_class()); @@ -96,7 +96,7 @@ error: GstVaapiSurfaceProxy * gst_vaapi_surface_proxy_ref(GstVaapiSurfaceProxy *proxy) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL); + g_return_val_if_fail(proxy != NULL, NULL); return GST_VAAPI_SURFACE_PROXY(gst_vaapi_mini_object_ref( GST_VAAPI_MINI_OBJECT(proxy))); @@ -112,7 +112,7 @@ gst_vaapi_surface_proxy_ref(GstVaapiSurfaceProxy *proxy) void gst_vaapi_surface_proxy_unref(GstVaapiSurfaceProxy *proxy) { - g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy)); + g_return_if_fail(proxy != NULL); gst_vaapi_mini_object_unref(GST_VAAPI_MINI_OBJECT(proxy)); } @@ -147,7 +147,7 @@ gst_vaapi_surface_proxy_replace(GstVaapiSurfaceProxy **old_proxy_ptr, GstVaapiSurface * gst_vaapi_surface_proxy_get_surface(GstVaapiSurfaceProxy *proxy) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL); + g_return_val_if_fail(proxy != NULL, NULL); return GST_VAAPI_SURFACE_PROXY_SURFACE(proxy); } @@ -164,7 +164,7 @@ gst_vaapi_surface_proxy_get_surface(GstVaapiSurfaceProxy *proxy) guint gst_vaapi_surface_proxy_get_flags(GstVaapiSurfaceProxy *proxy) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), 0); + g_return_val_if_fail(proxy != NULL, 0); return GST_VAAPI_SURFACE_PROXY_FLAGS(proxy); } @@ -180,7 +180,7 @@ gst_vaapi_surface_proxy_get_flags(GstVaapiSurfaceProxy *proxy) GstVaapiID gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), 0); + g_return_val_if_fail(proxy != NULL, 0); g_return_val_if_fail(proxy->surface != NULL, 0); return GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy); @@ -197,7 +197,7 @@ gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy) GstClockTime gst_vaapi_surface_proxy_get_timestamp(GstVaapiSurfaceProxy *proxy) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), 0); + g_return_val_if_fail(proxy != NULL, 0); return GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy); } @@ -213,7 +213,7 @@ gst_vaapi_surface_proxy_get_timestamp(GstVaapiSurfaceProxy *proxy) GstClockTime gst_vaapi_surface_proxy_get_duration(GstVaapiSurfaceProxy *proxy) { - g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), 0); + g_return_val_if_fail(proxy != NULL, 0); return GST_VAAPI_SURFACE_PROXY_DURATION(proxy); } @@ -233,7 +233,7 @@ void gst_vaapi_surface_proxy_set_destroy_notify(GstVaapiSurfaceProxy *proxy, GDestroyNotify destroy_func, gpointer user_data) { - g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy)); + g_return_if_fail(proxy != NULL); proxy->destroy_func = destroy_func; proxy->destroy_data = user_data; diff --git a/gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h b/gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h index 7df307fd04..d3fbcbc3ed 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h +++ b/gst-libs/gst/vaapi/gstvaapisurfaceproxy_priv.h @@ -31,9 +31,6 @@ #define GST_VAAPI_SURFACE_PROXY(obj) \ ((GstVaapiSurfaceProxy *)(obj)) -#define GST_VAAPI_IS_SURFACE_PROXY(obj) \ - (GST_VAAPI_SURFACE_PROXY(obj) != NULL) - struct _GstVaapiSurfaceProxy { /*< private >*/ GstVaapiMiniObject parent_instance; diff --git a/gst-libs/gst/vaapi/gstvaapitexture.c b/gst-libs/gst/vaapi/gstvaapitexture.c index 13696cdf7f..ae54ec33f2 100644 --- a/gst-libs/gst/vaapi/gstvaapitexture.c +++ b/gst-libs/gst/vaapi/gstvaapitexture.c @@ -245,7 +245,7 @@ gst_vaapi_texture_new( { GstVaapiTexture *texture; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); + g_return_val_if_fail(display != NULL, NULL); g_return_val_if_fail(target != GL_NONE, NULL); g_return_val_if_fail(format != GL_NONE, NULL); g_return_val_if_fail(width > 0, NULL); @@ -297,7 +297,7 @@ gst_vaapi_texture_new_with_texture( GLTextureState ts; gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL); + g_return_val_if_fail(display != NULL, NULL); g_return_val_if_fail(target != GL_NONE, NULL); g_return_val_if_fail(format != GL_NONE, NULL); @@ -598,7 +598,7 @@ gst_vaapi_texture_put_surface( ) { g_return_val_if_fail(texture != NULL, FALSE); - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); + g_return_val_if_fail(surface != NULL, FALSE); return _gst_vaapi_texture_put_surface(texture, surface, flags); } diff --git a/gst-libs/gst/vaapi/gstvaapivideopool.c b/gst-libs/gst/vaapi/gstvaapivideopool.c index 1f86ead599..360c9ed304 100644 --- a/gst-libs/gst/vaapi/gstvaapivideopool.c +++ b/gst-libs/gst/vaapi/gstvaapivideopool.c @@ -127,7 +127,7 @@ gst_vaapi_video_pool_replace(GstVaapiVideoPool **old_pool_ptr, GstVaapiDisplay * gst_vaapi_video_pool_get_display(GstVaapiVideoPool *pool) { - g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), NULL); + g_return_val_if_fail(pool != NULL, NULL); return pool->display; } @@ -148,7 +148,7 @@ gst_vaapi_video_pool_get_object(GstVaapiVideoPool *pool) { gpointer object; - g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), NULL); + g_return_val_if_fail(pool != NULL, NULL); if (pool->capacity && pool->used_count >= pool->capacity) return NULL; @@ -180,8 +180,8 @@ gst_vaapi_video_pool_put_object(GstVaapiVideoPool *pool, gpointer object) { GList *elem; - g_return_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool)); - g_return_if_fail(GST_VAAPI_IS_OBJECT(object)); + g_return_if_fail(pool != NULL); + g_return_if_fail(object != NULL); elem = g_list_find(pool->used_objects, object); if (!elem) @@ -207,8 +207,8 @@ gst_vaapi_video_pool_put_object(GstVaapiVideoPool *pool, gpointer object) gboolean gst_vaapi_video_pool_add_object(GstVaapiVideoPool *pool, gpointer object) { - g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_OBJECT(object), FALSE); + g_return_val_if_fail(pool != NULL, FALSE); + g_return_val_if_fail(object != NULL, FALSE); g_queue_push_tail(&pool->free_objects, gst_vaapi_object_ref(object)); return TRUE; @@ -230,7 +230,7 @@ gst_vaapi_video_pool_add_objects(GstVaapiVideoPool *pool, GPtrArray *objects) { guint i; - g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), FALSE); + g_return_val_if_fail(pool != NULL, FALSE); for (i = 0; i < objects->len; i++) { gpointer const object = g_ptr_array_index(objects, i); @@ -251,7 +251,7 @@ gst_vaapi_video_pool_add_objects(GstVaapiVideoPool *pool, GPtrArray *objects) guint gst_vaapi_video_pool_get_size(GstVaapiVideoPool *pool) { - g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), 0); + g_return_val_if_fail(pool != NULL, 0); return g_queue_get_length(&pool->free_objects); } @@ -273,7 +273,7 @@ gst_vaapi_video_pool_reserve(GstVaapiVideoPool *pool, guint n) { guint i, num_allocated; - g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), 0); + g_return_val_if_fail(pool != NULL, 0); num_allocated = gst_vaapi_video_pool_get_size(pool) + pool->used_count; if (n < num_allocated) @@ -303,7 +303,7 @@ gst_vaapi_video_pool_reserve(GstVaapiVideoPool *pool, guint n) guint gst_vaapi_video_pool_get_capacity(GstVaapiVideoPool *pool) { - g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), 0); + g_return_val_if_fail(pool != NULL, 0); return pool->capacity; } @@ -318,7 +318,7 @@ gst_vaapi_video_pool_get_capacity(GstVaapiVideoPool *pool) void gst_vaapi_video_pool_set_capacity(GstVaapiVideoPool *pool, guint capacity) { - g_return_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool)); + g_return_if_fail(pool != NULL); pool->capacity = capacity; } diff --git a/gst-libs/gst/vaapi/gstvaapivideopool.h b/gst-libs/gst/vaapi/gstvaapivideopool.h index 44dbf20082..2f13277532 100644 --- a/gst-libs/gst/vaapi/gstvaapivideopool.h +++ b/gst-libs/gst/vaapi/gstvaapivideopool.h @@ -32,9 +32,6 @@ G_BEGIN_DECLS #define GST_VAAPI_VIDEO_POOL(obj) \ ((GstVaapiVideoPool *)(obj)) -#define GST_VAAPI_IS_VIDEO_POOL(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiVideoPool GstVaapiVideoPool; GstVaapiVideoPool * diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.c b/gst-libs/gst/vaapi/gstvaapiwindow.c index 2031c89b4b..5215ef34cc 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow.c @@ -175,7 +175,7 @@ gst_vaapi_window_replace(GstVaapiWindow **old_window_ptr, GstVaapiDisplay * gst_vaapi_window_get_display(GstVaapiWindow *window) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW(window), NULL); + g_return_val_if_fail(window != NULL, NULL); return GST_VAAPI_OBJECT_DISPLAY(window); } @@ -190,7 +190,7 @@ gst_vaapi_window_get_display(GstVaapiWindow *window) void gst_vaapi_window_show(GstVaapiWindow *window) { - g_return_if_fail(GST_VAAPI_IS_WINDOW(window)); + g_return_if_fail(window != NULL); GST_VAAPI_WINDOW_GET_CLASS(window)->show(window); window->check_geometry = TRUE; @@ -206,7 +206,7 @@ gst_vaapi_window_show(GstVaapiWindow *window) void gst_vaapi_window_hide(GstVaapiWindow *window) { - g_return_if_fail(GST_VAAPI_IS_WINDOW(window)); + g_return_if_fail(window != NULL); GST_VAAPI_WINDOW_GET_CLASS(window)->hide(window); } @@ -222,7 +222,7 @@ gst_vaapi_window_hide(GstVaapiWindow *window) gboolean gst_vaapi_window_get_fullscreen(GstVaapiWindow *window) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW(window), FALSE); + g_return_val_if_fail(window != NULL, FALSE); gst_vaapi_window_ensure_size(window); @@ -241,7 +241,7 @@ gst_vaapi_window_set_fullscreen(GstVaapiWindow *window, gboolean fullscreen) { const GstVaapiWindowClass *klass; - g_return_if_fail(GST_VAAPI_IS_WINDOW(window)); + g_return_if_fail(window != NULL); klass = GST_VAAPI_WINDOW_GET_CLASS(window); @@ -263,7 +263,7 @@ gst_vaapi_window_set_fullscreen(GstVaapiWindow *window, gboolean fullscreen) guint gst_vaapi_window_get_width(GstVaapiWindow *window) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW(window), 0); + g_return_val_if_fail(window != NULL, 0); gst_vaapi_window_ensure_size(window); @@ -281,7 +281,7 @@ gst_vaapi_window_get_width(GstVaapiWindow *window) guint gst_vaapi_window_get_height(GstVaapiWindow *window) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW(window), 0); + g_return_val_if_fail(window != NULL, 0); gst_vaapi_window_ensure_size(window); @@ -299,7 +299,7 @@ gst_vaapi_window_get_height(GstVaapiWindow *window) void gst_vaapi_window_get_size(GstVaapiWindow *window, guint *pwidth, guint *pheight) { - g_return_if_fail(GST_VAAPI_IS_WINDOW(window)); + g_return_if_fail(window != NULL); gst_vaapi_window_ensure_size(window); @@ -320,7 +320,7 @@ gst_vaapi_window_get_size(GstVaapiWindow *window, guint *pwidth, guint *pheight) void gst_vaapi_window_set_width(GstVaapiWindow *window, guint width) { - g_return_if_fail(GST_VAAPI_IS_WINDOW(window)); + g_return_if_fail(window != NULL); gst_vaapi_window_set_size(window, width, window->height); } @@ -335,7 +335,7 @@ gst_vaapi_window_set_width(GstVaapiWindow *window, guint width) void gst_vaapi_window_set_height(GstVaapiWindow *window, guint height) { - g_return_if_fail(GST_VAAPI_IS_WINDOW(window)); + g_return_if_fail(window != NULL); gst_vaapi_window_set_size(window, window->width, height); } @@ -351,7 +351,7 @@ gst_vaapi_window_set_height(GstVaapiWindow *window, guint height) void gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height) { - g_return_if_fail(GST_VAAPI_IS_WINDOW(window)); + g_return_if_fail(window != NULL); if (width == window->width && height == window->height) return; @@ -417,8 +417,8 @@ gst_vaapi_window_put_surface( const GstVaapiWindowClass *klass; GstVaapiRectangle src_rect_default, dst_rect_default; - g_return_val_if_fail(GST_VAAPI_IS_WINDOW(window), FALSE); - g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); + g_return_val_if_fail(window != NULL, FALSE); + g_return_val_if_fail(surface != NULL, FALSE); klass = GST_VAAPI_WINDOW_GET_CLASS(window); if (!klass->render) diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.h b/gst-libs/gst/vaapi/gstvaapiwindow.h index 24c806f978..13359d74d4 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow.h @@ -34,9 +34,6 @@ G_BEGIN_DECLS #define GST_VAAPI_WINDOW(obj) \ ((GstVaapiWindow *)(obj)) -#define GST_VAAPI_IS_WINDOW(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiWindow GstVaapiWindow; typedef struct _GstVaapiWindowClass GstVaapiWindowClass; diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_drm.h b/gst-libs/gst/vaapi/gstvaapiwindow_drm.h index 563e6acc17..fc155b89da 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_drm.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow_drm.h @@ -30,9 +30,6 @@ G_BEGIN_DECLS #define GST_VAAPI_WINDOW_DRM(obj) \ ((GstVaapiWindowDRM *)(obj)) -#define GST_VAAPI_IS_WINDOW_DRM(obj) \ - ((obj) != NULL) - typedef struct _GstVaapiWindowDRM GstVaapiWindowDRM; GstVaapiWindow * diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c index 0e9430b6d5..3802a32833 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c @@ -39,9 +39,6 @@ #define GST_VAAPI_WINDOW_GLX_GET_PRIVATE(window) \ (&GST_VAAPI_WINDOW_GLX(window)->priv) -#define GST_VAAPI_IS_WINDOW_GLX(obj) \ - ((obj) != NULL) - #define GST_VAAPI_WINDOW_GLX_CLASS(klass) \ ((GstVaapiWindowGLXClass *)(klass)) @@ -403,7 +400,7 @@ gst_vaapi_window_glx_new_with_xid(GstVaapiDisplay *display, Window xid) GLXContext gst_vaapi_window_glx_get_context(GstVaapiWindowGLX *window) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW_GLX(window), NULL); + g_return_val_if_fail(window != NULL, NULL); return GST_VAAPI_WINDOW_GLX_GET_PRIVATE(window)->gl_context->context; } @@ -423,7 +420,7 @@ gst_vaapi_window_glx_get_context(GstVaapiWindowGLX *window) gboolean gst_vaapi_window_glx_set_context(GstVaapiWindowGLX *window, GLXContext ctx) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW_GLX(window), FALSE); + g_return_val_if_fail(window != NULL, FALSE); return gst_vaapi_window_glx_ensure_context(GST_VAAPI_WINDOW(window), ctx); } @@ -443,7 +440,7 @@ gst_vaapi_window_glx_make_current(GstVaapiWindowGLX *window) { gboolean success; - g_return_val_if_fail(GST_VAAPI_IS_WINDOW_GLX(window), FALSE); + g_return_val_if_fail(window != NULL, FALSE); GST_VAAPI_OBJECT_LOCK_DISPLAY(window); success = gl_set_current_context(window->priv.gl_context, NULL); @@ -462,7 +459,7 @@ gst_vaapi_window_glx_make_current(GstVaapiWindowGLX *window) void gst_vaapi_window_glx_swap_buffers(GstVaapiWindowGLX *window) { - g_return_if_fail(GST_VAAPI_IS_WINDOW_GLX(window)); + g_return_if_fail(window != NULL); GST_VAAPI_OBJECT_LOCK_DISPLAY(window); gl_swap_buffers(window->priv.gl_context); @@ -501,7 +498,7 @@ gst_vaapi_window_glx_put_texture( guint tex_width, tex_height; guint win_width, win_height; - g_return_val_if_fail(GST_VAAPI_IS_WINDOW_GLX(window), FALSE); + g_return_val_if_fail(window != NULL, FALSE); g_return_val_if_fail(texture != NULL, FALSE); gst_vaapi_texture_get_size(texture, &tex_width, &tex_height); diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c index a04d12dc36..d30bf09da3 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c @@ -519,7 +519,7 @@ gst_vaapi_window_x11_new_with_xid(GstVaapiDisplay *display, Window xid) Window gst_vaapi_window_x11_get_xid(GstVaapiWindowX11 *window) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW_X11(window), None); + g_return_val_if_fail(window != NULL, None); return GST_VAAPI_OBJECT_ID(window); } @@ -536,7 +536,7 @@ gst_vaapi_window_x11_get_xid(GstVaapiWindowX11 *window) gboolean gst_vaapi_window_x11_is_foreign_xid(GstVaapiWindowX11 *window) { - g_return_val_if_fail(GST_VAAPI_IS_WINDOW_X11(window), FALSE); + g_return_val_if_fail(window != NULL, FALSE); return GST_VAAPI_WINDOW(window)->use_foreign_window; } diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11.h b/gst-libs/gst/vaapi/gstvaapiwindow_x11.h index 507dd9bb8f..57c514347a 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11.h @@ -32,9 +32,6 @@ G_BEGIN_DECLS #define GST_VAAPI_WINDOW_X11(obj) \ ((GstVaapiWindowX11 *)(obj)) -#define GST_VAAPI_IS_WINDOW_X11(obj) \ - ((obj) != NULL) - /** * GST_VAAPI_WINDOW_XWINDOW: * @window: a #GstVaapiWindow