Re: [FFmpeg-devel] [PATCH] avformat/format: temporarily use old next api

2018-02-09 Thread Muhammad Faiz
On Sat, Feb 10, 2018 at 1:08 AM, Muhammad Faiz  wrote:
> On Fri, Feb 9, 2018 at 7:04 PM, James Almer  wrote:
>> On 2/9/2018 7:16 AM, Muhammad Faiz wrote:
>>> Should fix 
>>> https://ffmpeg.org/pipermail/ffmpeg-devel/2018-February/225066.html
>>>
>>> Signed-off-by: Muhammad Faiz 
>>> ---
>>> The actual problem is that av*next() and av*iterate() have different
>>> semantics:
>>>   - av*next() iterate all formats+devices
>>>   - av*iterate() iterate formats only.
>>> Is this the intended behaviour?
>>>
>>>  libavformat/format.c | 13 -
>>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/libavformat/format.c b/libavformat/format.c
>>> index b8c5a90a92..75951938cf 100644
>>> --- a/libavformat/format.c
>>> +++ b/libavformat/format.c
>>> @@ -52,7 +52,9 @@ AVOutputFormat *av_guess_format(const char *short_name, 
>>> const char *filename,
>>>  const char *mime_type)
>>>  {
>>>  AVOutputFormat *fmt = NULL, *fmt_found;
>>> +#if !FF_API_NEXT
>>>  void *i = 0;
>>> +#endif
>>>  int score_max, score;
>>>
>>>  /* specific test for image sequences */
>>> @@ -66,7 +68,13 @@ AVOutputFormat *av_guess_format(const char *short_name, 
>>> const char *filename,
>>>  /* Find the proper file type. */
>>>  fmt_found = NULL;
>>>  score_max = 0;
>>> -while ((fmt = av_muxer_iterate(&i))) {
>>> +#if FF_API_NEXT
>>> +FF_DISABLE_DEPRECATION_WARNINGS
>>> +while ((fmt = av_oformat_next(fmt)))
>>> +#else
>>> +while ((fmt = av_muxer_iterate(&i)))
>>> +#endif
>>> + {
>>>  score = 0;
>>>  if (fmt->name && short_name && av_match_name(short_name, 
>>> fmt->name))
>>>  score += 100;
>>> @@ -81,6 +89,9 @@ AVOutputFormat *av_guess_format(const char *short_name, 
>>> const char *filename,
>>>  fmt_found = fmt;
>>>  }
>>>  }
>>> +#if FF_API_NEXT
>>> +FF_ENABLE_DEPRECATION_WARNINGS
>>> +#endif
>>>  return fmt_found;
>>>  }
>>
>> Is your intention to schedule this change to happen once the deprecation
>> period ends two years from now, or were you just disabling it for a bit
>> until the new API is fixed/finalized?
>> If the latter, then please don't add the wrappers. Just replace the
>> _iterate() calls.
>
> My intention is the first. With assumption that people agree with
> current new API, and
> the different semantic between av_iformat/oformat_next (which iterate
> formats+devices)
> and av_muxer/demuxer_iterate (which iterate formats only) is intended 
> behaviour.
>
> Thank's.

Pushed.

Thank's.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/format: temporarily use old next api

2018-02-09 Thread Muhammad Faiz
On Fri, Feb 9, 2018 at 7:04 PM, James Almer  wrote:
> On 2/9/2018 7:16 AM, Muhammad Faiz wrote:
>> Should fix 
>> https://ffmpeg.org/pipermail/ffmpeg-devel/2018-February/225066.html
>>
>> Signed-off-by: Muhammad Faiz 
>> ---
>> The actual problem is that av*next() and av*iterate() have different
>> semantics:
>>   - av*next() iterate all formats+devices
>>   - av*iterate() iterate formats only.
>> Is this the intended behaviour?
>>
>>  libavformat/format.c | 13 -
>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/format.c b/libavformat/format.c
>> index b8c5a90a92..75951938cf 100644
>> --- a/libavformat/format.c
>> +++ b/libavformat/format.c
>> @@ -52,7 +52,9 @@ AVOutputFormat *av_guess_format(const char *short_name, 
>> const char *filename,
>>  const char *mime_type)
>>  {
>>  AVOutputFormat *fmt = NULL, *fmt_found;
>> +#if !FF_API_NEXT
>>  void *i = 0;
>> +#endif
>>  int score_max, score;
>>
>>  /* specific test for image sequences */
>> @@ -66,7 +68,13 @@ AVOutputFormat *av_guess_format(const char *short_name, 
>> const char *filename,
>>  /* Find the proper file type. */
>>  fmt_found = NULL;
>>  score_max = 0;
>> -while ((fmt = av_muxer_iterate(&i))) {
>> +#if FF_API_NEXT
>> +FF_DISABLE_DEPRECATION_WARNINGS
>> +while ((fmt = av_oformat_next(fmt)))
>> +#else
>> +while ((fmt = av_muxer_iterate(&i)))
>> +#endif
>> + {
>>  score = 0;
>>  if (fmt->name && short_name && av_match_name(short_name, fmt->name))
>>  score += 100;
>> @@ -81,6 +89,9 @@ AVOutputFormat *av_guess_format(const char *short_name, 
>> const char *filename,
>>  fmt_found = fmt;
>>  }
>>  }
>> +#if FF_API_NEXT
>> +FF_ENABLE_DEPRECATION_WARNINGS
>> +#endif
>>  return fmt_found;
>>  }
>
> Is your intention to schedule this change to happen once the deprecation
> period ends two years from now, or were you just disabling it for a bit
> until the new API is fixed/finalized?
> If the latter, then please don't add the wrappers. Just replace the
> _iterate() calls.

My intention is the first. With assumption that people agree with
current new API, and
the different semantic between av_iformat/oformat_next (which iterate
formats+devices)
and av_muxer/demuxer_iterate (which iterate formats only) is intended behaviour.

Thank's.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/format: temporarily use old next api

2018-02-09 Thread James Almer
On 2/9/2018 7:16 AM, Muhammad Faiz wrote:
> Should fix https://ffmpeg.org/pipermail/ffmpeg-devel/2018-February/225066.html
> 
> Signed-off-by: Muhammad Faiz 
> ---
> The actual problem is that av*next() and av*iterate() have different
> semantics:
>   - av*next() iterate all formats+devices
>   - av*iterate() iterate formats only.
> Is this the intended behaviour?
> 
>  libavformat/format.c | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/format.c b/libavformat/format.c
> index b8c5a90a92..75951938cf 100644
> --- a/libavformat/format.c
> +++ b/libavformat/format.c
> @@ -52,7 +52,9 @@ AVOutputFormat *av_guess_format(const char *short_name, 
> const char *filename,
>  const char *mime_type)
>  {
>  AVOutputFormat *fmt = NULL, *fmt_found;
> +#if !FF_API_NEXT
>  void *i = 0;
> +#endif
>  int score_max, score;
>  
>  /* specific test for image sequences */
> @@ -66,7 +68,13 @@ AVOutputFormat *av_guess_format(const char *short_name, 
> const char *filename,
>  /* Find the proper file type. */
>  fmt_found = NULL;
>  score_max = 0;
> -while ((fmt = av_muxer_iterate(&i))) {
> +#if FF_API_NEXT
> +FF_DISABLE_DEPRECATION_WARNINGS
> +while ((fmt = av_oformat_next(fmt)))
> +#else
> +while ((fmt = av_muxer_iterate(&i)))
> +#endif
> + {
>  score = 0;
>  if (fmt->name && short_name && av_match_name(short_name, fmt->name))
>  score += 100;
> @@ -81,6 +89,9 @@ AVOutputFormat *av_guess_format(const char *short_name, 
> const char *filename,
>  fmt_found = fmt;
>  }
>  }
> +#if FF_API_NEXT
> +FF_ENABLE_DEPRECATION_WARNINGS
> +#endif
>  return fmt_found;
>  }

Is your intention to schedule this change to happen once the deprecation
period ends two years from now, or were you just disabling it for a bit
until the new API is fixed/finalized?
If the latter, then please don't add the wrappers. Just replace the
_iterate() calls.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel