Re: [libav-devel] [PATCH 18/25] lavr: Only let pass-through ambisonic channel layouts

2017-06-29 Thread Vittorio Giovara
On Thu, Jun 29, 2017 at 5:23 AM, wm4  wrote:
> On Wed, 28 Jun 2017 18:11:02 -0400
> Vittorio Giovara  wrote:
>
>> Resampling or conversion to/from ambisonic audio are currently
>> unsupported features.
>>
>> Signed-off-by: Vittorio Giovara 
>> ---
>>  libavresample/utils.c | 8 
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/libavresample/utils.c b/libavresample/utils.c
>> index 15c827efbe..af2b9dbf2d 100644
>> --- a/libavresample/utils.c
>> +++ b/libavresample/utils.c
>> @@ -70,6 +70,14 @@ int avresample_open(AVAudioResampleContext *avr)
>>  av_channel_layout_default(>out_ch_layout, 
>> avr->out_ch_layout.nb_channels);
>>  }
>>
>> +if (( avr->in_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC ||
>> + avr->out_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC) &&
>> +av_channel_layout_compare(>in_ch_layout, >out_ch_layout)) 
>> {
>> +av_log(avr, AV_LOG_ERROR,
>> +   "Resampling to/from ambisonic channel layouts is not 
>> supported.\n");
>> +return AVERROR(ENOSYS);
>> +}
>> +
>>  /* set channel mixing parameters */
>>  #if FF_API_OLD_CHANNEL_LAYOUT
>>  if (avr->in_channel_layout) {
>
> Did it error out in all cases before this patch? It shouldn't use a
> blacklist for unknown channel orders, but a whitelist for supported
> ones.

In the past it used to support up any layout up to 62 channels, but it
never errored out.
I will change it to use a whitelist for only NATIVE and UNSPEC orders,
in the first lavr patch, and modify this one to only allow
passthrough.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 18/25] lavr: Only let pass-through ambisonic channel layouts

2017-06-29 Thread Vittorio Giovara
On Thu, Jun 29, 2017 at 3:22 AM, Diego Biurrun  wrote:
> On Wed, Jun 28, 2017 at 06:11:02PM -0400, Vittorio Giovara wrote:
>> Resampling or conversion to/from ambisonic audio are currently
>> unsupported features.
>
> Maybe you mean something like
>
>   lavr: Only allow pass-through of ambisonic channel layouts
>
> ? Your current commit title does not parse...

Yeah that is good. I tried to convey the fact that as long as you
don't change channel order, you're fine with using an ambisonic
channel layout for input and output.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 18/25] lavr: Only let pass-through ambisonic channel layouts

2017-06-29 Thread wm4
On Wed, 28 Jun 2017 18:11:02 -0400
Vittorio Giovara  wrote:

> Resampling or conversion to/from ambisonic audio are currently
> unsupported features.
> 
> Signed-off-by: Vittorio Giovara 
> ---
>  libavresample/utils.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavresample/utils.c b/libavresample/utils.c
> index 15c827efbe..af2b9dbf2d 100644
> --- a/libavresample/utils.c
> +++ b/libavresample/utils.c
> @@ -70,6 +70,14 @@ int avresample_open(AVAudioResampleContext *avr)
>  av_channel_layout_default(>out_ch_layout, 
> avr->out_ch_layout.nb_channels);
>  }
>  
> +if (( avr->in_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC ||
> + avr->out_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC) &&
> +av_channel_layout_compare(>in_ch_layout, >out_ch_layout)) {
> +av_log(avr, AV_LOG_ERROR,
> +   "Resampling to/from ambisonic channel layouts is not 
> supported.\n");
> +return AVERROR(ENOSYS);
> +}
> +
>  /* set channel mixing parameters */
>  #if FF_API_OLD_CHANNEL_LAYOUT
>  if (avr->in_channel_layout) {

Did it error out in all cases before this patch? It shouldn't use a
blacklist for unknown channel orders, but a whitelist for supported
ones.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 18/25] lavr: Only let pass-through ambisonic channel layouts

2017-06-29 Thread Diego Biurrun
On Wed, Jun 28, 2017 at 06:11:02PM -0400, Vittorio Giovara wrote:
> Resampling or conversion to/from ambisonic audio are currently
> unsupported features.

Maybe you mean something like

  lavr: Only allow pass-through of ambisonic channel layouts

? Your current commit title does not parse...

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 18/25] lavr: Only let pass-through ambisonic channel layouts

2017-06-28 Thread Vittorio Giovara
Resampling or conversion to/from ambisonic audio are currently
unsupported features.

Signed-off-by: Vittorio Giovara 
---
 libavresample/utils.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavresample/utils.c b/libavresample/utils.c
index 15c827efbe..af2b9dbf2d 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -70,6 +70,14 @@ int avresample_open(AVAudioResampleContext *avr)
 av_channel_layout_default(>out_ch_layout, 
avr->out_ch_layout.nb_channels);
 }
 
+if (( avr->in_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC ||
+ avr->out_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC) &&
+av_channel_layout_compare(>in_ch_layout, >out_ch_layout)) {
+av_log(avr, AV_LOG_ERROR,
+   "Resampling to/from ambisonic channel layouts is not 
supported.\n");
+return AVERROR(ENOSYS);
+}
+
 /* set channel mixing parameters */
 #if FF_API_OLD_CHANNEL_LAYOUT
 if (avr->in_channel_layout) {
-- 
2.13.1

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel