Skip to content

Draft: [RFC] access: Add a guesstype capability

Hi,

This MR aims at adding new (small) module type, guesstype, which can be used to ask the access module for the actual input item type, rather than only relying on the hardcoded array in input/item.c

The rationale here is that, in order to implement podcast import in the medialibrary, I need to be able to ship a podcast as an XML local file and still have the podcast module kick in, which it won't if the stream doesn't expose some specific content types.

Since the file access doesn't implement STREAM_GET_CONTENT_TYPE, it's currently not possible to do so.

I got this fixed by adding a new content_type module that wraps a regular access module, allowing me use an MRL such as contenttype://content-type=text/xml;path=/path/to/podcast.xml, but this causes the scheme not to be recognized by the current GuessType implementation, causing the preparser to skip an item flagged as ITEM_TYPE_UNKNOWN

By asking the module what type it exposes, I can successfully preparse the item without hardcoding something more in the item.c array.

This could be propagated to each modules and completely drop the hardcoded array if need be

v2

  • Remove the content type module
  • Apply suggestions from review
Edited by Hugo Beauzée-Luyssen

Merge request reports