[FFmpeg-cvslog] avcodec/h2645_parse: Reset nal_buffer_size on uninit

2019-10-14 Thread Andriy Gelman
ffmpeg | branch: master | Andriy Gelman  | Mon Oct 14 
21:45:18 2019 -0400| [cebb446911fdc6c42d5a480b441b025c399e4a88] | committer: 
James Almer

avcodec/h2645_parse: Reset nal_buffer_size on uninit

Without reseting nal_buffer_size, av_fast_realloc will fail if
ff_h2645_packet_split is called with the unitialized pkt as argument.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cebb446911fdc6c42d5a480b441b025c399e4a88
---

 libavcodec/h2645_parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index b1dba3d510..4808f79a67 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -524,7 +524,7 @@ void ff_h2645_packet_uninit(H2645Packet *pkt)
 av_freep(>nals[i].skipped_bytes_pos);
 }
 av_freep(>nals);
-pkt->nals_allocated = 0;
+pkt->nals_allocated = pkt->nal_buffer_size = 0;
 if (pkt->rbsp.rbsp_buffer_ref) {
 av_buffer_unref(>rbsp.rbsp_buffer_ref);
 pkt->rbsp.rbsp_buffer = NULL;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/av1_parse: simplify memset call

2019-10-14 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Oct 14 23:43:08 
2019 -0300| [1e0b6bc0b4d693d2e15c0721d83ed09ac6daf458] | committer: James Almer

avcodec/av1_parse: simplify memset call

Removed (new_size - pkt->nals_allocated) because this value is always 1
during the call.
Based on commit 78b86c30d3860135042505dd4a9cbd95c4e6257d.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e0b6bc0b4d693d2e15c0721d83ed09ac6daf458
---

 libavcodec/av1_parse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/av1_parse.c b/libavcodec/av1_parse.c
index cdd524baa8..6742bc152d 100644
--- a/libavcodec/av1_parse.c
+++ b/libavcodec/av1_parse.c
@@ -71,8 +71,7 @@ int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, 
int length, void *lo
 return AVERROR(ENOMEM);
 
 pkt->obus = tmp;
-memset(pkt->obus + pkt->obus_allocated, 0,
-   (new_size - pkt->obus_allocated) * sizeof(*tmp));
+memset(pkt->obus + pkt->obus_allocated, 0, sizeof(*pkt->obus));
 pkt->obus_allocated = new_size;
 }
 obu = >obus[pkt->nb_obus];

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/av1_parse: Use av_fast_realloc() for OBU array

2019-10-14 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Oct 14 23:42:01 
2019 -0300| [62f47225825ce0827570eb2c12033303d121e4ef] | committer: James Almer

avcodec/av1_parse: Use av_fast_realloc() for OBU array

Based on commits 22bec0d33f4231487547581a1f77e2e8e6eade88 and
cebb446911fdc6c42d5a480b441b025c399e4a88.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=62f47225825ce0827570eb2c12033303d121e4ef
---

 libavcodec/av1_parse.c | 8 ++--
 libavcodec/av1_parse.h | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/av1_parse.c b/libavcodec/av1_parse.c
index 6742bc152d..59ea0bc6e7 100644
--- a/libavcodec/av1_parse.c
+++ b/libavcodec/av1_parse.c
@@ -66,7 +66,11 @@ int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, 
int length, void *lo
 
 if (pkt->obus_allocated < pkt->nb_obus + 1) {
 int new_size = pkt->obus_allocated + 1;
-AV1OBU *tmp = av_realloc_array(pkt->obus, new_size, sizeof(*tmp));
+AV1OBU *tmp;
+
+if (new_size >= INT_MAX / sizeof(*tmp))
+return AVERROR(ENOMEM);
+tmp = av_fast_realloc(pkt->obus, >obus_allocated_size, 
new_size * sizeof(*tmp));
 if (!tmp)
 return AVERROR(ENOMEM);
 
@@ -102,5 +106,5 @@ int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, 
int length, void *lo
 void ff_av1_packet_uninit(AV1Packet *pkt)
 {
 av_freep(>obus);
-pkt->obus_allocated = 0;
+pkt->obus_allocated = pkt->obus_allocated_size = 0;
 }
diff --git a/libavcodec/av1_parse.h b/libavcodec/av1_parse.h
index 864308f81d..f3d932bc55 100644
--- a/libavcodec/av1_parse.h
+++ b/libavcodec/av1_parse.h
@@ -56,6 +56,7 @@ typedef struct AV1Packet {
 AV1OBU *obus;
 int nb_obus;
 int obus_allocated;
+unsigned obus_allocated_size;
 } AV1Packet;
 
 /**

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] ffprobe: fix output of packets_and_frames section in JSON format

2019-10-14 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Oct 11 13:36:38 
2019 -0300| [2e4f86e04ca6abdf8a1829dce210ceeef46eb224] | committer: James Almer

ffprobe: fix output of packets_and_frames section in JSON format

The "type" entry was hardcoded with an trailing comma, even if it was
the only entry in the section.

Fixes ticket #8228.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e4f86e04ca6abdf8a1829dce210ceeef46eb224
---

 fftools/ffprobe.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 2380417229..a95d74346d 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -1535,7 +1535,7 @@ static void json_print_section_header(WriterContext *wctx)
 if (parent_section && parent_section->id == 
SECTION_ID_PACKETS_AND_FRAMES) {
 if (!json->compact)
 JSON_INDENT();
-printf("\"type\": \"%s\"%s", section->name, json->item_sep);
+printf("\"type\": \"%s\"", section->name);
 }
 }
 av_bprint_finalize(, NULL);
@@ -1579,8 +1579,10 @@ static inline void json_print_item_str(WriterContext 
*wctx,
 static void json_print_str(WriterContext *wctx, const char *key, const char 
*value)
 {
 JSONContext *json = wctx->priv;
+const struct section *parent_section = wctx->level ?
+wctx->section[wctx->level-1] : NULL;
 
-if (wctx->nb_item[wctx->level])
+if (wctx->nb_item[wctx->level] || (parent_section && parent_section->id == 
SECTION_ID_PACKETS_AND_FRAMES))
 printf("%s", json->item_sep);
 if (!json->compact)
 JSON_INDENT();
@@ -1590,9 +1592,11 @@ static void json_print_str(WriterContext *wctx, const 
char *key, const char *val
 static void json_print_int(WriterContext *wctx, const char *key, long long int 
value)
 {
 JSONContext *json = wctx->priv;
+const struct section *parent_section = wctx->level ?
+wctx->section[wctx->level-1] : NULL;
 AVBPrint buf;
 
-if (wctx->nb_item[wctx->level])
+if (wctx->nb_item[wctx->level] || (parent_section && parent_section->id == 
SECTION_ID_PACKETS_AND_FRAMES))
 printf("%s", json->item_sep);
 if (!json->compact)
 JSON_INDENT();

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter: fix typo in comments

2019-10-14 Thread Zhao Zhili
ffmpeg | branch: master | Zhao Zhili  | Wed Oct  9 
20:06:10 2019 +0800| [2bfa7df9fefe50a8d7f3f2fe4313069e5f3155d4] | committer: 
Lou Logan

avfilter: fix typo in comments

Signed-off-by: myp...@gmail.com

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2bfa7df9fefe50a8d7f3f2fe4313069e5f3155d4
---

 libavfilter/avfilter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 9d70e7118b..3eaa8a4089 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -79,7 +79,7 @@ int avfilter_pad_count(const AVFilterPad *pads);
  * Get the name of an AVFilterPad.
  *
  * @param pads an array of AVFilterPads
- * @param pad_idx index of the pad in the array it; is the caller's
+ * @param pad_idx index of the pad in the array; it is the caller's
  *responsibility to ensure the index is valid
  *
  * @return name of the pad_idx'th pad in pads

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] tools/target_dec_fuzzer: Also fuzz FF_COMPLIANCE_EXPERIMENTAL

2019-10-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Oct 12 22:34:01 2019 +0200| [2d3ccfa86334c0bb74fffe564b5d684699274669] | 
committer: Michael Niedermayer

tools/target_dec_fuzzer: Also fuzz FF_COMPLIANCE_EXPERIMENTAL

This should improve coverage

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d3ccfa86334c0bb74fffe564b5d684699274669
---

 tools/target_dec_fuzzer.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 99e89ab092..8def3c9015 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -171,6 +171,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 if (size > 1024) {
 GetByteContext gbc;
 int extradata_size;
+int flags;
 size -= 1024;
 bytestream2_init(, data + size, 1024);
 ctx->width  = bytestream2_get_le32();
@@ -178,8 +179,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 ctx->bit_rate   = bytestream2_get_le64();
 ctx->bits_per_coded_sample  = bytestream2_get_le32();
 // Try to initialize a parser for this codec, note, this may fail 
which just means we test without one
-if (bytestream2_get_byte() & 1)
+flags = bytestream2_get_byte();
+if (flags & 1)
 parser = av_parser_init(c->id);
+if (flags & 2)
+ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
 
 extradata_size = bytestream2_get_le32();
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] tools/target_dec_fuzzer: Also fuzz codec_tag

2019-10-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Oct 12 22:34:02 2019 +0200| [cc50d113c88fb9fc5d9b010bbc9b9203b9a2b885] | 
committer: Michael Niedermayer

tools/target_dec_fuzzer: Also fuzz codec_tag

This should improve coverage

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc50d113c88fb9fc5d9b010bbc9b9203b9a2b885
---

 tools/target_dec_fuzzer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 8def3c9015..0047c9eed6 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -190,6 +190,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 ctx->sample_rate= bytestream2_get_le32();
 ctx->channels   = 
(unsigned)bytestream2_get_le32() % FF_SANE_NB_CHANNELS;
 ctx->block_align= bytestream2_get_le32();
+ctx->codec_tag  = bytestream2_get_le32();
 
 if (extradata_size < size) {
 ctx->extradata = av_mallocz(extradata_size + 
AV_INPUT_BUFFER_PADDING_SIZE);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] tools/target_dec_fuzzer: Also fuzz block_align

2019-10-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Oct 12 22:34:00 2019 +0200| [0c07eb52050b9a608608f9a4ad31f9a5cd4df97a] | 
committer: Michael Niedermayer

tools/target_dec_fuzzer: Also fuzz block_align

This should improve coverage

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c07eb52050b9a608608f9a4ad31f9a5cd4df97a
---

 tools/target_dec_fuzzer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index a2c59be318..99e89ab092 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -185,6 +185,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 
 ctx->sample_rate= bytestream2_get_le32();
 ctx->channels   = 
(unsigned)bytestream2_get_le32() % FF_SANE_NB_CHANNELS;
+ctx->block_align= bytestream2_get_le32();
 
 if (extradata_size < size) {
 ctx->extradata = av_mallocz(extradata_size + 
AV_INPUT_BUFFER_PADDING_SIZE);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_lenscorrection: make width/height int

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Oct 14 20:14:03 
2019 +0200| [79522411fa53b68743302d16d28156db95466a21] | committer: Paul B Mahol

avfilter/vf_lenscorrection: make width/height int

Somehow previous correct fix broke usage.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79522411fa53b68743302d16d28156db95466a21
---

 libavfilter/vf_lenscorrection.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c
index ac3c490821..bb8ea3734f 100644
--- a/libavfilter/vf_lenscorrection.c
+++ b/libavfilter/vf_lenscorrection.c
@@ -36,8 +36,8 @@
 
 typedef struct LenscorrectionCtx {
 const AVClass *av_class;
-unsigned int width;
-unsigned int height;
+int width;
+int height;
 int hsub, vsub;
 int nb_planes;
 double cx, cy, k1, k2;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] doc/APIchanges: add missing entry for the new runtime param AVOption flag

2019-10-14 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Oct 14 12:05:01 
2019 -0300| [5c3d521a942723313e53dbab284060071a4e0aea] | committer: James Almer

doc/APIchanges: add missing entry for the new runtime param AVOption flag

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c3d521a942723313e53dbab284060071a4e0aea
---

 doc/APIchanges | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index 9bfe153099..48168f82e6 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2019-10-14 - f3746d31f9 - lavu 56.35.101 - opt.h
+  Add AV_OPT_FLAG_RUNTIME_PARAM.
+
 2019-09-25 - xx - lavc 58.59.100 - avcodec.h
   Add max_samples
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_atadenoise: rewrite using macro

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Oct 14 16:39:56 
2019 +0200| [c4d1603baff1885fd6cac95251e7857263b343fa] | committer: Paul B Mahol

avfilter/vf_atadenoise: rewrite using macro

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4d1603baff1885fd6cac95251e7857263b343fa
---

 libavfilter/vf_atadenoise.c | 170 +++-
 1 file changed, 57 insertions(+), 113 deletions(-)

diff --git a/libavfilter/vf_atadenoise.c b/libavfilter/vf_atadenoise.c
index b7d958b832..be7c4e2a34 100644
--- a/libavfilter/vf_atadenoise.c
+++ b/libavfilter/vf_atadenoise.c
@@ -57,6 +57,10 @@ typedef struct ATADenoiseContext {
 int available;
 
 int (*filter_slice)(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs);
+void (*filter_row)(const uint8_t *src, uint8_t *dst,
+   const uint8_t *srcf[SIZE],
+   int w, int mid, int size,
+   int thra, int thrb);
 } ATADenoiseContext;
 
 #define OFFSET(x) offsetof(ATADenoiseContext, x)
@@ -125,7 +129,54 @@ typedef struct ThreadData {
 AVFrame *in, *out;
 } ThreadData;
 
-static int filter_slice8(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+#define FILTER_ROW(type, name)  \
+static void filter_row##name(const uint8_t *ssrc, uint8_t *ddst,\
+ const uint8_t *ssrcf[SIZE],\
+ int w, int mid, int size,  \
+ int thra, int thrb)\
+{   \
+const type *src = (const type *)ssrc;   \
+const type **srcf = (const type **)ssrcf;   \
+type *dst = (type *)ddst;   \
+\
+for (int x = 0; x < w; x++) {   \
+   const int srcx = src[x]; \
+   unsigned lsumdiff = 0, rsumdiff = 0; \
+   unsigned ldiff, rdiff;   \
+   unsigned sum = srcx; \
+   int l = 0, r = 0;\
+   int srcjx, srcix;\
+\
+   for (int j = mid - 1, i = mid + 1; j >= 0 && i < size; j--, i++) {   \
+   srcjx = srcf[j][x];  \
+\
+   ldiff = FFABS(srcx - srcjx); \
+   lsumdiff += ldiff;   \
+   if (ldiff > thra ||  \
+   lsumdiff > thrb) \
+   break;   \
+   l++; \
+   sum += srcjx;\
+\
+   srcix = srcf[i][x];  \
+\
+   rdiff = FFABS(srcx - srcix); \
+   rsumdiff += rdiff;   \
+   if (rdiff > thra ||  \
+   rsumdiff > thrb) \
+   break;   \
+   r++; \
+   sum += srcix;\
+   }\
+\
+   dst[x] = sum / (r + l + 1);  \
+   }\
+}
+
+FILTER_ROW(uint8_t, 8)
+FILTER_ROW(uint16_t, 16)
+
+static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
 {
 ATADenoiseContext *s = ctx->priv;
 ThreadData *td = arg;
@@ -133,7 +184,7 @@ static int filter_slice8(AVFilterContext *ctx, void *arg, 
int jobnr, int nb_jobs
 AVFrame *out = td->out;
 const int size = s->size;
 const int mid = s->mid;
-int p, x, y, i, j;
+int p, y, i;
 
 for (p = 0; p < 

[FFmpeg-cvslog] doc/filters: document colorchannelmixer commands

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Oct 14 13:14:18 
2019 +0200| [a4e5dc4b381f317e54e77b1db157571a4abb34a0] | committer: Paul B Mahol

doc/filters: document colorchannelmixer commands

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a4e5dc4b381f317e54e77b1db157571a4abb34a0
---

 doc/filters.texi | 4 
 1 file changed, 4 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index 1ad1c0e17b..6865f0f2b7 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7101,6 +7101,10 @@ 
colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
 @end example
 @end itemize
 
+@subsection Commands
+
+This filter supports the all above options as @ref{commands}.
+
 @section colorkey
 RGB colorspace color keying.
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] doc/filters: document scroll commands

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Oct 14 13:08:13 
2019 +0200| [746c8e7c9d91cf2511348577be06b8ef5498b3a0] | committer: Paul B Mahol

doc/filters: document scroll commands

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=746c8e7c9d91cf2511348577be06b8ef5498b3a0
---

 doc/filters.texi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index 8c1482ed1f..1447325341 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -15835,6 +15835,16 @@ Set the initial horizontal scrolling position. Default 
is 0. Allowed range is fr
 Set the initial vertical scrolling position. Default is 0. Allowed range is 
from 0 to 1.
 @end table
 
+@subsection Commands
+
+This filter supports the following @ref{commands}:
+@table @option
+@item horizontal, h
+Set the horizontal scrolling speed.
+@item vertical, v
+Set the vertical scrolling speed.
+@end table
+
 @anchor{selectivecolor}
 @section selectivecolor
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] doc/filters: document amplify commands

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Oct 14 13:11:21 
2019 +0200| [688472641dae19b5251b4a241762b2effc98a4b2] | committer: Paul B Mahol

doc/filters: document amplify commands

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=688472641dae19b5251b4a241762b2effc98a4b2
---

 doc/filters.texi | 12 
 1 file changed, 12 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index 1447325341..1ad1c0e17b 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -6183,6 +6183,18 @@ This option controls maximum possible value that will 
increase source pixel valu
 Set which planes to filter. Default is all. Allowed range is from 0 to 15.
 @end table
 
+@subsection Commands
+
+This filter supports the following @ref{commands} that corresponds to option 
of same name:
+@table @option
+@item factor
+@item threshold
+@item tolerance
+@item low
+@item high
+@item planes
+@end table
+
 @section ass
 
 Same as the @ref{subtitles} filter, except that it doesn't require libavcodec

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_bwdif: fix heap-buffer overflow

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Oct 13 23:21:35 
2019 +0200| [8c3166e1c302c3ba80d9742ae46161c0fa8e2606] | committer: Paul B Mahol

avfilter/vf_bwdif: fix heap-buffer overflow

Fixes #8261

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c3166e1c302c3ba80d9742ae46161c0fa8e2606
---

 libavfilter/vf_bwdif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
index 37165584cf..b6aed7a450 100644
--- a/libavfilter/vf_bwdif.c
+++ b/libavfilter/vf_bwdif.c
@@ -343,8 +343,8 @@ static int config_props(AVFilterLink *link)
 if(yadif->mode&1)
 link->frame_rate = av_mul_q(link->src->inputs[0]->frame_rate, 
(AVRational){2,1});
 
-if (link->w < 3 || link->h < 3) {
-av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is 
not supported\n");
+if (link->w < 3 || link->h < 4) {
+av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or 4 lines is 
not supported\n");
 return AVERROR(EINVAL);
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_colorchannelmixer: add support for commands

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 21:54:30 
2019 +0200| [4568e54cc51cf796b86a3dc7be8289108d58ae4c] | committer: Paul B Mahol

avfilter/vf_colorchannelmixer: add support for commands

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4568e54cc51cf796b86a3dc7be8289108d58ae4c
---

 libavfilter/vf_colorchannelmixer.c | 31 +++
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_colorchannelmixer.c 
b/libavfilter/vf_colorchannelmixer.c
index 3a9cd37b78..e6c6fe3c5d 100644
--- a/libavfilter/vf_colorchannelmixer.c
+++ b/libavfilter/vf_colorchannelmixer.c
@@ -52,7 +52,8 @@ typedef struct ColorChannelMixerContext {
 } ColorChannelMixerContext;
 
 #define OFFSET(x) offsetof(ColorChannelMixerContext, x)
-#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+#define FLAGS 
AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
+
 static const AVOption colorchannelmixer_options[] = {
 { "rr", "set the red gain for the red channel", OFFSET(rr), 
AV_OPT_TYPE_DOUBLE, {.dbl=1}, -2, 2, FLAGS },
 { "rg", "set the green gain for the red channel",   OFFSET(rg), 
AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
@@ -408,18 +409,20 @@ static int config_output(AVFilterLink *outlink)
 ColorChannelMixerContext *s = ctx->priv;
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format);
 const int depth = desc->comp[0].depth;
-int i, j, size, *buffer;
+int i, j, size, *buffer = s->buffer;
 
 ff_fill_rgba_map(s->rgba_map, outlink->format);
 
 size = 1 << depth;
-s->buffer = buffer = av_malloc(16 * size * sizeof(*s->buffer));
-if (!s->buffer)
-return AVERROR(ENOMEM);
+if (!s->buffer) {
+s->buffer = buffer = av_malloc(16 * size * sizeof(*s->buffer));
+if (!s->buffer)
+return AVERROR(ENOMEM);
 
-for (i = 0; i < 4; i++)
-for (j = 0; j < 4; j++, buffer += size)
-s->lut[i][j] = buffer;
+for (i = 0; i < 4; i++)
+for (j = 0; j < 4; j++, buffer += size)
+s->lut[i][j] = buffer;
+}
 
 for (i = 0; i < size; i++) {
 s->lut[R][R][i] = lrint(i * s->rr);
@@ -531,6 +534,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 return ff_filter_frame(outlink, out);
 }
 
+static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args,
+   char *res, int res_len, int flags)
+{
+int ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
+
+if (ret < 0)
+return ret;
+
+return config_output(ctx->outputs[0]);
+}
+
 static av_cold void uninit(AVFilterContext *ctx)
 {
 ColorChannelMixerContext *s = ctx->priv;
@@ -566,4 +580,5 @@ AVFilter ff_vf_colorchannelmixer = {
 .inputs= colorchannelmixer_inputs,
 .outputs   = colorchannelmixer_outputs,
 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | 
AVFILTER_FLAG_SLICE_THREADS,
+.process_command = process_command,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_gblur: switch to ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 13:03:52 
2019 +0200| [33e69806aa26e79c1d99c693b74158395babd932] | committer: Paul B Mahol

avfilter/vf_gblur: switch to ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33e69806aa26e79c1d99c693b74158395babd932
---

 libavfilter/vf_gblur.c | 20 ++--
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 6ef261478f..1957d79e0f 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -35,7 +35,7 @@
 #include "video.h"
 
 #define OFFSET(x) offsetof(GBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define FLAGS 
AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption gblur_options[] = {
 { "sigma",  "set sigma",OFFSET(sigma),  AV_OPT_TYPE_FLOAT, 
{.dbl=0.5}, 0.0, 1024, FLAGS },
@@ -344,22 +344,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 return ff_filter_frame(outlink, out);
 }
 
-static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args,
-   char *res, int res_len, int flags)
-{
-GBlurContext *s = ctx->priv;
-int ret = 0;
-
-if (   !strcmp(cmd, "sigma") || !strcmp(cmd, "sigmaV")
-|| !strcmp(cmd, "steps") || !strcmp(cmd, "planes")) {
-av_opt_set(s, cmd, args, 0);
-} else {
-ret = AVERROR(ENOSYS);
-}
-
-return ret;
-}
-
 static av_cold void uninit(AVFilterContext *ctx)
 {
 GBlurContext *s = ctx->priv;
@@ -395,5 +379,5 @@ AVFilter ff_vf_gblur = {
 .inputs= gblur_inputs,
 .outputs   = gblur_outputs,
 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | 
AVFILTER_FLAG_SLICE_THREADS,
-.process_command = process_command,
+.process_command = ff_filter_process_command,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flag

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 12:03:19 
2019 +0200| [f3746d31f9486bcc266f17738861cc8a5c9c1eb7] | committer: Paul B Mahol

avutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flag

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3746d31f9486bcc266f17738861cc8a5c9c1eb7
---

 libavfilter/version.h | 2 +-
 libavutil/opt.h   | 1 +
 libavutil/version.h   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/version.h b/libavfilter/version.h
index e9b75ee6b2..901fae095b 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR   7
 #define LIBAVFILTER_VERSION_MINOR  62
-#define LIBAVFILTER_VERSION_MICRO 100
+#define LIBAVFILTER_VERSION_MICRO 101
 
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 39f4a8dda0..bc98ab104d 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -288,6 +288,7 @@ typedef struct AVOption {
  */
 #define AV_OPT_FLAG_READONLY128
 #define AV_OPT_FLAG_BSF_PARAM   (1<<8) ///< a generic parameter which can 
be set by the user for bit stream filtering
+#define AV_OPT_FLAG_RUNTIME_PARAM   (1<<15) ///< a generic parameter which can 
be set by the user at runtime
 #define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can 
be set by the user for filtering
 #define AV_OPT_FLAG_DEPRECATED  (1<<17) ///< set if option is deprecated, 
users should refer to AVOption.help text for more information
 //FIXME think about enc-audio, ... style flags
diff --git a/libavutil/version.h b/libavutil/version.h
index 3395769857..27d663baf1 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR  56
 #define LIBAVUTIL_VERSION_MINOR  35
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/avfilter: add ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 12:42:40 
2019 +0200| [a918b833a5ea640b6c8fa1125ae420999055b753] | committer: Paul B Mahol

avfilter/avfilter: add ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a918b833a5ea640b6c8fa1125ae420999055b753
---

 libavfilter/avfilter.c | 13 +
 libavfilter/internal.h |  7 +++
 2 files changed, 20 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 93e866b79c..09f33e0e7c 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -884,6 +884,19 @@ static int process_options(AVFilterContext *ctx, 
AVDictionary **options,
 return count;
 }
 
+int ff_filter_process_command(AVFilterContext *ctx, const char *cmd,
+  const char *arg, char *res, int res_len, int 
flags)
+{
+const AVOption *o;
+
+if (!ctx->filter->priv_class)
+return 0;
+o = av_opt_find2(ctx->priv, cmd, NULL, AV_OPT_FLAG_RUNTIME_PARAM | 
AV_OPT_FLAG_FILTERING_PARAM, AV_OPT_SEARCH_CHILDREN, NULL);
+if (!o)
+return AVERROR(ENOSYS);
+return av_opt_set(ctx->priv, cmd, arg, 0);
+}
+
 int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
 {
 int ret = 0;
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 498bd3328d..1d77808082 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -411,6 +411,13 @@ static inline int ff_norm_qscale(int qscale, int type)
  */
 int ff_filter_get_nb_threads(AVFilterContext *ctx);
 
+/**
+ * Generic processing of user supplied commands that are set
+ * in the same way as the filter options.
+ */
+int ff_filter_process_command(AVFilterContext *ctx, const char *cmd,
+  const char *arg, char *res, int res_len, int 
flags);
+
 /**
  * Perform any additional setup required for hardware frames.
  *

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avutil/opt: print runtime flag too

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 12:56:55 
2019 +0200| [c109dfc1b1946964a19ad3beee73db6d9c95d940] | committer: Paul B Mahol

avutil/opt: print runtime flag too

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c109dfc1b1946964a19ad3beee73db6d9c95d940
---

 libavutil/opt.c|  1 +
 tests/ref/fate/opt | 50 +-
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7c2649725f..9081a593a1 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1217,6 +1217,7 @@ static void opt_list(void *obj, void *av_log_obj, const 
char *unit,
 av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_EXPORT) ? 'X' : '.');
 av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_READONLY)   ? 'R' : '.');
 av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_BSF_PARAM)  ? 'B' : '.');
+av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_RUNTIME_PARAM)  ? 'T' : '.');
 
 if (opt->help)
 av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt
index 6a7dbfa797..71f56ce51e 100644
--- a/tests/ref/fate/opt
+++ b/tests/ref/fate/opt
@@ -18,31 +18,31 @@ num64=1
 flt=0.33
 dbl=0.33
 TestContext AVOptions:
-  -num   E set num (from 0 to 100) (default 0)
-  -toggleE set toggle (from 0 to 1) (default 
1)
-  -rational E set rational (from 0 to 10) 
(default 1/1)
-  -string E set string (default "default")
-  -escape E set escape str (default "\=,")
-  -flags   E set flags (default cool)
- cool E set cool flag
- lame E set lame flag
- mu   E set mu flag
-  -size   E set size (default "200x300")
-  -pix_fmt   E set pixfmt (default 0bgr)
-  -sample_fmt E set samplefmt (default s16)
-  -video_rate E set videorate (default "25")
-  -duration E set duration (default 0.001)
-  -color   E set color (default "pink")
-  -cl E set channel layout (default 
0x137)
-  -binE set binary value
-  -bin1   E set binary value
-  -bin2   E set binary value
-  -num64   E set num 64bit (from 0 to 100) 
(default 1)
-  -flt E set float (from 0 to 100) (default 
0.33)
-  -dblE set double (from 0 to 100) 
(default 0.33)
-  -bool1 E set boolean value (default auto)
-  -bool2 E set boolean value (default true)
-  -bool3 E set boolean value (default false)
+  -num   E. set num (from 0 to 100) (default 
0)
+  -toggleE. set toggle (from 0 to 1) (default 
1)
+  -rational E. set rational (from 0 to 10) 
(default 1/1)
+  -string E. set string (default "default")
+  -escape E. set escape str (default "\=,")
+  -flags   E. set flags (default cool)
+ cool E. set cool flag
+ lame E. set lame flag
+ mu   E. set mu flag
+  -size   E. set size (default "200x300")
+  -pix_fmt   E. set pixfmt (default 0bgr)
+  -sample_fmt E. set samplefmt (default s16)
+  -video_rate E. set videorate (default "25")
+  -duration E. set duration (default 0.001)
+  -color   E. set color (default "pink")
+  -cl E. set channel layout (default 
0x137)
+  -binE. set binary value
+  -bin1   E. set binary value
+  -bin2   E. set binary value
+  -num64   E. set num 64bit (from 0 to 100) 
(default 1)
+  -flt E. set float (from 0 to 100) 
(default 0.33)
+  -dblE. set double (from 0 to 100) 
(default 0.33)
+  -bool1 E. set boolean value (default auto)
+  -bool2 E. set boolean value (default true)
+  -bool3 E. set boolean value (default false)
 
 Testing av_opt_is_set_to_default()
 name:   num default:1 error:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit 

[FFmpeg-cvslog] avfilter/af_rubberband: use ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 22:15:09 
2019 +0200| [dcfe32920c5b36d92012b6767c3085b26c07a9e6] | committer: Paul B Mahol

avfilter/af_rubberband: use ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dcfe32920c5b36d92012b6767c3085b26c07a9e6
---

 libavfilter/af_rubberband.c | 33 +
 1 file changed, 9 insertions(+), 24 deletions(-)

diff --git a/libavfilter/af_rubberband.c b/libavfilter/af_rubberband.c
index ef937f4415..e002d9de17 100644
--- a/libavfilter/af_rubberband.c
+++ b/libavfilter/af_rubberband.c
@@ -43,10 +43,11 @@ typedef struct RubberBandContext {
 
 #define OFFSET(x) offsetof(RubberBandContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define AT 
AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption rubberband_options[] = {
-{ "tempo",  "set tempo scale factor", OFFSET(tempo), 
AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 100, A },
-{ "pitch",  "set pitch scale factor", OFFSET(pitch), 
AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 100, A },
+{ "tempo",  "set tempo scale factor", OFFSET(tempo), 
AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 100, AT },
+{ "pitch",  "set pitch scale factor", OFFSET(pitch), 
AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 100, AT },
 { "transients", "set transients", OFFSET(transients), AV_OPT_TYPE_INT, 
{.i64=0}, 0, INT_MAX, A, "transients" },
 { "crisp",  0,0,  AV_OPT_TYPE_CONST, 
{.i64=RubberBandOptionTransientsCrisp},  0, 0, A, "transients" },
 { "mixed",  0,0,  AV_OPT_TYPE_CONST, 
{.i64=RubberBandOptionTransientsMixed},  0, 0, A, "transients" },
@@ -200,30 +201,14 @@ static int process_command(AVFilterContext *ctx, const 
char *cmd, const char *ar
char *res, int res_len, int flags)
 {
 RubberBandContext *s = ctx->priv;
+int ret;
 
-if (!strcmp(cmd, "tempo")) {
-double arg;
-
-sscanf(args, "%lf", );
-if (arg < 0.01 || arg > 100) {
-av_log(ctx, AV_LOG_ERROR,
-   "Tempo scale factor '%f' out of range\n", arg);
-return AVERROR(EINVAL);
-}
-rubberband_set_time_ratio(s->rbs, 1. / arg);
-}
-
-if (!strcmp(cmd, "pitch")) {
-double arg;
+ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
+if (ret < 0)
+return ret;
 
-sscanf(args, "%lf", );
-if (arg < 0.01 || arg > 100) {
-av_log(ctx, AV_LOG_ERROR,
-   "Pitch scale factor '%f' out of range\n", arg);
-return AVERROR(EINVAL);
-}
-rubberband_set_pitch_scale(s->rbs, arg);
-}
+rubberband_set_time_ratio(s->rbs, 1. / s->tempo);
+rubberband_set_pitch_scale(s->rbs, s->pitch);
 
 return 0;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_drawbox: use ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 22:04:02 
2019 +0200| [9e883a1448a172bef151e23a59e6b6a7f53596fc] | committer: Paul B Mahol

avfilter/vf_drawbox: use ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e883a1448a172bef151e23a59e6b6a7f53596fc
---

 libavfilter/vf_drawbox.c | 55 +---
 1 file changed, 24 insertions(+), 31 deletions(-)

diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index e5f5351b9d..d71e3af397 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -275,46 +275,39 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 
 static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args, char *res, int res_len, int flags)
 {
+AVFilterLink *inlink = ctx->inputs[0];
 DrawBoxContext *s = ctx->priv;
+int old_x = s->x;
+int old_y = s->y;
+int old_w = s->w;
+int old_h = s->h;
+int old_t = s->thickness;
+int old_r = s->replace;
 int ret;
 
-if (   !strcmp(cmd, "w") || !strcmp(cmd, "width")
-|| !strcmp(cmd, "h") || !strcmp(cmd, "height")
-|| !strcmp(cmd, "x") || !strcmp(cmd, "y")
-|| !strcmp(cmd, "t") || !strcmp(cmd, "thickness")
-|| !strcmp(cmd, "c") || !strcmp(cmd, "color")
-|| !strcmp(cmd, "replace")) {
-
-int old_x = s->x;
-int old_y = s->y;
-int old_w = s->w;
-int old_h = s->h;
-int old_t = s->thickness;
-int old_r = s->replace;
-
-AVFilterLink *inlink = ctx->inputs[0];
-
-av_opt_set(s, cmd, args, 0);
-init(ctx);
-
-if ((ret = config_input(inlink)) < 0) {
-s->x = old_x;
-s->y = old_y;
-s->w = old_w;
-s->h = old_h;
-s->thickness = old_t;
-s->replace = old_r;
-return ret;
-}
-} else {
-ret = AVERROR(ENOSYS);
+ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
+if (ret < 0)
+return ret;
+
+ret = init(ctx);
+if (ret < 0)
+goto end;
+ret = config_input(inlink);;
+end:
+if (ret < 0) {
+s->x = old_x;
+s->y = old_y;
+s->w = old_w;
+s->h = old_h;
+s->thickness = old_t;
+s->replace = old_r;
 }
 
 return ret;
 }
 
 #define OFFSET(x) offsetof(DrawBoxContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define FLAGS 
AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 #if CONFIG_DRAWBOX_FILTER
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/af_biquads: use ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Oct  9 11:15:56 
2019 +0200| [015cbca4441ce14f421cef01a1a065a49af9d3b3] | committer: Paul B Mahol

avfilter/af_biquads: use ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=015cbca4441ce14f421cef01a1a065a49af9d3b3
---

 libavfilter/af_biquads.c | 134 ---
 1 file changed, 10 insertions(+), 124 deletions(-)

diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 247a47256f..c0b2d73351 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -503,127 +503,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*buf)
 static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args,
char *res, int res_len, int flags)
 {
-BiquadsContext *s = ctx->priv;
 AVFilterLink *outlink = ctx->outputs[0];
+int ret;
 
-if ((!strcmp(cmd, "frequency") || !strcmp(cmd, "f")) &&
-(s->filter_type == equalizer ||
- s->filter_type == lowshelf  ||
- s->filter_type == highshelf ||
- s->filter_type == bass  ||
- s->filter_type == treble||
- s->filter_type == bandpass  ||
- s->filter_type == bandreject||
- s->filter_type == lowpass   ||
- s->filter_type == highpass  ||
- s->filter_type == allpass)) {
-double freq;
-
-if (sscanf(args, "%lf", ) != 1) {
-av_log(ctx, AV_LOG_ERROR, "Invalid frequency value.\n");
-return AVERROR(EINVAL);
-}
-
-s->frequency = freq;
-} else if ((!strcmp(cmd, "gain") || !strcmp(cmd, "g")) &&
-(s->filter_type == equalizer ||
- s->filter_type == lowshelf  ||
- s->filter_type == highshelf ||
- s->filter_type == bass  ||
- s->filter_type == treble)) {
-double gain;
-
-if (sscanf(args, "%lf", ) != 1) {
-av_log(ctx, AV_LOG_ERROR, "Invalid gain value.\n");
-return AVERROR(EINVAL);
-}
-
-s->gain = av_clipd(gain, -900, 900);
-} else if (!strcmp(cmd, "mix") || !strcmp(cmd, "m")) {
-double mix;
-
-if (sscanf(args, "%lf", ) != 1) {
-av_log(ctx, AV_LOG_ERROR, "Invalid mix value.\n");
-return AVERROR(EINVAL);
-}
-
-s->mix = av_clipd(mix, 0, 1);
-} else if ((!strcmp(cmd, "width") || !strcmp(cmd, "w")) &&
-(s->filter_type == equalizer ||
- s->filter_type == lowshelf  ||
- s->filter_type == highshelf ||
- s->filter_type == bass  ||
- s->filter_type == treble||
- s->filter_type == bandpass  ||
- s->filter_type == bandreject||
- s->filter_type == lowpass   ||
- s->filter_type == highpass  ||
- s->filter_type == allpass)) {
-double width;
-
-if (sscanf(args, "%lf", ) != 1) {
-av_log(ctx, AV_LOG_ERROR, "Invalid width value.\n");
-return AVERROR(EINVAL);
-}
-
-s->width = width;
-} else if ((!strcmp(cmd, "width_type") || !strcmp(cmd, "t")) &&
-(s->filter_type == equalizer ||
- s->filter_type == lowshelf  ||
- s->filter_type == highshelf ||
- s->filter_type == bass  ||
- s->filter_type == treble||
- s->filter_type == bandpass  ||
- s->filter_type == bandreject||
- s->filter_type == lowpass   ||
- s->filter_type == highpass  ||
- s->filter_type == allpass)) {
-char width_type;
-
-if (sscanf(args, "%c", _type) != 1) {
-av_log(ctx, AV_LOG_ERROR, "Invalid width_type value.\n");
-return AVERROR(EINVAL);
-}
-
-switch (width_type) {
-case 'h': width_type = HERTZ;   break;
-case 'q': width_type = QFACTOR; break;
-case 'o': width_type = OCTAVE;  break;
-case 's': width_type = SLOPE;   break;
-case 'k': width_type = KHERTZ;  break;
-default:
-av_log(ctx, AV_LOG_ERROR, "Invalid width_type value: %c\n", 
width_type);
-return AVERROR(EINVAL);
-}
-
-s->width_type = width_type;
-} else if ((!strcmp(cmd, "a0") ||
-!strcmp(cmd, "a1") ||
-!strcmp(cmd, "a2") ||
-!strcmp(cmd, "b0") ||
-!strcmp(cmd, "b1") ||
-!strcmp(cmd, "b2")) &&
-   s->filter_type == biquad) {
-double value;
-
-if (sscanf(args, "%lf", ) != 1) {
-av_log(ctx, AV_LOG_ERROR, "Invalid biquad value.\n");
-return AVERROR(EINVAL);
-}
-
-if (!strcmp(cmd, "a0"))
-s->a0 = value;
-else if (!strcmp(cmd, "a1"))
-s->a1 = value;
-else if (!strcmp(cmd, "a2"))
-s->a2 = value;
-else if (!strcmp(cmd, "b0"))
-s->b0 = value;
-else if (!strcmp(cmd, "b1"))
-s->b1 = 

[FFmpeg-cvslog] avfilter/vf_scroll: add support for commands

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 13:18:12 
2019 +0200| [7fcb84165e2229733cafa85ee2b82ce3fc2cbdb8] | committer: Paul B Mahol

avfilter/vf_scroll: add support for commands

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7fcb84165e2229733cafa85ee2b82ce3fc2cbdb8
---

 libavfilter/vf_scroll.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_scroll.c b/libavfilter/vf_scroll.c
index 32b36d5631..8d4da2b950 100644
--- a/libavfilter/vf_scroll.c
+++ b/libavfilter/vf_scroll.c
@@ -155,12 +155,13 @@ static int config_input(AVFilterLink *inlink)
 
 #define OFFSET(x) offsetof(ScrollContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define VFT 
AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption scroll_options[] = {
-{ "horizontal", "set the horizontal scrolling speed", OFFSET(h_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., FLAGS },
-{ "h",  "set the horizontal scrolling speed", OFFSET(h_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., FLAGS },
-{ "vertical",   "set the vertical scrolling speed",   OFFSET(v_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., FLAGS },
-{ "v",  "set the vertical scrolling speed",   OFFSET(v_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., FLAGS },
+{ "horizontal", "set the horizontal scrolling speed", OFFSET(h_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., VFT },
+{ "h",  "set the horizontal scrolling speed", OFFSET(h_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., VFT },
+{ "vertical",   "set the vertical scrolling speed",   OFFSET(v_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., VFT },
+{ "v",  "set the vertical scrolling speed",   OFFSET(v_speed), 
AV_OPT_TYPE_FLOAT, {.dbl=0.}, -1., 1., VFT },
 { "hpos",   "set initial horizontal position",OFFSET(h_ipos),  
AV_OPT_TYPE_FLOAT, {.dbl=0.},   0, 1., FLAGS },
 { "vpos",   "set initial vertical position",  OFFSET(v_ipos),  
AV_OPT_TYPE_FLOAT, {.dbl=0.},   0, 1., FLAGS },
 { NULL }
@@ -195,4 +196,5 @@ AVFilter ff_vf_scroll = {
 .inputs= scroll_inputs,
 .outputs   = scroll_outputs,
 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+.process_command = ff_filter_process_command,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/af_anlms: switch to ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 12:49:28 
2019 +0200| [9f7ab36ada16ea271bf1bd5ca1a4cea7d024d5c7] | committer: Paul B Mahol

avfilter/af_anlms: switch to ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f7ab36ada16ea271bf1bd5ca1a4cea7d024d5c7
---

 libavfilter/af_anlms.c | 35 ++-
 1 file changed, 10 insertions(+), 25 deletions(-)

diff --git a/libavfilter/af_anlms.c b/libavfilter/af_anlms.c
index 350bedaf7a..55e6946b68 100644
--- a/libavfilter/af_anlms.c
+++ b/libavfilter/af_anlms.c
@@ -60,17 +60,18 @@ typedef struct AudioNLMSContext {
 
 #define OFFSET(x) offsetof(AudioNLMSContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define AT 
AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption anlms_options[] = {
 { "order",   "set the filter order",   OFFSET(order),   AV_OPT_TYPE_INT,   
{.i64=256},  1, INT16_MAX, A },
-{ "mu",  "set the filter mu",  OFFSET(mu),  AV_OPT_TYPE_FLOAT, 
{.dbl=0.75}, 0, 2, A },
-{ "eps", "set the filter eps", OFFSET(eps), AV_OPT_TYPE_FLOAT, 
{.dbl=1},0, 1, A },
-{ "leakage", "set the filter leakage", OFFSET(leakage), AV_OPT_TYPE_FLOAT, 
{.dbl=0},0, 1, A },
-{ "out_mode", "set output mode",   OFFSET(output_mode), 
AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_OMODES-1, A, "mode" },
-{  "i", "input", 0,  AV_OPT_TYPE_CONST,
{.i64=IN_MODE},  0, 0, A, "mode" },
-{  "d", "desired",   0,  AV_OPT_TYPE_CONST,
{.i64=DESIRED_MODE}, 0, 0, A, "mode" },
-{  "o", "output",0,  AV_OPT_TYPE_CONST,
{.i64=OUT_MODE}, 0, 0, A, "mode" },
-{  "n", "noise", 0,  AV_OPT_TYPE_CONST,
{.i64=NOISE_MODE},   0, 0, A, "mode" },
+{ "mu",  "set the filter mu",  OFFSET(mu),  AV_OPT_TYPE_FLOAT, 
{.dbl=0.75}, 0, 2, AT },
+{ "eps", "set the filter eps", OFFSET(eps), AV_OPT_TYPE_FLOAT, 
{.dbl=1},0, 1, AT },
+{ "leakage", "set the filter leakage", OFFSET(leakage), AV_OPT_TYPE_FLOAT, 
{.dbl=0},0, 1, AT },
+{ "out_mode", "set output mode",   OFFSET(output_mode), 
AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_OMODES-1, AT, "mode" },
+{  "i", "input", 0,  AV_OPT_TYPE_CONST,
{.i64=IN_MODE},  0, 0, AT, "mode" },
+{  "d", "desired",   0,  AV_OPT_TYPE_CONST,
{.i64=DESIRED_MODE}, 0, 0, AT, "mode" },
+{  "o", "output",0,  AV_OPT_TYPE_CONST,
{.i64=OUT_MODE}, 0, 0, AT, "mode" },
+{  "n", "noise", 0,  AV_OPT_TYPE_CONST,
{.i64=NOISE_MODE},   0, 0, AT, "mode" },
 { NULL }
 };
 
@@ -281,22 +282,6 @@ static av_cold int init(AVFilterContext *ctx)
 return 0;
 }
 
-static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args,
-   char *res, int res_len, int flags)
-{
-AudioNLMSContext *s = ctx->priv;
-int ret;
-
-if (   !strcmp(cmd, "mu") || !strcmp(cmd, "eps")
-|| !strcmp(cmd, "leakage") || !strcmp(cmd, "out_mode")) {
-ret = av_opt_set(s, cmd, args, 0);
-} else {
-ret = AVERROR(ENOSYS);
-}
-
-return ret;
-}
-
 static av_cold void uninit(AVFilterContext *ctx)
 {
 AudioNLMSContext *s = ctx->priv;
@@ -341,5 +326,5 @@ AVFilter ff_af_anlms = {
 .inputs = inputs,
 .outputs= outputs,
 .flags  = AVFILTER_FLAG_SLICE_THREADS,
-.process_command = process_command,
+.process_command = ff_filter_process_command,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_avgblur: switch to ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 13:05:36 
2019 +0200| [4954a17ec7286c00cc971deb442ec438b78568f8] | committer: Paul B Mahol

avfilter/vf_avgblur: switch to ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4954a17ec7286c00cc971deb442ec438b78568f8
---

 libavfilter/vf_avgblur.c | 20 ++--
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c
index a1f6c9b80e..40b48799e0 100644
--- a/libavfilter/vf_avgblur.c
+++ b/libavfilter/vf_avgblur.c
@@ -46,7 +46,7 @@ typedef struct AverageBlurContext {
 } AverageBlurContext;
 
 #define OFFSET(x) offsetof(AverageBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define FLAGS 
AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption avgblur_options[] = {
 { "sizeX",  "set horizontal size",  OFFSET(radius),  AV_OPT_TYPE_INT, 
{.i64=1},   1, 1024, FLAGS },
@@ -287,22 +287,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 return ff_filter_frame(outlink, out);
 }
 
-static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args,
-   char *res, int res_len, int flags)
-{
-AverageBlurContext *s = ctx->priv;
-int ret = 0;
-
-if (   !strcmp(cmd, "sizeX") || !strcmp(cmd, "sizeY")
-|| !strcmp(cmd, "planes")) {
-av_opt_set(s, cmd, args, 0);
-} else {
-ret = AVERROR(ENOSYS);
-}
-
-return ret;
-}
-
 static av_cold void uninit(AVFilterContext *ctx)
 {
 AverageBlurContext *s = ctx->priv;
@@ -338,5 +322,5 @@ AVFilter ff_vf_avgblur = {
 .inputs= avgblur_inputs,
 .outputs   = avgblur_outputs,
 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | 
AVFILTER_FLAG_SLICE_THREADS,
-.process_command = process_command,
+.process_command = ff_filter_process_command,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_amplify: add support for commands

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 13:44:58 
2019 +0200| [953b1c7b1244b8213252209bc2e2308c8ad283a0] | committer: Paul B Mahol

avfilter/vf_amplify: add support for commands

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=953b1c7b1244b8213252209bc2e2308c8ad283a0
---

 libavfilter/vf_amplify.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_amplify.c b/libavfilter/vf_amplify.c
index 48dcb93a67..a3f7fd009b 100644
--- a/libavfilter/vf_amplify.c
+++ b/libavfilter/vf_amplify.c
@@ -268,15 +268,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 #define OFFSET(x) offsetof(AmplifyContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | 
AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption amplify_options[] = {
 { "radius", "set radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=2}, 1, 
63, .flags = FLAGS },
-{ "factor", "set factor", OFFSET(factor), AV_OPT_TYPE_FLOAT, {.dbl=2}, 0, 
UINT16_MAX, .flags = FLAGS },
-{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, 
{.dbl=10}, 0, UINT16_MAX, .flags = FLAGS },
-{ "tolerance", "set tolerance", OFFSET(tolerance), AV_OPT_TYPE_FLOAT, 
{.dbl=0}, 0, UINT16_MAX, .flags = FLAGS },
-{ "low", "set low limit for amplification", OFFSET(llimit), 
AV_OPT_TYPE_INT, {.i64=UINT16_MAX}, 0, UINT16_MAX, .flags = FLAGS },
-{ "high", "set high limit for amplification", OFFSET(hlimit), 
AV_OPT_TYPE_INT, {.i64=UINT16_MAX}, 0, UINT16_MAX, .flags = FLAGS },
-{ "planes", "set what planes to filter", OFFSET(planes), 
AV_OPT_TYPE_FLAGS, {.i64=7},0, 15,  FLAGS },
+{ "factor", "set factor", OFFSET(factor), AV_OPT_TYPE_FLOAT, {.dbl=2}, 0, 
UINT16_MAX, .flags = VFT },
+{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, 
{.dbl=10}, 0, UINT16_MAX, .flags = VFT },
+{ "tolerance", "set tolerance", OFFSET(tolerance), AV_OPT_TYPE_FLOAT, 
{.dbl=0}, 0, UINT16_MAX, .flags = VFT },
+{ "low", "set low limit for amplification", OFFSET(llimit), 
AV_OPT_TYPE_INT, {.i64=UINT16_MAX}, 0, UINT16_MAX, .flags = VFT },
+{ "high", "set high limit for amplification", OFFSET(hlimit), 
AV_OPT_TYPE_INT, {.i64=UINT16_MAX}, 0, UINT16_MAX, .flags = VFT },
+{ "planes", "set what planes to filter", OFFSET(planes), 
AV_OPT_TYPE_FLAGS, {.i64=7},0, 15,  VFT },
 { NULL },
 };
 
@@ -311,4 +312,5 @@ AVFilter ff_vf_amplify = {
 .init  = init,
 .uninit= uninit,
 .flags = AVFILTER_FLAG_SLICE_THREADS,
+.process_command = ff_filter_process_command,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/af_atempo: use ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Oct  9 12:13:22 
2019 +0200| [ce764a6c74f3d28df563bce21ccf38a9484e0eb7] | committer: Paul B Mahol

avfilter/af_atempo: use ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce764a6c74f3d28df563bce21ccf38a9484e0eb7
---

 libavfilter/af_atempo.c | 25 -
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 688dac5464..e4fc691abe 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -162,7 +162,7 @@ static const AVOption atempo_options[] = {
   OFFSET(tempo), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 },
   YAE_ATEMPO_MIN,
   YAE_ATEMPO_MAX,
-  AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
+  AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | 
AV_OPT_FLAG_RUNTIME_PARAM },
 { NULL }
 };
 
@@ -328,28 +328,14 @@ static int yae_reset(ATempoContext *atempo,
 return 0;
 }
 
-static int yae_set_tempo(AVFilterContext *ctx, const char *arg_tempo)
+static int yae_update(AVFilterContext *ctx)
 {
 const AudioFragment *prev;
 ATempoContext *atempo = ctx->priv;
-char   *tail = NULL;
-double tempo = av_strtod(arg_tempo, );
-
-if (tail && *tail) {
-av_log(ctx, AV_LOG_ERROR, "Invalid tempo value '%s'\n", arg_tempo);
-return AVERROR(EINVAL);
-}
-
-if (tempo < YAE_ATEMPO_MIN || tempo > YAE_ATEMPO_MAX) {
-av_log(ctx, AV_LOG_ERROR, "Tempo value %f exceeds [%f, %f] range\n",
-   tempo, YAE_ATEMPO_MIN, YAE_ATEMPO_MAX);
-return AVERROR(EINVAL);
-}
 
 prev = yae_prev_frag(atempo);
 atempo->origin[0] = prev->position[0] + atempo->window / 2;
 atempo->origin[1] = prev->position[1] + atempo->window / 2;
-atempo->tempo = tempo;
 return 0;
 }
 
@@ -1189,7 +1175,12 @@ static int process_command(AVFilterContext *ctx,
int res_len,
int flags)
 {
-return !strcmp(cmd, "tempo") ? yae_set_tempo(ctx, arg) : AVERROR(ENOSYS);
+int ret = ff_filter_process_command(ctx, cmd, arg, res, res_len, flags);
+
+if (ret < 0)
+return ret;
+
+return yae_update(ctx);
 }
 
 static const AVFilterPad atempo_inputs[] = {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/af_anlmdn: switch to ff_filter_process_command()

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Oct  8 13:12:52 
2019 +0200| [877e2e92a377249625f5a2fcba53f64525705560] | committer: Paul B Mahol

avfilter/af_anlmdn: switch to ff_filter_process_command()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=877e2e92a377249625f5a2fcba53f64525705560
---

 libavfilter/af_anlmdn.c | 36 +++-
 1 file changed, 7 insertions(+), 29 deletions(-)

diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c
index b5bc94b4eb..6e37452963 100644
--- a/libavfilter/af_anlmdn.c
+++ b/libavfilter/af_anlmdn.c
@@ -73,15 +73,16 @@ enum OutModes {
 
 #define OFFSET(x) offsetof(AudioNLMeansContext, x)
 #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define AFT 
AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption anlmdn_options[] = {
-{ "s", "set denoising strength", OFFSET(a),  AV_OPT_TYPE_FLOAT,
{.dbl=0.1},0.1, 10, AF },
+{ "s", "set denoising strength", OFFSET(a),  AV_OPT_TYPE_FLOAT,
{.dbl=0.1},0.1, 10, AFT },
 { "p", "set patch duration", OFFSET(pd), AV_OPT_TYPE_DURATION, 
{.i64=2000}, 1000, 10, AF },
 { "r", "set research duration",  OFFSET(rd), AV_OPT_TYPE_DURATION, 
{.i64=6000}, 2000, 30, AF },
-{ "o", "set output mode",OFFSET(om), AV_OPT_TYPE_INT,  
{.i64=OUT_MODE},  0, NB_MODES-1, AF, "mode" },
-{  "i", "input", 0,  AV_OPT_TYPE_CONST,
{.i64=IN_MODE},   0,  0, AF, "mode" },
-{  "o", "output",0,  AV_OPT_TYPE_CONST,
{.i64=OUT_MODE},  0,  0, AF, "mode" },
-{  "n", "noise", 0,  AV_OPT_TYPE_CONST,
{.i64=NOISE_MODE},0,  0, AF, "mode" },
+{ "o", "set output mode",OFFSET(om), AV_OPT_TYPE_INT,  
{.i64=OUT_MODE},  0, NB_MODES-1, AFT, "mode" },
+{  "i", "input", 0,  AV_OPT_TYPE_CONST,
{.i64=IN_MODE},   0,  0, AFT, "mode" },
+{  "o", "output",0,  AV_OPT_TYPE_CONST,
{.i64=OUT_MODE},  0,  0, AFT, "mode" },
+{  "n", "noise", 0,  AV_OPT_TYPE_CONST,
{.i64=NOISE_MODE},0,  0, AFT, "mode" },
 { "m", "set smooth factor",  OFFSET(m),  AV_OPT_TYPE_FLOAT,
{.dbl=11.},   1, 15, AF },
 { NULL }
 };
@@ -339,29 +340,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_frame_free(>cache);
 }
 
-static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args,
-   char *res, int res_len, int flags)
-{
-AudioNLMeansContext *s = ctx->priv;
-
-if (!strcmp(cmd, "s")) {
-float a;
-
-if (av_sscanf(args, "%f", ) == 1)
-s->a = av_clipf(a, 0.1, 10);
-} else if (!strcmp(cmd, "o")) {
-if (!strcmp(args, "i")) {
-s->om = IN_MODE;
-} else if (!strcmp(args, "o")) {
-s->om = OUT_MODE;
-} else if (!strcmp(args, "n")) {
-s->om = NOISE_MODE;
-}
-}
-
-return 0;
-}
-
 static const AVFilterPad inputs[] = {
 {
 .name = "default",
@@ -390,7 +368,7 @@ AVFilter ff_af_anlmdn = {
 .uninit= uninit,
 .inputs= inputs,
 .outputs   = outputs,
-.process_command = process_command,
+.process_command = ff_filter_process_command,
 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
  AVFILTER_FLAG_SLICE_THREADS,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] doc/filters: document new feature

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Oct 14 11:24:38 
2019 +0200| [8fec9fca69c22fc41d8602d8bdf547f14c70fc06] | committer: Paul B Mahol

doc/filters: document new feature

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fec9fca69c22fc41d8602d8bdf547f14c70fc06
---

 doc/filters.texi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index e7c1090853..8c1482ed1f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -312,6 +312,15 @@ See @code{ffmpeg -filters} to view which filters have 
timeline support.
 
 @c man end FILTERGRAPH DESCRIPTION
 
+@anchor{commands}
+@chapter Changing options at runtime with a command
+
+Some options can be changed during the operation of the filter using
+a command. These options are marked 'T' on the output of
+@command{ffmpeg} @option{-h filter=}.
+The name of the command is the name of the option and the argument is
+the new value.
+
 @anchor{framesync}
 @chapter Options for filters with several inputs (framesync)
 @c man begin OPTIONS FOR FILTERS WITH SEVERAL INPUTS

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_geq: allow user to set interpolation method

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Oct 11 18:26:22 
2019 +0200| [8a0d45a92eb31b2e4ea2fe8a10fb9817a0b0e63f] | committer: Paul B Mahol

avfilter/vf_geq: allow user to set interpolation method

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a0d45a92eb31b2e4ea2fe8a10fb9817a0b0e63f
---

 doc/filters.texi |  8 
 libavfilter/vf_geq.c | 27 +++
 2 files changed, 35 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index 0d4514678c..e7c1090853 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -11019,6 +11019,14 @@ red/green/blue component. Return 0 if there is no such 
component.
 @item alpha(x, y)
 Return the value of the pixel at location (@var{x},@var{y}) of the alpha
 plane. Return 0 if there is no such plane.
+
+@item interpolation
+Set one of interpolation methods:
+@table @option
+@item nearest, n
+@item bilinear, b
+@end table
+Default is bilinear.
 @end table
 
 For functions, if @var{x} and @var{y} are outside the area, the value will be
diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
index 8b1c7726dc..39083c149b 100644
--- a/libavfilter/vf_geq.c
+++ b/libavfilter/vf_geq.c
@@ -33,6 +33,12 @@
 #include "libavutil/pixdesc.h"
 #include "internal.h"
 
+enum InterpolationMethods {
+INTERP_NEAREST,
+INTERP_BILINEAR,
+NB_INTERP
+};
+
 static const char *const var_names[] = {   "X",   "Y",   "W",   "H",   "N",   
"SW",   "SH",   "T",NULL };
 enum   { VAR_X, VAR_Y, VAR_W, VAR_H, VAR_N, 
VAR_SW, VAR_SH, VAR_T, VAR_VARS_NB };
 
@@ -46,6 +52,7 @@ typedef struct GEQContext {
 double values[VAR_VARS_NB]; ///< expression values
 int hsub, vsub; ///< chroma subsampling
 int planes; ///< number of planes
+int interpolation;
 int is_rgb;
 int bps;
 } GEQContext;
@@ -70,6 +77,12 @@ static const AVOption geq_options[] = {
 { "g",  "set green expression",   OFFSET(expr_str[G]), 
AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
 { "blue_expr",  "set blue expression",OFFSET(expr_str[B]), 
AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
 { "b",  "set blue expression",OFFSET(expr_str[B]), 
AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
+{ "interpolation","set interpolation method", OFFSET(interpolation), 
AV_OPT_TYPE_INT, {.i64=INTERP_BILINEAR}, 0, NB_INTERP-1, FLAGS, "interp" },
+{ "i",  "set interpolation method",   OFFSET(interpolation), 
AV_OPT_TYPE_INT, {.i64=INTERP_BILINEAR}, 0, NB_INTERP-1, FLAGS, "interp" },
+{ "nearest","nearest interpolation",  0,   
AV_OPT_TYPE_CONST, {.i64=INTERP_NEAREST},  0, 0, FLAGS, "interp" },
+{ "n",  "nearest interpolation",  0,   
AV_OPT_TYPE_CONST, {.i64=INTERP_NEAREST},  0, 0, FLAGS, "interp" },
+{ "bilinear",   "bilinear interpolation", 0,   
AV_OPT_TYPE_CONST, {.i64=INTERP_BILINEAR}, 0, 0, FLAGS, "interp" },
+{ "b",  "bilinear interpolation", 0,   
AV_OPT_TYPE_CONST, {.i64=INTERP_BILINEAR}, 0, 0, FLAGS, "interp" },
 {NULL},
 };
 
@@ -88,6 +101,7 @@ static inline double getpix(void *priv, double x, double y, 
int plane)
 if (!src)
 return 0;
 
+if (geq->interpolation == INTERP_BILINEAR) {
 xi = x = av_clipd(x, 0, w - 2);
 yi = y = av_clipd(y, 0, h - 2);
 
@@ -104,6 +118,19 @@ static inline double getpix(void *priv, double x, double 
y, int plane)
 return (1-y)*((1-x)*src[xi +  yi* linesize] + x*src[xi + 1 +  yi   
 * linesize])
   +   y *((1-x)*src[xi + (yi+1) * linesize] + x*src[xi + 1 + 
(yi+1) * linesize]);
 }
+} else {
+xi = av_clipd(x, 0, w - 1);
+yi = av_clipd(y, 0, h - 1);
+
+if (geq->bps > 8) {
+const uint16_t *src16 = (const uint16_t*)src;
+linesize /= 2;
+
+return src16[xi + yi * linesize];
+} else {
+return src[xi + yi * linesize];
+}
+}
 }
 
 //TODO: cubic interpolate

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_geq: reindent

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Oct 11 18:29:03 
2019 +0200| [036fff7e43f5a8d608587daa053970b702d424c0] | committer: Paul B Mahol

avfilter/vf_geq: reindent

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=036fff7e43f5a8d608587daa053970b702d424c0
---

 libavfilter/vf_geq.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
index 39083c149b..e3267e331f 100644
--- a/libavfilter/vf_geq.c
+++ b/libavfilter/vf_geq.c
@@ -102,22 +102,22 @@ static inline double getpix(void *priv, double x, double 
y, int plane)
 return 0;
 
 if (geq->interpolation == INTERP_BILINEAR) {
-xi = x = av_clipd(x, 0, w - 2);
-yi = y = av_clipd(y, 0, h - 2);
+xi = x = av_clipd(x, 0, w - 2);
+yi = y = av_clipd(y, 0, h - 2);
 
-x -= xi;
-y -= yi;
+x -= xi;
+y -= yi;
 
-if (geq->bps > 8) {
-const uint16_t *src16 = (const uint16_t*)src;
-linesize /= 2;
+if (geq->bps > 8) {
+const uint16_t *src16 = (const uint16_t*)src;
+linesize /= 2;
 
-return (1-y)*((1-x)*src16[xi +  yi* linesize] + x*src16[xi + 1 +  
yi* linesize])
-  +   y *((1-x)*src16[xi + (yi+1) * linesize] + x*src16[xi + 1 + 
(yi+1) * linesize]);
-} else {
-return (1-y)*((1-x)*src[xi +  yi* linesize] + x*src[xi + 1 +  yi   
 * linesize])
-  +   y *((1-x)*src[xi + (yi+1) * linesize] + x*src[xi + 1 + 
(yi+1) * linesize]);
-}
+return (1-y)*((1-x)*src16[xi +  yi* linesize] + x*src16[xi + 1 
+  yi* linesize])
+  +   y *((1-x)*src16[xi + (yi+1) * linesize] + x*src16[xi + 1 
+ (yi+1) * linesize]);
+} else {
+return (1-y)*((1-x)*src[xi +  yi* linesize] + x*src[xi + 1 +  
yi* linesize])
+  +   y *((1-x)*src[xi + (yi+1) * linesize] + x*src[xi + 1 + 
(yi+1) * linesize]);
+}
 } else {
 xi = av_clipd(x, 0, w - 1);
 yi = av_clipd(y, 0, h - 1);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/vf_edgedetect: fix coverity issue

2019-10-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Oct 14 10:52:27 
2019 +0200| [996ff3fe86b0a7a0d2b8bc5a2570cb1271eb9474] | committer: Paul B Mahol

avfilter/vf_edgedetect: fix coverity issue

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=996ff3fe86b0a7a0d2b8bc5a2570cb1271eb9474
---

 libavfilter/vf_edgedetect.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c
index 11a31fa4ff..ea0efe0de3 100644
--- a/libavfilter/vf_edgedetect.c
+++ b/libavfilter/vf_edgedetect.c
@@ -150,8 +150,9 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int 
h,
 int i, j;
 
 memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
-if (h > 1)
+if (h > 1) {
 memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
+}
 for (j = 2; j < h - 2; j++) {
 dst[0] = src[0];
 dst[1] = src[1];
@@ -181,8 +182,9 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int 
h,
 dst += dst_linesize;
 src += src_linesize;
 }
-if (h > 2)
+if (h > 2) {
 memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
+}
 if (h > 3)
 memcpy(dst, src, w);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avformat/chromaprint: Fix fp_format option

2019-10-14 Thread Andriy Gelman
ffmpeg | branch: master | Andriy Gelman  | Sun Oct  6 
01:49:46 2019 -0400| [1108bd517363c50740025fcc58ae1e572c8150a0] | committer: 
Gyan Doshi

avformat/chromaprint: Fix fp_format option

The fp_format option was incorrectly declared,
so it could not be set via string constants.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1108bd517363c50740025fcc58ae1e572c8150a0
---

 libavformat/chromaprint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c
index f39c09ddb9..547e801cdd 100644
--- a/libavformat/chromaprint.c
+++ b/libavformat/chromaprint.c
@@ -164,7 +164,7 @@ fail:
 static const AVOption options[] = {
 { "silence_threshold", "threshold for detecting silence", 
OFFSET(silence_threshold), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 32767, FLAGS },
 { "algorithm", "version of the fingerprint algorithm", OFFSET(algorithm), 
AV_OPT_TYPE_INT, { .i64 = CHROMAPRINT_ALGORITHM_DEFAULT }, 
CHROMAPRINT_ALGORITHM_TEST1, INT_MAX, FLAGS },
-{ "fp_format", "fingerprint format to write", OFFSET(fp_format), 
AV_OPT_TYPE_INT, { .i64 = FINGERPRINT_BASE64 }, FINGERPRINT_RAW, 
FINGERPRINT_BASE64, FLAGS },
+{ "fp_format", "fingerprint format to write", OFFSET(fp_format), 
AV_OPT_TYPE_INT, { .i64 = FINGERPRINT_BASE64 }, FINGERPRINT_RAW, 
FINGERPRINT_BASE64, FLAGS, "fp_format" },
 { "raw", "binary raw fingerprint", 0, AV_OPT_TYPE_CONST, {.i64 = 
FINGERPRINT_RAW }, INT_MIN, INT_MAX, FLAGS, "fp_format"},
 { "compressed", "binary compressed fingerprint", 0, AV_OPT_TYPE_CONST, 
{.i64 = FINGERPRINT_COMPRESSED }, INT_MIN, INT_MAX, FLAGS, "fp_format"},
 { "base64", "Base64 compressed fingerprint", 0, AV_OPT_TYPE_CONST, {.i64 = 
FINGERPRINT_BASE64 }, INT_MIN, INT_MAX, FLAGS, "fp_format"},

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avformat/chromaprint: improve logging message

2019-10-14 Thread Andriy Gelman
ffmpeg | branch: master | Andriy Gelman  | Sun Oct  6 
01:49:48 2019 -0400| [634529c40d62e02bacea3a7f91d4226a9e4b3cbc] | committer: 
Gyan Doshi

avformat/chromaprint: improve logging message

Setting silence_threshold requires that -algorithm is set to 3.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=634529c40d62e02bacea3a7f91d4226a9e4b3cbc
---

 libavformat/chromaprint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c
index 547e801cdd..a4c0b97d99 100644
--- a/libavformat/chromaprint.c
+++ b/libavformat/chromaprint.c
@@ -73,7 +73,7 @@ static int write_header(AVFormatContext *s)
 if (cpr->silence_threshold != -1) {
 #if CPR_VERSION_INT >= AV_VERSION_INT(0, 7, 0)
 if (!chromaprint_set_option(cpr->ctx, "silence_threshold", 
cpr->silence_threshold)) {
-av_log(s, AV_LOG_ERROR, "Failed to set silence threshold.\n");
+av_log(s, AV_LOG_ERROR, "Failed to set silence threshold. Setting 
silence_threshold requires -algorithm 3 option.\n");
 goto fail;
 }
 #else

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".