Re: [FFmpeg-devel] [PATCH] avfilter: add crossfade filter

2020-01-10 Thread Gyan

Paul, this is useful. When can you merge this?

On 24-10-2019 02:19 am, Paul B Mahol wrote:

Signed-off-by: Paul B Mahol 
---
  doc/filters.texi |  18 +
  libavfilter/Makefile |   1 +
  libavfilter/allfilters.c |   1 +
  libavfilter/vf_blend.c   | 157 ++-
  4 files changed, 175 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 7400e7dd31..eea0be060d 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -6450,6 +6450,7 @@ The threshold below which a pixel value is considered 
black; it defaults to
  
  @end table
  
+@anchor{blend}

  @section blend, tblend
  
  Blend two video frames into each other.

@@ -8068,6 +8069,23 @@ indicates 'never reset', and returns the largest area 
encountered during
  playback.
  @end table
  
+@section crossfade

+
+Apply cross fade from one input video stream to another input video stream.
+The cross fade is applied for specified duration.
+
+The filter accepts the following options:
+
+@table @option
+@item duration
+Set cross fade duration in seconds.
+
+@item offset
+Set cross fade start relative to first input stream.
+
+For rest of options explanation see @ref{blend} filter.
+@end table
+
  @anchor{cue}
  @section cue
  
diff --git a/libavfilter/Makefile b/libavfilter/Makefile

index 63d2fba861..e02c7d3614 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -197,6 +197,7 @@ OBJS-$(CONFIG_COREIMAGE_FILTER)  += 
vf_coreimage.o
  OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o
  OBJS-$(CONFIG_CROP_FILTER)   += vf_crop.o
  OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o
+OBJS-$(CONFIG_CROSSFADE_FILTER)  += vf_blend.o framesync.o
  OBJS-$(CONFIG_CUE_FILTER)+= f_cue.o
  OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o
  OBJS-$(CONFIG_DATASCOPE_FILTER)  += vf_datascope.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index e4186f93db..7838002230 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -185,6 +185,7 @@ extern AVFilter ff_vf_coreimage;
  extern AVFilter ff_vf_cover_rect;
  extern AVFilter ff_vf_crop;
  extern AVFilter ff_vf_cropdetect;
+extern AVFilter ff_vf_crossfade;
  extern AVFilter ff_vf_cue;
  extern AVFilter ff_vf_curves;
  extern AVFilter ff_vf_datascope;
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 67163be3e7..c4411ca5f9 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -26,6 +26,7 @@
  #include "formats.h"
  #include "framesync.h"
  #include "internal.h"
+#include "filters.h"
  #include "video.h"
  #include "blend.h"
  
@@ -44,6 +45,17 @@ typedef struct BlendContext {

  int depth;
  FilterParams params[4];
  int tblend;
+int crossfade;
+int64_t duration;
+int64_t offset;
+int64_t duration_pts;
+int64_t offset_pts;
+int64_t first_pts;
+int64_t pts;
+int crossfade_is_over;
+int need_second;
+int eof[2];
+AVFrame *cf[2];
  AVFrame *prev_frame;/* only used with tblend */
  } BlendContext;
  
@@ -557,6 +569,7 @@ static av_cold int init(AVFilterContext *ctx)

  BlendContext *s = ctx->priv;
  
  s->tblend = !strcmp(ctx->filter->name, "tblend");

+s->crossfade = !strcmp(ctx->filter->name, "crossfade");
  
  s->fs.on_event = blend_frame_for_dualinput;

  return 0;
@@ -715,7 +728,7 @@ static int config_output(AVFilterLink *outlink)
  s->depth = pix_desc->comp[0].depth;
  s->nb_planes = av_pix_fmt_count_planes(toplink->format);
  
-if (!s->tblend)

+if (!s->tblend && !s->crossfade)
  if ((ret = ff_framesync_init_dualinput(>fs, ctx)) < 0)
  return ret;
  
@@ -743,7 +756,14 @@ static int config_output(AVFilterLink *outlink)

  }
  }
  
-if (s->tblend)

+s->first_pts = s->pts = AV_NOPTS_VALUE;
+
+if (s->duration)
+s->duration_pts = av_rescale_q(s->duration, AV_TIME_BASE_Q, 
outlink->time_base);
+if (s->offset)
+s->offset_pts = av_rescale_q(s->offset, AV_TIME_BASE_Q, 
outlink->time_base);
+
+if (s->tblend || s->crossfade)
  return 0;
  
  ret = ff_framesync_configure(>fs);

@@ -859,3 +879,136 @@ AVFilter ff_vf_tblend = {
  };
  
  #endif

+
+static const AVOption crossfade_options[] = {
+{ "duration", "set cross fade duration", OFFSET(duration), 
AV_OPT_TYPE_DURATION, {.i64=100}, 0, 6000, FLAGS },
+{ "offset",   "set cross fade start relative to first input stream", 
OFFSET(offset), AV_OPT_TYPE_DURATION, {.i64=0}, 0, 6000, FLAGS },
+COMMON_OPTIONS,
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(crossfade);
+
+static int crossfade_activate(AVFilterContext *ctx)
+{
+BlendContext *s   = ctx->priv;
+AVFilterLink *outlink = ctx->outputs[0];
+AVFrame *in = NULL, *out = NULL;
+int ret = 0, status;
+int64_t pts;
+
+

[FFmpeg-devel] [PATCH v1] avcodec/wavpack: simplify the code

2020-01-10 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/wavpack.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index d024280..edc0f79 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1114,9 +1114,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, 
void *data,
 avctx->bits_per_raw_sample = ((frame_flags & 0x03) + 1) << 3;
 }
 
-while (buf_size > 0) {
-if (buf_size <= WV_HEADER_SIZE)
-break;
+while (buf_size > WV_HEADER_SIZE) {
 frame_size = AV_RL32(buf + 4) - 12;
 buf   += 20;
 buf_size  -= 20;
-- 
2.9.5

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

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

Re: [FFmpeg-devel] [PATCH V1] doc/general: Add avs2 decoder/encoder entry

2020-01-10 Thread Gyan



On 11-01-2020 09:42 am, Jun Zhao wrote:

From: Jun Zhao 

Add avs2 decoder/encoder entry

Signed-off-by: Jun Zhao 
---
  doc/general.texi |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/doc/general.texi b/doc/general.texi
index a5b77e0..e668599 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -819,6 +819,8 @@ following image formats are supported:
  @tab fourcc: AVrp
  @item AVS (Audio Video Standard) video  @tab @tab  X
  @tab Video encoding used by the Creature Shock game.
+@item AVS2-P2/IEEE1857.4 @tab  E  @tab  E
+@tab Supported through external libraries libxavs2 and libdavs2
  @item AYUV   @tab  X  @tab  X
  @tab Microsoft uncompressed packed 4:4:4:4
  @item Beam Software VB   @tab @tab  X

Pushed as 883e6af710ba71bb26b5b9e19ebbec455528d7b4

Thanks,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH V1 03/11] lavfi/crop: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_crop.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 9bf4077..8dbf1b5 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -370,14 +370,15 @@ static int process_command(AVFilterContext *ctx, const 
char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(CropContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+#define TFLAGS 
AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption crop_options[] = {
-{ "out_w",   "set the width crop area expression",   OFFSET(w_expr), 
AV_OPT_TYPE_STRING, {.str = "iw"}, CHAR_MIN, CHAR_MAX, FLAGS },
-{ "w",   "set the width crop area expression",   OFFSET(w_expr), 
AV_OPT_TYPE_STRING, {.str = "iw"}, CHAR_MIN, CHAR_MAX, FLAGS },
-{ "out_h",   "set the height crop area expression",  OFFSET(h_expr), 
AV_OPT_TYPE_STRING, {.str = "ih"}, CHAR_MIN, CHAR_MAX, FLAGS },
-{ "h",   "set the height crop area expression",  OFFSET(h_expr), 
AV_OPT_TYPE_STRING, {.str = "ih"}, CHAR_MIN, CHAR_MAX, FLAGS },
-{ "x",   "set the x crop area expression",   OFFSET(x_expr), 
AV_OPT_TYPE_STRING, {.str = "(in_w-out_w)/2"}, CHAR_MIN, CHAR_MAX, FLAGS },
-{ "y",   "set the y crop area expression",   OFFSET(y_expr), 
AV_OPT_TYPE_STRING, {.str = "(in_h-out_h)/2"}, CHAR_MIN, CHAR_MAX, FLAGS },
+{ "out_w",   "set the width crop area expression",   OFFSET(w_expr), 
AV_OPT_TYPE_STRING, {.str = "iw"}, CHAR_MIN, CHAR_MAX, TFLAGS },
+{ "w",   "set the width crop area expression",   OFFSET(w_expr), 
AV_OPT_TYPE_STRING, {.str = "iw"}, CHAR_MIN, CHAR_MAX, TFLAGS },
+{ "out_h",   "set the height crop area expression",  OFFSET(h_expr), 
AV_OPT_TYPE_STRING, {.str = "ih"}, CHAR_MIN, CHAR_MAX, TFLAGS },
+{ "h",   "set the height crop area expression",  OFFSET(h_expr), 
AV_OPT_TYPE_STRING, {.str = "ih"}, CHAR_MIN, CHAR_MAX, TFLAGS },
+{ "x",   "set the x crop area expression",   OFFSET(x_expr), 
AV_OPT_TYPE_STRING, {.str = "(in_w-out_w)/2"}, CHAR_MIN, CHAR_MAX, TFLAGS },
+{ "y",   "set the y crop area expression",   OFFSET(y_expr), 
AV_OPT_TYPE_STRING, {.str = "(in_h-out_h)/2"}, CHAR_MIN, CHAR_MAX, TFLAGS },
 { "keep_aspect", "keep aspect ratio",
OFFSET(keep_aspect), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
 { "exact",   "do exact cropping",OFFSET(exact),  
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
 { NULL }
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH 1/2] avformat/libzmq: Check return of zmq_setsockopt

2020-01-10 Thread Andriy Gelman
From: Andriy Gelman 

Signed-off-by: Andriy Gelman 
---
 libavformat/libzmq.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavformat/libzmq.c b/libavformat/libzmq.c
index d86488293ff..2df55542c7e 100644
--- a/libavformat/libzmq.c
+++ b/libavformat/libzmq.c
@@ -123,7 +123,14 @@ static int zmq_proto_open(URLContext *h, const char *uri, 
int flags)
 return AVERROR_EXTERNAL;
 }
 
-zmq_setsockopt(s->socket, ZMQ_SUBSCRIBE, "", 0);
+ret = zmq_setsockopt(s->socket, ZMQ_SUBSCRIBE, "", 0);
+if (ret == -1) {
+av_log(h, AV_LOG_ERROR, "Error occured during zmq_setsockopt(): 
%s\n", ZMQ_STRERROR);
+zmq_close(s->socket);
+zmq_ctx_term(s->context);
+return AVERROR_EXTERNAL;
+}
+
 ret = zmq_connect(s->socket, uri);
 if (ret == -1) {
 av_log(h, AV_LOG_ERROR, "Error occured during zmq_connect(): 
%s\n", ZMQ_STRERROR);
-- 
2.24.0

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

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

[FFmpeg-devel] [PATCH 2/2] avformat/libzmq: Replace fail statements with goto

2020-01-10 Thread Andriy Gelman
From: Andriy Gelman 

Signed-off-by: Andriy Gelman 
---
 libavformat/libzmq.c | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/libavformat/libzmq.c b/libavformat/libzmq.c
index 2df55542c7e..8c8b294c921 100644
--- a/libavformat/libzmq.c
+++ b/libavformat/libzmq.c
@@ -101,16 +101,13 @@ static int zmq_proto_open(URLContext *h, const char *uri, 
int flags)
 s->socket = zmq_socket(s->context, ZMQ_PUB);
 if (!s->socket) {
 av_log(h, AV_LOG_ERROR, "Error occured during zmq_socket(): %s\n", 
ZMQ_STRERROR);
-zmq_ctx_term(s->context);
-return AVERROR_EXTERNAL;
+goto fail_term;
 }
 
 ret = zmq_bind(s->socket, uri);
 if (ret == -1) {
 av_log(h, AV_LOG_ERROR, "Error occured during zmq_bind(): %s\n", 
ZMQ_STRERROR);
-zmq_close(s->socket);
-zmq_ctx_term(s->context);
-return AVERROR_EXTERNAL;
+goto fail_close;
 }
 }
 
@@ -119,27 +116,28 @@ static int zmq_proto_open(URLContext *h, const char *uri, 
int flags)
 s->socket = zmq_socket(s->context, ZMQ_SUB);
 if (!s->socket) {
 av_log(h, AV_LOG_ERROR, "Error occured during zmq_socket(): %s\n", 
ZMQ_STRERROR);
-zmq_ctx_term(s->context);
-return AVERROR_EXTERNAL;
+goto fail_term;
 }
 
 ret = zmq_setsockopt(s->socket, ZMQ_SUBSCRIBE, "", 0);
 if (ret == -1) {
 av_log(h, AV_LOG_ERROR, "Error occured during zmq_setsockopt(): 
%s\n", ZMQ_STRERROR);
-zmq_close(s->socket);
-zmq_ctx_term(s->context);
-return AVERROR_EXTERNAL;
+goto fail_close;
 }
 
 ret = zmq_connect(s->socket, uri);
 if (ret == -1) {
 av_log(h, AV_LOG_ERROR, "Error occured during zmq_connect(): 
%s\n", ZMQ_STRERROR);
-zmq_close(s->socket);
-zmq_ctx_term(s->context);
-return AVERROR_EXTERNAL;
+goto fail_close;
 }
 }
 return 0;
+
+fail_close:
+zmq_close(s->socket);
+fail_term:
+zmq_ctx_term(s->context);
+return AVERROR_EXTERNAL;
 }
 
 static int zmq_proto_write(URLContext *h, const unsigned char *buf, int size)
-- 
2.24.0

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

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

[FFmpeg-devel] [PATCH V1 02/11] lavfi/spp: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_spp.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c
index db381cd..7381938 100644
--- a/libavfilter/vf_spp.c
+++ b/libavfilter/vf_spp.c
@@ -57,8 +57,9 @@ static void *child_next(void *obj, void *prev)
 
 #define OFFSET(x) offsetof(SPPContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+#define TFLAGS 
AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 static const AVOption spp_options[] = {
-{ "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 
3}, 0, MAX_LEVEL, FLAGS },
+{ "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 
3}, 0, MAX_LEVEL, TFLAGS },
 { "qp", "force a constant quantizer parameter", OFFSET(qp), 
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, FLAGS },
 { "mode", "set thresholding mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = 
MODE_HARD}, 0, NB_MODES - 1, FLAGS, "mode" },
 { "hard", "hard thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = 
MODE_HARD}, INT_MIN, INT_MAX, FLAGS, "mode" },
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 01/11] lavfi/spp: add "quality" option in runtime change path

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

it's stranage to use option "level" in runtime change path but used
"quality" in option, add "quality" in runtime change path, it's more
intuitive and keep the "level" for compatibility.

Signed-off-by: Jun Zhao 
---
 doc/filters.texi |9 +
 libavfilter/vf_spp.c |2 +-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index a2f862e..7459255 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -17271,6 +17271,15 @@ option may cause flicker since the B-Frames have often 
larger QP. Default is
 @code{0} (not enabled).
 @end table
 
+@subsection Commands
+
+This filter supports the following commands:
+@table @option
+@item level
+@item quality
+Same as quality option. And the command accepts the @code{max} same as the 
@code{6}.
+@end table
+
 @section sr
 
 Scale the input by applying one of the super-resolution methods based on
diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c
index fe579ce..db381cd 100644
--- a/libavfilter/vf_spp.c
+++ b/libavfilter/vf_spp.c
@@ -444,7 +444,7 @@ static int process_command(AVFilterContext *ctx, const char 
*cmd, const char *ar
 {
 SPPContext *s = ctx->priv;
 
-if (!strcmp(cmd, "level")) {
+if (!strcmp(cmd, "level") || !strcmp(cmd, "quality")) {
 if (!strcmp(args, "max"))
 s->log2_count = MAX_LEVEL;
 else
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 07/11] lavfi/rotate: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_rotate.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
index 371ff7f..378be44 100644
--- a/libavfilter/vf_rotate.c
+++ b/libavfilter/vf_rotate.c
@@ -94,10 +94,11 @@ typedef struct ThreadData {
 
 #define OFFSET(x) offsetof(RotContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+#define TFLAGS 
AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption rotate_options[] = {
-{ "angle", "set angle (in radians)",   OFFSET(angle_expr_str), 
AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
-{ "a", "set angle (in radians)",   OFFSET(angle_expr_str), 
AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
+{ "angle", "set angle (in radians)",   OFFSET(angle_expr_str), 
AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, .flags=TFLAGS },
+{ "a", "set angle (in radians)",   OFFSET(angle_expr_str), 
AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, .flags=TFLAGS },
 { "out_w", "set output width expression",  OFFSET(outw_expr_str), 
AV_OPT_TYPE_STRING, {.str="iw"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
 { "ow","set output width expression",  OFFSET(outw_expr_str), 
AV_OPT_TYPE_STRING, {.str="iw"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
 { "out_h", "set output height expression", OFFSET(outh_expr_str), 
AV_OPT_TYPE_STRING, {.str="ih"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 04/11] lavfi/hue: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_hue.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c
index 32b..026d4b6 100644
--- a/libavfilter/vf_hue.c
+++ b/libavfilter/vf_hue.c
@@ -86,7 +86,7 @@ typedef struct HueContext {
 } HueContext;
 
 #define OFFSET(x) offsetof(HueContext, 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 hue_options[] = {
 { "h", "set the hue angle degrees expression", OFFSET(hue_deg_expr), 
AV_OPT_TYPE_STRING,
   { .str = NULL }, .flags = FLAGS },
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 10/11] lavfi/zscale: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_zscale.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
index db2dd17..46c5dd7 100644
--- a/libavfilter/vf_zscale.c
+++ b/libavfilter/vf_zscale.c
@@ -738,12 +738,13 @@ static int process_command(AVFilterContext *ctx, const 
char *cmd, const char *ar
 
 #define OFFSET(x) offsetof(ZScaleContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define TFLAGS 
AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption zscale_options[] = {
-{ "w",  "Output video width",  OFFSET(w_expr),AV_OPT_TYPE_STRING, 
.flags = FLAGS },
-{ "width",  "Output video width",  OFFSET(w_expr),AV_OPT_TYPE_STRING, 
.flags = FLAGS },
-{ "h",  "Output video height", OFFSET(h_expr),AV_OPT_TYPE_STRING, 
.flags = FLAGS },
-{ "height", "Output video height", OFFSET(h_expr),AV_OPT_TYPE_STRING, 
.flags = FLAGS },
+{ "w",  "Output video width",  OFFSET(w_expr),AV_OPT_TYPE_STRING, 
.flags = TFLAGS },
+{ "width",  "Output video width",  OFFSET(w_expr),AV_OPT_TYPE_STRING, 
.flags = TFLAGS },
+{ "h",  "Output video height", OFFSET(h_expr),AV_OPT_TYPE_STRING, 
.flags = TFLAGS },
+{ "height", "Output video height", OFFSET(h_expr),AV_OPT_TYPE_STRING, 
.flags = TFLAGS },
 { "size",   "set video size",  OFFSET(size_str),  AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, FLAGS },
 { "s",  "set video size",  OFFSET(size_str),  AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, FLAGS },
 { "dither", "set dither type", OFFSET(dither),AV_OPT_TYPE_INT, 
{.i64 = 0}, 0, ZIMG_DITHER_ERROR_DIFFUSION, FLAGS, "dither" },
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 09/11] lavfi/firequalizer: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag

Signed-off-by: Jun Zhao 
---
 libavfilter/af_firequalizer.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_firequalizer.c b/libavfilter/af_firequalizer.c
index 00ddc87..f4513a1 100644
--- a/libavfilter/af_firequalizer.c
+++ b/libavfilter/af_firequalizer.c
@@ -112,10 +112,11 @@ typedef struct FIREqualizerContext {
 
 #define OFFSET(x) offsetof(FIREqualizerContext, x)
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define TFLAGS 
AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption firequalizer_options[] = {
-{ "gain", "set gain curve", OFFSET(gain), AV_OPT_TYPE_STRING, { .str = 
"gain_interpolate(f)" }, 0, 0, FLAGS },
-{ "gain_entry", "set gain entry", OFFSET(gain_entry), AV_OPT_TYPE_STRING, 
{ .str = NULL }, 0, 0, FLAGS },
+{ "gain", "set gain curve", OFFSET(gain), AV_OPT_TYPE_STRING, { .str = 
"gain_interpolate(f)" }, 0, 0, TFLAGS },
+{ "gain_entry", "set gain entry", OFFSET(gain_entry), AV_OPT_TYPE_STRING, 
{ .str = NULL }, 0, 0, TFLAGS },
 { "delay", "set delay", OFFSET(delay), AV_OPT_TYPE_DOUBLE, { .dbl = 0.01 
}, 0.0, 1e10, FLAGS },
 { "accuracy", "set accuracy", OFFSET(accuracy), AV_OPT_TYPE_DOUBLE, { .dbl 
= 5.0 }, 0.0, 1e10, FLAGS },
 { "wfunc", "set window function", OFFSET(wfunc), AV_OPT_TYPE_INT, { .i64 = 
WFUNC_HANN }, 0, NB_WFUNC-1, FLAGS, "wfunc" },
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 11/11] lavfi/vulume: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

 enable runtime change flag.

Signed-off-by: Jun Zhao 
---
 libavfilter/af_volume.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
index b106ed8..213c571 100644
--- a/libavfilter/af_volume.c
+++ b/libavfilter/af_volume.c
@@ -62,10 +62,11 @@ static const char *const var_names[] = {
 #define OFFSET(x) offsetof(VolumeContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
+#define T AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption volume_options[] = {
 { "volume", "set volume adjustment expression",
-OFFSET(volume_expr), AV_OPT_TYPE_STRING, { .str = "1.0" }, .flags 
= A|F },
+OFFSET(volume_expr), AV_OPT_TYPE_STRING, { .str = "1.0" }, .flags 
= A|F|T },
 { "precision", "select mathematical precision",
 OFFSET(precision), AV_OPT_TYPE_INT, { .i64 = PRECISION_FLOAT }, 
PRECISION_FIXED, PRECISION_DOUBLE, A|F, "precision" },
 { "fixed",  "select 8-bit fixed-point", 0, AV_OPT_TYPE_CONST, { 
.i64 = PRECISION_FIXED  }, INT_MIN, INT_MAX, A|F, "precision" },
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 08/11] lavfi/eq: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_eq.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
index 914a07f..f4cf499 100644
--- a/libavfilter/vf_eq.c
+++ b/libavfilter/vf_eq.c
@@ -353,24 +353,24 @@ static const AVFilterPad eq_outputs[] = {
 
 #define OFFSET(x) offsetof(EQContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-
+#define TFLAGS 
AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 static const AVOption eq_options[] = {
 { "contrast", "set the contrast adjustment, negative values give a 
negative image",
-OFFSET(contrast_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(contrast_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "brightness",   "set the brightness adjustment",
-OFFSET(brightness_expr),   AV_OPT_TYPE_STRING, {.str = "0.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(brightness_expr),   AV_OPT_TYPE_STRING, {.str = "0.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "saturation",   "set the saturation adjustment",
-OFFSET(saturation_expr),   AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(saturation_expr),   AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "gamma","set the initial gamma value",
-OFFSET(gamma_expr),AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(gamma_expr),AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "gamma_r",  "gamma value for red",
-OFFSET(gamma_r_expr),  AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(gamma_r_expr),  AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "gamma_g",  "gamma value for green",
-OFFSET(gamma_g_expr),  AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(gamma_g_expr),  AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "gamma_b",  "gamma value for blue",
-OFFSET(gamma_b_expr),  AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(gamma_b_expr),  AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "gamma_weight", "set the gamma weight which reduces the effect of gamma 
on bright areas",
-OFFSET(gamma_weight_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, FLAGS },
+OFFSET(gamma_weight_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 
CHAR_MIN, CHAR_MAX, TFLAGS },
 { "eval", "specify when to evaluate expressions", OFFSET(eval_mode), 
AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_INIT}, 0, EVAL_MODE_NB-1, FLAGS, "eval" },
  { "init",  "eval expressions once during initialization", 0, 
AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT},  .flags = FLAGS, .unit = "eval" },
  { "frame", "eval expressions per-frame",  0, 
AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" },
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 06/11] lavfi/streamselect: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag.

Signed-off-by: Jun Zhao 
---
 libavfilter/f_streamselect.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c
index 7a1ff77..b3ae4be 100644
--- a/libavfilter/f_streamselect.c
+++ b/libavfilter/f_streamselect.c
@@ -41,9 +41,10 @@ typedef struct StreamSelectContext {
 
 #define OFFSET(x) offsetof(StreamSelectContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | 
AV_OPT_FLAG_FILTERING_PARAM
+#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | 
AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
 static const AVOption streamselect_options[] = {
 { "inputs",  "number of input streams",   OFFSET(nb_inputs),  
AV_OPT_TYPE_INT,{.i64=2},2, INT_MAX,  .flags=FLAGS },
-{ "map", "input indexes to remap to outputs", OFFSET(map_str),
AV_OPT_TYPE_STRING, {.str=NULL},  .flags=FLAGS },
+{ "map", "input indexes to remap to outputs", OFFSET(map_str),
AV_OPT_TYPE_STRING, {.str=NULL},  .flags=TFLAGS },
 { NULL }
 };
 
-- 
1.7.1

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

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

[FFmpeg-devel] [PATCH V1 05/11] lavfi/scale: enable runtime change flag

2020-01-10 Thread Jun Zhao
From: Jun Zhao 

enable runtime change flag.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_scale.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 8620d1c..81b2207 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -569,12 +569,13 @@ static const AVClass *child_class_next(const AVClass 
*prev)
 
 #define OFFSET(x) offsetof(ScaleContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define TFLAGS 
AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
 static const AVOption scale_options[] = {
-{ "w", "Output video width",  OFFSET(w_expr),
AV_OPT_TYPE_STRING,.flags = FLAGS },
-{ "width", "Output video width",  OFFSET(w_expr),
AV_OPT_TYPE_STRING,.flags = FLAGS },
-{ "h", "Output video height", OFFSET(h_expr),
AV_OPT_TYPE_STRING,.flags = FLAGS },
-{ "height","Output video height", OFFSET(h_expr),
AV_OPT_TYPE_STRING,.flags = FLAGS },
+{ "w", "Output video width",  OFFSET(w_expr),
AV_OPT_TYPE_STRING,.flags = TFLAGS },
+{ "width", "Output video width",  OFFSET(w_expr),
AV_OPT_TYPE_STRING,.flags = TFLAGS },
+{ "h", "Output video height", OFFSET(h_expr),
AV_OPT_TYPE_STRING,.flags = TFLAGS },
+{ "height","Output video height", OFFSET(h_expr),
AV_OPT_TYPE_STRING,.flags = TFLAGS },
 { "flags", "Flags to pass to libswscale", OFFSET(flags_str), 
AV_OPT_TYPE_STRING, { .str = "bilinear" }, .flags = FLAGS },
 { "interl", "set interlacing", OFFSET(interlaced), AV_OPT_TYPE_BOOL, {.i64 
= 0 }, -1, 1, FLAGS },
 { "size",   "set video size",  OFFSET(size_str), 
AV_OPT_TYPE_STRING, {.str = NULL}, 0, FLAGS },
-- 
1.7.1

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

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

Re: [FFmpeg-devel] [PATCH 2/2] avio: do not export avpriv_io_{move, delete}

2020-01-10 Thread Hendrik Leppkes
On Fri, Jan 10, 2020 at 7:31 PM James Almer  wrote:
>
> On 1/10/2020 11:30 AM, Anton Khirnov wrote:
> > Quoting James Almer (2020-01-10 14:33:06)
> >> On 1/10/2020 8:21 AM, Anton Khirnov wrote:
> >>> They are private and not used by anything outside of lavf. There is no
> >>> reason for them to be exported.
> >>> ---
> >>>  libavformat/avio.c|  4 ++--
> >>>  libavformat/avio.h| 19 ---
> >>>  libavformat/dashenc.c | 10 +-
> >>>  libavformat/url.h | 20 
> >>>  4 files changed, 27 insertions(+), 26 deletions(-)
> >>>
> >>> diff --git a/libavformat/avio.c b/libavformat/avio.c
> >>> index 2dd2312296..3e390fe719 100644
> >>> --- a/libavformat/avio.c
> >>> +++ b/libavformat/avio.c
> >>> @@ -494,7 +494,7 @@ int avio_check(const char *url, int flags)
> >>>  return ret;
> >>>  }
> >>>
> >>> -int avpriv_io_move(const char *url_src, const char *url_dst)
> >>> +int ffurl_move(const char *url_src, const char *url_dst)
> >>>  {
> >>>  URLContext *h_src, *h_dst;
> >>>  int ret = ffurl_alloc(_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
> >>> @@ -516,7 +516,7 @@ int avpriv_io_move(const char *url_src, const char 
> >>> *url_dst)
> >>>  return ret;
> >>>  }
> >>>
> >>> -int avpriv_io_delete(const char *url)
> >>> +int ffurl_delete(const char *url)
> >>>  {
> >>>  URLContext *h;
> >>>  int ret = ffurl_alloc(, url, AVIO_FLAG_WRITE, NULL);
> >>> diff --git a/libavformat/avio.h b/libavformat/avio.h
> >>> index 9141642e75..34c5957791 100644
> >>> --- a/libavformat/avio.h
> >>> +++ b/libavformat/avio.h
> >>> @@ -374,25 +374,6 @@ const char *avio_find_protocol_name(const char *url);
> >>>   */
> >>>  int avio_check(const char *url, int flags);
> >>>
> >>> -/**
> >>> - * Move or rename a resource.
> >>> - *
> >>> - * @note url_src and url_dst should share the same protocol and 
> >>> authority.
> >>> - *
> >>> - * @param url_src url to resource to be moved
> >>> - * @param url_dst new url to resource if the operation succeeded
> >>> - * @return >=0 on success or negative on error.
> >>> - */
> >>> -int avpriv_io_move(const char *url_src, const char *url_dst);
> >>> -
> >>> -/**
> >>> - * Delete a resource.
> >>> - *
> >>> - * @param url resource to be deleted.
> >>> - * @return >=0 on success or negative on error.
> >>> - */
> >>> -int avpriv_io_delete(const char *url);
> >>
> >> No, unfortunately and despite the name, these are public. Or rather,
> >> exposed in a public header when they were not meant to be public,
> >> afaics, so what we can do instead is schedule them for removal in the
> >> next bump and not bother with a two year deprecation period. We've done
> >> it before for other avpriv_ functions mistakenly exposed in public headers.
> >
> > There's (sadly) plenty of stuff in public headers that is not meant to
> > be public. For example, the FF_API_* macros, the internal fields of
> > structs like AVCodec, etc. IMO we should not take into consideration
> > people using private APIs, otherwise we legitimize such behavior. Anyone
> > using a private function gets to keep all the pieces when we break it.
>
> Yes, i agree with this if we were talking about clearly marked
> non-public structs, fields and defines. In those cases, people using
> them should be aware of the consequences. But these are two five years
> old documented functions in a public header (Although admittedly not
> announced in APIChanges) and even featured in an API example tool.
> I don't think the avpriv_ prefix is something we documented outside of
> the developer guidelines, so anyone reading avio.h and the example will
> have no reason to think these were there by mistake.
>
> You could replace the doxy with a "do not use" notice aside from
> wrapping them in a scheduled removal preprocessor check, but at the very
> least the symbols should not be removed until the next major bump.
>
> If others agree with you though, I'll not block this.
>

If we plan to do a bump relatively soon anyway, then there is no
reason to really rush anything, and just let them in until such a time
that there is a bump. Considering their only not-really-public nature
we can forego the 2 year deprecation and just throw them out when we
open the ABI.

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

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

Re: [FFmpeg-devel] [PATCH] avformat/image2: Upon request, make available extra metadata, fields related to input path to be used by filters.

2020-01-10 Thread Marton Balint



On Fri, 10 Jan 2020, Alexandre Heitor Schmidt wrote:


On 09/01/2020 21:39, Marton Balint wrote:
>
>
> On Sat, 4 Jan 2020, Alexandre Heitor Schmidt wrote:
>
>> Hi there! I'm just writing to make sure this patch wasn't forgotten. :)
>
> Thanks, I think the patch is fine now, I will apply it tomorrow if 
there are no further comments.

>
> Regards,
> Marton

Awesome!


Thanks, applied with some minor changes:
- move option from common opts to the image2 demuxer opts
- use av_dict_free to free the metadata dictionary
- bump avformat micro version

Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH 2/3] avcodec/agm: YUV420 without DCT needs even dimensions

2020-01-10 Thread Michael Niedermayer
Fixes: out of array access
Fixes: 
19892/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5707525924323328

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/agm.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/agm.c b/libavcodec/agm.c
index 80f4697ee5..a874226c28 100644
--- a/libavcodec/agm.c
+++ b/libavcodec/agm.c
@@ -1239,6 +1239,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
 s->dct = avctx->codec_tag != MKTAG('A', 'G', 'M', '4') &&
  avctx->codec_tag != MKTAG('A', 'G', 'M', '5');
 
+if (!s->rgb && !s->dct) {
+if ((avctx->width & 1) || (avctx->height & 1))
+return AVERROR_INVALIDDATA;
+}
+
 avctx->idct_algo = FF_IDCT_SIMPLE;
 ff_idctdsp_init(>idsp, avctx);
 ff_init_scantable(s->idsp.idct_permutation, >scantable, 
ff_zigzag_direct);
-- 
2.24.0

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

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

[FFmpeg-devel] [PATCH 1/3] avcodec/ralf: Fix integer overflow in apply_lpc()

2020-01-10 Thread Michael Niedermayer
Fixes: signed integer overflow: 2147482897 + 2048 cannot be represented in type 
'int'
Fixes: 
19240/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5743240326414336
Fixes: 
19869/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5150136636538880

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/ralf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c
index d8f1803086..15be19b526 100644
--- a/libavcodec/ralf.c
+++ b/libavcodec/ralf.c
@@ -330,7 +330,7 @@ static void apply_lpc(RALFContext *ctx, int ch, int length, 
int bits)
 acc = (acc + bias - 1) >> ctx->filter_bits;
 acc = FFMAX(acc, min_clip);
 } else {
-acc = (acc + bias) >> ctx->filter_bits;
+acc = ((unsigned)acc + bias) >> ctx->filter_bits;
 acc = FFMIN(acc, max_clip);
 }
 audio[i] += acc;
-- 
2.24.0

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

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

[FFmpeg-devel] [PATCH] tiffdec: support embedded ICC profiles

2020-01-10 Thread Lynne
Patch attached.

Very widespread, every NASA TIFF image has an ICC profile embedded, and its 
almost never sRGB, so this is really needed for proper color display.
>From 1a3cbad82c897110e8ef221aae9733b841a443fc Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Fri, 10 Jan 2020 21:55:19 +
Subject: [PATCH] tiffdec: support embedded ICC profiles

---
 libavcodec/tiff.c | 13 +
 libavcodec/tiff.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 636614aa28..257572b551 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1218,6 +1218,7 @@ static void set_sar(TiffContext *s, unsigned tag, unsigned num, unsigned den)
 
 static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
 {
+AVFrameSideData *sd;
 unsigned tag, type, count, off, value = 0, value2 = 1; // value2 is a denominator so init. to 1
 int i, start;
 int pos;
@@ -1643,6 +1644,18 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
 }
 }
 break;
+case TIFF_ICC_PROFILE:
+if (count >= INT_MAX || count <= 0)
+return AVERROR_INVALIDDATA;
+if (bytestream2_get_bytes_left(>gb) < count)
+return AVERROR_INVALIDDATA;
+
+sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, count);
+if (!sd)
+return AVERROR(ENOMEM);
+
+bytestream2_get_bufferu(>gb, sd->data, count);
+break;
 case TIFF_ARTIST:
 ADD_METADATA(count, "artist", NULL);
 break;
diff --git a/libavcodec/tiff.h b/libavcodec/tiff.h
index 2184c2c829..c07a5d4fa9 100644
--- a/libavcodec/tiff.h
+++ b/libavcodec/tiff.h
@@ -92,6 +92,7 @@ enum TiffTags {
 TIFF_MODEL_TIEPOINT = 0x8482,
 TIFF_MODEL_PIXEL_SCALE  = 0x830E,
 TIFF_MODEL_TRANSFORMATION= 0x8480,
+TIFF_ICC_PROFILE= 0x8773,
 TIFF_GEO_KEY_DIRECTORY  = 0x87AF,
 TIFF_GEO_DOUBLE_PARAMS  = 0x87B0,
 TIFF_GEO_ASCII_PARAMS   = 0x87B1,
-- 
2.25.0.rc2

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

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

[FFmpeg-devel] [PATCH 3/3] tools/target_dec_fuzzer: limit per frame samples for APE

2020-01-10 Thread Michael Niedermayer
APE in its highest compression mode is really slow so even one frame
of millions of samples takes a long time

Fixes: Timeout (too long -> 3sec)
Fixes: 
19937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5751668818051072

Signed-off-by: Michael Niedermayer 
---
 tools/target_dec_fuzzer.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 2d9d28b46d..ccbb949b29 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -93,7 +93,7 @@ const uint32_t maxiteration = 8096;
 const uint64_t maxpixels_per_frame = 4096 * 4096;
 uint64_t maxpixels;
 
-const uint64_t maxsamples_per_frame = 256*1024*32;
+uint64_t maxsamples_per_frame = 256*1024*32;
 uint64_t maxsamples;
 
 static const uint64_t FUZZ_TAG = 0x4741542D5A5A5546ULL;
@@ -133,6 +133,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 case AVMEDIA_TYPE_VIDEO   : decode_handler = avcodec_decode_video2; break;
 case AVMEDIA_TYPE_SUBTITLE: decode_handler = subtitle_handler ; break;
 }
+switch (c->id) {
+case AV_CODEC_ID_APE:   maxsamples_per_frame /= 256; break;
+}
 maxpixels = maxpixels_per_frame * maxiteration;
 maxsamples = maxsamples_per_frame * maxiteration;
 switch (c->id) {
-- 
2.24.0

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

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

Re: [FFmpeg-devel] [PATCH] avformat/image2: Upon request, make available extra metadata, fields related to input path to be used by filters.

2020-01-10 Thread Alexandre Heitor Schmidt

On 09/01/2020 21:39, Marton Balint wrote:
>
>
> On Sat, 4 Jan 2020, Alexandre Heitor Schmidt wrote:
>
>> Hi there! I'm just writing to make sure this patch wasn't forgotten. :)
>
> Thanks, I think the patch is fine now, I will apply it tomorrow if 
there are no further comments.

>
> Regards,
> Marton

Awesome!

Thank you, Marton!

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

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

Re: [FFmpeg-devel] [PATCH v4 1/2] avcodec/libvpxenc: add VP9 temporal scalability encoding option

2020-01-10 Thread Wonkap Jang
On Fri, Jan 10, 2020 at 9:59 AM Wonkap Jang  wrote:

> This commit reuses the configuration options for VP8 that enables
> temporal scalability for VP9. It also adds a way to enable three
> preset temporal structures (refer to the documentation for more
> detail) that can be used in offline encoding.
> ---
>  doc/encoders.texi  |  18 ++-
>  libavcodec/libvpxenc.c | 251 +
>  2 files changed, 243 insertions(+), 26 deletions(-)
>
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index 61e674cf96..88429aed4c 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -1885,8 +1885,6 @@ Enable error resiliency features.
>  Increase sharpness at the expense of lower PSNR.
>  The valid range is [0, 7].
>
> -@item VP8-specific options
> -@table @option
>  @item ts-parameters
>  Sets the temporal scalability configuration using a :-separated list of
>  key=value pairs. For example, to specify temporal scalability parameters
> @@ -1894,7 +1892,7 @@ with @code{ffmpeg}:
>  @example
>  ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
>  ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
> -ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT
> +ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
>  @end example
>  Below is a brief explanation of each of the parameters, please
>  refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for
> more
> @@ -1911,6 +1909,20 @@ Frame rate decimation factor for each temporal
> layer.
>  Length of the sequence defining frame temporal layer membership.
>  @item ts_layer_id
>  Template defining the membership of frames to temporal layers.
> +@item ts_layering_mode
> +(optional) Selecting the temporal structure from a set of pre-defined
> temporal layering modes.
> +Currently supports the following options.
> +@table @option
> +@item 0
> +No temporal layering flags are provided internally,
> +relies on flags being passed in using metadata in AVFrame.
> +@item 2
> +Two temporal layers. 0-1...
> +@item 3
> +Three temporal layers. 0-2-1-2...; with single reference frame.
> +@item 4
> +Same as option "3", except there is a dependency between
> +the two temporal layer 2 frames within the temporal period.
>  @end table
>  @end table
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 0b8a070304..14cc1e7158 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -100,7 +100,9 @@ typedef struct VPxEncoderContext {
>  int rc_undershoot_pct;
>  int rc_overshoot_pct;
>
> -AVDictionary *vp8_ts_parameters;
> +AVDictionary *vpx_ts_parameters;
> +int *ts_layer_flags;
> +int current_temporal_idx;
>
>  // VP9-only
>  int lossless;
> @@ -137,6 +139,7 @@ static const char *const ctlidstr[] = {
>  [VP8E_SET_CQ_LEVEL]  = "VP8E_SET_CQ_LEVEL",
>  [VP8E_SET_MAX_INTRA_BITRATE_PCT] = "VP8E_SET_MAX_INTRA_BITRATE_PCT",
>  [VP8E_SET_SHARPNESS]   = "VP8E_SET_SHARPNESS",
> +[VP8E_SET_TEMPORAL_LAYER_ID]   = "VP8E_SET_TEMPORAL_LAYER_ID",
>  #if CONFIG_LIBVPX_VP9_ENCODER
>  [VP9E_SET_LOSSLESS]= "VP9E_SET_LOSSLESS",
>  [VP9E_SET_TILE_COLUMNS]= "VP9E_SET_TILE_COLUMNS",
> @@ -144,6 +147,11 @@ static const char *const ctlidstr[] = {
>  [VP9E_SET_FRAME_PARALLEL_DECODING] =
> "VP9E_SET_FRAME_PARALLEL_DECODING",
>  [VP9E_SET_AQ_MODE] = "VP9E_SET_AQ_MODE",
>  [VP9E_SET_COLOR_SPACE] = "VP9E_SET_COLOR_SPACE",
> +[VP9E_SET_SVC_LAYER_ID]= "VP9E_SET_SVC_LAYER_ID",
> +#if VPX_ENCODER_ABI_VERSION >= 12
> +[VP9E_SET_SVC_PARAMETERS]  = "VP9E_SET_SVC_PARAMETERS",
> +#endif
> +[VP9E_SET_SVC] = "VP9E_SET_SVC",
>  #if VPX_ENCODER_ABI_VERSION >= 11
>  [VP9E_SET_COLOR_RANGE] = "VP9E_SET_COLOR_RANGE",
>  #endif
> @@ -223,8 +231,16 @@ static av_cold void dump_enc_cfg(AVCodecContext
> *avctx,
> "  %*s%u\n", width, "ts_number_layers:",
> cfg->ts_number_layers);
>  av_log(avctx, level,
> "\n  %*s", width, "ts_target_bitrate:");
> -for (i = 0; i < VPX_TS_MAX_LAYERS; i++)
> -av_log(avctx, level, "%u ", cfg->ts_target_bitrate[i]);
> +if (avctx->codec_id == AV_CODEC_ID_VP8) {
> +for (i = 0; i < VPX_TS_MAX_LAYERS; i++)
> +av_log(avctx, level, "%u ", cfg->ts_target_bitrate[i]);
> +}
> +#if (VPX_ENCODER_ABI_VERSION >= 12) && CONFIG_LIBVPX_VP9_ENCODER
> +if (avctx->codec_id == AV_CODEC_ID_VP9) {
> +for (i = 0; i < VPX_TS_MAX_LAYERS; i++)
> +av_log(avctx, level, "%u ", cfg->layer_target_bitrate[i]);
> +}
> +#endif
>  av_log(avctx, level, "\n");
>  av_log(avctx, level,
> "\n  %*s", width, "ts_rate_decimator:");
> @@ -346,6 +362,8 @@ static av_cold int vpx_free(AVCodecContext *avctx)
>  }
>  #endif
>
> +av_freep(>ts_layer_flags);
> +
>  vpx_codec_destroy(>encoder);
>  if (ctx->is_alpha) 

Re: [FFmpeg-devel] [PATCH 1/2] examples/avio_dir_cmd: drop support for move/delete operations

2020-01-10 Thread James Almer
On 1/10/2020 2:57 PM, Marton Balint wrote:
> 
> 
> On Fri, 10 Jan 2020, James Almer wrote:
> 
>> On 1/10/2020 8:21 AM, Anton Khirnov wrote:
>>> They use non-public functions, which is unacceptable for a public API
>>> example. Rename the example back to avio_list_dir.
>>>
>>> This effectively reverts c84d208c275d6a43b3c3421d38772179abf8acee and
>>> 767d780ec001167b2fd8f6cfe4ef78a3a8b1e34c.
>>
>> LGTM, these should have never been used here to being with.
> 
> The idea was to make the API public, but there was no consensus about
> it, so the avpriv stuff became a compromise.

The functions should have been moved to avio_internal.h until there was
consensus, then. Being private they obviously can't be used here.

> 
> Regards,
> Marton
> 
>>
>>> ---
>>>  configure |  4 +-
>>>  doc/examples/.gitignore   |  2 +-
>>>  doc/examples/Makefile |  2 +-
>>>  doc/examples/Makefile.example |  2 +-
>>>  .../{avio_dir_cmd.c => avio_list_dir.c}   | 56 ++-
>>>  5 files changed, 9 insertions(+), 57 deletions(-)
>>>  rename doc/examples/{avio_dir_cmd.c => avio_list_dir.c} (69%)
>>>
>>> diff --git a/configure b/configure
>>> index 46f2038627..65a5a30f36 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -1664,7 +1664,7 @@ COMPONENT_LIST="
>>>  "
>>>
>>>  EXAMPLE_LIST="
>>> -    avio_dir_cmd_example
>>> +    avio_list_dir_example
>>>  avio_reading_example
>>>  decode_audio_example
>>>  decode_video_example
>>> @@ -3599,7 +3599,7 @@ yadif_cuda_filter_deps="ffnvcodec"
>>>  yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
>>>
>>>  # examples
>>> -avio_dir_cmd_deps="avformat avutil"
>>> +avio_list_dir_deps="avformat avutil"
>>>  avio_reading_deps="avformat avcodec avutil"
>>>  decode_audio_example_deps="avcodec avutil"
>>>  decode_video_example_deps="avcodec avutil"
>>> diff --git a/doc/examples/.gitignore b/doc/examples/.gitignore
>>> index 75152cb50b..44960e1de7 100644
>>> --- a/doc/examples/.gitignore
>>> +++ b/doc/examples/.gitignore
>>> @@ -1,4 +1,4 @@
>>> -/avio_dir_cmd
>>> +/avio_list_dir
>>>  /avio_reading
>>>  /decode_audio
>>>  /decode_video
>>> diff --git a/doc/examples/Makefile b/doc/examples/Makefile
>>> index 2935424e54..81bfd34d5d 100644
>>> --- a/doc/examples/Makefile
>>> +++ b/doc/examples/Makefile
>>> @@ -1,4 +1,4 @@
>>> -EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE)  += avio_dir_cmd
>>> +EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
>>>  EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)  += avio_reading
>>>  EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)  += decode_audio
>>>  EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)  += decode_video
>>> diff --git a/doc/examples/Makefile.example
>>> b/doc/examples/Makefile.example
>>> index 6428154c51..a232d97f98 100644
>>> --- a/doc/examples/Makefile.example
>>> +++ b/doc/examples/Makefile.example
>>> @@ -11,7 +11,7 @@ CFLAGS += -Wall -g
>>>  CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
>>>  LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
>>>
>>> -EXAMPLES=   avio_dir_cmd   \
>>> +EXAMPLES=   avio_list_dir  \
>>>  avio_reading   \
>>>  decode_audio   \
>>>  decode_video   \
>>> diff --git a/doc/examples/avio_dir_cmd.c b/doc/examples/avio_list_dir.c
>>> similarity index 69%
>>> rename from doc/examples/avio_dir_cmd.c
>>> rename to doc/examples/avio_list_dir.c
>>> index 0722bd9ab1..3073baaefa 100644
>>> --- a/doc/examples/avio_dir_cmd.c
>>> +++ b/doc/examples/avio_list_dir.c
>>> @@ -102,38 +102,15 @@ static int list_op(const char *input_dir)
>>>  return ret;
>>>  }
>>>
>>> -static int del_op(const char *url)
>>> -{
>>> -    int ret = avpriv_io_delete(url);
>>> -    if (ret < 0)
>>> -    av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url,
>>> av_err2str(ret));
>>> -    return ret;
>>> -}
>>> -
>>> -static int move_op(const char *src, const char *dst)
>>> -{
>>> -    int ret = avpriv_io_move(src, dst);
>>> -    if (ret < 0)
>>> -    av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s':
>>> %s.\n", src, dst, av_err2str(ret));
>>> -    return ret;
>>> -}
>>> -
>>> -
>>>  static void usage(const char *program_name)
>>>  {
>>> -    fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
>>> -    "API example program to show how to manipulate resources "
>>> -    "accessed through AVIOContext.\n"
>>> -    "OPERATIONS:\n"
>>> -    "list  list content of the directory\n"
>>> -    "move  rename content in directory\n"
>>> -    "del   delete content in directory\n",
>>> -    program_name);
>>> +    fprintf(stderr, "usage: %s input_dir\n"
>>> +    "API example program to show how to list files in
>>> directory "
>>> +    "accessed through AVIOContext.\n", 

Re: [FFmpeg-devel] [PATCH 2/2] avio: do not export avpriv_io_{move, delete}

2020-01-10 Thread James Almer
On 1/10/2020 11:30 AM, Anton Khirnov wrote:
> Quoting James Almer (2020-01-10 14:33:06)
>> On 1/10/2020 8:21 AM, Anton Khirnov wrote:
>>> They are private and not used by anything outside of lavf. There is no
>>> reason for them to be exported.
>>> ---
>>>  libavformat/avio.c|  4 ++--
>>>  libavformat/avio.h| 19 ---
>>>  libavformat/dashenc.c | 10 +-
>>>  libavformat/url.h | 20 
>>>  4 files changed, 27 insertions(+), 26 deletions(-)
>>>
>>> diff --git a/libavformat/avio.c b/libavformat/avio.c
>>> index 2dd2312296..3e390fe719 100644
>>> --- a/libavformat/avio.c
>>> +++ b/libavformat/avio.c
>>> @@ -494,7 +494,7 @@ int avio_check(const char *url, int flags)
>>>  return ret;
>>>  }
>>>  
>>> -int avpriv_io_move(const char *url_src, const char *url_dst)
>>> +int ffurl_move(const char *url_src, const char *url_dst)
>>>  {
>>>  URLContext *h_src, *h_dst;
>>>  int ret = ffurl_alloc(_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
>>> @@ -516,7 +516,7 @@ int avpriv_io_move(const char *url_src, const char 
>>> *url_dst)
>>>  return ret;
>>>  }
>>>  
>>> -int avpriv_io_delete(const char *url)
>>> +int ffurl_delete(const char *url)
>>>  {
>>>  URLContext *h;
>>>  int ret = ffurl_alloc(, url, AVIO_FLAG_WRITE, NULL);
>>> diff --git a/libavformat/avio.h b/libavformat/avio.h
>>> index 9141642e75..34c5957791 100644
>>> --- a/libavformat/avio.h
>>> +++ b/libavformat/avio.h
>>> @@ -374,25 +374,6 @@ const char *avio_find_protocol_name(const char *url);
>>>   */
>>>  int avio_check(const char *url, int flags);
>>>  
>>> -/**
>>> - * Move or rename a resource.
>>> - *
>>> - * @note url_src and url_dst should share the same protocol and authority.
>>> - *
>>> - * @param url_src url to resource to be moved
>>> - * @param url_dst new url to resource if the operation succeeded
>>> - * @return >=0 on success or negative on error.
>>> - */
>>> -int avpriv_io_move(const char *url_src, const char *url_dst);
>>> -
>>> -/**
>>> - * Delete a resource.
>>> - *
>>> - * @param url resource to be deleted.
>>> - * @return >=0 on success or negative on error.
>>> - */
>>> -int avpriv_io_delete(const char *url);
>>
>> No, unfortunately and despite the name, these are public. Or rather,
>> exposed in a public header when they were not meant to be public,
>> afaics, so what we can do instead is schedule them for removal in the
>> next bump and not bother with a two year deprecation period. We've done
>> it before for other avpriv_ functions mistakenly exposed in public headers.
> 
> There's (sadly) plenty of stuff in public headers that is not meant to
> be public. For example, the FF_API_* macros, the internal fields of
> structs like AVCodec, etc. IMO we should not take into consideration
> people using private APIs, otherwise we legitimize such behavior. Anyone
> using a private function gets to keep all the pieces when we break it.

Yes, i agree with this if we were talking about clearly marked
non-public structs, fields and defines. In those cases, people using
them should be aware of the consequences. But these are two five years
old documented functions in a public header (Although admittedly not
announced in APIChanges) and even featured in an API example tool.
I don't think the avpriv_ prefix is something we documented outside of
the developer guidelines, so anyone reading avio.h and the example will
have no reason to think these were there by mistake.

You could replace the doxy with a "do not use" notice aside from
wrapping them in a scheduled removal preprocessor check, but at the very
least the symbols should not be removed until the next major bump.

If others agree with you though, I'll not block this.

> 
>>
>> For that matter, it's about time we do a major bump. I'm willing to help
>> doing the required work to properly remove deprecated stuff that i'm
>> sure can't be deleted as is.
> 
> That said, I am certainly not against a major bump.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 2/2] avio: do not export avpriv_io_{move, delete}

2020-01-10 Thread Marton Balint



On Fri, 10 Jan 2020, Anton Khirnov wrote:


Quoting James Almer (2020-01-10 14:33:06)

On 1/10/2020 8:21 AM, Anton Khirnov wrote:
> They are private and not used by anything outside of lavf. There is no
> reason for them to be exported.
> ---
>  libavformat/avio.c|  4 ++--
>  libavformat/avio.h| 19 ---
>  libavformat/dashenc.c | 10 +-
>  libavformat/url.h | 20 
>  4 files changed, 27 insertions(+), 26 deletions(-)
> 
> diff --git a/libavformat/avio.c b/libavformat/avio.c

> index 2dd2312296..3e390fe719 100644
> --- a/libavformat/avio.c
> +++ b/libavformat/avio.c
> @@ -494,7 +494,7 @@ int avio_check(const char *url, int flags)
>  return ret;
>  }
> 
> -int avpriv_io_move(const char *url_src, const char *url_dst)

> +int ffurl_move(const char *url_src, const char *url_dst)
>  {
>  URLContext *h_src, *h_dst;
>  int ret = ffurl_alloc(_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
> @@ -516,7 +516,7 @@ int avpriv_io_move(const char *url_src, const char 
*url_dst)
>  return ret;
>  }
> 
> -int avpriv_io_delete(const char *url)

> +int ffurl_delete(const char *url)
>  {
>  URLContext *h;
>  int ret = ffurl_alloc(, url, AVIO_FLAG_WRITE, NULL);
> diff --git a/libavformat/avio.h b/libavformat/avio.h
> index 9141642e75..34c5957791 100644
> --- a/libavformat/avio.h
> +++ b/libavformat/avio.h
> @@ -374,25 +374,6 @@ const char *avio_find_protocol_name(const char *url);
>   */
>  int avio_check(const char *url, int flags);
> 
> -/**

> - * Move or rename a resource.
> - *
> - * @note url_src and url_dst should share the same protocol and authority.
> - *
> - * @param url_src url to resource to be moved
> - * @param url_dst new url to resource if the operation succeeded
> - * @return >=0 on success or negative on error.
> - */
> -int avpriv_io_move(const char *url_src, const char *url_dst);
> -
> -/**
> - * Delete a resource.
> - *
> - * @param url resource to be deleted.
> - * @return >=0 on success or negative on error.
> - */
> -int avpriv_io_delete(const char *url);

No, unfortunately and despite the name, these are public. Or rather,
exposed in a public header when they were not meant to be public,
afaics, so what we can do instead is schedule them for removal in the
next bump and not bother with a two year deprecation period. We've done
it before for other avpriv_ functions mistakenly exposed in public headers.


There's (sadly) plenty of stuff in public headers that is not meant to
be public. For example, the FF_API_* macros, the internal fields of
structs like AVCodec, etc. IMO we should not take into consideration
people using private APIs, otherwise we legitimize such behavior. Anyone
using a private function gets to keep all the pieces when we break it.



For that matter, it's about time we do a major bump. I'm willing to help
doing the required work to properly remove deprecated stuff that i'm
sure can't be deleted as is.


That said, I am certainly not against a major bump.


Yes, please wait with these till the bump. A release should be made before 
the bump though.


Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH v4 2/2] avcodec/libvpxenc: add a way to explicitly set temporal layer id

2020-01-10 Thread Wonkap Jang
In order for rate control to correctly allocate bitrate to each temporal
layer, correct temporal layer id has to be set to each frame. This
commit provides the ability to set correct temporal layer id for each
frame.
---
 libavcodec/libvpxenc.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 14cc1e7158..8d24e96241 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1520,11 +1520,22 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
*pkt,
 #endif
 if (frame->pict_type == AV_PICTURE_TYPE_I)
 flags |= VPX_EFLAG_FORCE_KF;
-if (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id == AV_CODEC_ID_VP8 && 
frame->metadata) {
+if (frame->metadata) {
 AVDictionaryEntry* en = av_dict_get(frame->metadata, "vp8-flags", 
NULL, 0);
 if (en) {
 flags |= strtoul(en->value, NULL, 10);
 }
+
+memset(_id, 0, sizeof(layer_id));
+
+en = av_dict_get(frame->metadata, "temporal_id", NULL, 0);
+if (en) {
+layer_id.temporal_layer_id = strtoul(en->value, NULL, 10);
+#ifdef VPX_CTRL_VP9E_SET_MAX_INTER_BITRATE_PCT
+layer_id.temporal_layer_id_per_spatial[0] = 
layer_id.temporal_layer_id;
+#endif
+layer_id_valid = 1;
+}
 }
 
 if (sd) {
-- 
2.25.0.rc1.283.g88dfdc4193-goog

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

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

[FFmpeg-devel] [PATCH v4 1/2] avcodec/libvpxenc: add VP9 temporal scalability encoding option

2020-01-10 Thread Wonkap Jang
This commit reuses the configuration options for VP8 that enables
temporal scalability for VP9. It also adds a way to enable three
preset temporal structures (refer to the documentation for more
detail) that can be used in offline encoding.
---
 doc/encoders.texi  |  18 ++-
 libavcodec/libvpxenc.c | 251 +
 2 files changed, 243 insertions(+), 26 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 61e674cf96..88429aed4c 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1885,8 +1885,6 @@ Enable error resiliency features.
 Increase sharpness at the expense of lower PSNR.
 The valid range is [0, 7].
 
-@item VP8-specific options
-@table @option
 @item ts-parameters
 Sets the temporal scalability configuration using a :-separated list of
 key=value pairs. For example, to specify temporal scalability parameters
@@ -1894,7 +1892,7 @@ with @code{ffmpeg}:
 @example
 ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
 ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
-ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT
+ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
 @end example
 Below is a brief explanation of each of the parameters, please
 refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
@@ -1911,6 +1909,20 @@ Frame rate decimation factor for each temporal layer.
 Length of the sequence defining frame temporal layer membership.
 @item ts_layer_id
 Template defining the membership of frames to temporal layers.
+@item ts_layering_mode
+(optional) Selecting the temporal structure from a set of pre-defined temporal 
layering modes.
+Currently supports the following options.
+@table @option
+@item 0
+No temporal layering flags are provided internally,
+relies on flags being passed in using metadata in AVFrame.
+@item 2
+Two temporal layers. 0-1...
+@item 3
+Three temporal layers. 0-2-1-2...; with single reference frame.
+@item 4
+Same as option "3", except there is a dependency between
+the two temporal layer 2 frames within the temporal period.
 @end table
 @end table
 
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 0b8a070304..14cc1e7158 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -100,7 +100,9 @@ typedef struct VPxEncoderContext {
 int rc_undershoot_pct;
 int rc_overshoot_pct;
 
-AVDictionary *vp8_ts_parameters;
+AVDictionary *vpx_ts_parameters;
+int *ts_layer_flags;
+int current_temporal_idx;
 
 // VP9-only
 int lossless;
@@ -137,6 +139,7 @@ static const char *const ctlidstr[] = {
 [VP8E_SET_CQ_LEVEL]  = "VP8E_SET_CQ_LEVEL",
 [VP8E_SET_MAX_INTRA_BITRATE_PCT] = "VP8E_SET_MAX_INTRA_BITRATE_PCT",
 [VP8E_SET_SHARPNESS]   = "VP8E_SET_SHARPNESS",
+[VP8E_SET_TEMPORAL_LAYER_ID]   = "VP8E_SET_TEMPORAL_LAYER_ID",
 #if CONFIG_LIBVPX_VP9_ENCODER
 [VP9E_SET_LOSSLESS]= "VP9E_SET_LOSSLESS",
 [VP9E_SET_TILE_COLUMNS]= "VP9E_SET_TILE_COLUMNS",
@@ -144,6 +147,11 @@ static const char *const ctlidstr[] = {
 [VP9E_SET_FRAME_PARALLEL_DECODING] = "VP9E_SET_FRAME_PARALLEL_DECODING",
 [VP9E_SET_AQ_MODE] = "VP9E_SET_AQ_MODE",
 [VP9E_SET_COLOR_SPACE] = "VP9E_SET_COLOR_SPACE",
+[VP9E_SET_SVC_LAYER_ID]= "VP9E_SET_SVC_LAYER_ID",
+#if VPX_ENCODER_ABI_VERSION >= 12
+[VP9E_SET_SVC_PARAMETERS]  = "VP9E_SET_SVC_PARAMETERS",
+#endif
+[VP9E_SET_SVC] = "VP9E_SET_SVC",
 #if VPX_ENCODER_ABI_VERSION >= 11
 [VP9E_SET_COLOR_RANGE] = "VP9E_SET_COLOR_RANGE",
 #endif
@@ -223,8 +231,16 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx,
"  %*s%u\n", width, "ts_number_layers:", cfg->ts_number_layers);
 av_log(avctx, level,
"\n  %*s", width, "ts_target_bitrate:");
-for (i = 0; i < VPX_TS_MAX_LAYERS; i++)
-av_log(avctx, level, "%u ", cfg->ts_target_bitrate[i]);
+if (avctx->codec_id == AV_CODEC_ID_VP8) {
+for (i = 0; i < VPX_TS_MAX_LAYERS; i++)
+av_log(avctx, level, "%u ", cfg->ts_target_bitrate[i]);
+}
+#if (VPX_ENCODER_ABI_VERSION >= 12) && CONFIG_LIBVPX_VP9_ENCODER
+if (avctx->codec_id == AV_CODEC_ID_VP9) {
+for (i = 0; i < VPX_TS_MAX_LAYERS; i++)
+av_log(avctx, level, "%u ", cfg->layer_target_bitrate[i]);
+}
+#endif
 av_log(avctx, level, "\n");
 av_log(avctx, level,
"\n  %*s", width, "ts_rate_decimator:");
@@ -346,6 +362,8 @@ static av_cold int vpx_free(AVCodecContext *avctx)
 }
 #endif
 
+av_freep(>ts_layer_flags);
+
 vpx_codec_destroy(>encoder);
 if (ctx->is_alpha) {
 vpx_codec_destroy(>encoder_alpha);
@@ -370,23 +388,154 @@ static void vp8_ts_parse_int_array(int *dest, char 
*value, size_t value_len, int
 }
 }
 
-static int vp8_ts_param_parse(struct vpx_codec_enc_cfg *enccfg, char *key, 
char *value)
+static void 

Re: [FFmpeg-devel] [PATCH 1/2] examples/avio_dir_cmd: drop support for move/delete operations

2020-01-10 Thread Marton Balint



On Fri, 10 Jan 2020, James Almer wrote:


On 1/10/2020 8:21 AM, Anton Khirnov wrote:

They use non-public functions, which is unacceptable for a public API
example. Rename the example back to avio_list_dir.

This effectively reverts c84d208c275d6a43b3c3421d38772179abf8acee and
767d780ec001167b2fd8f6cfe4ef78a3a8b1e34c.


LGTM, these should have never been used here to being with.


The idea was to make the API public, but there was no consensus about it, 
so the avpriv stuff became a compromise.


Regards,
Marton




---
 configure |  4 +-
 doc/examples/.gitignore   |  2 +-
 doc/examples/Makefile |  2 +-
 doc/examples/Makefile.example |  2 +-
 .../{avio_dir_cmd.c => avio_list_dir.c}   | 56 ++-
 5 files changed, 9 insertions(+), 57 deletions(-)
 rename doc/examples/{avio_dir_cmd.c => avio_list_dir.c} (69%)

diff --git a/configure b/configure
index 46f2038627..65a5a30f36 100755
--- a/configure
+++ b/configure
@@ -1664,7 +1664,7 @@ COMPONENT_LIST="
 "

 EXAMPLE_LIST="
-avio_dir_cmd_example
+avio_list_dir_example
 avio_reading_example
 decode_audio_example
 decode_video_example
@@ -3599,7 +3599,7 @@ yadif_cuda_filter_deps="ffnvcodec"
 yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"

 # examples
-avio_dir_cmd_deps="avformat avutil"
+avio_list_dir_deps="avformat avutil"
 avio_reading_deps="avformat avcodec avutil"
 decode_audio_example_deps="avcodec avutil"
 decode_video_example_deps="avcodec avutil"
diff --git a/doc/examples/.gitignore b/doc/examples/.gitignore
index 75152cb50b..44960e1de7 100644
--- a/doc/examples/.gitignore
+++ b/doc/examples/.gitignore
@@ -1,4 +1,4 @@
-/avio_dir_cmd
+/avio_list_dir
 /avio_reading
 /decode_audio
 /decode_video
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index 2935424e54..81bfd34d5d 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -1,4 +1,4 @@
-EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE)  += avio_dir_cmd
+EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
 EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)  += avio_reading
 EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)  += decode_audio
 EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)  += decode_video
diff --git a/doc/examples/Makefile.example b/doc/examples/Makefile.example
index 6428154c51..a232d97f98 100644
--- a/doc/examples/Makefile.example
+++ b/doc/examples/Makefile.example
@@ -11,7 +11,7 @@ CFLAGS += -Wall -g
 CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
 LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)

-EXAMPLES=   avio_dir_cmd   \
+EXAMPLES=   avio_list_dir  \
 avio_reading   \
 decode_audio   \
 decode_video   \
diff --git a/doc/examples/avio_dir_cmd.c b/doc/examples/avio_list_dir.c
similarity index 69%
rename from doc/examples/avio_dir_cmd.c
rename to doc/examples/avio_list_dir.c
index 0722bd9ab1..3073baaefa 100644
--- a/doc/examples/avio_dir_cmd.c
+++ b/doc/examples/avio_list_dir.c
@@ -102,38 +102,15 @@ static int list_op(const char *input_dir)
 return ret;
 }

-static int del_op(const char *url)
-{
-int ret = avpriv_io_delete(url);
-if (ret < 0)
-av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, 
av_err2str(ret));
-return ret;
-}
-
-static int move_op(const char *src, const char *dst)
-{
-int ret = avpriv_io_move(src, dst);
-if (ret < 0)
-av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, 
dst, av_err2str(ret));
-return ret;
-}
-
-
 static void usage(const char *program_name)
 {
-fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
-"API example program to show how to manipulate resources "
-"accessed through AVIOContext.\n"
-"OPERATIONS:\n"
-"list  list content of the directory\n"
-"move  rename content in directory\n"
-"del   delete content in directory\n",
-program_name);
+fprintf(stderr, "usage: %s input_dir\n"
+"API example program to show how to list files in directory "
+"accessed through AVIOContext.\n", program_name);
 }

 int main(int argc, char *argv[])
 {
-const char *op = NULL;
 int ret;

 av_log_set_level(AV_LOG_DEBUG);
@@ -145,32 +122,7 @@ int main(int argc, char *argv[])

 avformat_network_init();

-op = argv[1];
-if (strcmp(op, "list") == 0) {
-if (argc < 3) {
-av_log(NULL, AV_LOG_INFO, "Missing argument for list 
operation.\n");
-ret = AVERROR(EINVAL);
-} else {
-ret = list_op(argv[2]);
-}
-} else if (strcmp(op, "del") == 0) {
-if (argc < 3) {
-av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
-ret = 

Re: [FFmpeg-devel] [PATCHv2 1/3] avutil/eval: separate AVExpr state to a new AVExprState struct

2020-01-10 Thread Marton Balint



On Fri, 10 Jan 2020, Anton Khirnov wrote:


Quoting Marton Balint (2019-12-30 23:23:40)

Also add helper functions to allocate and free such a struct, and make it
usable by providing a new av_eval_expr2 function for which you can specify a
custom AVExprState.


Why not just parse the expression multiple times? Performance?


For fixing the vf_geq issue in the second patch, yes parsing the 
expression multiple times should work, parsing MAX_THREADS * 4 expressions 
is totally OK.


However API-wise, it is cleaner to separate state from the expression, I 
find it totally unintuitive that an expression has a state or that 
evaluating an expression is not thread safe.



Beyond that, it seems to me that the user now has to juggle multiple
contexts manually, which is complex and can be avoided.


It is only a possibility, most users can use av_eval_expr as before and 
use the internal state of the expression.


How about introducing a function for duplicating AVExpr instead? Would 
that not solve this as well?


I don't really like this idea, you want to duplicate the state, 
not the expression.


Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v3 3/3] doc/encoders: add VP9 temporal scalability encoding option

2020-01-10 Thread Wonkap Jang
On Thu, Jan 9, 2020 at 8:09 PM James Zern 
wrote:

> On Wed, Jan 8, 2020 at 3:00 PM Wonkap Jang
>  wrote:
> >
> > Documentation change for adding support for encoding
> > with temporal scalability in VP9.
> > ---
> >  doc/encoders.texi | 18 +++---
> >  1 file changed, 15 insertions(+), 3 deletions(-)
> >
>
> This could be a part of the first patch in the series so that if it
> needs to be reverted the documentation stays up to date.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


OK. I'll include it in the first patch and send as version 4 of the series
of patches.

Thank you,

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

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

Re: [FFmpeg-devel] [PATCH] avfilter/f_metadata: allow direct flushing when printing to file

2020-01-10 Thread Gyan



On 10-01-2020 11:00 am, Gyan wrote:



On 07-01-2020 05:44 pm, Gyan Doshi wrote:

Useful for monitoring sparse data in realtime
---
  doc/filters.texi | 3 +++
  libavfilter/f_metadata.c | 6 ++
  2 files changed, 9 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index fc2d198077..e682ba62bb 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -22711,6 +22711,9 @@ plain filename any writable url can be 
specified. Filename ``-'' is a shorthand
  for standard output. If @code{file} option is not set, output is 
written to the log

  with AV_LOG_INFO loglevel.
  +@item direct
+Reduces buffering in print mode when output is written to a URL set 
using @var{file}.

+
  @end table
    @subsection Examples
diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index 3bf4bb17f5..bf298e9d39 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -88,6 +88,8 @@ typedef struct MetadataContext {
  int (*compare)(struct MetadataContext *s,
 const char *value1, const char *value2);
  void (*print)(AVFilterContext *ctx, const char *msg, ...) 
av_printf_format(2, 3);

+
+    int direct;    // reduces buffering when printing to 
user-supplied URL

  } MetadataContext;
    #define OFFSET(x) offsetof(MetadataContext, x)
@@ -111,6 +113,7 @@ static const AVOption filt_name##_options[] = { \
  {   "ends_with",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
METADATAF_ENDS_WITH },   0, 0, FLAGS, "function" }, \
  { "expr", "set expression for expr function", OFFSET(expr_str), 
AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, FLAGS }, \
  { "file", "set file where to print metadata information", 
OFFSET(file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS }, \
+    { "direct", "reduce buffering when printing to user-set file or 
pipe", OFFSET(direct), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS }, \

  { NULL } \
  }
  @@ -274,6 +277,9 @@ static av_cold int init(AVFilterContext *ctx)
 s->file_str, buf);
  return ret;
  }
+
+    if (s->direct)
+    s->avio_context->direct = AVIO_FLAG_DIRECT;
  }
    return 0;


Plan to push tonight.


Pushed as 22a06a539ddba083b0a496a1871a90afb8d51627

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

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

Re: [FFmpeg-devel] [PATCH v1] avcodec/utils: replace avctx->internal with avci for better readability

2020-01-10 Thread Michael Niedermayer
On Thu, Jan 09, 2020 at 09:04:33AM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  libavcodec/utils.c | 63 
> --
>  1 file changed, 33 insertions(+), 30 deletions(-)

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk



signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v1] avfilter/vf_showinfo: fix the integer handling issues

2020-01-10 Thread Michael Niedermayer
On Thu, Jan 09, 2020 at 09:02:11AM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Fixes CID 1457606 and 1457607
> Signed-off-by: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  libavfilter/vf_showinfo.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 7/7] avformat/mov: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup

2020-01-10 Thread Michael Niedermayer
On Sun, Nov 10, 2019 at 05:07:33AM +0100, Andreas Rheinhardt wrote:
> This will likely also fix CID 1452574 and 1452565, false positives
> resulting from Coverity thinking that av_dict_set() automatically
> frees its key and value parameters (even without the
> AV_DICT_DONT_STRDUP_* flags).
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/mov.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v2] fate: Don't use depreceated keepside option

2020-01-10 Thread James Almer
On 1/10/2020 11:04 AM, Andreas Rheinhardt wrote:
> On Mon, Dec 30, 2019 at 1:43 PM Andreas Rheinhardt <
> andreas.rheinha...@gmail.com> wrote:
> 
>> The tests for concat use this option which is scheduled for removal and
>> does nothing any more. So remove it; otherwise, these tests would fail
>> at the next major version bump.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>> As James has recently suggested that we might bump major in the coming
>> months [1], I thought it worthwhile to ressurect my old patchset [2];
>> and it turned out that the second patch of this patchset does not apply
>> cleanly any more because of e9bb1410, so here it is rebased on master.
>>
>> I am also open to comments regarding the other two patches.
>>
>> [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-December/254869.html
>> [2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248674.html
>>
>>  tests/fate-run.sh | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/fate-run.sh b/tests/fate-run.sh
>> index 83cad8cabe..552b3dd9df 100755
>> --- a/tests/fate-run.sh
>> +++ b/tests/fate-run.sh
>> @@ -471,10 +471,10 @@ concat(){
>>  awk "{gsub(/%SRCFILE%/, \"$sample\"); print}" $template > $concatfile
>>
>>  if [ "$mode" = "md5" ]; then
>> -run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
>> -show_packets -v 0 -fflags keepside -safe 0 $extra_args $(target_path
>> $concatfile) | tr -d '\r' > $packetfile
>> +run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
>> -show_packets -v 0 -safe 0 $extra_args $(target_path $concatfile) | tr -d
>> '\r' > $packetfile
>>  do_md5sum $packetfile
>>  else
>> -run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
>> -show_packets -v 0 -of compact=p=0:nk=1 -fflags keepside -safe 0
>> $extra_args $(target_path $concatfile)
>> +run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
>> -show_packets -v 0 -of compact=p=0:nk=1 -safe 0 $extra_args $(target_path
>> $concatfile)
>>  fi
>>  }
>>
>> --
>> 2.20.1
>>
>>
> Ping.

Pushed, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH] avformat/hlsenc: compare without the last directory separator in get_relative_url

2020-01-10 Thread Steven Liu
fix ticket: 8461

Signed-off-by: Steven Liu 
---
 libavformat/hlsenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index d130f03ea6..e87f08b0e6 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1234,7 +1234,7 @@ static const char* get_relative_url(const char 
*master_url, const char *media_ur
 if (!p) p = strrchr(master_url, '\\');
 
 if (p) {
-base_len = p + 1 - master_url;
+base_len = p - master_url;
 if (av_strncasecmp(master_url, media_url, base_len)) {
 av_log(NULL, AV_LOG_WARNING, "Unable to find relative url\n");
 return NULL;
-- 
2.17.2 (Apple Git-113)




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

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

Re: [FFmpeg-devel] [PATCH 2/2] avio: do not export avpriv_io_{move, delete}

2020-01-10 Thread Anton Khirnov
Quoting James Almer (2020-01-10 14:33:06)
> On 1/10/2020 8:21 AM, Anton Khirnov wrote:
> > They are private and not used by anything outside of lavf. There is no
> > reason for them to be exported.
> > ---
> >  libavformat/avio.c|  4 ++--
> >  libavformat/avio.h| 19 ---
> >  libavformat/dashenc.c | 10 +-
> >  libavformat/url.h | 20 
> >  4 files changed, 27 insertions(+), 26 deletions(-)
> > 
> > diff --git a/libavformat/avio.c b/libavformat/avio.c
> > index 2dd2312296..3e390fe719 100644
> > --- a/libavformat/avio.c
> > +++ b/libavformat/avio.c
> > @@ -494,7 +494,7 @@ int avio_check(const char *url, int flags)
> >  return ret;
> >  }
> >  
> > -int avpriv_io_move(const char *url_src, const char *url_dst)
> > +int ffurl_move(const char *url_src, const char *url_dst)
> >  {
> >  URLContext *h_src, *h_dst;
> >  int ret = ffurl_alloc(_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
> > @@ -516,7 +516,7 @@ int avpriv_io_move(const char *url_src, const char 
> > *url_dst)
> >  return ret;
> >  }
> >  
> > -int avpriv_io_delete(const char *url)
> > +int ffurl_delete(const char *url)
> >  {
> >  URLContext *h;
> >  int ret = ffurl_alloc(, url, AVIO_FLAG_WRITE, NULL);
> > diff --git a/libavformat/avio.h b/libavformat/avio.h
> > index 9141642e75..34c5957791 100644
> > --- a/libavformat/avio.h
> > +++ b/libavformat/avio.h
> > @@ -374,25 +374,6 @@ const char *avio_find_protocol_name(const char *url);
> >   */
> >  int avio_check(const char *url, int flags);
> >  
> > -/**
> > - * Move or rename a resource.
> > - *
> > - * @note url_src and url_dst should share the same protocol and authority.
> > - *
> > - * @param url_src url to resource to be moved
> > - * @param url_dst new url to resource if the operation succeeded
> > - * @return >=0 on success or negative on error.
> > - */
> > -int avpriv_io_move(const char *url_src, const char *url_dst);
> > -
> > -/**
> > - * Delete a resource.
> > - *
> > - * @param url resource to be deleted.
> > - * @return >=0 on success or negative on error.
> > - */
> > -int avpriv_io_delete(const char *url);
> 
> No, unfortunately and despite the name, these are public. Or rather,
> exposed in a public header when they were not meant to be public,
> afaics, so what we can do instead is schedule them for removal in the
> next bump and not bother with a two year deprecation period. We've done
> it before for other avpriv_ functions mistakenly exposed in public headers.

There's (sadly) plenty of stuff in public headers that is not meant to
be public. For example, the FF_API_* macros, the internal fields of
structs like AVCodec, etc. IMO we should not take into consideration
people using private APIs, otherwise we legitimize such behavior. Anyone
using a private function gets to keep all the pieces when we break it.

> 
> For that matter, it's about time we do a major bump. I'm willing to help
> doing the required work to properly remove deprecated stuff that i'm
> sure can't be deleted as is.

That said, I am certainly not against a major bump.

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v2] fate: Don't use depreceated keepside option

2020-01-10 Thread Andreas Rheinhardt
On Mon, Dec 30, 2019 at 1:43 PM Andreas Rheinhardt <
andreas.rheinha...@gmail.com> wrote:

> The tests for concat use this option which is scheduled for removal and
> does nothing any more. So remove it; otherwise, these tests would fail
> at the next major version bump.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
> As James has recently suggested that we might bump major in the coming
> months [1], I thought it worthwhile to ressurect my old patchset [2];
> and it turned out that the second patch of this patchset does not apply
> cleanly any more because of e9bb1410, so here it is rebased on master.
>
> I am also open to comments regarding the other two patches.
>
> [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-December/254869.html
> [2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248674.html
>
>  tests/fate-run.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/fate-run.sh b/tests/fate-run.sh
> index 83cad8cabe..552b3dd9df 100755
> --- a/tests/fate-run.sh
> +++ b/tests/fate-run.sh
> @@ -471,10 +471,10 @@ concat(){
>  awk "{gsub(/%SRCFILE%/, \"$sample\"); print}" $template > $concatfile
>
>  if [ "$mode" = "md5" ]; then
> -run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
> -show_packets -v 0 -fflags keepside -safe 0 $extra_args $(target_path
> $concatfile) | tr -d '\r' > $packetfile
> +run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
> -show_packets -v 0 -safe 0 $extra_args $(target_path $concatfile) | tr -d
> '\r' > $packetfile
>  do_md5sum $packetfile
>  else
> -run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
> -show_packets -v 0 -of compact=p=0:nk=1 -fflags keepside -safe 0
> $extra_args $(target_path $concatfile)
> +run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams
> -show_packets -v 0 -of compact=p=0:nk=1 -safe 0 $extra_args $(target_path
> $concatfile)
>  fi
>  }
>
> --
> 2.20.1
>
>
Ping.

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

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

Re: [FFmpeg-devel] [PATCH] CDToons decoder

2020-01-10 Thread Paul B Mahol
On 1/5/20, Alyssa Milburn  wrote:
> This adds a decoder for Broderbund's sprite-based QuickTime CDToons
> codec, based on the decoder I wrote for ScummVM.
>
> A couple of samples can be found at http://noopwafel.net/cdtoons/.
>
> Signed-off-by: Alyssa Milburn 
> ---
>  Changelog   |   1 +
>  doc/general.texi|   2 +
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/avcodec.h|   1 +
>  libavcodec/cdtoons.c| 438 
>  libavcodec/codec_desc.c |   7 +
>  libavcodec/version.h|   2 +-
>  libavformat/isom.c  |   1 +
>  libavformat/riff.c  |   1 +
>  10 files changed, 454 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/cdtoons.c
>
> diff --git a/Changelog b/Changelog
> index b9401aaab6..9cac485bb5 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -29,6 +29,7 @@ version :
>  - mvha decoder
>  - MPEG-H 3D Audio support in mp4
>  - thistogram filter
> +- CDToons decoder
>
>
>  version 4.2:
> diff --git a/doc/general.texi b/doc/general.texi
> index a5b77e0de1..8fdf8af9fe 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -844,6 +844,8 @@ following image formats are supported:
>  @tab Codec used in Delphine Software International games.
>  @item Discworld II BMV Video @tab @tab  X
>  @item Canopus Lossless Codec @tab @tab  X
> +@item CDToons@tab @tab  X
> +@tab Codec used in various Broderbund games.
>  @item Cinepak@tab @tab  X
>  @item Cirrus Logic AccuPak   @tab  X  @tab  X
>  @tab fourcc: CLJR
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index c1f35b40d8..383a6da32d 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -244,6 +244,7 @@ OBJS-$(CONFIG_CAVS_DECODER)+= cavs.o
> cavsdec.o cavsdsp.o \
>cavsdata.o
>  OBJS-$(CONFIG_CCAPTION_DECODER)+= ccaption_dec.o ass.o
>  OBJS-$(CONFIG_CDGRAPHICS_DECODER)  += cdgraphics.o
> +OBJS-$(CONFIG_CDTOONS_DECODER) += cdtoons.o
>  OBJS-$(CONFIG_CDXL_DECODER)+= cdxl.o
>  OBJS-$(CONFIG_CFHD_DECODER)+= cfhd.o cfhddata.o
>  OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index ec7366144f..a87f29829d 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -68,6 +68,7 @@ extern AVCodec ff_brender_pix_decoder;
>  extern AVCodec ff_c93_decoder;
>  extern AVCodec ff_cavs_decoder;
>  extern AVCodec ff_cdgraphics_decoder;
> +extern AVCodec ff_cdtoons_decoder;
>  extern AVCodec ff_cdxl_decoder;
>  extern AVCodec ff_cfhd_decoder;
>  extern AVCodec ff_cinepak_encoder;
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 119b32dc1f..e9a24165ed 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -460,6 +460,7 @@ enum AVCodecID {
>  AV_CODEC_ID_IMM5,
>  AV_CODEC_ID_MVDV,
>  AV_CODEC_ID_MVHA,
> +AV_CODEC_ID_CDTOONS,
>
>  /* various PCM "codecs" */
>  AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the
> start of audio codecs
> diff --git a/libavcodec/cdtoons.c b/libavcodec/cdtoons.c
> new file mode 100644
> index 00..d6c441b8e3
> --- /dev/null
> +++ b/libavcodec/cdtoons.c
> @@ -0,0 +1,438 @@
> +/*
> + * CDToons video decoder
> + * Copyright (C) 2011 The FFmpeg project
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
> USA
> + */
> +
> +/**
> + * @file
> + * CDToons video decoder
> + * @author Alyssa Milburn 
> + */
> +
> +#include 
> +
> +#include "libavutil/attributes.h"
> +#include "libavutil/internal.h"
> +#include "avcodec.h"
> +#include "bytestream.h"
> +#include "internal.h"
> +
> +#define CDTOONS_HEADER_SIZE   44
> +#define CDTOONS_MAX_SPRITES 1200
> +
> +typedef struct CDToonsSprite {
> +uint16_t flags;
> +uint16_t owner_frame;
> +uint16_t start_frame;
> +uint16_t end_frame;
> +uint32_t size;
> +uint8_t *data;
> +} CDToonsSprite;
> +
> +typedef struct CDToonsContext {
> +AVCodecContext *avctx;
> +AVFrame *frame;
> +
> +uint16_t last_pal_id;   ///< The index of the active palette sprite.
> +uint32_t pal[256];  ///< The 

Re: [FFmpeg-devel] [PATCH 1/2] examples/avio_dir_cmd: drop support for move/delete operations

2020-01-10 Thread James Almer
On 1/10/2020 8:21 AM, Anton Khirnov wrote:
> They use non-public functions, which is unacceptable for a public API
> example. Rename the example back to avio_list_dir.
> 
> This effectively reverts c84d208c275d6a43b3c3421d38772179abf8acee and
> 767d780ec001167b2fd8f6cfe4ef78a3a8b1e34c.

LGTM, these should have never been used here to being with.

> ---
>  configure |  4 +-
>  doc/examples/.gitignore   |  2 +-
>  doc/examples/Makefile |  2 +-
>  doc/examples/Makefile.example |  2 +-
>  .../{avio_dir_cmd.c => avio_list_dir.c}   | 56 ++-
>  5 files changed, 9 insertions(+), 57 deletions(-)
>  rename doc/examples/{avio_dir_cmd.c => avio_list_dir.c} (69%)
> 
> diff --git a/configure b/configure
> index 46f2038627..65a5a30f36 100755
> --- a/configure
> +++ b/configure
> @@ -1664,7 +1664,7 @@ COMPONENT_LIST="
>  "
>  
>  EXAMPLE_LIST="
> -avio_dir_cmd_example
> +avio_list_dir_example
>  avio_reading_example
>  decode_audio_example
>  decode_video_example
> @@ -3599,7 +3599,7 @@ yadif_cuda_filter_deps="ffnvcodec"
>  yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
>  
>  # examples
> -avio_dir_cmd_deps="avformat avutil"
> +avio_list_dir_deps="avformat avutil"
>  avio_reading_deps="avformat avcodec avutil"
>  decode_audio_example_deps="avcodec avutil"
>  decode_video_example_deps="avcodec avutil"
> diff --git a/doc/examples/.gitignore b/doc/examples/.gitignore
> index 75152cb50b..44960e1de7 100644
> --- a/doc/examples/.gitignore
> +++ b/doc/examples/.gitignore
> @@ -1,4 +1,4 @@
> -/avio_dir_cmd
> +/avio_list_dir
>  /avio_reading
>  /decode_audio
>  /decode_video
> diff --git a/doc/examples/Makefile b/doc/examples/Makefile
> index 2935424e54..81bfd34d5d 100644
> --- a/doc/examples/Makefile
> +++ b/doc/examples/Makefile
> @@ -1,4 +1,4 @@
> -EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE)  += avio_dir_cmd
> +EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
>  EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)  += avio_reading
>  EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)  += decode_audio
>  EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)  += decode_video
> diff --git a/doc/examples/Makefile.example b/doc/examples/Makefile.example
> index 6428154c51..a232d97f98 100644
> --- a/doc/examples/Makefile.example
> +++ b/doc/examples/Makefile.example
> @@ -11,7 +11,7 @@ CFLAGS += -Wall -g
>  CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
>  LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
>  
> -EXAMPLES=   avio_dir_cmd   \
> +EXAMPLES=   avio_list_dir  \
>  avio_reading   \
>  decode_audio   \
>  decode_video   \
> diff --git a/doc/examples/avio_dir_cmd.c b/doc/examples/avio_list_dir.c
> similarity index 69%
> rename from doc/examples/avio_dir_cmd.c
> rename to doc/examples/avio_list_dir.c
> index 0722bd9ab1..3073baaefa 100644
> --- a/doc/examples/avio_dir_cmd.c
> +++ b/doc/examples/avio_list_dir.c
> @@ -102,38 +102,15 @@ static int list_op(const char *input_dir)
>  return ret;
>  }
>  
> -static int del_op(const char *url)
> -{
> -int ret = avpriv_io_delete(url);
> -if (ret < 0)
> -av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, 
> av_err2str(ret));
> -return ret;
> -}
> -
> -static int move_op(const char *src, const char *dst)
> -{
> -int ret = avpriv_io_move(src, dst);
> -if (ret < 0)
> -av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, 
> dst, av_err2str(ret));
> -return ret;
> -}
> -
> -
>  static void usage(const char *program_name)
>  {
> -fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
> -"API example program to show how to manipulate resources "
> -"accessed through AVIOContext.\n"
> -"OPERATIONS:\n"
> -"list  list content of the directory\n"
> -"move  rename content in directory\n"
> -"del   delete content in directory\n",
> -program_name);
> +fprintf(stderr, "usage: %s input_dir\n"
> +"API example program to show how to list files in directory "
> +"accessed through AVIOContext.\n", program_name);
>  }
>  
>  int main(int argc, char *argv[])
>  {
> -const char *op = NULL;
>  int ret;
>  
>  av_log_set_level(AV_LOG_DEBUG);
> @@ -145,32 +122,7 @@ int main(int argc, char *argv[])
>  
>  avformat_network_init();
>  
> -op = argv[1];
> -if (strcmp(op, "list") == 0) {
> -if (argc < 3) {
> -av_log(NULL, AV_LOG_INFO, "Missing argument for list 
> operation.\n");
> -ret = AVERROR(EINVAL);
> -} else {
> -ret = list_op(argv[2]);
> -}
> -} else if (strcmp(op, "del") == 0) {
> -if (argc < 3) {
> -

Re: [FFmpeg-devel] [PATCH 2/2] avio: do not export avpriv_io_{move, delete}

2020-01-10 Thread James Almer
On 1/10/2020 8:21 AM, Anton Khirnov wrote:
> They are private and not used by anything outside of lavf. There is no
> reason for them to be exported.
> ---
>  libavformat/avio.c|  4 ++--
>  libavformat/avio.h| 19 ---
>  libavformat/dashenc.c | 10 +-
>  libavformat/url.h | 20 
>  4 files changed, 27 insertions(+), 26 deletions(-)
> 
> diff --git a/libavformat/avio.c b/libavformat/avio.c
> index 2dd2312296..3e390fe719 100644
> --- a/libavformat/avio.c
> +++ b/libavformat/avio.c
> @@ -494,7 +494,7 @@ int avio_check(const char *url, int flags)
>  return ret;
>  }
>  
> -int avpriv_io_move(const char *url_src, const char *url_dst)
> +int ffurl_move(const char *url_src, const char *url_dst)
>  {
>  URLContext *h_src, *h_dst;
>  int ret = ffurl_alloc(_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
> @@ -516,7 +516,7 @@ int avpriv_io_move(const char *url_src, const char 
> *url_dst)
>  return ret;
>  }
>  
> -int avpriv_io_delete(const char *url)
> +int ffurl_delete(const char *url)
>  {
>  URLContext *h;
>  int ret = ffurl_alloc(, url, AVIO_FLAG_WRITE, NULL);
> diff --git a/libavformat/avio.h b/libavformat/avio.h
> index 9141642e75..34c5957791 100644
> --- a/libavformat/avio.h
> +++ b/libavformat/avio.h
> @@ -374,25 +374,6 @@ const char *avio_find_protocol_name(const char *url);
>   */
>  int avio_check(const char *url, int flags);
>  
> -/**
> - * Move or rename a resource.
> - *
> - * @note url_src and url_dst should share the same protocol and authority.
> - *
> - * @param url_src url to resource to be moved
> - * @param url_dst new url to resource if the operation succeeded
> - * @return >=0 on success or negative on error.
> - */
> -int avpriv_io_move(const char *url_src, const char *url_dst);
> -
> -/**
> - * Delete a resource.
> - *
> - * @param url resource to be deleted.
> - * @return >=0 on success or negative on error.
> - */
> -int avpriv_io_delete(const char *url);

No, unfortunately and despite the name, these are public. Or rather,
exposed in a public header when they were not meant to be public,
afaics, so what we can do instead is schedule them for removal in the
next bump and not bother with a two year deprecation period. We've done
it before for other avpriv_ functions mistakenly exposed in public headers.

For that matter, it's about time we do a major bump. I'm willing to help
doing the required work to properly remove deprecated stuff that i'm
sure can't be deleted as is.

> -
>  /**
>   * Open directory for reading.
>   *
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index b84736881f..46041337c2 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -540,7 +540,7 @@ static void write_hls_media_playlist(OutputStream *os, 
> AVFormatContext *s,
>  dashenc_io_close(s, >m3u8_out, temp_filename_hls);
>  
>  if (use_rename)
> -if (avpriv_io_move(temp_filename_hls, filename_hls) < 0) {
> +if (ffurl_move(temp_filename_hls, filename_hls) < 0) {
>  av_log(os->ctx, AV_LOG_WARNING, "renaming file %s to %s 
> failed\n\n", temp_filename_hls, filename_hls);
>  }
>  }
> @@ -1037,7 +1037,7 @@ static int write_manifest(AVFormatContext *s, int final)
>  dashenc_io_close(s, >mpd_out, temp_filename);
>  
>  if (use_rename) {
> -if ((ret = avpriv_io_move(temp_filename, s->url)) < 0)
> +if ((ret = ffurl_move(temp_filename, s->url)) < 0)
>  return ret;
>  }
>  
> @@ -1119,7 +1119,7 @@ static int write_manifest(AVFormatContext *s, int final)
>  }
>  dashenc_io_close(s, >m3u8_out, temp_filename);
>  if (use_rename)
> -if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0)
> +if ((ret = ffurl_move(temp_filename, filename_hls)) < 0)
>  return ret;
>  c->master_playlist_created = 1;
>  }
> @@ -1507,7 +1507,7 @@ static void dashenc_delete_file(AVFormatContext *s, 
> char *filename) {
>  av_dict_free(_opts);
>  ff_format_io_close(s, );
>  } else {
> -int res = avpriv_io_delete(filename);
> +int res = ffurl_delete(filename);
>  if (res < 0) {
>  char errbuf[AV_ERROR_MAX_STRING_SIZE];
>  av_strerror(res, errbuf, sizeof(errbuf));
> @@ -1619,7 +1619,7 @@ static int dash_flush(AVFormatContext *s, int final, 
> int stream)
>  dashenc_io_close(s, >out, os->temp_path);
>  
>  if (use_rename) {
> -ret = avpriv_io_move(os->temp_path, os->full_path);
> +ret = ffurl_move(os->temp_path, os->full_path);
>  if (ret < 0)
>  break;
>  }
> diff --git a/libavformat/url.h b/libavformat/url.h
> index 4750bfff82..98ac6e3ccd 100644
> --- a/libavformat/url.h
> +++ b/libavformat/url.h
> @@ -340,4 +340,24 @@ const AVClass *ff_urlcontext_child_class_next(const 
> AVClass *prev);
>  const URLProtocol 

[FFmpeg-devel] [PATCH 2/2] avio: do not export avpriv_io_{move, delete}

2020-01-10 Thread Anton Khirnov
They are private and not used by anything outside of lavf. There is no
reason for them to be exported.
---
 libavformat/avio.c|  4 ++--
 libavformat/avio.h| 19 ---
 libavformat/dashenc.c | 10 +-
 libavformat/url.h | 20 
 4 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 2dd2312296..3e390fe719 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -494,7 +494,7 @@ int avio_check(const char *url, int flags)
 return ret;
 }
 
-int avpriv_io_move(const char *url_src, const char *url_dst)
+int ffurl_move(const char *url_src, const char *url_dst)
 {
 URLContext *h_src, *h_dst;
 int ret = ffurl_alloc(_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
@@ -516,7 +516,7 @@ int avpriv_io_move(const char *url_src, const char *url_dst)
 return ret;
 }
 
-int avpriv_io_delete(const char *url)
+int ffurl_delete(const char *url)
 {
 URLContext *h;
 int ret = ffurl_alloc(, url, AVIO_FLAG_WRITE, NULL);
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 9141642e75..34c5957791 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -374,25 +374,6 @@ const char *avio_find_protocol_name(const char *url);
  */
 int avio_check(const char *url, int flags);
 
-/**
- * Move or rename a resource.
- *
- * @note url_src and url_dst should share the same protocol and authority.
- *
- * @param url_src url to resource to be moved
- * @param url_dst new url to resource if the operation succeeded
- * @return >=0 on success or negative on error.
- */
-int avpriv_io_move(const char *url_src, const char *url_dst);
-
-/**
- * Delete a resource.
- *
- * @param url resource to be deleted.
- * @return >=0 on success or negative on error.
- */
-int avpriv_io_delete(const char *url);
-
 /**
  * Open directory for reading.
  *
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index b84736881f..46041337c2 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -540,7 +540,7 @@ static void write_hls_media_playlist(OutputStream *os, 
AVFormatContext *s,
 dashenc_io_close(s, >m3u8_out, temp_filename_hls);
 
 if (use_rename)
-if (avpriv_io_move(temp_filename_hls, filename_hls) < 0) {
+if (ffurl_move(temp_filename_hls, filename_hls) < 0) {
 av_log(os->ctx, AV_LOG_WARNING, "renaming file %s to %s 
failed\n\n", temp_filename_hls, filename_hls);
 }
 }
@@ -1037,7 +1037,7 @@ static int write_manifest(AVFormatContext *s, int final)
 dashenc_io_close(s, >mpd_out, temp_filename);
 
 if (use_rename) {
-if ((ret = avpriv_io_move(temp_filename, s->url)) < 0)
+if ((ret = ffurl_move(temp_filename, s->url)) < 0)
 return ret;
 }
 
@@ -1119,7 +1119,7 @@ static int write_manifest(AVFormatContext *s, int final)
 }
 dashenc_io_close(s, >m3u8_out, temp_filename);
 if (use_rename)
-if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0)
+if ((ret = ffurl_move(temp_filename, filename_hls)) < 0)
 return ret;
 c->master_playlist_created = 1;
 }
@@ -1507,7 +1507,7 @@ static void dashenc_delete_file(AVFormatContext *s, char 
*filename) {
 av_dict_free(_opts);
 ff_format_io_close(s, );
 } else {
-int res = avpriv_io_delete(filename);
+int res = ffurl_delete(filename);
 if (res < 0) {
 char errbuf[AV_ERROR_MAX_STRING_SIZE];
 av_strerror(res, errbuf, sizeof(errbuf));
@@ -1619,7 +1619,7 @@ static int dash_flush(AVFormatContext *s, int final, int 
stream)
 dashenc_io_close(s, >out, os->temp_path);
 
 if (use_rename) {
-ret = avpriv_io_move(os->temp_path, os->full_path);
+ret = ffurl_move(os->temp_path, os->full_path);
 if (ret < 0)
 break;
 }
diff --git a/libavformat/url.h b/libavformat/url.h
index 4750bfff82..98ac6e3ccd 100644
--- a/libavformat/url.h
+++ b/libavformat/url.h
@@ -340,4 +340,24 @@ const AVClass *ff_urlcontext_child_class_next(const 
AVClass *prev);
 const URLProtocol **ffurl_get_protocols(const char *whitelist,
 const char *blacklist);
 
+/**
+ * Move or rename a resource.
+ *
+ * @note url_src and url_dst should share the same protocol and authority.
+ *
+ * @param url_src url to resource to be moved
+ * @param url_dst new url to resource if the operation succeeded
+ * @return >=0 on success or negative on error.
+ */
+int ffurl_move(const char *url_src, const char *url_dst);
+
+/**
+ * Delete a resource.
+ *
+ * @param url resource to be deleted.
+ * @return >=0 on success or negative on error.
+ */
+int ffurl_delete(const char *url);
+
+
 #endif /* AVFORMAT_URL_H */
-- 
2.24.1

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

To 

[FFmpeg-devel] [PATCH 1/2] examples/avio_dir_cmd: drop support for move/delete operations

2020-01-10 Thread Anton Khirnov
They use non-public functions, which is unacceptable for a public API
example. Rename the example back to avio_list_dir.

This effectively reverts c84d208c275d6a43b3c3421d38772179abf8acee and
767d780ec001167b2fd8f6cfe4ef78a3a8b1e34c.
---
 configure |  4 +-
 doc/examples/.gitignore   |  2 +-
 doc/examples/Makefile |  2 +-
 doc/examples/Makefile.example |  2 +-
 .../{avio_dir_cmd.c => avio_list_dir.c}   | 56 ++-
 5 files changed, 9 insertions(+), 57 deletions(-)
 rename doc/examples/{avio_dir_cmd.c => avio_list_dir.c} (69%)

diff --git a/configure b/configure
index 46f2038627..65a5a30f36 100755
--- a/configure
+++ b/configure
@@ -1664,7 +1664,7 @@ COMPONENT_LIST="
 "
 
 EXAMPLE_LIST="
-avio_dir_cmd_example
+avio_list_dir_example
 avio_reading_example
 decode_audio_example
 decode_video_example
@@ -3599,7 +3599,7 @@ yadif_cuda_filter_deps="ffnvcodec"
 yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
 
 # examples
-avio_dir_cmd_deps="avformat avutil"
+avio_list_dir_deps="avformat avutil"
 avio_reading_deps="avformat avcodec avutil"
 decode_audio_example_deps="avcodec avutil"
 decode_video_example_deps="avcodec avutil"
diff --git a/doc/examples/.gitignore b/doc/examples/.gitignore
index 75152cb50b..44960e1de7 100644
--- a/doc/examples/.gitignore
+++ b/doc/examples/.gitignore
@@ -1,4 +1,4 @@
-/avio_dir_cmd
+/avio_list_dir
 /avio_reading
 /decode_audio
 /decode_video
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index 2935424e54..81bfd34d5d 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -1,4 +1,4 @@
-EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE)  += avio_dir_cmd
+EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
 EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)  += avio_reading
 EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)  += decode_audio
 EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)  += decode_video
diff --git a/doc/examples/Makefile.example b/doc/examples/Makefile.example
index 6428154c51..a232d97f98 100644
--- a/doc/examples/Makefile.example
+++ b/doc/examples/Makefile.example
@@ -11,7 +11,7 @@ CFLAGS += -Wall -g
 CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
 LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
 
-EXAMPLES=   avio_dir_cmd   \
+EXAMPLES=   avio_list_dir  \
 avio_reading   \
 decode_audio   \
 decode_video   \
diff --git a/doc/examples/avio_dir_cmd.c b/doc/examples/avio_list_dir.c
similarity index 69%
rename from doc/examples/avio_dir_cmd.c
rename to doc/examples/avio_list_dir.c
index 0722bd9ab1..3073baaefa 100644
--- a/doc/examples/avio_dir_cmd.c
+++ b/doc/examples/avio_list_dir.c
@@ -102,38 +102,15 @@ static int list_op(const char *input_dir)
 return ret;
 }
 
-static int del_op(const char *url)
-{
-int ret = avpriv_io_delete(url);
-if (ret < 0)
-av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, 
av_err2str(ret));
-return ret;
-}
-
-static int move_op(const char *src, const char *dst)
-{
-int ret = avpriv_io_move(src, dst);
-if (ret < 0)
-av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, 
dst, av_err2str(ret));
-return ret;
-}
-
-
 static void usage(const char *program_name)
 {
-fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
-"API example program to show how to manipulate resources "
-"accessed through AVIOContext.\n"
-"OPERATIONS:\n"
-"list  list content of the directory\n"
-"move  rename content in directory\n"
-"del   delete content in directory\n",
-program_name);
+fprintf(stderr, "usage: %s input_dir\n"
+"API example program to show how to list files in directory "
+"accessed through AVIOContext.\n", program_name);
 }
 
 int main(int argc, char *argv[])
 {
-const char *op = NULL;
 int ret;
 
 av_log_set_level(AV_LOG_DEBUG);
@@ -145,32 +122,7 @@ int main(int argc, char *argv[])
 
 avformat_network_init();
 
-op = argv[1];
-if (strcmp(op, "list") == 0) {
-if (argc < 3) {
-av_log(NULL, AV_LOG_INFO, "Missing argument for list 
operation.\n");
-ret = AVERROR(EINVAL);
-} else {
-ret = list_op(argv[2]);
-}
-} else if (strcmp(op, "del") == 0) {
-if (argc < 3) {
-av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
-ret = AVERROR(EINVAL);
-} else {
-ret = del_op(argv[2]);
-}
-} else if (strcmp(op, "move") == 0) {
-if (argc < 4) {
-av_log(NULL, AV_LOG_INFO, "Missing argument for move 
operation.\n");
-ret = AVERROR(EINVAL);
-} else {
-

Re: [FFmpeg-devel] [PATCH] lavc/qsv: adding DX11 support

2020-01-10 Thread Anton Khirnov
Quoting Artem Galin (2019-12-23 19:31:04)
> This enables DX11 support for QSV with higher priority than DX9.
> In case of multiple GPUs configuration, DX9 API does not allow to get
> access to QSV device in some cases - headless.
> Implementation based on DX11 resolves that restriction by enumerating list of 
> available GPUs and finding device with QSV support.
> 
> Signed-off-by: Artem Galin 
> ---
>  libavcodec/qsv.c  | 13 +++--
>  libavcodec/qsv_internal.h |  1 +
>  libavutil/hwcontext_d3d11va.c | 57 +-
>  libavutil/hwcontext_qsv.c | 89 +++
>  libavutil/hwcontext_qsv.h |  1 +
>  5 files changed, 147 insertions(+), 14 deletions(-)
> 
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index b00e427435..33ac7a3373 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -414,7 +414,7 @@ static int ff_qsv_set_display_handle(AVCodecContext 
> *avctx, QSVSession *qs)
>  int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs,
>   const char *load_plugins, int gpu_copy)
>  {
> -mfxIMPL  impl = MFX_IMPL_AUTO_ANY;
> +mfxIMPL  impl = MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_D3D11;
>  mfxVersionver = { { QSV_VERSION_MINOR, QSV_VERSION_MAJOR } };
>  mfxInitParam init_par = { MFX_IMPL_AUTO_ANY };
>  
> @@ -504,6 +504,7 @@ static AVBufferRef *qsv_create_mids(AVBufferRef 
> *hw_frames_ref)
>  for (i = 0; i < nb_surfaces; i++) {
>  QSVMid *mid = [i];
>  mid->handle= frames_hwctx->surfaces[i].Data.MemId;
> +mid->texture   = frames_hwctx->texture;
>  mid->hw_frames_ref = hw_frames_ref1;
>  }
>  
> @@ -713,7 +714,13 @@ static mfxStatus qsv_frame_unlock(mfxHDL pthis, mfxMemId 
> mid, mfxFrameData *ptr)
>  static mfxStatus qsv_frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
>  {
>  QSVMid *qsv_mid = (QSVMid*)mid;
> -*hdl = qsv_mid->handle;
> +if (qsv_mid->texture) {
> +mfxHDLPair *pair  =  (mfxHDLPair*)hdl;
> +pair->first  = qsv_mid->texture;
> +pair->second = qsv_mid->handle;
> +} else {
> +*hdl = qsv_mid->handle;
> +}
>  return MFX_ERR_NONE;
>  }
>  
> @@ -723,8 +730,8 @@ int ff_qsv_init_session_device(AVCodecContext *avctx, 
> mfxSession *psession,
>  {
>  static const mfxHandleType handle_types[] = {
>  MFX_HANDLE_VA_DISPLAY,
> -MFX_HANDLE_D3D9_DEVICE_MANAGER,
>  MFX_HANDLE_D3D11_DEVICE,
> +MFX_HANDLE_D3D9_DEVICE_MANAGER,
>  };
>  AVHWDeviceContext*device_ctx = (AVHWDeviceContext*)device_ref->data;
>  AVQSVDeviceContext *device_hwctx = device_ctx->hwctx;
> diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
> index 37559270e5..09425fb431 100644
> --- a/libavcodec/qsv_internal.h
> +++ b/libavcodec/qsv_internal.h
> @@ -60,6 +60,7 @@
>  
>  typedef struct QSVMid {
>  AVBufferRef *hw_frames_ref;
> +void *texture;
>  mfxHDL handle;
>  
>  AVFrame *locked_frame;
> diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
> index 6670c47579..a08479fd96 100644
> --- a/libavutil/hwcontext_d3d11va.c
> +++ b/libavutil/hwcontext_d3d11va.c
> @@ -244,7 +244,7 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx)
>  return AVERROR(EINVAL);
>  }
>  
> -texDesc = (D3D11_TEXTURE2D_DESC){
> +texDesc = (D3D11_TEXTURE2D_DESC) {
>  .Width  = ctx->width,
>  .Height = ctx->height,
>  .MipLevels  = 1,
> @@ -510,6 +510,46 @@ static void d3d11va_device_uninit(AVHWDeviceContext 
> *hwdev)
>  }
>  }
>  
> +static int d3d11va_device_find_qsv_adapter(AVHWDeviceContext *ctx, UINT 
> creationFlags)
> +{
> +HRESULT hr;
> +IDXGIAdapter *adapter = NULL;
> +int adapter_id = 0;
> +int vendor_id = 0x8086;
> +IDXGIFactory2 *factory;
> +hr = mCreateDXGIFactory(_IDXGIFactory2, (void **));
> +while (IDXGIFactory2_EnumAdapters(factory, adapter_id++, ) != 
> DXGI_ERROR_NOT_FOUND)
> +{
> +ID3D11Device* device = NULL;
> +DXGI_ADAPTER_DESC adapter_desc;
> +
> +hr = mD3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, 
> creationFlags, NULL, 0, D3D11_SDK_VERSION, , NULL, NULL);
> +if (FAILED(hr)) {
> +av_log(ctx, AV_LOG_ERROR, "D3D11CreateDevice returned error\n");
> +continue;
> +}
> +
> +hr = IDXGIAdapter2_GetDesc(adapter, _desc);
> +if (FAILED(hr)) {
> +av_log(ctx, AV_LOG_ERROR, "IDXGIAdapter2_GetDesc returned 
> error\n");
> +continue;
> +}
> +
> +if(device)
> +ID3D11Device_Release(device);
> +
> +if (adapter)
> +IDXGIAdapter_Release(adapter);
> +
> +if (adapter_desc.VendorId == vendor_id) {
> +IDXGIFactory2_Release(factory);
> +return adapter_id - 1;
> +}
> +}
> +IDXGIFactory2_Release(factory);
> +  

Re: [FFmpeg-devel] [PATCHv2 1/3] avutil/eval: separate AVExpr state to a new AVExprState struct

2020-01-10 Thread Anton Khirnov
Quoting Marton Balint (2019-12-30 23:23:40)
> Also add helper functions to allocate and free such a struct, and make it
> usable by providing a new av_eval_expr2 function for which you can specify a
> custom AVExprState.

Why not just parse the expression multiple times? Performance?

Beyond that, it seems to me that the user now has to juggle multiple
contexts manually, which is complex and can be avoided. How about
introducing a function for duplicating AVExpr instead? Would that not
solve this as well?

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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