[vlc-commits] objects: merge vlc_object_t and vlc_common_members

Rémi Denis-Courmont git at videolan.org
Sun Apr 14 21:13:37 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 14 22:09:02 2019 +0300| [1c73d134c757f300a438945e661e79b4a6ca0e28] | committer: Rémi Denis-Courmont

objects: merge vlc_object_t and vlc_common_members

This should fix historical aliasing issues.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1c73d134c757f300a438945e661e79b4a6ca0e28
---

 include/vlc_addons.h                     |  4 ++--
 include/vlc_aout.h                       |  2 +-
 include/vlc_aout_volume.h                |  2 +-
 include/vlc_codec.h                      |  6 +++---
 include/vlc_demux.h                      |  2 +-
 include/vlc_events.h                     |  6 +++---
 include/vlc_extensions.h                 |  2 +-
 include/vlc_filter.h                     |  2 +-
 include/vlc_fingerprinter.h              |  2 +-
 include/vlc_inhibit.h                    |  2 +-
 include/vlc_input.h                      |  2 +-
 include/vlc_interface.h                  |  2 +-
 include/vlc_keystore.h                   |  2 +-
 include/vlc_media_library.h              |  2 +-
 include/vlc_meta.h                       |  2 +-
 include/vlc_meta_fetcher.h               |  2 +-
 include/vlc_objects.h                    | 30 +++++++++++++++---------------
 include/vlc_opengl.h                     |  2 +-
 include/vlc_playlist_export.h            |  2 +-
 include/vlc_playlist_legacy.h            |  4 ++--
 include/vlc_probe.h                      |  2 +-
 include/vlc_renderer_discovery.h         |  2 +-
 include/vlc_services_discovery.h         |  2 +-
 include/vlc_sout.h                       |  8 ++++----
 include/vlc_spu.h                        |  2 +-
 include/vlc_stream.h                     |  2 +-
 include/vlc_stream_extractor.h           |  4 ++--
 include/vlc_tls.h                        |  4 ++--
 include/vlc_video_splitter.h             |  2 +-
 include/vlc_vod.h                        |  2 +-
 include/vlc_vout.h                       |  2 +-
 include/vlc_vout_display.h               |  2 +-
 include/vlc_vout_window.h                |  2 +-
 include/vlc_xml.h                        |  4 ++--
 lib/media_player_internal.h              |  2 +-
 modules/access/http/connmgr.c            |  2 +-
 modules/audio_output/mmdevice.h          |  2 +-
 modules/codec/avcodec/encoder.c          |  2 +-
 modules/codec/avcodec/va.h               |  2 +-
 modules/demux/mpeg/ps.c                  |  2 +-
 modules/misc/webservices/acoustid.c      |  6 +++---
 modules/video_output/opengl/converter.h  |  2 +-
 modules/video_output/vulkan/instance.h   |  2 +-
 src/input/player.c                       |  2 +-
 src/input/vlm_internal.h                 |  4 ++--
 src/interface/dialog.c                   |  2 +-
 src/media_source/media_source.c          |  2 +-
 src/misc/messages.c                      |  2 +-
 src/misc/objects.c                       | 14 +++++++-------
 src/misc/update.h                        |  2 +-
 src/misc/variables.h                     |  2 +-
 src/modules/modules.c                    |  8 ++++----
 src/network/httpd.c                      |  2 +-
 src/video_output/vout_spuregion_helper.h | 12 ++++++------
 54 files changed, 97 insertions(+), 97 deletions(-)

diff --git a/include/vlc_addons.h b/include/vlc_addons.h
index c1131e0715..7447c7e8cd 100644
--- a/include/vlc_addons.h
+++ b/include/vlc_addons.h
@@ -106,7 +106,7 @@ typedef struct addons_finder_t addons_finder_t;
 typedef struct addons_finder_sys_t addons_finder_sys_t;
 struct addons_finder_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     int ( * pf_find )( addons_finder_t * );
     int ( * pf_retrieve )( addons_finder_t *, addon_entry_t * );
@@ -120,7 +120,7 @@ typedef struct addons_storage_t addons_storage_t;
 typedef struct addons_storage_sys_t addons_storage_sys_t;
 struct addons_storage_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     int ( * pf_install )( addons_storage_t *, addon_entry_t * );
     int ( * pf_remove )( addons_storage_t *, addon_entry_t * );
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 579119f654..43fbf2f120 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -137,7 +137,7 @@ struct vlc_audio_output_events {
  **/
 struct audio_output
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     void *sys; /**< Private data for callbacks */
 
diff --git a/include/vlc_aout_volume.h b/include/vlc_aout_volume.h
index 2421877671..4988ef1014 100644
--- a/include/vlc_aout_volume.h
+++ b/include/vlc_aout_volume.h
@@ -43,7 +43,7 @@ typedef struct audio_volume audio_volume_t;
  */
 struct audio_volume
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     vlc_fourcc_t format; /**< Audio samples format */
     void (*amplify)(audio_volume_t *, block_t *, float); /**< Amplifier */
diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 118adc0330..71f3e8439f 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -98,7 +98,7 @@ struct decoder_owner_callbacks
  */
 struct decoder_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Module properties */
     module_t *          p_module;
@@ -220,7 +220,7 @@ struct decoder_cc_desc_t
 
 struct encoder_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Module properties */
     module_t *          p_module;
@@ -498,7 +498,7 @@ enum vlc_decoder_device_type
  */
 typedef struct vlc_decoder_device
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /** Private context that could be used by the "decoder device" module
      * implementation */
diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index 11cfc6e1b9..9930c0957d 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -53,7 +53,7 @@
 /* demux_meta_t is returned by "meta reader" module to the demuxer */
 typedef struct demux_meta_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     input_item_t *p_item; /***< the input item that is being read */
 
     vlc_meta_t *p_meta;                 /**< meta data */
diff --git a/include/vlc_events.h b/include/vlc_events.h
index beefd41bc9..845dd31ccf 100644
--- a/include/vlc_events.h
+++ b/include/vlc_events.h
@@ -46,9 +46,9 @@
  * (see src/misc/variables.c).
  *
  * It has the following advantages over Variable based Callback:
- * - No need to implement the whole vlc_common_members in the object,
+ * - No need to implement the whole vlc_object_t in the object,
  * thus it reduce it size. This is especially true for input_item_t which
- * doesn't have vlc_common_members. This is the first reason of existence of
+ * doesn't have vlc_object_t. This is the first reason of existence of
  * this implementation.
  * - Libvlc can easily be based upon that.
  * - Existing event are clearly declared (in include/vlc_events.h)
@@ -56,7 +56,7 @@
  *
  **** Example usage
  *
- * (vlc_cool_object_t doesn't need to have the vlc_common_members.)
+ * (vlc_cool_object_t doesn't need to have the vlc_object_t.)
  *
  * struct vlc_cool_object_t
  * {
diff --git a/include/vlc_extensions.h b/include/vlc_extensions.h
index bba1364c57..28937fc595 100644
--- a/include/vlc_extensions.h
+++ b/include/vlc_extensions.h
@@ -51,7 +51,7 @@ typedef struct extension_t {
 /** Extensions manager object */
 struct extensions_manager_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     module_t *p_module;                /**< Extensions manager module */
     extensions_manager_sys_t *p_sys;   /**< Reserved for the module */
diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index b2a8f871a4..65d2ea0e9f 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -65,7 +65,7 @@ struct vlc_mouse_t;
  */
 struct filter_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Module properties */
     module_t *          p_module;
diff --git a/include/vlc_fingerprinter.h b/include/vlc_fingerprinter.h
index aba6d8e2b2..200f3ae167 100644
--- a/include/vlc_fingerprinter.h
+++ b/include/vlc_fingerprinter.h
@@ -68,7 +68,7 @@ static inline void fingerprint_request_Delete( fingerprint_request_t *p_f )
 
 struct fingerprinter_thread_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Specific interfaces */
     fingerprinter_sys_t * p_sys;
diff --git a/include/vlc_inhibit.h b/include/vlc_inhibit.h
index 960920063b..113a9e6ab0 100644
--- a/include/vlc_inhibit.h
+++ b/include/vlc_inhibit.h
@@ -42,7 +42,7 @@ enum vlc_inhibit_flags
 
 struct vlc_inhibit
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     vlc_inhibit_sys_t *p_sys;
     void (*inhibit) (vlc_inhibit_t *, unsigned flags);
diff --git a/include/vlc_input.h b/include/vlc_input.h
index 51bad61e0b..e6bd8440e3 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -224,7 +224,7 @@ typedef struct input_resource_t input_resource_t;
  */
 struct input_thread_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 };
 
 /**
diff --git a/include/vlc_interface.h b/include/vlc_interface.h
index ff285f7677..66331e3a99 100644
--- a/include/vlc_interface.h
+++ b/include/vlc_interface.h
@@ -46,7 +46,7 @@ typedef struct intf_sys_t intf_sys_t;
 /** Describe all interface-specific data of the interface thread */
 typedef struct intf_thread_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     struct intf_thread_t *p_next; /** LibVLC interfaces book keeping */
 
diff --git a/include/vlc_keystore.h b/include/vlc_keystore.h
index 8fe8964b0b..80262987c2 100644
--- a/include/vlc_keystore.h
+++ b/include/vlc_keystore.h
@@ -294,7 +294,7 @@ vlc_keystore_release_entry(vlc_keystore_entry *p_entry)
 typedef struct vlc_keystore_sys vlc_keystore_sys;
 struct vlc_keystore
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     module_t            *p_module;
     vlc_keystore_sys    *p_sys;
 
diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h
index ce885099ab..1abbf5049d 100644
--- a/include/vlc_media_library.h
+++ b/include/vlc_media_library.h
@@ -664,7 +664,7 @@ typedef struct vlc_medialibrary_callbacks_t
 
 struct vlc_medialibrary_module_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     module_t *p_module;
 
diff --git a/include/vlc_meta.h b/include/vlc_meta.h
index f564989d47..897d227a81 100644
--- a/include/vlc_meta.h
+++ b/include/vlc_meta.h
@@ -98,7 +98,7 @@ VLC_API const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type )
 
 typedef struct meta_export_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     input_item_t *p_item;
     const char *psz_file;
 } meta_export_t;
diff --git a/include/vlc_meta_fetcher.h b/include/vlc_meta_fetcher.h
index da9a353e06..d540b2d371 100644
--- a/include/vlc_meta_fetcher.h
+++ b/include/vlc_meta_fetcher.h
@@ -30,7 +30,7 @@ typedef enum meta_fetcher_scope_t
 
 typedef struct meta_fetcher_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     input_item_t *p_item;
     meta_fetcher_scope_t e_scope;
 } meta_fetcher_t;
diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index 4b4527c4f7..cc5eea64eb 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -30,6 +30,7 @@
 
 struct vlc_logger;
 struct vlc_object_internals;
+struct vlc_object_marker;
 
 /**
  * VLC object common members
@@ -38,10 +39,13 @@ struct vlc_object_internals;
  * Object also have private properties maintained by the core, see
  * \ref vlc_object_internals_t
  */
-struct vlc_common_members
+struct vlc_object_t
 {
     struct vlc_logger *logger;
-    struct vlc_object_internals *priv;
+    union {
+        struct vlc_object_internals *priv;
+        struct vlc_object_marker *obj;
+    };
 
     bool no_interact;
 
@@ -64,10 +68,16 @@ struct vlc_common_members
 #if !defined(__cplusplus)
 # define VLC_OBJECT(x) \
     _Generic((x)->obj, \
-        struct vlc_common_members: (vlc_object_t *)(x) \
+        struct vlc_object_marker *: (x), \
+        default: (&((x)->obj)) \
     )
 # define vlc_object_cast(t)
 #else
+static inline vlc_object_t *VLC_OBJECT(vlc_object_t *o)
+{
+    return o;
+}
+
 # define vlc_object_cast(t) \
 struct t; \
 static inline struct vlc_object_t *VLC_OBJECT(struct t *d) \
@@ -76,7 +86,6 @@ static inline struct vlc_object_t *VLC_OBJECT(struct t *d) \
 }
 #endif
 
-vlc_object_cast(vlc_object_t)
 vlc_object_cast(libvlc_int_t)
 vlc_object_cast(intf_thread_t)
 vlc_object_cast(vlc_player_t)
@@ -100,19 +109,10 @@ vlc_object_cast(services_discovery_t)
 vlc_object_cast(vlc_renderer_discovery_t)
 vlc_object_cast(vlc_medialibrary_module_t)
 
-/*****************************************************************************
- * The vlc_object_t type. Yes, it's that simple :-)
- *****************************************************************************/
-/** The main vlc_object_t structure */
-struct vlc_object_t
-{
-    struct vlc_common_members obj;
-};
-
 /* The root object */
 struct libvlc_int_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 };
 
 /**
@@ -158,7 +158,7 @@ VLC_API vlc_object_t *vlc_object_parent(vlc_object_t *obj) VLC_USED;
 
 static inline struct vlc_logger *vlc_object_logger(vlc_object_t *obj)
 {
-    return obj->obj.logger;
+    return obj->logger;
 }
 #define vlc_object_logger(o) vlc_object_logger(VLC_OBJECT(o))
 
diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h
index c8e7de6d95..8c4909fc5d 100644
--- a/include/vlc_opengl.h
+++ b/include/vlc_opengl.h
@@ -40,7 +40,7 @@ typedef struct vlc_gl_t vlc_gl_t;
 
 struct vlc_gl_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     struct vout_window_t *surface;
     module_t *module;
diff --git a/include/vlc_playlist_export.h b/include/vlc_playlist_export.h
index ffee11e621..d4cf0ce729 100644
--- a/include/vlc_playlist_export.h
+++ b/include/vlc_playlist_export.h
@@ -61,7 +61,7 @@ vlc_playlist_view_Get(struct vlc_playlist_view *view, size_t index);
  */
 struct vlc_playlist_export
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     char *base_url;
     FILE *file;
     struct vlc_playlist_view *playlist_view;
diff --git a/include/vlc_playlist_legacy.h b/include/vlc_playlist_legacy.h
index ad0cb8d543..8f4521e7af 100644
--- a/include/vlc_playlist_legacy.h
+++ b/include/vlc_playlist_legacy.h
@@ -111,7 +111,7 @@ struct intf_thread_t;
 /** Helper structure to export to file part of the playlist */
 typedef struct playlist_export_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     char *base_url;
     FILE *p_file;
     playlist_item_t *p_root;
@@ -145,7 +145,7 @@ typedef enum
 /** Structure containing information about the playlist */
 struct playlist_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     playlist_item_array_t items; /**< Arrays of items */
 
diff --git a/include/vlc_probe.h b/include/vlc_probe.h
index 89ba938817..3ed31068b2 100644
--- a/include/vlc_probe.h
+++ b/include/vlc_probe.h
@@ -38,7 +38,7 @@ void *vlc_probe (vlc_object_t *, const char *, size_t *);
 
 struct vlc_probe_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     void  *list;
     size_t count;
diff --git a/include/vlc_renderer_discovery.h b/include/vlc_renderer_discovery.h
index dc55ba2412..8c13a4a9da 100644
--- a/include/vlc_renderer_discovery.h
+++ b/include/vlc_renderer_discovery.h
@@ -163,7 +163,7 @@ struct vlc_renderer_discovery_owner
 
 struct vlc_renderer_discovery_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     module_t *          p_module;
 
     struct vlc_renderer_discovery_owner owner;
diff --git a/include/vlc_services_discovery.h b/include/vlc_services_discovery.h
index 17114f7c8f..e7b0e7b6e1 100644
--- a/include/vlc_services_discovery.h
+++ b/include/vlc_services_discovery.h
@@ -57,7 +57,7 @@ struct services_discovery_owner_t
  */
 struct services_discovery_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     module_t *          p_module;             /**< Loaded module */
 
     char *psz_name;                           /**< Main name of the SD */
diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index c8647c1f34..484e91fff3 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -46,7 +46,7 @@ extern "C" {
  * invalid unsynchronized access) */
 struct sout_instance_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     char *psz_sout;
 
@@ -67,7 +67,7 @@ struct sout_instance_t
 /** Stream output access_output */
 struct sout_access_out_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     module_t                *p_module;
     char                    *psz_access;
@@ -115,7 +115,7 @@ static inline bool sout_AccessOutCanControlPace( sout_access_out_t *p_ao )
 /** Muxer structure */
 struct  sout_mux_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     module_t            *p_module;
 
     sout_instance_t     *p_sout;
@@ -193,7 +193,7 @@ enum sout_stream_query_e {
 
 struct sout_stream_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     module_t          *p_module;
     sout_instance_t   *p_sout;
diff --git a/include/vlc_spu.h b/include/vlc_spu.h
index 3f5ef1ca48..ee6c68f784 100644
--- a/include/vlc_spu.h
+++ b/include/vlc_spu.h
@@ -45,7 +45,7 @@ typedef struct spu_private_t spu_private_t;
  */
 struct spu_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     spu_private_t *p;
 };
diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index 43369ec897..bc6c0d30b7 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -44,7 +44,7 @@ extern "C" {
 
 struct stream_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     char        *psz_name;
     char        *psz_url; /**< Full URL or MRL (can be NULL) */
diff --git a/include/vlc_stream_extractor.h b/include/vlc_stream_extractor.h
index 0f628eb88b..1090c70cd7 100644
--- a/include/vlc_stream_extractor.h
+++ b/include/vlc_stream_extractor.h
@@ -48,7 +48,7 @@ extern "C" {
  **/
 
 typedef struct stream_extractor_t {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /**
      * \name Callbacks for entity extraction
@@ -71,7 +71,7 @@ typedef struct stream_extractor_t {
 } stream_extractor_t;
 
 typedef struct stream_directory_t {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /**
      * \name Callbacks for stream directories
diff --git a/include/vlc_tls.h b/include/vlc_tls.h
index c5c294d978..c91385e55e 100644
--- a/include/vlc_tls.h
+++ b/include/vlc_tls.h
@@ -138,7 +138,7 @@ struct vlc_tls_operations
  */
 typedef struct vlc_tls_client
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     const struct vlc_tls_client_operations *ops;
     void *sys;
 } vlc_tls_client_t;
@@ -216,7 +216,7 @@ VLC_API vlc_tls_t *vlc_tls_ClientSessionCreate(vlc_tls_client_t *creds,
  */
 typedef struct vlc_tls_server
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     const struct vlc_tls_server_operations *ops;
     void *sys;
 
diff --git a/include/vlc_video_splitter.h b/include/vlc_video_splitter.h
index 092c761fc3..c57538dc7a 100644
--- a/include/vlc_video_splitter.h
+++ b/include/vlc_video_splitter.h
@@ -55,7 +55,7 @@ typedef struct
  */
 struct video_splitter_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Module properties */
     module_t        *p_module;
diff --git a/include/vlc_vod.h b/include/vlc_vod.h
index 32db1c700b..de0bf41d70 100644
--- a/include/vlc_vod.h
+++ b/include/vlc_vod.h
@@ -34,7 +34,7 @@
 
 struct vod_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Module properties */
     module_t  *p_module;
diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 1d4e9ffcec..88f825d3fa 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -57,7 +57,7 @@ typedef struct vout_thread_sys_t vout_thread_sys_t;
  * structure.
  */
 struct vout_thread_t {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Private vout_thread data */
     vout_thread_sys_t *p;
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index f42db98a58..5b07e11f6c 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -217,7 +217,7 @@ typedef int (*vout_display_open_cb)(vout_display_t *vd,
 typedef int (*vout_display_close_cb)(vout_display_t *vd);
 
 struct vout_display_t {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Module */
     module_t *module;
diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index aea7a1f4cd..73154d2cd8 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -333,7 +333,7 @@ struct vout_window_operations {
  * Finally, it must support some control requests such as for fullscreen mode.
  */
 typedef struct vout_window_t {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
      /**
       * Window handle type
diff --git a/include/vlc_xml.h b/include/vlc_xml.h
index 61abc74cf8..9e0b48e147 100644
--- a/include/vlc_xml.h
+++ b/include/vlc_xml.h
@@ -35,7 +35,7 @@ extern "C" {
 
 struct xml_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     /* Module properties */
     module_t  *p_module;
@@ -64,7 +64,7 @@ static inline void xml_CatalogAdd( xml_t *xml, const char *type,
 
 struct xml_reader_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     void     *p_sys;
     stream_t *p_stream;
diff --git a/lib/media_player_internal.h b/lib/media_player_internal.h
index e6ec99f401..bc1faf44ba 100644
--- a/lib/media_player_internal.h
+++ b/lib/media_player_internal.h
@@ -37,7 +37,7 @@
 
 struct libvlc_media_player_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     int                i_refcount;
     vlc_mutex_t        object_lock;
diff --git a/modules/access/http/connmgr.c b/modules/access/http/connmgr.c
index 9735d186ff..43326b5252 100644
--- a/modules/access/http/connmgr.c
+++ b/modules/access/http/connmgr.c
@@ -275,7 +275,7 @@ struct vlc_http_mgr *vlc_http_mgr_create(vlc_object_t *obj,
     if (unlikely(mgr == NULL))
         return NULL;
 
-    mgr->logger = obj->obj.logger;
+    mgr->logger = obj->logger;
     mgr->obj = obj;
     mgr->creds = NULL;
     mgr->jar = jar;
diff --git a/modules/audio_output/mmdevice.h b/modules/audio_output/mmdevice.h
index 2e131ab01f..c027367ec8 100644
--- a/modules/audio_output/mmdevice.h
+++ b/modules/audio_output/mmdevice.h
@@ -33,7 +33,7 @@ typedef struct aout_stream aout_stream_t;
  */
 struct aout_stream
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     void *sys;
 
     HRESULT (*time_get)(aout_stream_t *, vlc_tick_t *);
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 2f8e2d8a14..cbac0d3394 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -70,7 +70,7 @@ struct thread_context_t;
  *****************************************************************************/
 struct thread_context_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     AVCodecContext  *p_context;
     int             (* pf_func)(AVCodecContext *c, void *arg);
diff --git a/modules/codec/avcodec/va.h b/modules/codec/avcodec/va.h
index 9a5baafb38..97df858389 100644
--- a/modules/codec/avcodec/va.h
+++ b/modules/codec/avcodec/va.h
@@ -29,7 +29,7 @@ typedef struct vlc_va_t vlc_va_t;
 typedef struct vlc_va_sys_t vlc_va_sys_t;
 
 struct vlc_va_t {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     vlc_va_sys_t *sys;
     int  (*get)(vlc_va_t *, picture_t *pic, uint8_t **surface);
diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index 01e7ff087b..859c23b313 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -247,7 +247,7 @@ static int OpenForce( vlc_object_t *p_this )
 
 static int Open( vlc_object_t *p_this )
 {
-    return OpenCommon( p_this, p_this->obj.force );
+    return OpenCommon( p_this, p_this->force );
 }
 
 /*****************************************************************************
diff --git a/modules/misc/webservices/acoustid.c b/modules/misc/webservices/acoustid.c
index 9fd67c8fa6..be7cb8dfab 100644
--- a/modules/misc/webservices/acoustid.c
+++ b/modules/misc/webservices/acoustid.c
@@ -160,13 +160,13 @@ int DoAcoustIdWebRequest( vlc_object_t *p_obj, acoustid_fingerprint_t *p_data )
          return VLC_EGENERIC;
 
     msg_Dbg( p_obj, "Querying AcoustID from %s", psz_url );
-    bool saved_no_interact = p_obj->obj.no_interact;
-    p_obj->obj.no_interact = true;
+    bool saved_no_interact = p_obj->no_interact;
+    p_obj->no_interact = true;
 
     stream_t *p_stream = vlc_stream_NewURL( p_obj, psz_url );
 
     free( psz_url );
-    p_obj->obj.no_interact = saved_no_interact;
+    p_obj->no_interact = saved_no_interact;
     if ( p_stream == NULL )
         return VLC_EGENERIC;
 
diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h
index ce8846d52d..a84e6c6f4a 100644
--- a/modules/video_output/opengl/converter.h
+++ b/modules/video_output/opengl/converter.h
@@ -252,7 +252,7 @@ struct pl_shader_res;
 typedef struct opengl_tex_converter_t opengl_tex_converter_t;
 struct opengl_tex_converter_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     module_t *p_module;
 
diff --git a/modules/video_output/vulkan/instance.h b/modules/video_output/vulkan/instance.h
index f4830c86e8..30f0962c86 100644
--- a/modules/video_output/vulkan/instance.h
+++ b/modules/video_output/vulkan/instance.h
@@ -35,7 +35,7 @@ struct vout_window_cfg_t;
 typedef struct vlc_vk_t
 {
     // fields internal to instance.c, should not be touched
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     module_t *module;
     vlc_atomic_rc_t ref_count;
     void *platform_sys;
diff --git a/src/input/player.c b/src/input/player.c
index a4e54f8526..1cd06ca42b 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -143,7 +143,7 @@ struct vlc_player_input
 
 struct vlc_player_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     vlc_mutex_t lock;
     vlc_mutex_t aout_listeners_lock;
     vlc_mutex_t vout_listeners_lock;
diff --git a/src/input/vlm_internal.h b/src/input/vlm_internal.h
index e5bcb1e273..e765c226f0 100644
--- a/src/input/vlm_internal.h
+++ b/src/input/vlm_internal.h
@@ -47,7 +47,7 @@ typedef struct
 
 typedef struct
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     vlm_media_t cfg;
 
     struct
@@ -83,7 +83,7 @@ typedef struct
 
 struct vlm_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     vlc_mutex_t  lock;
     vlc_thread_t thread;
diff --git a/src/interface/dialog.c b/src/interface/dialog.c
index 8cc77622d1..f18c6afc24 100644
--- a/src/interface/dialog.c
+++ b/src/interface/dialog.c
@@ -122,7 +122,7 @@ struct dialog_i11e_context
 static inline vlc_dialog_provider *
 get_dialog_provider(vlc_object_t *p_obj, bool b_check_interact)
 {
-    if (b_check_interact && p_obj->obj.no_interact)
+    if (b_check_interact && p_obj->no_interact)
         return NULL;
 
     vlc_dialog_provider *p_provider =
diff --git a/src/media_source/media_source.c b/src/media_source/media_source.c
index d02be7ad70..f6ac776ae2 100644
--- a/src/media_source/media_source.c
+++ b/src/media_source/media_source.c
@@ -51,7 +51,7 @@ typedef struct
 
 struct vlc_media_source_provider_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     vlc_mutex_t lock;
     struct vlc_list media_sources;
 };
diff --git a/src/misc/messages.c b/src/misc/messages.c
index c100a56865..0872511389 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -377,7 +377,7 @@ static struct vlc_logger *vlc_LogSwitchCreate(void)
  * Module-based message log.
  */
 struct vlc_logger_module {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     struct vlc_logger frontend;
     const struct vlc_logger_operations *ops;
     void *opaque;
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 534fb41ea7..f87edd9827 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -72,18 +72,18 @@ int vlc_object_init(vlc_object_t *restrict obj, vlc_object_t *parent,
     vlc_cond_init (&priv->var_wait);
     priv->resources = NULL;
 
-    obj->obj.priv = priv;
-    obj->obj.force = false;
+    obj->priv = priv;
+    obj->force = false;
 
     if (likely(parent != NULL))
     {
-        obj->obj.logger = parent->obj.logger;
-        obj->obj.no_interact = parent->obj.no_interact;
+        obj->logger = parent->logger;
+        obj->no_interact = parent->no_interact;
     }
     else
     {
-        obj->obj.logger = NULL;
-        obj->obj.no_interact = false;
+        obj->logger = NULL;
+        obj->no_interact = false;
     }
 
     return 0;
@@ -151,7 +151,7 @@ void vlc_object_vaLog(vlc_object_t *obj, int prio, const char *module,
     if (typename == NULL)
         typename = "generic";
 
-    vlc_vaLog(&obj->obj.logger, prio, typename, module, file, line, func,
+    vlc_vaLog(&obj->logger, prio, typename, module, file, line, func,
               format, ap);
 }
 
diff --git a/src/misc/update.h b/src/misc/update.h
index c5ca7d11c7..227870f0ce 100644
--- a/src/misc/update.h
+++ b/src/misc/update.h
@@ -132,7 +132,7 @@ typedef struct public_key_t public_key_t;
  */
 typedef struct
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
 
     vlc_thread_t thread;
     atomic_bool aborted;
diff --git a/src/misc/variables.h b/src/misc/variables.h
index 71e5a33449..5ef84f1b2a 100644
--- a/src/misc/variables.h
+++ b/src/misc/variables.h
@@ -46,7 +46,7 @@ struct vlc_object_internals
     struct vlc_res *resources;
 };
 
-# define vlc_internals(o) ((o)->obj.priv)
+# define vlc_internals(o) ((o)->priv)
 # define vlc_externals(priv) (abort(), (void *)(priv))
 
 extern void var_DestroyAll( vlc_object_t * );
diff --git a/src/modules/modules.c b/src/modules/modules.c
index caef245ffc..9c5c4229a2 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -254,7 +254,7 @@ static int generic_start(void *func, bool forced, va_list ap)
     int (*activate)(vlc_object_t *) = func;
     int ret;
 
-    obj->obj.force = forced;
+    obj->force = forced;
     ret = activate(obj);
     if (ret != VLC_SUCCESS)
         vlc_objres_clear(obj);
@@ -273,15 +273,15 @@ static void generic_stop(void *func, va_list ap)
 module_t *module_need(vlc_object_t *obj, const char *cap, const char *name,
                       bool strict)
 {
-    const bool b_force_backup = obj->obj.force; /* FIXME: remove this */
-    module_t *module = vlc_module_load(obj->obj.logger, cap, name, strict,
+    const bool b_force_backup = obj->force; /* FIXME: remove this */
+    module_t *module = vlc_module_load(obj->logger, cap, name, strict,
                                        generic_start, obj);
     if (module != NULL) {
         var_Create(obj, "module-name", VLC_VAR_STRING);
         var_SetString(obj, "module-name", module_get_object(module));
     }
 
-    obj->obj.force = b_force_backup;
+    obj->force = b_force_backup;
     return module;
 }
 
diff --git a/src/network/httpd.c b/src/network/httpd.c
index b249c99213..2db57bc174 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -74,7 +74,7 @@ static void httpd_AppendData(httpd_stream_t *stream, uint8_t *p_data, int i_data
 /* each host run in his own thread */
 struct httpd_host_t
 {
-    struct vlc_common_members obj;
+    struct vlc_object_t obj;
     struct vlc_list node;
 
     /* ref count */
diff --git a/src/video_output/vout_spuregion_helper.h b/src/video_output/vout_spuregion_helper.h
index bd4045a11b..05c349601e 100644
--- a/src/video_output/vout_spuregion_helper.h
+++ b/src/video_output/vout_spuregion_helper.h
@@ -67,18 +67,18 @@ spuregion_CreateFromPicture( vlc_object_t *p_this, video_format_t *p_fmt,
                              const char *psz_uri )
 {
     picture_t *p_pic = NULL;
-    struct vlc_logger *logger = p_this->obj.logger;
-    bool no_interact = p_this->obj.no_interact;
-    p_this->obj.logger = NULL;
-    p_this->obj.no_interact = true;
+    struct vlc_logger *logger = p_this->logger;
+    bool no_interact = p_this->no_interact;
+    p_this->logger = NULL;
+    p_this->no_interact = true;
     image_handler_t *p_image = image_HandlerCreate( p_this );
     if( p_image )
     {
         p_pic = image_ReadUrl( p_image, psz_uri, p_fmt );
         image_HandlerDelete( p_image );
     }
-    p_this->obj.no_interact = no_interact;
-    p_this->obj.logger = logger;
+    p_this->no_interact = no_interact;
+    p_this->logger = logger;
 
     if(!p_pic)
         return NULL;



More information about the vlc-commits mailing list