hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
851 stars 206 forks source link

Create more fine-grained `--mime-filter` #188

Closed hzeller closed 5 years ago

hzeller commented 5 years ago

There might be certain cases where filtering available mime-types might need to be more fine-grained, e.g. including and excluding specific mime-types.

Currently, this is only filtering top-level mime-types, such as --mime-filter=audio video, only allowing these two top-level but it would be good to e.g. say something like --mime-filter=audio -audio/flac +video/mpeg, essentially allowing only audio, except audio/flac and include video/mpeg as the only allowed video-format.

(this came up in #135)

mill1000 commented 5 years ago

Thinking about how to do this now.

First, I think it makes sense to move the filter setup into upnp_connmgr instead of passing it through upnp_renderer. The filtering is performed in upnp_connmgr anyway so no need for a middle man.

Second, I'll relocate the filter so that it filters the supported_types linked list instead of the CONNMGR_VAR_SINK_PROTO_INFO string.

Now, after the initial filtering by root type (eg. audio, video, image) the specific types can be added or removed (e.g. +/-audio/flac syntax) right before CONNMGR_VAR_SINK_PROTO_INFO is generated.