diff --git a/include/vlc_addons.h b/include/vlc_addons.h index c1131e0715107465eb463b73c63634c17e22094a..7447c7e8cd678bbaf994c60f6c5edb44d1211fda 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 579119f654b69499ade96690c08a3c8f3792e7ee..43fbf2f1208225db742b2cc63e0172c88025b308 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 242187767141149bca816fa8a0ff5597f9f3257e..4988ef10146a50b8465abb61f85768481b3fbf60 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 118adc03307de305f6b3f88c5eddee992954688c..71f3e8439f07866e1c4416ebad2bcee33a135fec 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 11cfc6e1b9dc33774a86c6b5bbbe128843b14fd0..9930c0957d957029cc1151fe8fb2b0a1802135a3 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 beefd41bc9fadc366066e44b21432fb59f77644c..845dd31ccf184fe288879f9573e6933706689efb 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 bba1364c572ad59fdcb3ea7533a16f6c04ff308b..28937fc595fc4fd1dc11db3afa5bf1327de4c52d 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 b2a8f871a4e0cd45585fbbb4e774b38d902d5e6b..65d2ea0e9f10cded25e33411cc5c20ca4e47aaa3 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 aba6d8e2b286e18632f2461be871d3711ab13ab8..200f3ae1670ed3bb640ed640e3ba13981d00e53b 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 960920063b4157ddf0b9a2ddfcb7cffa23b5b3d7..113a9e6ab0461643b9f4b79c01b2677262ead6b1 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 51bad61e0b87e014193e2354a5e948525b61194e..e6bd8440e3c882bfed45f37aa60f3053a26ccf5a 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 ff285f767779ba88c99ed942f0fdb378163e2d92..66331e3a99d79311b958bba4ad34a42556b22172 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 8fe8964b0b3e04801efbc96d929fe9f2449cc020..80262987c286a8ead2481b2c7321c3676b1ff2a5 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 ce885099abe7ccd05cf6064978d3d5bf7c1e2aee..1abbf5049d0d2110948b2362dfafa2f0f71f2015 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 f564989d479790168da9047fb83aeca9468a8b84..897d227a81318688fce0c05a6761d06d2bf908fe 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 da9a353e06569bee26bfeed2da97204358e16b50..d540b2d37178e9f894e65c8e14dd9e7f4278cb30 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 4b4527c4f7cf63c1cdfec929b5790f43bd6b02ff..cc5eea64eb84cf143631f9a9249098167c4eb207 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 c8e7de6d95c202e1ff805d38859b2fd640709833..8c4909fc5d576af39e0c5462a7f5a9356f9caddb 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 ffee11e621d764b6924eef97b6fd308734b22763..d4cf0ce7290ae381385d16269b8c8e2f79985b1a 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 ad0cb8d543232489e9d343e3a0a51f189cc52790..8f4521e7af866dddcf84f7d02188e908020a6191 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 89ba9388176386e256d3abba84691861cfcf66c4..3ed31068b2325281c76a8c11b3c5f09aefaaf76c 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 dc55ba241297c54384f892282840112b8e30971d..8c13a4a9daa254f39104333b884001803cda1ff6 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 17114f7c8ffdecfe45e8897401d872d0b6c2d3ee..e7b0e7b6e1d2bee0fc0530e3a7a177206913b689 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 c8647c1f347d0f7258d719e4c18f84a1e80e17c1..484e91fff382bc40544f3b5904ac1014a99543c4 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 3f5ef1ca48981c13f8c16b02e835264834c38658..ee6c68f78414e0a23944237e93aa010d55e50d22 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 43369ec897a66db2d45287b91f8927740cf223c4..bc6c0d30b7122694930b595408d25a7b19f70c16 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 0f628eb88b118f9c0b6e7ce723368cc25e562d72..1090c70cd745785302ccd27c35133d138f1ee149 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 c5c294d9782d87e7d3d98976c92300f8e177807b..c91385e55e40b488026c5f070f4bbd5123217a37 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 092c761fc3adbbfbb688f86fa3d420a0dba968d3..c57538dc7ac806b8e651b188d1c0eb62942a3041 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 32db1c700b904b2c22a7c9c613cfba2dc96b7a38..de0bf41d70d92dc7805b432e9eee7593fb39cc8a 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 1d4e9ffcecbc9ab3d5982bb8ac763a966f20f75d..88f825d3fa505f408a4bc51ffc502c0673d929ba 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 f42db98a58120250a2ed0c3b2a8fc7a7f32d18bb..5b07e11f6cc8c5f215c902367ffcbcb6356baa6a 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 aea7a1f4cd56ee86f9ca061ed57a9fbe3222f506..73154d2cd80daf0436723be747a8b179e9ad979b 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 61abc74cf8e1967966b802e9e075901cd271497c..9e0b48e14762091d90558fbc4c106e929d21daab 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 e6ec99f401fd82cef7ea0abf2643fe6811e0885e..bc1faf44bae7c62dbf39e6a1dfbebc4a65c59330 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 9735d186ff570d862fe6262769afa7420059cd04..43326b52524099feaa246f0fd7fe7dbbcb1c5943 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 2e131ab01f4e024fb276d9d60fe1002006cfdbd6..c027367ec8b9b5935b6c1245907de6d80400cdd1 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 2f8e2d8a145c2558f57c97787eba2af407ec6af3..cbac0d3394839de6a898d68f2a3735db042b9446 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 9a5baafb38ac79d3a935a3158c647ffff283ebca..97df858389ba1351c708a2fdb943ef951dc1286b 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 01e7ff087b2ad7a202d83d04cae0659edeb55b32..859c23b3135de79fb09a4cc8b8384081cc00245d 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/keystore/secret.c b/modules/keystore/secret.c index d4d663d5c96dfe884ce24f8044c39dbcba6f96e8..d1f1e39acddbe10e51ef576078129306e4418dd4 100644 --- a/modules/keystore/secret.c +++ b/modules/keystore/secret.c @@ -293,7 +293,7 @@ dbus_vanished_cb(GDBusConnection *connection, const gchar *name, static int Open(vlc_object_t *p_this) { - if (!p_this->obj.force) + if (!p_this->force) { /* First, check if secrets service is running using g_bus_watch_name(). * Indeed, secret_service_get_sync will spawn a service if it's not diff --git a/modules/misc/webservices/acoustid.c b/modules/misc/webservices/acoustid.c index 9fd67c8fa6193a5737ee6f279dd7748c272aa085..be7cb8dfabb4c032404c3ad07b78b5494cdc323c 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_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c index 45098204a397b010d7781c0de14a81786d898be6..10514fdd5a62c6c4f55ebba50fe6fd457b3345cb 100644 --- a/modules/video_chroma/d3d11_fmt.c +++ b/modules/video_chroma/d3d11_fmt.c @@ -311,7 +311,7 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *hd3d, HRESULT hr = E_NOTIMPL; UINT creationFlags = 0; - if (hw_decoding || !obj->obj.force) + if (hw_decoding || !obj->force) creationFlags |= D3D11_CREATE_DEVICE_VIDEO_SUPPORT; #if !defined(NDEBUG) @@ -350,7 +350,7 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *hd3d, driverAttempts[driver], out->feature_level); D3D11_GetDriverVersion( obj, out ); /* we can work with legacy levels but only if forced */ - if ( obj->obj.force || out->feature_level >= D3D_FEATURE_LEVEL_11_0 ) + if ( obj->force || out->feature_level >= D3D_FEATURE_LEVEL_11_0 ) break; msg_Dbg(obj, "Incompatible feature level %x", out->feature_level); ID3D11DeviceContext_Release(out->d3dcontext); diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h index ce8846d52ded278f1f58b928832a56680ca1cb9f..a84e6c6f4a5bf808bb0b80cf7c12db9d551eb649 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 f4830c86e8a0943c93039d47498014c0b4516230..30f0962c86da68d191c9ba971796d7d9809a972b 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 a4e54f85260b73c931a046fdba8e619a6c1e1ba4..1cd06ca42bde757eadd9b16e5e2fefb874b45844 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 e5bcb1e273e03323fb8eb05519421e20059f220d..e765c226f08ee1ff2e050d1ead1aa68f87752d30 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 8cc77622d1fecdbe1d9db4448f6696219db243b5..f18c6afc2461f6ae0a33a7d00548bebdeb795227 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 d02be7ad7052997fcf980809dd46806635300ae1..f6ac776ae204fdf094381f0d13d610f895fcf662 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 c100a56865e759c21ed27f7873fb49d37b15a527..087251138976ada5f4601566583de5fe132f3c79 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 534fb41ea7f4a0fbc71360921318d94e0ae8c128..f87edd9827f91c76da5d96beb8f59f76e5aa1ccf 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 c5ca7d11c7552d8924caeb169b36eb26fddd7e34..227870f0cee7c52cd79cdad198b84654951bd174 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 71e5a33449ae8b934138505e2fc3ece76019a77b..5ef84f1b2af9e1132419836e55dcbb6f01cd697b 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 caef245ffc95e252659992bcc23d1998b3036e1d..9c5c4229a2f0dddcc48a931369e78f55b5fac4b3 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 b249c99213f2e9089a2f90c32d8bf077e108bd8f..2db57bc174ff44be1b47a6f87158c9eedfb1ec31 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 bd4045a11b906b47c64cf78dbcac3f8bad2e0d8a..05c349601e53a6b65d17b41b1a32b54b4912144f 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;