[FFmpeg-devel] [PATCH] avformat: Replace ffurl_close() by ffurl_closep() where appropriate

2020-05-25 Thread Andreas Rheinhardt
It avoids leaving dangling pointers behind in memory. Also remove redundant checks for whether the URLContext to be closed is already NULL. Signed-off-by: Andreas Rheinhardt --- libavformat/async.c | 4 ++-- libavformat/cache.c | 2 +- libavformat/concat.c

[FFmpeg-devel] [PATCH v2 1/2] lavfi/afir: fix vpad.name leak

2020-05-25 Thread Jun Zhao
From: Jun Zhao Fix vpad.name leak in error path, move the vpad related operation only if enabled show IR frequency response. Signed-off-by: Jun Zhao --- libavfilter/af_afir.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_afir.c

Re: [FFmpeg-devel] [PATCH] lavfi/afir: fix vpad.name leak

2020-05-25 Thread Paul B Mahol
typo in commit message. On 5/25/20, Jun Zhao wrote: > From: Jun Zhao > > Fixed vpad.name leak in error path, move the vpad related operation > only if enabeled show IR frequency response. > > Signed-off-by: Jun Zhao > --- > libavfilter/af_afir.c | 14 ++ > 1 file changed, 6

Re: [FFmpeg-devel] [PATCH] lavfi/afir: fix vpad.name leak

2020-05-25 Thread myp...@gmail.com
On Mon, May 25, 2020 at 3:51 PM Paul B Mahol wrote: > > typo in commit message. Will fix, tks > > On 5/25/20, Jun Zhao wrote: > > From: Jun Zhao > > > > Fixed vpad.name leak in error path, move the vpad related operation > > only if enabeled show IR frequency response. > > > > Signed-off-by:

Re: [FFmpeg-devel] [PATCH v5] libavformat/flacdec: Workaround for truncated metadata picture size

2020-05-25 Thread Mattias Wadman
Hello, ok to merge? On Tue, May 19, 2020 at 11:27 AM Mattias Wadman wrote: > > Some flac muxers write truncated metadata picture size if the picture > data do not fit in 24 bits. Detect this by truncting the size found inside > the picture block and if it matches the block size use it and read

Re: [FFmpeg-devel] [PATCH] avformat: Replace ffurl_close() by ffurl_closep() where appropriate

2020-05-25 Thread Andreas Rheinhardt
Anton Khirnov: > Quoting Andreas Rheinhardt (2020-05-25 08:27:44) >> It avoids leaving dangling pointers behind in memory. >> >> Also remove redundant checks for whether the URLContext to be closed is >> already NULL. >> >> Signed-off-by: Andreas Rheinhardt > > Looks very nice. > Applied.

[FFmpeg-devel] [PATCH 1/2] mfenc: Remove an unused include

2020-05-25 Thread Martin Storsjö
This might have been used originally for the decoder parts of the MediaFoundation wrapper, which aren't merged yet. --- libavcodec/mfenc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c index 83f26b3cc6..3432d48f30 100644 ---

[FFmpeg-devel] [PATCH v2 2/2] lavfi/aiir: Refine the pad/vpad related operation

2020-05-25 Thread Jun Zhao
From: Jun Zhao move the pad/vpad related operation with more natural coding style. Signed-off-by: Jun Zhao --- libavfilter/af_aiir.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index 92ff348..7971cf2 100644 ---

Re: [FFmpeg-devel] [PATCH] avformat: Replace ffurl_close() by ffurl_closep() where appropriate

2020-05-25 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2020-05-25 08:27:44) > It avoids leaving dangling pointers behind in memory. > > Also remove redundant checks for whether the URLContext to be closed is > already NULL. > > Signed-off-by: Andreas Rheinhardt Looks very nice. -- Anton Khirnov

[FFmpeg-devel] [PATCH 2/2] mfenc: Avoid including codecapi.h, fix building in UWP mode with clang

2020-05-25 Thread Martin Storsjö
Including codecapi.h and uuids.h in UWP mode doesn't define all defines properly, ending up with constructs that MSVC silently tolerates, but that clang errors out on, like this: DEFINE_GUIDEX(CODECAPI_AVEncCommonFormatConstraint); Just avoid including codecapi.h completely and hardcode the

Re: [FFmpeg-devel] [PATCH 1/3] doc/APIchanges: fix typo in version number

2020-05-25 Thread James Almer
On 5/25/2020 10:12 AM, Anton Khirnov wrote: > --- > doc/APIchanges | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 56ec9f8ac3..6a03686068 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -31,7 +31,7 @@ API changes, most

Re: [FFmpeg-devel] [PATCH 2/3] avcodec.h: split AVCodec API into its own header

2020-05-25 Thread James Almer
On 5/25/2020 10:31 AM, Anton Khirnov wrote: > Quoting James Almer (2020-05-25 15:21:12) >> On 5/25/2020 10:12 AM, Anton Khirnov wrote: >>> -/** >>> - * Iterate over all registered codecs. >>> - * >>> - * @param opaque a pointer where libavcodec will store the iteration >>> state. Must >>> - *

[FFmpeg-devel] [PATCH 1/5] avformat/aviobuf: Don't check for overflow after it happened

2020-05-25 Thread Andreas Rheinhardt
If adding two ints overflows, it doesn't matter whether the result will be stored in an unsigned or not; and checking afterwards does not make it retroactively defined. Signed-off-by: Andreas Rheinhardt --- libavformat/aviobuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[FFmpeg-devel] [PATCH 2/5] avformat/aviobuf: Simplify dyn_buf_write() a bit

2020-05-25 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavformat/aviobuf.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 33c2d6f037..fcde7e8510 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -1272,22

[FFmpeg-devel] [PATCH 4/5] avformat/aviobuf: Return better error codes

2020-05-25 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavformat/aviobuf.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 688c7c50fd..a13c677875 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -696,7

[FFmpeg-devel] [PATCH 3/5] avformat/aviobuf: Stop restricting dynamic buffer sizes to INT_MAX/2

2020-05-25 Thread Andreas Rheinhardt
This has originally been done in 568e18b15e2ddf494fd8926707d34ca08c8edce5 as a precaution against integer overflows, but it is actually easy to support the full range of int without overflows. Signed-off-by: Andreas Rheinhardt --- libavformat/aviobuf.c | 4 +++- 1 file changed, 3 insertions(+),

[FFmpeg-devel] [PATCH 5/5] avformat/aviobuf: Also return truncated buffer in avio_get_dyn_buf()

2020-05-25 Thread Andreas Rheinhardt
Two kinds of errors can happen when working with dynamic buffers: (Re)allocation errors or truncation errors (one has to truncate the buffer to a size of INT_MAX because avio_close_dyn_buf() and avio_get_dyn_buf() both return an int). Right now, avio_get_dyn_buf() returns an empty buffer in either

Re: [FFmpeg-devel] [PATCH 1/5] avformat/aviobuf: Don't check for overflow after it happened

2020-05-25 Thread Andreas Rheinhardt
James Almer: > On 5/25/2020 11:07 AM, Andreas Rheinhardt wrote: >> If adding two ints overflows, it doesn't matter whether the result will >> be stored in an unsigned or not; and checking afterwards does not make it >> retroactively defined. >> >> Signed-off-by: Andreas Rheinhardt >> --- >>

Re: [FFmpeg-devel] [PATCH 2/3] avcodec.h: split AVCodec API into its own header

2020-05-25 Thread Anton Khirnov
Quoting James Almer (2020-05-25 15:21:12) > On 5/25/2020 10:12 AM, Anton Khirnov wrote: > > -/** > > - * Iterate over all registered codecs. > > - * > > - * @param opaque a pointer where libavcodec will store the iteration > > state. Must > > - * point to NULL to start the

Re: [FFmpeg-devel] [PATCH 1/5] avformat/aviobuf: Don't check for overflow after it happened

2020-05-25 Thread James Almer
On 5/25/2020 11:07 AM, Andreas Rheinhardt wrote: > If adding two ints overflows, it doesn't matter whether the result will > be stored in an unsigned or not; and checking afterwards does not make it > retroactively defined. > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/aviobuf.c | 2

[FFmpeg-devel] [PATCH 1/2] dnn_backend_native_layer_mathunary: add abs support

2020-05-25 Thread Ting Fu
more math unary operations will be added here It can be tested with the model file generated with below python scripy: import tensorflow as tf import numpy as np import imageio in_img = imageio.imread('input.jpeg') in_img = in_img.astype(np.float32)/255.0 in_data = in_img[np.newaxis, :] x =

[FFmpeg-devel] [PATCH 2/2] dnn-layer-mathunary-test: add unit test for abs

2020-05-25 Thread Ting Fu
Signed-off-by: Ting Fu --- tests/dnn/.gitignore | 1 + tests/dnn/Makefile | 1 + tests/dnn/dnn-layer-mathunary-test.c | 81 tests/fate/dnn.mak | 5 ++ 4 files changed, 88 insertions(+) create mode 100644

[FFmpeg-devel] [PATCH] avfilter: add iir video filter

2020-05-25 Thread Paul B Mahol
Signed-off-by: Paul B Mahol --- doc/filters.texi | 18 ++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_iir.c | 410 +++ 4 files changed, 430 insertions(+) create mode 100644 libavfilter/vf_iir.c diff --git

[FFmpeg-devel] [PATCH 3/3] avformat/prompeg: use av_dict_set_int() instead

2020-05-25 Thread lance . lmwang
From: Limin Wang Signed-off-by: Limin Wang --- libavformat/prompeg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/prompeg.c b/libavformat/prompeg.c index 9770a916a2..7b2e5e8344 100644 --- a/libavformat/prompeg.c +++ b/libavformat/prompeg.c @@ -291,8 +291,7

[FFmpeg-devel] [PATCH 3/3] avcodec.h: move avcodec_get_{type, name} to codec_id.h

2020-05-25 Thread Anton Khirnov
--- libavcodec/avcodec.h | 11 --- libavcodec/codec_id.h | 12 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 4f46a1fb2e..01099bc8cd 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4115,17

Re: [FFmpeg-devel] [PATCH 2/3] avcodec.h: split AVCodec API into its own header

2020-05-25 Thread James Almer
On 5/25/2020 10:12 AM, Anton Khirnov wrote: > -/** > - * Iterate over all registered codecs. > - * > - * @param opaque a pointer where libavcodec will store the iteration state. > Must > - * point to NULL to start the iteration. > - * > - * @return the next registered codec or NULL

Re: [FFmpeg-devel] [PATCH 3/3] lavf/dashdec: avoid reading the first data segment in read_header

2020-05-25 Thread Gorilla Maguila
These lines: +if (pls->init_sec_data_len > 0) +pls->ctx->probesize = FFMIN(pls->ctx->probesize, pls->init_sec_data_len); pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? s->max_analyze_duration : 4 * AV_TIME_BASE; -ret = av_probe_input_buffer(>pb, _fmt, "",

Re: [FFmpeg-devel] [PATCH 3/3] avcodec.h: move avcodec_get_{type, name} to codec_id.h

2020-05-25 Thread James Almer
On 5/25/2020 10:12 AM, Anton Khirnov wrote: > --- > libavcodec/avcodec.h | 11 --- > libavcodec/codec_id.h | 12 > 2 files changed, 12 insertions(+), 11 deletions(-) > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 4f46a1fb2e..01099bc8cd 100644 > ---

Re: [FFmpeg-devel] [PATCH 4/5] avformat/aviobuf: Return better error codes

2020-05-25 Thread Michael Niedermayer
On Mon, May 25, 2020 at 04:08:00PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavformat/aviobuf.c | 14 -- > 1 file changed, 8 insertions(+), 6 deletions(-) probably ok thx [...] -- Michael GnuPG fingerprint:

[FFmpeg-devel] [PATCH 1/3] avformat/rtspdec: use av_dict_set_int() instead

2020-05-25 Thread lance . lmwang
From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtspdec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index bd2e8f47f1..dfa29913bf 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -289,9 +289,7

[FFmpeg-devel] [PATCH 2/3] avformat/rtpproto: use av_dict_set_int() instead

2020-05-25 Thread lance . lmwang
From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtpproto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index 1f0a82ac7e..8b6c895222 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -301,8

[FFmpeg-devel] [PATCH 2/3] avcodec.h: split AVCodec API into its own header

2020-05-25 Thread Anton Khirnov
--- doc/APIchanges | 3 + libavcodec/Makefile | 1 + libavcodec/avcodec.h | 415 +- libavcodec/codec.h | 462 +++ libavcodec/version.h | 4 +- 5 files changed, 469 insertions(+), 416 deletions(-) create

[FFmpeg-devel] [PATCH 1/3] doc/APIchanges: fix typo in version number

2020-05-25 Thread Anton Khirnov
--- doc/APIchanges | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 56ec9f8ac3..6a03686068 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -31,7 +31,7 @@ API changes, most recent first: Move AVBitstreamFilter-related public API to

Re: [FFmpeg-devel] [PATCH] avcodec/mediacodec_common: use MediaFormat to probe frame color characteristics

2020-05-25 Thread Matthieu Bouron
On Wed, May 20, 2020 at 10:07:03AM +0200, Matthieu Bouron wrote: > On Sat, May 09, 2020 at 09:45:05AM +0200, Matthieu Bouron wrote: > > On Tue, Mar 31, 2020 at 10:03:08AM +0200, Matthieu Bouron wrote: > > > --- > > > libavcodec/mediacodecdec_common.c | 100 ++ > > > 1

[FFmpeg-devel] [PATCH 1/2 v4] avcodec/encode: restructure the core encoding code

2020-05-25 Thread James Almer
This commit follows the same logic as 061a0c14bb, but for the encode API: The new public encoding API will no longer be a wrapper around the old deprecated one, and the internal API used by the encoders now consists of a single receive_packet() callback that pulls frames as required. amf encoders

[FFmpeg-devel] [PATCH 2/2 v4] avcodec/encode: restructure the old encode API

2020-05-25 Thread James Almer
Following the same logic as 061a0c14bb, this commit turns the old encode API into a wrapper for the new one. Signed-off-by: James Almer --- libavcodec/encode.c | 370 +- libavcodec/internal.h | 1 + libavcodec/utils.c| 8 +- 3 files changed, 116

[FFmpeg-devel] [PATCH 3/4] avformat/hlsenc: Avoid duplicating strings when parsing

2020-05-25 Thread Andreas Rheinhardt
Up until now, the HLS muxer uses av_strtok() to split an input string controlling parameters of the VariantStreams and then duplicates parts of this string containing parameters such as the language or the name of the VariantStream. But these parts are proper zero-terminated strings of their own

[FFmpeg-devel] [PATCH 1/4] avformat/hlsplaylist: Add const where appropriate

2020-05-25 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavformat/hlsplaylist.c | 27 --- libavformat/hlsplaylist.h | 23 +-- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c index

[FFmpeg-devel] [PATCH 2/4] avformat/hlsenc: Don't unnecessarily duplicate baseurl string

2020-05-25 Thread Andreas Rheinhardt
Up until now, the HLS muxer duplicated a string for every VariantStream, although neither the original nor the copies are ever modified. So use the original directly and stop copying. Signed-off-by: Andreas Rheinhardt --- libavformat/hlsenc.c | 12 ++-- 1 file changed, 2 insertions(+),

[FFmpeg-devel] [PATCH 4/4] avformat/hlsenc, hlsplaylist: Cosmetics

2020-05-25 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavformat/hlsenc.c | 5 ++--- libavformat/hlsplaylist.c | 22 ++ libavformat/hlsplaylist.h | 9 + 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index

Re: [FFmpeg-devel] [PATCH v3] avcodec/v4l2_m2m_dec: Remove redundant packet and fix double free

2020-05-25 Thread Andriy Gelman
On Sat, 16. May 11:53, Andriy Gelman wrote: > On Sat, 09. May 13:35, Andriy Gelman wrote: > > From: Andriy Gelman > > > > v4l2_receive_frame() uses two packets s->buf_pkt and avpkt. If avpkt > > cannot be enqueued, the packet is buffered in s->buf_pkt and enqueued in > > the next call. Currently

Re: [FFmpeg-devel] [PATCH 1/2 v4] avcodec/encode: restructure the core encoding code

2020-05-25 Thread Andreas Rheinhardt
James Almer: > This commit follows the same logic as 061a0c14bb, but for the encode API: The > new public encoding API will no longer be a wrapper around the old deprecated > one, and the internal API used by the encoders now consists of a single > receive_packet() callback that pulls frames as

Re: [FFmpeg-devel] [PATCH 3/3] lavf/dashdec: avoid reading the first data segment in read_header

2020-05-25 Thread Ridley Combs
> On May 25, 2020, at 08:43, Gorilla Maguila wrote: > > These lines: > > +if (pls->init_sec_data_len > 0) > +pls->ctx->probesize = FFMIN(pls->ctx->probesize, > pls->init_sec_data_len); > pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? > s->max_analyze_duration :

Re: [FFmpeg-devel] [PATCH 1/2] avformat/oggparsevorbis: Error out on double init of vp

2020-05-25 Thread Michael Niedermayer
On Sun, Apr 19, 2020 at 05:05:52PM +0200, Michael Niedermayer wrote: > Fixes: memleak > Fixes: > 19949/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5743636058210304 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by:

[FFmpeg-devel] [PATCH 1/2] dnn: add openvino as one of dnn backend

2020-05-25 Thread Guo, Yejun
OpenVINO is a Deep Learning Deployment Toolkit at https://github.com/openvinotoolkit/openvino, it supports CPU, GPU and heterogeneous plugins to accelerate deep learning inferencing. Please refer to https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md to build openvino (c

[FFmpeg-devel] [PATCH 2/2] vf_dnn_processing.c: add dnn backend openvino

2020-05-25 Thread Guo, Yejun
We can try with the srcnn model from sr filter. 1) get srcnn.pb model file, see filter sr 2) convert srcnn.pb into openvino model with command: python mo_tf.py --input_model srcnn.pb --data_type=FP32 --input_shape [1,960,1440,1] --keep_shape_ops See the script at

Re: [FFmpeg-devel] [PATCH 1/3] avformat/matroskadec: Beautify matroska_parse_laces()

2020-05-25 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Andreas Rheinhardt: >> Signed-off-by: Andreas Rheinhardt >> --- >> libavformat/matroskadec.c | 27 +++ >> 1 file changed, 11 insertions(+), 16 deletions(-) >> >> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c >> index