[vlc-devel] [PATCH 0/5] Decoder fallback

Thomas Guillem thomas at gllm.fr
Wed Jun 3 17:35:40 CEST 2015


This set of patches add the decoder module fallback feature: if a decoder
module fails during playback (from pf_decode or when updating audio/video
format), the Decoder thread will be able to fallback to the next decoder
module.

Example of real cases:
1/ Fallback to avcodec when MediaCodec fails after receiving the first input
buffers
2/ Get ride of all audio_filter/converter/* and move them to codec/

First, I had to patch the module code in order to add a way to load a module
coming right after an other one in the priority list, see patches 1 and 2.

Then, I moved Decoder Create and Delete code that is module specific, see patch
3.

Then, I implemented the decoder fallback, see patch 4. There is one tricky part
where I'm not sure and would like your comments. I moved the module_unneed call
from the input thread to the decoder thread. Are there some module that need
the Open and the Close function to be on the same thread ? If it's not
accepted, should I send an ES event from the decoder thread to the input thread
to close the decoder ?

Finally, I added the fallback in MediaCodec.

When/if this set of patches is accepted, I'll look into the video/audio
update_format function in order to add a decoder fallback here.

Regards,
Thomas.

Thomas Guillem (5):
  modules: module_list_cap sort list using the name argument
  modules: add vlc_module_load_next/module_need_next
  decoder: refactor decoder module create/delete
  decoder: add a way to try an other decoder module
  mediacodec: try next decoder in case of error

 include/vlc_codec.h              |   1 +
 include/vlc_modules.h            |  11 +-
 modules/codec/omxil/mediacodec.c |  12 +-
 src/config/core.c                |  11 +-
 src/input/decoder.c              | 280 ++++++++++++++++++++++-----------------
 src/libvlccore.sym               |   4 +-
 src/modules/bank.c               | 115 ++++++++++++++--
 src/modules/modules.c            | 110 +++++----------
 src/modules/modules.h            |   9 +-
 9 files changed, 319 insertions(+), 234 deletions(-)

-- 
2.1.4




More information about the vlc-devel mailing list