Commit ff2901af authored by Romain Vimont's avatar Romain Vimont Committed by Jean-Baptiste Kempf

core: remove global *_sys_t typedefs

Do not declare *_sys_t typedefs globally in vlc_common.h. Instead,
declare them locally in each module that provides a definition.

This paves the way to move C++ definitions into anonymous namespaces in
order to respect C++ ODR.

The picture_resource_t and sout_stream_id_sys_t typedefs will be handled
separately, since they require specific additional changes.

See #18033
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 1bbd0eb5
...@@ -338,7 +338,6 @@ typedef struct date_t date_t; ...@@ -338,7 +338,6 @@ typedef struct date_t date_t;
typedef struct playlist_t playlist_t; typedef struct playlist_t playlist_t;
typedef struct playlist_item_t playlist_item_t; typedef struct playlist_item_t playlist_item_t;
typedef struct services_discovery_t services_discovery_t; typedef struct services_discovery_t services_discovery_t;
typedef struct services_discovery_sys_t services_discovery_sys_t;
typedef struct vlc_renderer_discovery_t vlc_renderer_discovery_t; typedef struct vlc_renderer_discovery_t vlc_renderer_discovery_t;
typedef struct vlc_renderer_item_t vlc_renderer_item_t; typedef struct vlc_renderer_item_t vlc_renderer_item_t;
...@@ -352,14 +351,10 @@ typedef struct config_category_t config_category_t; ...@@ -352,14 +351,10 @@ typedef struct config_category_t config_category_t;
typedef struct input_thread_t input_thread_t; typedef struct input_thread_t input_thread_t;
typedef struct input_item_t input_item_t; typedef struct input_item_t input_item_t;
typedef struct input_item_node_t input_item_node_t; typedef struct input_item_node_t input_item_node_t;
typedef struct access_sys_t access_sys_t;
typedef struct stream_t stream_t; typedef struct stream_t stream_t;
typedef struct stream_sys_t stream_sys_t;
typedef struct stream_t demux_t; typedef struct stream_t demux_t;
typedef struct demux_sys_t demux_sys_t;
typedef struct es_out_t es_out_t; typedef struct es_out_t es_out_t;
typedef struct es_out_id_t es_out_id_t; typedef struct es_out_id_t es_out_id_t;
typedef struct es_out_sys_t es_out_sys_t;
typedef struct seekpoint_t seekpoint_t; typedef struct seekpoint_t seekpoint_t;
typedef struct info_t info_t; typedef struct info_t info_t;
typedef struct info_category_t info_category_t; typedef struct info_category_t info_category_t;
...@@ -374,7 +369,6 @@ typedef struct video_palette_t video_palette_t; ...@@ -374,7 +369,6 @@ typedef struct video_palette_t video_palette_t;
/* Audio */ /* Audio */
typedef struct audio_output audio_output_t; typedef struct audio_output audio_output_t;
typedef struct aout_sys_t aout_sys_t;
typedef audio_format_t audio_sample_format_t; typedef audio_format_t audio_sample_format_t;
/* Video */ /* Video */
...@@ -399,29 +393,23 @@ typedef struct sout_input_t sout_input_t; ...@@ -399,29 +393,23 @@ typedef struct sout_input_t sout_input_t;
typedef struct sout_packetizer_input_t sout_packetizer_input_t; typedef struct sout_packetizer_input_t sout_packetizer_input_t;
typedef struct sout_access_out_t sout_access_out_t; typedef struct sout_access_out_t sout_access_out_t;
typedef struct sout_access_out_sys_t sout_access_out_sys_t;
typedef struct sout_mux_t sout_mux_t; typedef struct sout_mux_t sout_mux_t;
typedef struct sout_mux_sys_t sout_mux_sys_t;
typedef struct sout_stream_t sout_stream_t; typedef struct sout_stream_t sout_stream_t;
typedef struct sout_stream_sys_t sout_stream_sys_t;
typedef struct config_chain_t config_chain_t; typedef struct config_chain_t config_chain_t;
typedef struct session_descriptor_t session_descriptor_t; typedef struct session_descriptor_t session_descriptor_t;
/* Decoders */ /* Decoders */
typedef struct decoder_t decoder_t; typedef struct decoder_t decoder_t;
typedef struct decoder_sys_t decoder_sys_t;
typedef struct decoder_synchro_t decoder_synchro_t; typedef struct decoder_synchro_t decoder_synchro_t;
/* Encoders */ /* Encoders */
typedef struct encoder_t encoder_t; typedef struct encoder_t encoder_t;
typedef struct encoder_sys_t encoder_sys_t;
/* Filters */ /* Filters */
typedef struct filter_t filter_t; typedef struct filter_t filter_t;
typedef struct filter_sys_t filter_sys_t;
/* Network */ /* Network */
typedef struct vlc_url_t vlc_url_t; typedef struct vlc_url_t vlc_url_t;
...@@ -438,13 +426,10 @@ typedef struct md5_s md5_t; ...@@ -438,13 +426,10 @@ typedef struct md5_s md5_t;
/* XML */ /* XML */
typedef struct xml_t xml_t; typedef struct xml_t xml_t;
typedef struct xml_sys_t xml_sys_t;
typedef struct xml_reader_t xml_reader_t; typedef struct xml_reader_t xml_reader_t;
typedef struct xml_reader_sys_t xml_reader_sys_t;
/* vod server */ /* vod server */
typedef struct vod_t vod_t; typedef struct vod_t vod_t;
typedef struct vod_sys_t vod_sys_t;
typedef struct vod_media_t vod_media_t; typedef struct vod_media_t vod_media_t;
/* VLM */ /* VLM */
......
...@@ -122,7 +122,7 @@ static void DumpDeviceStatus (vlc_object_t *obj, snd_pcm_t *pcm) ...@@ -122,7 +122,7 @@ static void DumpDeviceStatus (vlc_object_t *obj, snd_pcm_t *pcm)
#define DumpDeviceStatus(o, p) DumpDeviceStatus(VLC_OBJECT(o), p) #define DumpDeviceStatus(o, p) DumpDeviceStatus(VLC_OBJECT(o), p)
struct demux_sys_t typedef struct
{ {
snd_pcm_t *pcm; snd_pcm_t *pcm;
es_out_id_t *es; es_out_id_t *es;
...@@ -132,7 +132,7 @@ struct demux_sys_t ...@@ -132,7 +132,7 @@ struct demux_sys_t
mtime_t caching; mtime_t caching;
snd_pcm_uframes_t period_size; snd_pcm_uframes_t period_size;
unsigned rate; unsigned rate;
}; } demux_sys_t;
static void Poll (snd_pcm_t *pcm, int canc) static void Poll (snd_pcm_t *pcm, int canc)
{ {
......
...@@ -58,11 +58,11 @@ static ssize_t Read(stream_t *, void *, size_t); ...@@ -58,11 +58,11 @@ static ssize_t Read(stream_t *, void *, size_t);
static int Seek(stream_t *, uint64_t); static int Seek(stream_t *, uint64_t);
static int Control(stream_t *, int, va_list); static int Control(stream_t *, int, va_list);
struct access_sys_t typedef struct
{ {
input_attachment_t *attachment; input_attachment_t *attachment;
size_t offset; size_t offset;
}; } access_sys_t;
/* */ /* */
static int Open(vlc_object_t *object) static int Open(vlc_object_t *object)
......
...@@ -228,7 +228,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer ...@@ -228,7 +228,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
* Struct * Struct
*****************************************************************************/ *****************************************************************************/
struct demux_sys_t typedef struct demux_sys_t
{ {
CFTypeRef _Nullable session; // AVCaptureSession CFTypeRef _Nullable session; // AVCaptureSession
CFTypeRef _Nullable device; // AVCaptureDevice CFTypeRef _Nullable device; // AVCaptureDevice
...@@ -237,7 +237,7 @@ struct demux_sys_t ...@@ -237,7 +237,7 @@ struct demux_sys_t
es_format_t fmt; es_format_t fmt;
int height, width; int height, width;
BOOL b_es_setup; BOOL b_es_setup;
}; } demux_sys_t;
/***************************************************************************** /*****************************************************************************
* Open: * Open:
......
...@@ -65,15 +65,16 @@ static int UrlInterruptCallback(void *access) ...@@ -65,15 +65,16 @@ static int UrlInterruptCallback(void *access)
return vlc_killed(); return vlc_killed();
} }
struct access_sys_t typedef struct
{ {
AVIOContext *context; AVIOContext *context;
int64_t size; int64_t size;
}; } access_sys_t;
struct sout_access_out_sys_t { typedef struct
{
AVIOContext *context; AVIOContext *context;
}; } sout_access_out_sys_t;
/* */ /* */
......
...@@ -145,7 +145,7 @@ typedef struct bluray_overlay_t ...@@ -145,7 +145,7 @@ typedef struct bluray_overlay_t
struct subpicture_updater_sys_t *p_updater; struct subpicture_updater_sys_t *p_updater;
} bluray_overlay_t; } bluray_overlay_t;
struct demux_sys_t typedef struct
{ {
BLURAY *bluray; BLURAY *bluray;
...@@ -200,7 +200,7 @@ struct demux_sys_t ...@@ -200,7 +200,7 @@ struct demux_sys_t
/* Used to store bluray disc path */ /* Used to store bluray disc path */
char *psz_bd_path; char *psz_bd_path;
}; } demux_sys_t;
struct subpicture_updater_sys_t struct subpicture_updater_sys_t
{ {
...@@ -921,9 +921,10 @@ static void blurayClose(vlc_object_t *object) ...@@ -921,9 +921,10 @@ static void blurayClose(vlc_object_t *object)
* Elementary streams handling * Elementary streams handling
*****************************************************************************/ *****************************************************************************/
struct es_out_sys_t { typedef struct
{
demux_t *p_demux; demux_t *p_demux;
}; } es_out_sys_t;
typedef struct fmt_es_pair { typedef struct fmt_es_pair {
int i_id; int i_id;
......
...@@ -115,7 +115,7 @@ static vcddev_t *DiscOpen(vlc_object_t *obj, const char *location, ...@@ -115,7 +115,7 @@ static vcddev_t *DiscOpen(vlc_object_t *obj, const char *location,
/* how many blocks Demux() will read in each iteration */ /* how many blocks Demux() will read in each iteration */
#define CDDA_BLOCKS_ONCE 20 #define CDDA_BLOCKS_ONCE 20
struct demux_sys_t typedef struct
{ {
vcddev_t *vcddev; /* vcd device descriptor */ vcddev_t *vcddev; /* vcd device descriptor */
es_out_id_t *es; es_out_id_t *es;
...@@ -124,7 +124,7 @@ struct demux_sys_t ...@@ -124,7 +124,7 @@ struct demux_sys_t
unsigned start; /**< Track first sector */ unsigned start; /**< Track first sector */
unsigned length; /**< Track total sectors */ unsigned length; /**< Track total sectors */
unsigned position; /**< Current offset within track sectors */ unsigned position; /**< Current offset within track sectors */
}; } demux_sys_t;
static int Demux(demux_t *demux) static int Demux(demux_t *demux)
{ {
...@@ -269,7 +269,7 @@ error: ...@@ -269,7 +269,7 @@ error:
/***************************************************************************** /*****************************************************************************
* Access: local prototypes * Access: local prototypes
*****************************************************************************/ *****************************************************************************/
struct access_sys_t typedef struct
{ {
vcddev_t *vcddev; /* vcd device descriptor */ vcddev_t *vcddev; /* vcd device descriptor */
int *p_sectors; /* Track sectors */ int *p_sectors; /* Track sectors */
...@@ -279,7 +279,7 @@ struct access_sys_t ...@@ -279,7 +279,7 @@ struct access_sys_t
#ifdef HAVE_LIBCDDB #ifdef HAVE_LIBCDDB
cddb_disc_t *cddb; cddb_disc_t *cddb;
#endif #endif
}; } access_sys_t;
#ifdef HAVE_LIBCDDB #ifdef HAVE_LIBCDDB
static cddb_disc_t *GetCDDBInfo( vlc_object_t *obj, int i_titles, int *p_sectors ) static cddb_disc_t *GetCDDBInfo( vlc_object_t *obj, int i_titles, int *p_sectors )
......
...@@ -35,7 +35,7 @@ struct access_entry ...@@ -35,7 +35,7 @@ struct access_entry
char mrl[1]; char mrl[1];
}; };
struct access_sys_t typedef struct
{ {
stream_t *access; stream_t *access;
struct access_entry *next; struct access_entry *next;
...@@ -46,7 +46,7 @@ struct access_sys_t ...@@ -46,7 +46,7 @@ struct access_sys_t
bool can_control_pace; bool can_control_pace;
uint64_t size; uint64_t size;
int64_t caching; int64_t caching;
}; } access_sys_t;
static stream_t *GetAccess(stream_t *access) static stream_t *GetAccess(stream_t *access)
{ {
......
...@@ -54,7 +54,7 @@ vlc_module_begin() ...@@ -54,7 +54,7 @@ vlc_module_begin()
set_callbacks( Open, Close ) set_callbacks( Open, Close )
vlc_module_end() vlc_module_end()
struct demux_sys_t typedef struct
{ {
/* camera info */ /* camera info */
dc1394_t *p_dccontext; dc1394_t *p_dccontext;
...@@ -77,7 +77,7 @@ struct demux_sys_t ...@@ -77,7 +77,7 @@ struct demux_sys_t
unsigned int focus; unsigned int focus;
es_out_id_t *p_es_video; es_out_id_t *p_es_video;
dc1394video_frame_t *frame; dc1394video_frame_t *frame;
}; } demux_sys_t;
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
......
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
#include <vlc_fs.h> #include <vlc_fs.h>
#include <vlc_url.h> #include <vlc_url.h>
struct access_sys_t typedef struct
{ {
char *base_uri; char *base_uri;
DIR *dir; DIR *dir;
}; } access_sys_t;
/***************************************************************************** /*****************************************************************************
* DirInit: Init the directory access with a directory stream * DirInit: Init the directory access with a directory stream
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <wrl/client.h> #include <wrl/client.h>
using Microsoft::WRL::ComPtr; using Microsoft::WRL::ComPtr;
typedef struct demux_sys_t demux_sys_t;
/**************************************************************************** /****************************************************************************
* Crossbar stuff * Crossbar stuff
****************************************************************************/ ****************************************************************************/
...@@ -47,6 +49,8 @@ struct CrossbarRoute ...@@ -47,6 +49,8 @@ struct CrossbarRoute
LONG AudioOutputIndex; LONG AudioOutputIndex;
}; };
struct access_sys_t;
void DeleteCrossbarRoutes( access_sys_t * ); void DeleteCrossbarRoutes( access_sys_t * );
HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *, HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *,
IPin *, LONG, int = 0 ); IPin *, LONG, int = 0 );
......
...@@ -51,11 +51,11 @@ struct entry_item ...@@ -51,11 +51,11 @@ struct entry_item
input_item_t *p_item; input_item_t *p_item;
}; };
struct services_discovery_sys_t typedef struct
{ {
netbios_ns *p_ns; netbios_ns *p_ns;
vlc_array_t entry_item_list; vlc_array_t entry_item_list;
}; } services_discovery_sys_t;
static void entry_item_append( services_discovery_t *p_sd, static void entry_item_append( services_discovery_t *p_sd,
netbios_ns_entry *p_entry, netbios_ns_entry *p_entry,
......
...@@ -426,12 +426,12 @@ vlc_module_begin () ...@@ -426,12 +426,12 @@ vlc_module_begin ()
#endif #endif
vlc_module_end () vlc_module_end ()
struct access_sys_t typedef struct
{ {
dvb_device_t *dev; dvb_device_t *dev;
uint8_t signal_poll; uint8_t signal_poll;
tuner_setup_t pf_setup; tuner_setup_t pf_setup;
}; } access_sys_t;
static block_t *Read (stream_t *, bool *); static block_t *Read (stream_t *, bool *);
static int Control (stream_t *, int, va_list); static int Control (stream_t *, int, va_list);
......
...@@ -92,7 +92,7 @@ static int AVCPlay( stream_t *, int ); ...@@ -92,7 +92,7 @@ static int AVCPlay( stream_t *, int );
static int AVCPause( stream_t *, int ); static int AVCPause( stream_t *, int );
static int AVCStop( stream_t *, int ); static int AVCStop( stream_t *, int );
struct access_sys_t typedef struct
{ {
raw1394handle_t p_avc1394; raw1394handle_t p_avc1394;
raw1394handle_t p_raw1394; raw1394handle_t p_raw1394;
...@@ -108,7 +108,7 @@ struct access_sys_t ...@@ -108,7 +108,7 @@ struct access_sys_t
event_thread_t *p_ev; event_thread_t *p_ev;
vlc_mutex_t lock; vlc_mutex_t lock;
block_t *p_frame; block_t *p_frame;
}; } access_sys_t;
#define ISOCHRONOUS_QUEUE_LENGTH 1000 #define ISOCHRONOUS_QUEUE_LENGTH 1000
#define ISOCHRONOUS_MAX_PACKET_SIZE 4096 #define ISOCHRONOUS_MAX_PACKET_SIZE 4096
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include "dvb.h" #include "dvb.h"
#include "scan.h" #include "scan.h"
struct access_sys_t typedef struct
{ {
demux_handle_t p_demux_handles[MAX_DEMUX]; demux_handle_t p_demux_handles[MAX_DEMUX];
dvb_sys_t dvb; dvb_sys_t dvb;
...@@ -55,7 +55,7 @@ struct access_sys_t ...@@ -55,7 +55,7 @@ struct access_sys_t
/* Scan */ /* Scan */
struct scan_t *scan; struct scan_t *scan;
bool done; bool done;
}; } access_sys_t;
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
......
...@@ -120,7 +120,7 @@ vlc_module_end () ...@@ -120,7 +120,7 @@ vlc_module_end ()
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
struct demux_sys_t typedef struct
{ {
dvdnav_t *dvdnav; dvdnav_t *dvdnav;
...@@ -165,7 +165,7 @@ struct demux_sys_t ...@@ -165,7 +165,7 @@ struct demux_sys_t
mtime_t i_pgc_length; mtime_t i_pgc_length;
int i_vobu_index; int i_vobu_index;
int i_vobu_flush; int i_vobu_flush;
}; } demux_sys_t;
static int Control( demux_t *, int, va_list ); static int Control( demux_t *, int, va_list );
static int Demux( demux_t * ); static int Demux( demux_t * );
......
...@@ -92,7 +92,7 @@ vlc_module_end () ...@@ -92,7 +92,7 @@ vlc_module_end ()
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
struct demux_sys_t typedef struct
{ {
/* DVDRead state */ /* DVDRead state */
dvd_reader_t *p_dvdread; dvd_reader_t *p_dvdread;
...@@ -145,7 +145,7 @@ struct demux_sys_t ...@@ -145,7 +145,7 @@ struct demux_sys_t
/* SPU */ /* SPU */
uint32_t clut[16]; uint32_t clut[16];
}; } demux_sys_t;
static int Control ( demux_t *, int, va_list ); static int Control ( demux_t *, int, va_list );
static int Demux ( demux_t * ); static int Demux ( demux_t * );
......
...@@ -64,12 +64,12 @@ ...@@ -64,12 +64,12 @@
#include <vlc_url.h> #include <vlc_url.h>
#include <vlc_interrupt.h> #include <vlc_interrupt.h>
struct access_sys_t typedef struct
{ {
int fd; int fd;
bool b_pace_control; bool b_pace_control;
}; } access_sys_t;