[vlc-devel] [PATCH 00/11] es_format_t access cleaning

Steve Lhomme robux4 at videolabs.io
Thu Jul 13 15:44:33 CEST 2017


Following the previous set of 9 patches I updated the code to correct issues
discussed.

As before the packetizer is now assumed to have the same format on input and
output. The output being forced to be packetized. With this core change
packetizers don't need to anything on the fmt_out on init or it's probably
wrong (this could be enforced with an assert later). The packetized flag is 
before opening the packetizer module(s). On error the packtizer is destroyed
so it won't matter which value it had.

I added es_format_Replace() to specifically tell when an es_format_t copy is
done on a previously initilaized es_format_t. Meaning it has to be cleaned as
it may contain various dynamically allocated buffers. I have some code
instrumentation that can be used to make sure es_format_XXX calls are clean,
not included in this patchset.

The last may part is adding a helper function to the core to load a decoder
module. This avoids possible errors in calls and make sure the fmt_out is
always as expected when going through modules to find a matching one. Some
of the transcoders fill fmt_out prior to loading the decoder. It might not
be correct as that's not what decoders expect in normal playback. But for now
I kept the distinct behaviour.

Steve Lhomme (11):
  core: use the same ES format on input and output of packetizers
  core: force the output to b_packetized when a packetizer is opened
    successfully
  modules: no need to set b_packetizer on the packetizer output anymore
  modules:packetizers: no need to initialize the fmt_out anymore
  vlc_es.h: add es_format_Replace() to explicitly initialize an ES from
    another ES
  core: use es_format_Replace when copying an es_format_t on an
    initialized one
  modules: use es_format_Replace when copying an es_format_t on an
    initialized one
  decoder: add a function to create a decoder module
  image: use the new decoder_LoadModule()
  decoder: add the possibility to have a custom fmt_out setup to load a
    decoder
  modules:stream_out: use the new decoder_LoadModule()

 include/vlc_codec.h                  | 10 +++++++
 include/vlc_es.h                     | 11 +++++++
 modules/codec/aes3.c                 |  2 --
 modules/codec/cvdsub.c               |  1 -
 modules/codec/daala.c                |  3 --
 modules/codec/ddummy.c               |  2 +-
 modules/codec/kate.c                 |  3 --
 modules/codec/oggspots.c             |  4 +--
 modules/codec/rawvideo.c             |  2 +-
 modules/codec/speex.c                |  3 --
 modules/codec/spudec/spudec.c        |  1 -
 modules/codec/theora.c               |  3 --
 modules/codec/vorbis.c               |  3 --
 modules/codec/xwd.c                  |  2 +-
 modules/demux/mpeg/ts_psi.c          |  4 +--
 modules/demux/mpeg/ts_sl.c           |  4 +--
 modules/demux/ogg.c                  |  4 +--
 modules/hw/mmal/deinterlace.c        |  2 +-
 modules/mux/mp4/mp4.c                |  2 +-
 modules/packetizer/a52.c             |  4 ---
 modules/packetizer/avparser.c        |  2 --
 modules/packetizer/copy.c            |  4 ---
 modules/packetizer/dirac.c           |  2 --
 modules/packetizer/dts.c             |  4 ---
 modules/packetizer/flac.c            |  6 ----
 modules/packetizer/h264.c            |  5 ----
 modules/packetizer/hevc.c            |  4 ---
 modules/packetizer/mlp.c             |  2 --
 modules/packetizer/mpeg4audio.c      |  9 ------
 modules/packetizer/mpeg4video.c      | 18 +-----------
 modules/packetizer/mpegvideo.c       |  4 ---
 modules/packetizer/vc1.c             |  1 -
 modules/stream_out/mosaic_bridge.c   | 18 ++++++++----
 modules/stream_out/transcode/audio.c | 18 ++++++++----
 modules/stream_out/transcode/spu.c   |  3 +-
 modules/stream_out/transcode/video.c | 22 +++++++++-----
 modules/video_chroma/chain.c         |  5 ++--
 modules/video_filter/canvas.c        |  2 +-
 src/input/decoder.c                  | 56 +++++++++++++++++++++++++++---------
 src/input/demux.c                    |  4 ++-
 src/input/es_out.c                   |  3 +-
 src/libvlccore.sym                   |  1 +
 src/misc/filter_chain.c              | 16 +++--------
 src/misc/image.c                     |  3 +-
 44 files changed, 131 insertions(+), 151 deletions(-)

-- 
2.12.1



More information about the vlc-devel mailing list