[vlc-devel] [PATCH 00/13] Convert p_sys to void*

Romain Vimont rom1v at videolabs.io
Tue Apr 24 11:18:18 CEST 2018


In C++, there cannot be more than one definition of a single type in the
entire program (1). This has been reported by #17078 and #18033.

Contrary to my first proposal (2), this patchset only converts p_sys to
void* (#17078). The namespace/typedefs will be changed separately.

Concretely:
 1. Declare references to private data as void* instead of XXX_sys_t*.
 2. Adapt code that now dereferences void*.

There are 16 XXX_sys_t types (in include/vlc_common.h), but stream_t
already uses void* for its private data, and demux/access use stream_t.
Therefore, this patchset contains 13 patches, one per type change.

There are still other types with a member having type XXX_sys_t* outside
vlc_common.h. They are not replaced yet.

I applied some changes in .m files too, but did not compile them, so I
would appreciate a review/compilation from an apple-guy :)

(1) <http://en.cppreference.com/w/cpp/language/definition#One_Definition_Rule>
(2) <https://mailman.videolan.org/pipermail/vlc-devel/2018-April/118805.html>

Romain Vimont (13):
  Replace service_discovery_sys_t* by void*
  Replace es_out_sys_t* by void*
  Replace aout_sys_t* by void*
  Replace picture_sys_t* by void*
  Replace sout_access_out_sys_t* by void*
  Replace sout_mux_sys_t* by void*
  Replace sout_stream_sys_t* by void*
  Replace decoder_sys_t* by void*
  Replace encoder_sys_t* by void*
  Replace filter_sys_t* by void*
  Replace xml_sys_t* by void*
  Replace xml_reader_sys_t* by void*
  Replace vod_sys_t* by void*

 include/vlc_aout.h                            |   2 +-
 include/vlc_codec.h                           |   4 +-
 include/vlc_es_out.h                          |   2 +-
 include/vlc_filter.h                          |   2 +-
 include/vlc_picture.h                         |   2 +-
 include/vlc_services_discovery.h              |   2 +-
 include/vlc_sout.h                            |   6 +-
 include/vlc_vod.h                             |   2 +-
 include/vlc_xml.h                             |   4 +-
 modules/access/bluray.c                       |  22 ++--
 .../audio_filter/channel_mixer/headphone.c    |   7 +-
 modules/audio_filter/channel_mixer/mono.c     |   9 +-
 modules/audio_filter/channel_mixer/trivial.c  |  15 ++-
 modules/audio_filter/converter/tospdif.c      |  10 +-
 modules/audio_filter/normvol.c                |   2 +-
 modules/audio_filter/param_eq.c               |  10 +-
 modules/audio_filter/scaletempo.c             |   3 +-
 .../audio_filter/spatializer/spatializer.cpp  |   6 +-
 modules/audio_output/alsa.c                   |   9 +-
 modules/audio_output/file.c                   |  70 +++++-----
 modules/audio_output/pulse.c                  |   3 +-
 modules/audio_output/sndio.c                  |   3 +-
 modules/codec/avcodec/subtitle.c              |   4 +-
 modules/codec/avcodec/video.c                 |  19 +--
 modules/codec/cc.c                            |   3 +-
 modules/codec/crystalhd.c                     |  11 +-
 modules/codec/cvdsub.c                        |   4 +-
 modules/codec/flac.c                          |  13 +-
 modules/codec/kate.c                          |   9 +-
 modules/codec/oggspots.c                      |   3 +-
 modules/codec/opus.c                          |   4 +-
 modules/codec/png.c                           |  11 +-
 modules/codec/rawvideo.c                      |   2 +-
 modules/codec/scte18.c                        |   4 +-
 modules/codec/speex.c                         |  11 +-
 modules/codec/spudec/spudec.c                 |   5 +-
 modules/codec/stl.c                           |  10 +-
 modules/codec/textst.c                        |  15 ++-
 modules/codec/theora.c                        |  14 +-
 modules/codec/ttml/substtml.c                 |   5 +-
 modules/codec/vorbis.c                        |   9 +-
 modules/codec/webvtt/subsvtt.c                |  24 ++--
 modules/demux/avformat/mux.c                  |   3 +-
 modules/hw/vaapi/chroma.c                     |   9 +-
 modules/hw/vaapi/filters.c                    |   3 +-
 modules/hw/vaapi/vlc_vaapi.c                  |   8 +-
 modules/hw/vdpau/chroma.c                     |   7 +-
 modules/hw/vdpau/display.c                    |   3 +-
 modules/misc/rtsp.c                           |  32 +++--
 modules/misc/xml/libxml.c                     |  11 +-
 modules/mux/ogg.c                             |  42 +++---
 modules/packetizer/avparser.c                 |   9 +-
 modules/packetizer/copy.c                     |  19 +--
 modules/packetizer/h264.c                     |   5 +-
 modules/packetizer/hevc.c                     |   5 +-
 modules/packetizer/mpeg4audio.c               |   5 +-
 modules/packetizer/mpeg4video.c               |  12 +-
 modules/packetizer/mpegaudio.c                |   2 +-
 modules/services_discovery/microdns.c         |  21 +--
 modules/services_discovery/mtp.c              |  39 +++---
 modules/services_discovery/podcast.c          |  12 +-
 modules/services_discovery/sap.c              |  33 ++---
 modules/services_discovery/upnp.cpp           |   4 +-
 modules/spu/subsdelay.c                       |  42 +++---
 modules/stream_out/chromecast/cast.cpp        |  24 ++--
 modules/stream_out/rtp.c                      |  13 +-
 modules/stream_out/setid.c                    |  14 +-
 modules/stream_out/standard.c                 |  12 +-
 modules/stream_out/transcode/audio.c          |   2 +-
 modules/stream_out/transcode/video.c          |  52 ++++----
 modules/stream_out/vod.c                      |   3 +-
 modules/text_renderer/freetype/freetype.c     |   7 +-
 modules/text_renderer/freetype/text_layout.c  |   4 +-
 modules/text_renderer/svg.c                   |  10 +-
 modules/video_chroma/chain.c                  |  61 +++++----
 modules/video_chroma/i420_rgb.c               |  99 ++++++++-------
 modules/video_chroma/i420_rgb16.c             |  16 ++-
 modules/video_chroma/i420_rgb16_x86.c         |  36 ++++--
 modules/video_chroma/i420_rgb8.c              |   6 +-
 modules/video_filter/alphamask.c              |   7 +-
 modules/video_filter/antiflicker.c            |  58 +++++----
 modules/video_filter/ball.c                   | 120 +++++++++---------
 modules/video_filter/blend.cpp                |   5 +-
 modules/video_filter/canvas.c                 |   8 +-
 modules/video_filter/deinterlace/algo_basic.c |   9 +-
 .../video_filter/deinterlace/deinterlace.c    |  12 +-
 modules/video_filter/deinterlace/helpers.c    |   2 +
 modules/video_filter/deinterlace/merge.h      |   4 +-
 modules/video_filter/erase.c                  |  10 +-
 modules/video_filter/extract.c                |  22 ++--
 modules/video_filter/fps.c                    |   7 +-
 modules/video_filter/gaussianblur.c           |  26 ++--
 modules/video_filter/gradient.c               |  85 +++++++------
 modules/video_filter/motionblur.c             |  24 ++--
 modules/video_filter/psychedelic.c            | 108 ++++++++--------
 modules/video_filter/puzzle_mgt.c             |   8 +-
 modules/video_filter/puzzle_pce.c             |   6 +-
 modules/video_filter/ripple.c                 |  18 +--
 modules/video_filter/sharpen.c                |  13 +-
 modules/video_filter/wave.c                   |  16 +--
 modules/video_output/opengl/converter_sw.c    |  13 +-
 modules/video_output/opengl/converter_vdpau.c |  13 +-
 modules/visualization/glspectrum.c            |   3 +-
 modules/visualization/visual/visual.c         |   5 +-
 src/input/es_out.c                            |  15 ++-
 105 files changed, 947 insertions(+), 730 deletions(-)

-- 
2.17.0



More information about the vlc-devel mailing list