[vlc-devel] [PATCH 1/8] ES: add a property to audio_format_t for Ambisonics support

Rémi Denis-Courmont remi at remlab.net
Fri Feb 24 18:51:39 CET 2017


Le perjantaina 24. helmikuuta 2017, 16.14.55 EET Adrien Maglo a écrit :
> ---
>  include/vlc_es.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/include/vlc_es.h b/include/vlc_es.h
> index c8dd4c4..cc797b6 100644
> --- a/include/vlc_es.h
> +++ b/include/vlc_es.h
> @@ -65,6 +65,16 @@ typedef struct
>      float      pf_gain[AUDIO_REPLAY_GAIN_MAX];
>  } audio_replay_gain_t;
> 
> +
> +/**
> + * audio channel type
> + */
> +typedef enum audio_channel_type_t
> +{
> +    PHYSICAL_CHANNELS = 0,
> +    AMBISONICS_CHANNELS,

Missing any kind of namespacing.

> +} audio_channel_type_t;

Is there any particular reason to make the starting point explicit?

Also, should it not be channel*s* type?

> +
>  /**
>   * audio format description
>   */
> @@ -81,6 +91,9 @@ struct audio_format_t
>       * buffer is derived. */
>      uint32_t     i_original_channels;
> 
> +    /* Channel type */
> +    audio_channel_type_t channel_type;
> +
>      /* Optional - for A/52, SPDIF and DTS types : */
>      /* Bytes used by one compressed frame, depends on bitrate. */
>      unsigned int i_bytes_per_frame;

Frankly, I don´t recommend adding a new member, especially not an enumeration, 
as dealing with it throughout the code base will be painstakingly tedious. I 
suspect that the rest of the patch series only scratches the surface.

If it were possible, I would just define new formats, as there is still plenty 
of space left in the 32-bits number space. But I suppose that you want 
orthogonality to the sample format; then I admittedly don´t have any better 
idea.

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



More information about the vlc-devel mailing list