[vlc-devel] [PATCH 2/4] core: dec-dev: add vlc_decoder_device_GetName()

Rémi Denis-Courmont remi at remlab.net
Thu Jan 16 19:09:55 CET 2020


Le torstaina 16. tammikuuta 2020, 18.41.35 EET Thomas Guillem a écrit :
> Returns the name of the decoder device module. It will be used by the vout
> in next commits.
> ---
>  src/input/decoder_helpers.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
> index e7926901a85..824bf17a664 100644
> --- a/src/input/decoder_helpers.c
> +++ b/src/input/decoder_helpers.c
> @@ -169,6 +169,7 @@ void decoder_AbortPictures(decoder_t *dec, bool abort)
>  struct vlc_decoder_device_priv
>  {
>      struct vlc_decoder_device device;
> +    const char *name;
>      vlc_atomic_rc_t rc;
>  };
> 
> @@ -202,6 +203,10 @@ vlc_decoder_device_Create(vlc_object_t *o, const char
> *name, vlc_object_delete(&priv->device);
>          return NULL;
>      }
> +
> +    priv->name = module_get_name(module, false);

This cannot be right. The module name means explicitly nothing other than 
debug info.

> +    assert(priv->name);
> +
>      assert(priv->device.ops != NULL);
>      vlc_atomic_rc_init(&priv->rc);
>      return &priv->device;
> @@ -230,6 +235,14 @@ vlc_decoder_device_Release(vlc_decoder_device *device)
>      }
>  }
> 
> +const char *
> +vlc_decoder_device_GetName(vlc_decoder_device *device)
> +{
> +    struct vlc_decoder_device_priv *priv =
> +            container_of(device, struct vlc_decoder_device_priv, device);
> +    return priv->name;
> +}
> +
>  /* video context */
> 
>  struct vlc_video_context


-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list