[vlc-devel] [PATCH 04/18] decoder: add a function to create a decoder module

Steve Lhomme robux4 at gmail.com
Tue Jul 18 09:32:34 CEST 2017


On Tue, Jul 18, 2017 at 6:28 AM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le 17 juillet 2017 23:40:13 GMT+08:00, Steve Lhomme <robux4 at gmail.com> a
> écrit :
>>
>> On Mon, Jul 17, 2017 at 5:02 PM, Rémi Denis-Courmont <remi at remlab.net>
>> wrote:
>>>
>>>  On lundi 17 juillet 2017 16:33:10 EEST Steve Lhomme wrote:
>>>>
>>>>  And add a sanity check for the ES category.
>>>
>>>
>>>  I don't think this grants a new function TBH. This is such a narrow
>>> wrapper.
>>
>>
>> Yeah it's not big but apart from the core there are 3 modules that
>> also load a decoder. And they could/should benefit from the extra
>> safety on fmt_out when loading a module. Unfortunately there is
>> nothing that would allow creating a decoder_t directly. There's
>> input_DecoderCreate() but it depends on input_resource_t that they
>> don't have.
>>
>>>  We don't usually expose such functionality - instead combining object
>>> creation
>>>  and module loading.
>>>
>>>
>>>  --
>>>  Rémi Denis-Courmont
>>> ________________________________
>>>
>>>  vlc-devel mailing list
>>>  To unsubscribe or modify your subscription options:
>>>  https://mailman.videolan.org/listinfo/vlc-devel
>>
>> ________________________________
>>
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
>
> I don't really buy it. The function semantics are very tightly coupled with
> the calling code, especially given the callback parameter.
>
> If you want to rationalize this, the "modern" pattern defined by Laurent
> consists of providing an "owner" structure pointer for the callbacks and
> private data of the caller. This allows to keep object allocation,
> initialization and module probing in a single function.

The decoder owner (decoder_owner_sys_t*) is opaque to the decoder. So
I don't see how it could be used by generic code to find callbacks to
call.

> --
> Rémi Denis-Courmont
> Typed on an inconvenient virtual keyboard
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list