[vlc-devel] [PATCH 07/11] mosaic_bridge: implement the get_device to provide a decoder device to the decoder

Steve Lhomme robux4 at ycbcr.xyz
Thu Nov 14 08:01:26 CET 2019


On 2019-11-13 18:00, Alexandre Janniaux wrote:
> Hi,
> 
> I'm OK with this state of the patch and whole set, though
> I didn't test yet.
> 
> However, this patch rings a bell in my understanding.
> In the case of mosaic, we might still want to use HW
> buffers if we can, even if it also needs changes in the
> handling of SPU.
> 
> In this case, we probably still want to match the decoder
> device with the one which might be used later in the sout
> chain, like `display`. Is there a plan for this already or
> is it too soon?

In general we use one "decoder device" (hardware device) for one 
decoding + rendering pipeline (rendering might be display, streaming, 
file saving). I don't know exactly how the mosaic bridge module works 
but if you display a mosaic on a single screen that would mean the 
"decoder device" should probably correspond to that single screen, for 
all mosaic sources.

There should be a way to propagate the decoder device matching the 
"display" in stream output back to the decoder(s) via the bridge(s). 
Just like we propagate it from the vout to the decoder(s) in regular 
playback. I haven't investigated in details on the mosaic/bridge works yet.

> Regards,
> --
> Alexandre Janniaux
> Videolabs
> 
> On Mon, Nov 04, 2019 at 01:05:26PM +0100, Steve Lhomme wrote:
>> The decoder device is created with a NULL window. This can work with some
>> decoder devices but in some case none will be created and we just get NULL.
>> ---
>>   modules/stream_out/mosaic_bridge.c | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>>
>> diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
>> index 896ce2372eb..268a9588e75 100644
>> --- a/modules/stream_out/mosaic_bridge.c
>> +++ b/modules/stream_out/mosaic_bridge.c
>> @@ -64,6 +64,7 @@ typedef struct
>>   struct decoder_owner
>>   {
>>       decoder_t dec;
>> +    vlc_decoder_device *dec_dev;
>>       sout_stream_t *p_stream;
>>   };
>>
>> @@ -251,6 +252,16 @@ static int Open( vlc_object_t *p_this )
>>       return VLC_SUCCESS;
>>   }
>>
>> +static vlc_decoder_device * video_get_decoder_device( decoder_t *p_dec )
>> +{
>> +    struct decoder_owner *p_owner = dec_get_owner( p_dec );
>> +    if ( p_owner->dec_dev == NULL )
>> +    {
>> +        p_owner->dec_dev = vlc_decoder_device_Create(p_dec, NULL);
>> +    }
>> +    return p_owner->dec_dev ? vlc_decoder_device_Hold(p_owner->dec_dev) : NULL;
>> +}
>> +
>>   /*****************************************************************************
>>    * Close
>>    *****************************************************************************/
>> @@ -273,6 +284,12 @@ static void Close( vlc_object_t * p_this )
>>
>>   static void ReleaseDecoder( decoder_t *p_dec )
>>   {
>> +    struct decoder_owner *p_owner = dec_get_owner( p_dec );
>> +    if ( p_owner->dec_dev )
>> +    {
>> +        vlc_decoder_device_Release( p_owner->dec_dev );
>> +        p_owner->dec_dev = NULL;
>> +    }
>>       decoder_Destroy( p_dec );
>>   }
>>
>> @@ -303,6 +320,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
>>       static const struct decoder_owner_callbacks dec_cbs =
>>       {
>>           .video = {
>> +            .get_device = video_get_decoder_device,
>>               .format_update = video_update_format_decoder,
>>               .queue = decoder_queue_video,
>>           },
>> --
>> 2.17.1
>>
>> _______________________________________________
>> 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
> 


More information about the vlc-devel mailing list