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

Alexandre Janniaux ajanni at videolabs.io
Wed Nov 13 18:00:49 CET 2019


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?

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


More information about the vlc-devel mailing list