[vlc-devel] [PATCH 12/39] input: resource: get the decoder device before calling vout_Request()

Steve Lhomme robux4 at ycbcr.xyz
Mon Oct 7 10:21:36 CEST 2019


On 2019-10-05 11:32, Rémi Denis-Courmont wrote:
> Le keskiviikkona 2. lokakuuta 2019, 17.23.27 EEST Steve Lhomme a écrit :
>> ---
>>   src/input/resource.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/input/resource.c b/src/input/resource.c
>> index 984d68e3ffa..71cbbda2f6c 100644
>> --- a/src/input/resource.c
>> +++ b/src/input/resource.c
>> @@ -426,9 +426,12 @@ vout_thread_t
>> *input_resource_GetVoutDecoderDevice(input_resource_t *p_resource, }
>>   #endif
>>
>> -    vlc_decoder_device *dec_dev = vout_GetDevice(cfg);
>> +    if (pp_dec_dev)
>> +    {
>> +        *pp_dec_dev = vout_GetDevice(cfg);
>> +    }
>>
>> -    if (vout_Request(cfg, dec_dev, p_resource->p_input)) {
>> +    if (vout_Request(cfg, pp_dec_dev ? *pp_dec_dev : NULL,
>> p_resource->p_input)) { input_resource_PutVoutLocked(p_resource, cfg->vout,
>> false); vlc_mutex_unlock(&p_resource->lock);
>>           return NULL;
> 
> This seems backward. If the goal is to cache the decoder device, then it
> should be stored in the input resource, along the window - if only because it
> could well outlive the vout, or there may be no vout.

As you pointed out the decoder device and window lifecycles are closely 
related (the decoder device shouldn't be used if its window is 
gone/disabled). But the window is hardly an "input resource" it's more 
likely cached by the host app. If you really want to reverse the order 
you mention in 
https://mailman.videolan.org/pipermail/vlc-devel/2019-October/128214.html 
then it would make even less sense to put the window/decoder device in 
the "input resource" as they would be cached at the "player" level.

For the time being the decoder device is kept and released at the same 
place the window is enabled/disabled.

> I don't think push buffers implementation for the hardware accelerated case can
> be completed until the player window callback exists - and player / input
> resource tracks the window(s).
> 
> -- 
> レミ・デニ-クールモン
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> 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