Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally

Since we started depending on GLib 2.44, we can be sure this macro is
defined (it will be a no-op on compilers that don't support it). For
plugins we should just start using `G_DECLARE_FINAL_TYPE` which means we
no longer need the macro there, but for most types in base/gst-libs we
don't want to break ABI, which means it's better to just keep it like it
is (and use the `#ifdef` instead).
This commit is contained in:
Niels De Graef 2019-06-04 09:01:47 +02:00 committed by Nicolas Dufresne
parent ac5d0f7da6
commit 93daa1435a
39 changed files with 0 additions and 132 deletions

View file

@ -114,9 +114,7 @@ GST_ALLOCATORS_API
gboolean gst_is_dmabuf_memory (GstMemory * mem);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDmaBufAllocator, gst_object_unref)
#endif
G_END_DECLS
#endif /* __GST_DMABUF_H__ */

View file

@ -93,9 +93,7 @@ gboolean gst_is_fd_memory (GstMemory *mem);
GST_ALLOCATORS_API
gint gst_fd_memory_get_fd (GstMemory *mem);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstFdAllocator, gst_object_unref)
#endif
G_END_DECLS

View file

@ -162,9 +162,7 @@ void gst_app_sink_set_callbacks (GstAppSink * appsink,
gpointer user_data,
GDestroyNotify notify);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAppSink, gst_object_unref)
#endif
G_END_DECLS

View file

@ -184,9 +184,7 @@ void gst_app_src_set_callbacks (GstAppSrc * appsrc,
gpointer user_data,
GDestroyNotify notify);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAppSrc, gst_object_unref)
#endif
G_END_DECLS

View file

@ -145,9 +145,7 @@ GST_AUDIO_API
gboolean gst_audio_info_is_equal (const GstAudioInfo *info,
const GstAudioInfo *other);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioInfo, gst_audio_info_free)
#endif
G_END_DECLS

View file

@ -270,9 +270,7 @@ gst_audio_base_sink_set_custom_slaving_callback (GstAudioBaseSink * sink,
GST_AUDIO_API
void gst_audio_base_sink_report_device_failure (GstAudioBaseSink * sink);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioBaseSink, gst_object_unref)
#endif
G_END_DECLS

View file

@ -153,9 +153,7 @@ GstAudioBaseSrcSlaveMethod
gst_audio_base_src_get_slave_method (GstAudioBaseSrc *src);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioBaseSrc, gst_object_unref)
#endif
G_END_DECLS

View file

@ -138,9 +138,7 @@ GST_AUDIO_API
gboolean gst_audio_cd_src_add_track (GstAudioCdSrc * src,
GstAudioCdSrcTrack * track);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioCdSrc, gst_object_unref)
#endif
G_END_DECLS

View file

@ -108,9 +108,7 @@ GstClockTime gst_audio_clock_adjust (GstAudioClock * clock, GstClock
GST_AUDIO_API
void gst_audio_clock_invalidate (GstAudioClock * clock);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioClock, gst_object_unref)
#endif
G_END_DECLS

View file

@ -442,9 +442,7 @@ GST_AUDIO_API
void gst_audio_decoder_set_use_default_pad_acceptcaps (GstAudioDecoder * decoder,
gboolean use);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioDecoder, gst_object_unref)
#endif
G_END_DECLS

View file

@ -371,9 +371,7 @@ GST_AUDIO_API
void gst_audio_encoder_merge_tags (GstAudioEncoder * enc,
const GstTagList * tags, GstTagMergeMode mode);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioEncoder, gst_object_unref)
#endif
G_END_DECLS

View file

@ -99,9 +99,7 @@ GST_AUDIO_API
void gst_audio_filter_class_add_pad_templates (GstAudioFilterClass * klass,
GstCaps * allowed_caps);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioFilter, gst_object_unref)
#endif
G_END_DECLS

View file

@ -404,9 +404,7 @@ void gst_audio_ring_buffer_advance (GstAudioRingBuffer *buf,
GST_AUDIO_API
void gst_audio_ring_buffer_may_start (GstAudioRingBuffer *buf, gboolean allowed);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioRingBuffer, gst_object_unref)
#endif
G_END_DECLS

View file

@ -100,9 +100,7 @@ struct _GstAudioSinkClass {
GST_AUDIO_API
GType gst_audio_sink_get_type(void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioSink, gst_object_unref)
#endif
G_END_DECLS

View file

@ -99,9 +99,7 @@ struct _GstAudioSrcClass {
GST_AUDIO_API
GType gst_audio_src_get_type(void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioSrc, gst_object_unref)
#endif
G_END_DECLS

View file

@ -38,9 +38,7 @@ G_GNUC_INTERNAL GType gst_gl_context_egl_get_type (void);
#define GST_IS_GL_CONTEXT_EGL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_GL_CONTEXT_EGL))
#define GST_GL_CONTEXT_EGL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGLClass))
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLContextEGL, gst_object_unref)
#endif
/**

View file

@ -108,69 +108,37 @@ typedef struct _GstGLAsyncDebug GstGLAsyncDebug;
#include <gst/gl/gstgl_enums.h>
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLBaseFilter, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLBaseMemoryAllocator, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLBufferAllocator, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLBufferPool, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLColorConvert, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLContext, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLDisplay, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLFilter, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLMemoryAllocator, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLMemoryPBOAllocator, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLOverlayCompositor, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLSLStage, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLShader, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLUpload, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLViewConvert, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLWindow, gst_object_unref)
#endif
G_END_DECLS

View file

@ -112,9 +112,7 @@ gboolean gst_gl_framebuffer_draw_to_texture (GstGLFrameb
GstGLFramebufferFunc func,
gpointer user_data);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLFramebuffer, gst_object_unref)
#endif
G_END_DECLS

View file

@ -259,21 +259,13 @@ GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *in
GST_PBUTILS_API
GstEncodingProfile * gst_encoding_profile_copy (GstEncodingProfile *self);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingAudioProfile, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingContainerProfile, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingProfile, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingVideoProfile, gst_object_unref)
#endif
G_END_DECLS

View file

@ -171,9 +171,7 @@ GList * gst_encoding_list_available_categories (void);
GST_PBUTILS_API
GList * gst_encoding_list_all_targets (const gchar * categoryname);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingTarget, gst_object_unref)
#endif
G_END_DECLS

View file

@ -410,33 +410,19 @@ gst_discoverer_discover_uri (GstDiscoverer * discoverer,
const gchar * uri,
GError ** err);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDiscoverer, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDiscovererAudioInfo, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDiscovererContainerInfo, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDiscovererInfo, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDiscovererStreamInfo, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDiscovererSubtitleInfo, gst_object_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDiscovererVideoInfo, gst_object_unref)
#endif
G_END_DECLS

View file

@ -156,9 +156,7 @@ gboolean gst_install_plugins_installation_in_progress (void);
GST_PBUTILS_API
gboolean gst_install_plugins_supported (void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstInstallPluginsContext, gst_install_plugins_context_free)
#endif
G_END_DECLS

View file

@ -117,9 +117,7 @@ GST_RTP_API
GstFlowReturn gst_rtp_base_audio_payload_flush (GstRTPBaseAudioPayload * baseaudiopayload,
guint payload_len, GstClockTime timestamp);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTPBaseAudioPayload, gst_object_unref)
#endif
G_END_DECLS

View file

@ -128,9 +128,7 @@ void gst_rtp_base_depayload_set_source_info_enabled (GstRTPBaseDepayl
gboolean enable);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTPBaseDepayload, gst_object_unref)
#endif
G_END_DECLS

View file

@ -188,9 +188,7 @@ GST_RTP_API
guint gst_rtp_base_payload_get_source_count (GstRTPBasePayload * payload,
GstBuffer * buffer);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTPBasePayload, gst_object_unref)
#endif
G_END_DECLS

View file

@ -110,9 +110,7 @@ GstRTSPResult gst_rtsp_url_set_port (GstRTSPUrl *url, guint16 port);
GST_RTSP_API
GstRTSPResult gst_rtsp_url_get_port (const GstRTSPUrl *url, guint16 *port);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTSPUrl, gst_rtsp_url_free)
#endif
G_END_DECLS

View file

@ -740,13 +740,9 @@ gboolean gst_mikey_message_add_rand_len (GstMIKEYMessage
/* General Extension Payload */
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstMIKEYMessage, gst_mikey_message_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstMIKEYPayload, gst_mikey_payload_unref)
#endif
G_END_DECLS

View file

@ -755,9 +755,7 @@ GstSDPResult gst_sdp_message_attributes_to_caps (const GstSDPMessage
GST_SDP_API
GstSDPResult gst_sdp_media_attributes_to_caps (const GstSDPMedia *media, GstCaps *caps);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstSDPMessage, gst_sdp_message_free)
#endif
G_END_DECLS

View file

@ -131,9 +131,7 @@ struct _GstTagDemuxClass
GST_TAG_API
GType gst_tag_demux_get_type (void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTagDemux, gst_object_unref)
#endif
G_END_DECLS

View file

@ -82,9 +82,7 @@ struct _GstTagMuxClass {
GST_TAG_API
GType gst_tag_mux_get_type (void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTagMux, gst_object_unref)
#endif
G_END_DECLS

View file

@ -82,9 +82,7 @@ struct _GstColorBalanceChannelClass {
GST_VIDEO_API
GType gst_color_balance_channel_get_type (void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstColorBalanceChannel, gst_object_unref)
#endif
G_END_DECLS

View file

@ -477,9 +477,7 @@ GST_VIDEO_API
void gst_video_decoder_set_use_default_pad_acceptcaps (GstVideoDecoder * decoder,
gboolean use);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoDecoder, gst_object_unref)
#endif
G_END_DECLS

View file

@ -377,9 +377,7 @@ gboolean gst_video_encoder_is_qos_enabled (GstVideoEncoder * encoder
GST_VIDEO_API
GstClockTimeDiff gst_video_encoder_get_max_encode_time (GstVideoEncoder *encoder, GstVideoCodecFrame * frame);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoEncoder, gst_object_unref)
#endif
G_END_DECLS

View file

@ -82,9 +82,7 @@ struct _GstVideoFilterClass {
GST_VIDEO_API
GType gst_video_filter_get_type (void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoFilter, gst_object_unref)
#endif
G_END_DECLS

View file

@ -81,9 +81,7 @@ GType gst_video_buffer_pool_get_type (void);
GST_VIDEO_API
GstBufferPool * gst_video_buffer_pool_new (void);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoBufferPool, gst_object_unref)
#endif
G_END_DECLS

View file

@ -128,9 +128,7 @@ GST_VIDEO_API
void gst_video_sink_center_rect (GstVideoRectangle src, GstVideoRectangle dst,
GstVideoRectangle *result, gboolean scaling);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoSink, gst_object_unref)
#endif
G_END_DECLS

View file

@ -297,13 +297,9 @@ void gst_video_codec_frame_set_user_data (GstVideoCodecFrame *fr
GST_VIDEO_API
gpointer gst_video_codec_frame_get_user_data (GstVideoCodecFrame *frame);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoCodecFrame, gst_video_codec_frame_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoCodecState, gst_video_codec_state_unref)
#endif
G_END_DECLS

View file

@ -445,9 +445,7 @@ GST_VIDEO_API
gboolean gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoInfo, gst_video_info_free)
#endif
G_END_DECLS

View file

@ -304,13 +304,9 @@ GstVideoOverlayCompositionMeta * gst_buffer_add_video_overlay_composition_meta (
#define gst_buffer_remove_video_overlay_composition_meta(b,m) \
gst_buffer_remove_meta((b),((GstMeta *) m))
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoOverlayComposition, gst_video_overlay_composition_unref)
#endif
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoOverlayRectangle, gst_video_overlay_rectangle_unref)
#endif
G_END_DECLS