Re: [FFmpeg-devel] [PATCH] checkasm/hevc_idct : update test bit depth from 8 9 and 10 to 8 10 and 12

2018-03-08 Thread Paul B Mahol
On 3/8/18, Yingming Fan  wrote:
> From: Yingming Fan 
>
> ---
>  We have 8 10 and 12 SIMD codes, but previous checkasm hevc_idct only test 8
> and 10 bit depth.
>
>  tests/checkasm/hevc_idct.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/checkasm/hevc_idct.c b/tests/checkasm/hevc_idct.c
> index eea712101d..c20111c2df 100644
> --- a/tests/checkasm/hevc_idct.c
> +++ b/tests/checkasm/hevc_idct.c
> @@ -87,7 +87,7 @@ void checkasm_check_hevc_idct(void)
>  {
>  int bit_depth;
>
> -for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
> +for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
>  HEVCDSPContext h;
>
>  ff_hevc_dsp_init(&h, bit_depth);
> @@ -95,7 +95,7 @@ void checkasm_check_hevc_idct(void)
>  }
>  report("idct_dc");
>
> -for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
> +for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
>  HEVCDSPContext h;
>
>  ff_hevc_dsp_init(&h, bit_depth);

Isn't this dropping 9 case?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] checkasm/hevc_idct : update test bit depth from 8 9 and 10 to 8 10 and 12

2018-03-08 Thread Hendrik Leppkes
On Thu, Mar 8, 2018 at 9:16 AM, Paul B Mahol  wrote:
> On 3/8/18, Yingming Fan  wrote:
>> From: Yingming Fan 
>>
>> ---
>>  We have 8 10 and 12 SIMD codes, but previous checkasm hevc_idct only test 8
>> and 10 bit depth.
>>
>>  tests/checkasm/hevc_idct.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/checkasm/hevc_idct.c b/tests/checkasm/hevc_idct.c
>> index eea712101d..c20111c2df 100644
>> --- a/tests/checkasm/hevc_idct.c
>> +++ b/tests/checkasm/hevc_idct.c
>> @@ -87,7 +87,7 @@ void checkasm_check_hevc_idct(void)
>>  {
>>  int bit_depth;
>>
>> -for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
>> +for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
>>  HEVCDSPContext h;
>>
>>  ff_hevc_dsp_init(&h, bit_depth);
>> @@ -95,7 +95,7 @@ void checkasm_check_hevc_idct(void)
>>  }
>>  report("idct_dc");
>>
>> -for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
>> +for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
>>  HEVCDSPContext h;
>>
>>  ff_hevc_dsp_init(&h, bit_depth);
>
> Isn't this dropping 9 case?

It is, but we don't have any optimizations for 9 anyway, so there is
nothing to test.

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


[FFmpeg-devel] [PATCH 01/10] lavu/opt: add AV_OPT_FLAG_BSF_PARAM

2018-03-08 Thread Jun Zhao

From 665692d981828ccc0875f9dcbf2c89f3495fcce6 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 13:47:23 +0800
Subject: [PATCH 01/10] lavu/opt: add AV_OPT_FLAG_BSF_PARAM

add AV_OPT_FLAG_BSF_PARAM for bit stream filter options.

Signed-off-by: Jun Zhao 
---
 libavutil/opt.c | 1 +
 libavutil/opt.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index df88663e3f..3b0aab4ee8 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1181,6 +1181,7 @@ static void opt_list(void *obj, void *av_log_obj, const 
char *unit,
 av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');
 av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_EXPORT) ? 'X' : '.');
 av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_READONLY)   ? 'R' : '.');
+av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & 
AV_OPT_FLAG_BSF_PARAM)  ? 'B' : '.');
 
 if (opt->help)
 av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 391720f2e2..07da68ea23 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -287,6 +287,7 @@ typedef struct AVOption {
  * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set.
  */
 #define AV_OPT_FLAG_READONLY128
+#define AV_OPT_FLAG_BSF_PARAM   (1<<8) ///< a generic parameter which can 
be set by the user for bit stream filtering
 #define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can 
be set by the user for filtering
 //FIXME think about enc-audio, ... style flags
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 02/10] ffmpeg: support dump bit stream filter options.

2018-03-08 Thread Jun Zhao

From c058a02677f7cbba65443db260b21b9acfa79796 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 13:50:31 +0800
Subject: [PATCH 02/10] ffmpeg: support dump bit stream filter options.

Support dump bit stream filter option in ffmpeg -h full and
ffmpeg -h bsf=FooBar.

Signed-off-by: Jun Zhao 
---
 fftools/cmdutils.c   | 17 +
 fftools/ffmpeg_opt.c |  3 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 0c7d13c27a..f9d87f6724 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1897,6 +1897,21 @@ static void show_help_filter(const char *name)
 }
 #endif
 
+static void show_help_bsf(const char *name)
+{
+const AVBitStreamFilter *bsf = av_bsf_get_by_name(name);
+
+if (!bsf) {
+av_log(NULL, AV_LOG_ERROR, "Unknown bit stream filter '%s'.\n", name);
+return;
+}
+
+printf("Bit stream filter %s\n", bsf->name);
+if (bsf->priv_class)
+show_help_children(bsf->priv_class, AV_OPT_FLAG_BSF_PARAM);
+printf("\n");
+}
+
 int show_help(void *optctx, const char *opt, const char *arg)
 {
 char *topic, *par;
@@ -1923,6 +1938,8 @@ int show_help(void *optctx, const char *opt, const char 
*arg)
 } else if (!strcmp(topic, "filter")) {
 show_help_filter(par);
 #endif
+} else if (!strcmp(topic, "bsf")) {
+show_help_bsf(par);
 } else {
 show_help_default(topic, par);
 }
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 1b591d9695..d7a7eb0662 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -3114,7 +3114,7 @@ void show_help_default(const char *opt, const char *arg)
"-h  -- print basic options\n"
"-h long -- print more options\n"
"-h full -- print all options (including all format and codec 
specific options, very long)\n"
-   "-h type=name -- print all options for the named 
decoder/encoder/demuxer/muxer/filter\n"
+   "-h type=name -- print all options for the named 
decoder/encoder/demuxer/muxer/filter/bsf\n"
"See man %s for detailed description of the options.\n"
"\n", program_name);
 
@@ -3159,6 +3159,7 @@ void show_help_default(const char *opt, const char *arg)
 #endif
 show_help_children(swr_get_class(), AV_OPT_FLAG_AUDIO_PARAM);
 show_help_children(avfilter_get_class(), AV_OPT_FLAG_VIDEO_PARAM | 
AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM);
+show_help_children(av_bsf_get_class(), AV_OPT_FLAG_VIDEO_PARAM | 
AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_BSF_PARAM);
 }
 }
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 03/10] lavc/dump_extradata_bsf: support dump options.

2018-03-08 Thread Jun Zhao

From b296202365cf6c2174440107a5aa8547a1b02253 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 14:01:48 +0800
Subject: [PATCH 03/10] lavc/dump_extradata_bsf: support dump options.

support dump bit stream filter options

Signed-off-by: Jun Zhao 
---
 libavcodec/dump_extradata_bsf.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavcodec/dump_extradata_bsf.c b/libavcodec/dump_extradata_bsf.c
index fa7bc86e19..081ae5aa08 100644
--- a/libavcodec/dump_extradata_bsf.c
+++ b/libavcodec/dump_extradata_bsf.c
@@ -78,13 +78,14 @@ fail:
 }
 
 #define OFFSET(x) offsetof(DumpExtradataContext, x)
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 static const AVOption options[] = {
 { "freq", "When do dump extradata", OFFSET(freq), AV_OPT_TYPE_INT,
-{ .i64 = DUMP_FREQ_KEYFRAME }, DUMP_FREQ_KEYFRAME, DUMP_FREQ_ALL, 0, 
"freq" },
-{ "k",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME 
}, .unit = "freq" },
-{ "keyframe", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME 
}, .unit = "freq" },
-{ "e",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_ALL  
}, .unit = "freq" },
-{ "all",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_ALL  
}, .unit = "freq" },
+{ .i64 = DUMP_FREQ_KEYFRAME }, DUMP_FREQ_KEYFRAME, DUMP_FREQ_ALL, 
FLAGS, "freq" },
+{ "k",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME 
}, .flags = FLAGS, .unit = "freq" },
+{ "keyframe", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME 
}, .flags = FLAGS, .unit = "freq" },
+{ "e",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_ALL  
}, .flags = FLAGS, .unit = "freq" },
+{ "all",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_ALL  
}, .flags = FLAGS, .unit = "freq" },
 { NULL },
 };
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 04/10] lavc/extract_extradata_bsf: support dump options.

2018-03-08 Thread Jun Zhao

From 1a833a4bbd9cfe22bf2c3c31a76b2028d67f2ad2 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 14:05:53 +0800
Subject: [PATCH 04/10] lavc/extract_extradata_bsf: support dump options.

support dump bit stream filter options

Signed-off-by: Jun Zhao 
---
 libavcodec/extract_extradata_bsf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/extract_extradata_bsf.c 
b/libavcodec/extract_extradata_bsf.c
index d40907a675..14f584749d 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -315,9 +315,10 @@ static const enum AVCodecID codec_ids[] = {
 };
 
 #define OFFSET(x) offsetof(ExtractExtradataContext, x)
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 static const AVOption options[] = {
 { "remove", "remove the extradata from the bitstream", OFFSET(remove), 
AV_OPT_TYPE_INT,
-{ .i64 = 0 }, 0, 1 },
+{ .i64 = 0 }, 0, 1 , FLAGS},
 { NULL },
 };
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 05/10] lavc/h264_metadata_bsf: support dump options.

2018-03-08 Thread Jun Zhao

From 9748a9b27ef1b67505202ad8e33b5259c066781c Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 14:22:25 +0800
Subject: [PATCH 05/10] lavc/h264_metadata_bsf: support dump options.

support dump bit stream filter options

Signed-off-by: Jun Zhao 
---
 libavcodec/h264_metadata_bsf.c | 39 ---
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c
index 466823cda6..12e739a354 100644
--- a/libavcodec/h264_metadata_bsf.c
+++ b/libavcodec/h264_metadata_bsf.c
@@ -451,63 +451,64 @@ static void h264_metadata_close(AVBSFContext *bsf)
 }
 
 #define OFFSET(x) offsetof(H264MetadataContext, x)
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 static const AVOption h264_metadata_options[] = {
 { "aud", "Access Unit Delimiter NAL units",
 OFFSET(aud), AV_OPT_TYPE_INT,
-{ .i64 = PASS }, PASS, REMOVE, 0, "aud" },
-{ "pass",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PASS   }, .unit = "aud" },
-{ "insert", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = INSERT }, .unit = "aud" },
-{ "remove", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE }, .unit = "aud" },
+{ .i64 = PASS }, PASS, REMOVE, FLAGS, "aud" },
+{ "pass",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PASS   }, .flags = FLAGS, 
.unit = "aud" },
+{ "insert", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = INSERT }, .flags = FLAGS, 
.unit = "aud" },
+{ "remove", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE }, .flags = FLAGS, 
.unit = "aud" },
 
 { "sample_aspect_ratio", "Set sample aspect ratio (table E-1)",
 OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL,
-{ .dbl = 0.0 }, 0, 65535 },
+{ .dbl = 0.0 }, 0, 65535, FLAGS },
 
 { "video_format", "Set video format (table E-2)",
 OFFSET(video_format), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 7 },
+{ .i64 = -1 }, -1, 7, FLAGS},
 { "video_full_range_flag", "Set video full range flag",
 OFFSET(video_full_range_flag), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 1 },
+{ .i64 = -1 }, -1, 1, FLAGS },
 { "colour_primaries", "Set colour primaries (table E-3)",
 OFFSET(colour_primaries), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 { "transfer_characteristics", "Set transfer characteristics (table E-4)",
 OFFSET(transfer_characteristics), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 { "matrix_coefficients", "Set matrix coefficients (table E-5)",
 OFFSET(matrix_coefficients), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 
 { "chroma_sample_loc_type", "Set chroma sample location type (figure E-1)",
 OFFSET(chroma_sample_loc_type), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 6 },
+{ .i64 = -1 }, -1, 6, FLAGS },
 
 { "tick_rate", "Set VUI tick rate (num_units_in_tick / time_scale)",
 OFFSET(tick_rate), AV_OPT_TYPE_RATIONAL,
-{ .dbl = 0.0 }, 0, UINT_MAX },
+{ .dbl = 0.0 }, 0, UINT_MAX, FLAGS },
 { "fixed_frame_rate_flag", "Set VUI fixed frame rate flag",
 OFFSET(fixed_frame_rate_flag), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 1 },
+{ .i64 = -1 }, -1, 1, FLAGS },
 
 { "crop_left", "Set left border crop offset",
 OFFSET(crop_left), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, H264_MAX_WIDTH },
+{ .i64 = -1 }, -1, H264_MAX_WIDTH, FLAGS },
 { "crop_right", "Set right border crop offset",
 OFFSET(crop_right), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, H264_MAX_WIDTH },
+{ .i64 = -1 }, -1, H264_MAX_WIDTH, FLAGS },
 { "crop_top", "Set top border crop offset",
 OFFSET(crop_top), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, H264_MAX_HEIGHT },
+{ .i64 = -1 }, -1, H264_MAX_HEIGHT, FLAGS },
 { "crop_bottom", "Set bottom border crop offset",
 OFFSET(crop_bottom), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, H264_MAX_HEIGHT },
+{ .i64 = -1 }, -1, H264_MAX_HEIGHT, FLAGS },
 
 { "sei_user_data", "Insert SEI user data (UUID+string)",
-OFFSET(sei_user_data), AV_OPT_TYPE_STRING, { .str = NULL } },
+OFFSET(sei_user_data), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = 
FLAGS },
 
 { "delete_filler", "Delete all filler (both NAL and SEI)",
-OFFSET(delete_filler), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1 },
+OFFSET(delete_filler), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1 , FLAGS},
 
 { NULL }
 };
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 06/10] lavc/h265_metadata_bsf: support dump options.

2018-03-08 Thread Jun Zhao

From 8dd710a5693503555e302bd3248a805e5cd92e93 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 14:28:13 +0800
Subject: [PATCH 06/10] lavc/h265_metadata_bsf: support dump options.

support dump bit stream filter options

Signed-off-by: Jun Zhao 
---
 libavcodec/h265_metadata_bsf.c | 35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/libavcodec/h265_metadata_bsf.c b/libavcodec/h265_metadata_bsf.c
index 2398ee95c5..2b5dd9debd 100644
--- a/libavcodec/h265_metadata_bsf.c
+++ b/libavcodec/h265_metadata_bsf.c
@@ -379,59 +379,60 @@ static void h265_metadata_close(AVBSFContext *bsf)
 }
 
 #define OFFSET(x) offsetof(H265MetadataContext, x)
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 static const AVOption h265_metadata_options[] = {
 { "aud", "Access Unit Delimiter NAL units",
 OFFSET(aud), AV_OPT_TYPE_INT,
-{ .i64 = PASS }, PASS, REMOVE, 0, "aud" },
-{ "pass",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PASS   }, .unit = "aud" },
-{ "insert", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = INSERT }, .unit = "aud" },
-{ "remove", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE }, .unit = "aud" },
+{ .i64 = PASS }, PASS, REMOVE, FLAGS, "aud" },
+{ "pass",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PASS   }, .flags = FLAGS, 
.unit = "aud" },
+{ "insert", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = INSERT }, .flags = FLAGS, 
.unit = "aud" },
+{ "remove", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE }, .flags = FLAGS, 
.unit = "aud" },
 
 { "sample_aspect_ratio", "Set sample aspect ratio (table E-1)",
 OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL,
-{ .dbl = 0.0 }, 0, 65535 },
+{ .dbl = 0.0 }, 0, 65535, FLAGS },
 
 { "video_format", "Set video format (table E-2)",
 OFFSET(video_format), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 7 },
+{ .i64 = -1 }, -1, 7, FLAGS },
 { "video_full_range_flag", "Set video full range flag",
 OFFSET(video_full_range_flag), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 1 },
+{ .i64 = -1 }, -1, 1, FLAGS },
 { "colour_primaries", "Set colour primaries (table E-3)",
 OFFSET(colour_primaries), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 { "transfer_characteristics", "Set transfer characteristics (table E-4)",
 OFFSET(transfer_characteristics), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 { "matrix_coefficients", "Set matrix coefficients (table E-5)",
 OFFSET(matrix_coefficients), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 
 { "chroma_sample_loc_type", "Set chroma sample location type (figure E-1)",
 OFFSET(chroma_sample_loc_type), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 6 },
+{ .i64 = -1 }, -1, 6, FLAGS },
 
 { "tick_rate",
 "Set VPS and VUI tick rate (num_units_in_tick / time_scale)",
 OFFSET(tick_rate), AV_OPT_TYPE_RATIONAL,
-{ .dbl = 0.0 }, 0, UINT_MAX },
+{ .dbl = 0.0 }, 0, UINT_MAX, FLAGS },
 { "num_ticks_poc_diff_one",
 "Set VPS and VUI number of ticks per POC increment",
 OFFSET(num_ticks_poc_diff_one), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, INT_MAX },
+{ .i64 = -1 }, -1, INT_MAX, FLAGS },
 
 { "crop_left", "Set left border crop offset",
 OFFSET(crop_left), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, HEVC_MAX_WIDTH },
+{ .i64 = -1 }, -1, HEVC_MAX_WIDTH, FLAGS },
 { "crop_right", "Set right border crop offset",
 OFFSET(crop_right), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, HEVC_MAX_WIDTH },
+{ .i64 = -1 }, -1, HEVC_MAX_WIDTH, FLAGS },
 { "crop_top", "Set top border crop offset",
 OFFSET(crop_top), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, HEVC_MAX_HEIGHT },
+{ .i64 = -1 }, -1, HEVC_MAX_HEIGHT, FLAGS },
 { "crop_bottom", "Set bottom border crop offset",
 OFFSET(crop_bottom), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, HEVC_MAX_HEIGHT },
+{ .i64 = -1 }, -1, HEVC_MAX_HEIGHT, FLAGS },
 
 { NULL }
 };
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 07/10] lavc/mpeg2_metadata_bsf: support dump options.

2018-03-08 Thread Jun Zhao

From 20bc3ecc33a8785c3ecb4651e81ae533cb706877 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 14:31:30 +0800
Subject: [PATCH 07/10] lavc/mpeg2_metadata_bsf: support dump options.

support dump bit stream filter options

Signed-off-by: Jun Zhao 
---
 libavcodec/mpeg2_metadata_bsf.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavcodec/mpeg2_metadata_bsf.c b/libavcodec/mpeg2_metadata_bsf.c
index 3bb6c1d549..6d5f581ab1 100644
--- a/libavcodec/mpeg2_metadata_bsf.c
+++ b/libavcodec/mpeg2_metadata_bsf.c
@@ -266,27 +266,28 @@ static void mpeg2_metadata_close(AVBSFContext *bsf)
 }
 
 #define OFFSET(x) offsetof(MPEG2MetadataContext, x)
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 static const AVOption mpeg2_metadata_options[] = {
 { "display_aspect_ratio", "Set display aspect ratio (table 6-3)",
 OFFSET(display_aspect_ratio), AV_OPT_TYPE_RATIONAL,
-{ .dbl = 0.0 }, 0, 65535 },
+{ .dbl = 0.0 }, 0, 65535, FLAGS },
 
 { "frame_rate", "Set frame rate",
 OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL,
-{ .dbl = 0.0 }, 0, UINT_MAX },
+{ .dbl = 0.0 }, 0, UINT_MAX, FLAGS },
 
 { "video_format", "Set video format (table 6-6)",
 OFFSET(video_format), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 7 },
+{ .i64 = -1 }, -1, 7, FLAGS },
 { "colour_primaries", "Set colour primaries (table 6-7)",
 OFFSET(colour_primaries), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 { "transfer_characteristics", "Set transfer characteristics (table 6-8)",
 OFFSET(transfer_characteristics), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 { "matrix_coefficients", "Set matrix coefficients (table 6-9)",
 OFFSET(matrix_coefficients), AV_OPT_TYPE_INT,
-{ .i64 = -1 }, -1, 255 },
+{ .i64 = -1 }, -1, 255, FLAGS },
 
 { NULL }
 };
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 09/10] lavc/remove_extradata_bsf: support dump options.

2018-03-08 Thread Jun Zhao

From fd544f7ce882dfcebab08da3c508395e13b752c2 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 15:00:27 +0800
Subject: [PATCH 09/10] lavc/remove_extradata_bsf: support dump options.

support dump bit stream filter options

Signed-off-by: Jun Zhao 
---
 libavcodec/remove_extradata_bsf.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavcodec/remove_extradata_bsf.c 
b/libavcodec/remove_extradata_bsf.c
index a54bbdbacf..44ffddf27d 100644
--- a/libavcodec/remove_extradata_bsf.c
+++ b/libavcodec/remove_extradata_bsf.c
@@ -94,12 +94,13 @@ static void remove_extradata_close(AVBSFContext *ctx)
 }
 
 #define OFFSET(x) offsetof(RemoveExtradataContext, x)
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 static const AVOption options[] = {
-{ "freq", NULL, OFFSET(freq), AV_OPT_TYPE_INT, { .i64 = 
REMOVE_FREQ_KEYFRAME }, REMOVE_FREQ_KEYFRAME, REMOVE_FREQ_NONKEYFRAME, 0, 
"freq" },
-{ "k",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
REMOVE_FREQ_NONKEYFRAME }, .unit = "freq" },
-{ "keyframe", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
REMOVE_FREQ_KEYFRAME }, .unit = "freq" },
-{ "e",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE_FREQ_ALL 
 }, .unit = "freq" },
-{ "all",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE_FREQ_ALL 
 }, .unit = "freq" },
+{ "freq", NULL, OFFSET(freq), AV_OPT_TYPE_INT, { .i64 = 
REMOVE_FREQ_KEYFRAME }, REMOVE_FREQ_KEYFRAME, REMOVE_FREQ_NONKEYFRAME, FLAGS, 
"freq" },
+{ "k",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
REMOVE_FREQ_NONKEYFRAME }, .flags = FLAGS, .unit = "freq" },
+{ "keyframe", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
REMOVE_FREQ_KEYFRAME }, .flags = FLAGS, .unit = "freq" },
+{ "e",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE_FREQ_ALL 
 }, .flags = FLAGS, .unit = "freq" },
+{ "all",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = REMOVE_FREQ_ALL 
 }, .flags = FLAGS, .unit = "freq" },
 { NULL },
 };
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 08/10] lavc/noise_bsf: support dump options.

2018-03-08 Thread Jun Zhao

From 78784edf606aa1c5bbcb643ce0ac0f17964827c9 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 14:57:47 +0800
Subject: [PATCH 08/10] lavc/noise_bsf: support dump options.

support dump bit stream filter options.

Signed-off-by: Jun Zhao 
---
 libavcodec/noise_bsf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c
index 84b94032ad..6bb89507fc 100644
--- a/libavcodec/noise_bsf.c
+++ b/libavcodec/noise_bsf.c
@@ -78,9 +78,10 @@ fail:
 }
 
 #define OFFSET(x) offsetof(NoiseContext, x)
+#define FLAGS 
(AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 static const AVOption options[] = {
-{ "amount", NULL, OFFSET(amount), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 
INT_MAX },
-{ "dropamount", NULL, OFFSET(dropamount), AV_OPT_TYPE_INT, { .i64 = 0 }, 
0, INT_MAX },
+{ "amount", NULL, OFFSET(amount), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 
INT_MAX, FLAGS },
+{ "dropamount", NULL, OFFSET(dropamount), AV_OPT_TYPE_INT, { .i64 = 0 }, 
0, INT_MAX, FLAGS },
 { NULL },
 };
 
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 10/10] doc/fftools-common-opts: allow printing bsf details.

2018-03-08 Thread Jun Zhao

From 690dab339f5f9fe0682b64ce63e84bfd88bac47f Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Thu, 8 Mar 2018 15:18:11 +0800
Subject: [PATCH 10/10] doc/fftools-common-opts: allow printing bsf details.

Signed-off-by: Jun Zhao 
---
 doc/fftools-common-opts.texi | 4 
 1 file changed, 4 insertions(+)

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 185ec218d5..a0b0781050 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -102,6 +102,10 @@ Print detailed information about the muxer named 
@var{muxer_name}. Use the
 @item filter=@var{filter_name}
 Print detailed information about the filter name @var{filter_name}. Use the
 @option{-filters} option to get a list of all filters.
+
+@item bsf=@var{bit_stream_filter_name}
+Print detailed information about the bit stream filter name 
@var{bit_stream_filter_name}.
+Use the @option{-bsfs} option to get a list of all bit stream filters.
 @end table
 
 @item -version
-- 
2.14.1

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


Re: [FFmpeg-devel] [PATCH] avutil/parseutils: only accept full us duration, do not accept mss duration

2018-03-08 Thread Tobias Rapp

On 08.03.2018 00:14, Hendrik Leppkes wrote:

On Thu, Mar 8, 2018 at 12:05 AM, Aurelien Jacobs  wrote:

On Wed, Mar 07, 2018 at 11:45:03PM +0100, Marton Balint wrote:



On Wed, 7 Mar 2018, Aurelien Jacobs wrote:


On Tue, Mar 06, 2018 at 01:02:48AM +0100, Marton Balint wrote:

Accepting 'u' suffix for a time specification is neither intuitive nor
consistent (now that we don't accept m).


The 'm' SI prefix is still accepted in various time options, and the 'u'
prefix is still accepted in those options even after your patch, so you
can't really argue that this patch improve consistency.
(eg. -black_min_duration 5ms is still accepted).
So this will surprise nobody that I don't like this patch.


This really is a cursed topic, I am not sure I follow, after the patch:

5ms is accepted
5us is accepted
5m is not accepted
5u is not accepted


That is only for AV_OPT_TYPE_DURATION.
All other numeric options type still accept SI prefix without unit.
This include various time options such as black_min_duration.
So after the patch, for black_min_duration:

5m is accepted
5u is accepted



Because those use AV_OPT_TYPE_DOUBLE, a generic type without any
possiblity of a unit.
Ideally those should all be transitioned to AV_OPT_TYPE_DURATION if
they refer to a time for consistency, and not the actual time-type
bend to reflect some generic type. Why would we have the duration type
if its just a copy of the double type anyway?


As a user with technical background I find it logical that 
AV_OPT_TYPE_DURATION is a superset of AV_OPT_TYPE_DOUBLE. Any 
double-formatted string is treated as a value in seconds. Additionally 
AV_OPT_TYPE_DURATION accepts HH:MM:SS formatted strings.


So I think Aurelien has a point here: Why should we enforce a unit 
suffix for AV_OPT_TYPE_DURATION and loose the superset property?


Regards,
Tobias

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


[FFmpeg-devel] [PATCH 1/1] avfilter: add panorama filter

2018-03-08 Thread Hazem Ashmawy
[PATCH 1/1] avfilter: add panorama filter

Hello there,

This is my first message and patch to ffmpeg so I'm sorry if there are any
mistaks in formating the patch or the email. It's my first time to use
git send-email too.


This patch is part of the qualification task for GSoC 2018. The project is to
write filter which will be supporting all 360 projections under the supervision
 of Paul B Mahol.

I extended Paul's filter:
https://github.com/richardpl/FFmpeg/commit/f9f6a6cc0ceb1a4e749041658b7a441696b82588

It originally supported conversion between cubemap3x2 and equirectangular
projections. I extended it in the simplest way by supporting cubemap6x1 too.
I'd be happy to extend it for more complex layouts.

Thanks,
Hazem
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/1] avfilter: add panorama filter

2018-03-08 Thread Hazem Ashmawy
Add filter to convert between various panorama projections. It supports
Equirectangular and Cubemaps (3x2 and 6x1 cubemap layouts).

commit a8d80408bd9d99542cc29f30d7e6b00771846029
Author: Hazem Ashmawy 
Date:   Thu Mar 8 10:09:36 2018 +0200

avfilter: add convertion to/from cubemap 6x1

Signed-off-by: Hazem Ashmawy 

commit f9f6a6cc0ceb1a4e749041658b7a441696b82588
Author: Paul B Mahol 
Date:   Thu Dec 3 21:15:13 2015 +0100

avfilter: add panorama filter

Signed-off-by: Paul B Mahol 

Signed-off-by: Hazem Ashmawy 
---
 libavfilter/Makefile  |   1 +
 libavfilter/allfilters.c  |   1 +
 libavfilter/vf_panorama.c | 553 ++
 3 files changed, 555 insertions(+)
 create mode 100644 libavfilter/vf_panorama.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 6a60836..06f4502 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -267,6 +267,7 @@ OBJS-$(CONFIG_OWDENOISE_FILTER)  += 
vf_owdenoise.o
 OBJS-$(CONFIG_PAD_FILTER)+= vf_pad.o
 OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o
 OBJS-$(CONFIG_PALETTEUSE_FILTER) += vf_paletteuse.o framesync.o
+OBJS-$(CONFIG_PANORAMA_FILTER)   += vf_panorama.o
 OBJS-$(CONFIG_PERMS_FILTER)  += f_perms.o
 OBJS-$(CONFIG_PERSPECTIVE_FILTER)+= vf_perspective.o
 OBJS-$(CONFIG_PHASE_FILTER)  += vf_phase.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 9adb109..2bf232c 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -276,6 +276,7 @@ static void register_all(void)
 REGISTER_FILTER(PAD,pad,vf);
 REGISTER_FILTER(PALETTEGEN, palettegen, vf);
 REGISTER_FILTER(PALETTEUSE, paletteuse, vf);
+REGISTER_FILTER(PANORAMA,   panorama,   vf);
 REGISTER_FILTER(PERMS,  perms,  vf);
 REGISTER_FILTER(PERSPECTIVE,perspective,vf);
 REGISTER_FILTER(PHASE,  phase,  vf);
diff --git a/libavfilter/vf_panorama.c b/libavfilter/vf_panorama.c
new file mode 100644
index 000..0153605
--- /dev/null
+++ b/libavfilter/vf_panorama.c
@@ -0,0 +1,553 @@
+/*
+ * 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
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/eval.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+enum Projections {
+EQUIRECTANGULAR,
+CUBEMAP_6_1,
+CUBEMAP_3_2,
+NB_PROJECTIONS,
+};
+
+enum Faces {
+LEFT,
+FRONT,
+RIGHT,
+TOP,
+BACK,
+DOWN,
+};
+
+struct XYRemap {
+int vi, ui;
+int v2, u2;
+double a, b, c, d;
+};
+
+typedef struct PanoramaContext {
+const AVClass *class;
+int in, out;
+
+int planewidth[4], planeheight[4];
+int inplanewidth[4], inplaneheight[4];
+int nb_planes;
+
+struct XYRemap *remap[4];
+
+int (*panorama)(struct PanoramaContext *s,
+const uint8_t *src, uint8_t *dst,
+int width, int height,
+int in_linesize, int out_linesize,
+const struct XYRemap *remap);
+} PanoramaContext;
+
+#define OFFSET(x) offsetof(PanoramaContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption panorama_options[] = {
+{ "input",  "set input projection",   OFFSET(in), AV_OPT_TYPE_INT,   
{.i64=EQUIRECTANGULAR}, 0, NB_PROJECTIONS-1, FLAGS, "in" },
+{ "e", "equirectangular",  0, AV_OPT_TYPE_CONST, 
{.i64=EQUIRECTANGULAR}, 0,0, FLAGS, "in" },
+{  "c6x1", "cubemap",  0, AV_OPT_TYPE_CONST, 
{.i64=CUBEMAP_6_1}, 0,0, FLAGS, "in" },
+{  "c3x2", "cubemap",  0, AV_OPT_TYPE_CONST, 
{.i64=CUBEMAP_3_2}, 0,0, FLAGS, "in" },
+{ "output", "set output projection", OFFSET(out), AV_OPT_TYPE_INT,   
{.i64=CUBEMAP_3_2}, 0, NB_PROJECTIONS-1, FLAGS, "out" },
+{ "e", "equirectangular",  0, AV_OPT_TYPE_CONST, 
{.i64=EQUIRECTANGULAR}, 0,0, FLAG

Re: [FFmpeg-devel] [PATCH 1/1] avfilter: add panorama filter

2018-03-08 Thread Paul B Mahol
On 3/8/18, Hazem Ashmawy  wrote:
> Add filter to convert between various panorama projections. It supports
> Equirectangular and Cubemaps (3x2 and 6x1 cubemap layouts).
>
> commit a8d80408bd9d99542cc29f30d7e6b00771846029
> Author: Hazem Ashmawy 
> Date:   Thu Mar 8 10:09:36 2018 +0200
>
> avfilter: add convertion to/from cubemap 6x1
>
> Signed-off-by: Hazem Ashmawy 
>
> commit f9f6a6cc0ceb1a4e749041658b7a441696b82588
> Author: Paul B Mahol 
> Date:   Thu Dec 3 21:15:13 2015 +0100
>
> avfilter: add panorama filter
>
> Signed-off-by: Paul B Mahol 
>
> Signed-off-by: Hazem Ashmawy 
> ---
>  libavfilter/Makefile  |   1 +
>  libavfilter/allfilters.c  |   1 +
>  libavfilter/vf_panorama.c | 553
> ++
>  3 files changed, 555 insertions(+)
>  create mode 100644 libavfilter/vf_panorama.c
>

OK, just had too much whitespaces inserted somehow somewhere, always
check you do not have trailing whitespaces.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avutil/parseutils: only accept full us duration, do not accept mss duration

2018-03-08 Thread Hendrik Leppkes
On Thu, Mar 8, 2018 at 9:47 AM, Tobias Rapp  wrote:
> On 08.03.2018 00:14, Hendrik Leppkes wrote:
>>
>> On Thu, Mar 8, 2018 at 12:05 AM, Aurelien Jacobs  wrote:
>>>
>>> On Wed, Mar 07, 2018 at 11:45:03PM +0100, Marton Balint wrote:



 On Wed, 7 Mar 2018, Aurelien Jacobs wrote:

> On Tue, Mar 06, 2018 at 01:02:48AM +0100, Marton Balint wrote:
>>
>> Accepting 'u' suffix for a time specification is neither intuitive nor
>> consistent (now that we don't accept m).
>
>
> The 'm' SI prefix is still accepted in various time options, and the
> 'u'
> prefix is still accepted in those options even after your patch, so you
> can't really argue that this patch improve consistency.
> (eg. -black_min_duration 5ms is still accepted).
> So this will surprise nobody that I don't like this patch.


 This really is a cursed topic, I am not sure I follow, after the patch:

 5ms is accepted
 5us is accepted
 5m is not accepted
 5u is not accepted
>>>
>>>
>>> That is only for AV_OPT_TYPE_DURATION.
>>> All other numeric options type still accept SI prefix without unit.
>>> This include various time options such as black_min_duration.
>>> So after the patch, for black_min_duration:
>>>
>>> 5m is accepted
>>> 5u is accepted
>>>
>>
>> Because those use AV_OPT_TYPE_DOUBLE, a generic type without any
>> possiblity of a unit.
>> Ideally those should all be transitioned to AV_OPT_TYPE_DURATION if
>> they refer to a time for consistency, and not the actual time-type
>> bend to reflect some generic type. Why would we have the duration type
>> if its just a copy of the double type anyway?
>
>
> As a user with technical background I find it logical that
> AV_OPT_TYPE_DURATION is a superset of AV_OPT_TYPE_DOUBLE. Any
> double-formatted string is treated as a value in seconds. Additionally
> AV_OPT_TYPE_DURATION accepts HH:MM:SS formatted strings.
>
> So I think Aurelien has a point here: Why should we enforce a unit suffix
> for AV_OPT_TYPE_DURATION and loose the superset property?
>

Because something like "3m" for a time property is ambigious and
confusing. I would personally never expect that to mean "3ms", and as
this thread has shown here, I would not be alone with that
interpretation.

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


Re: [FFmpeg-devel] [PATCH v3 0/2] libavfilter/vf_fps: Rewrite using activate callback

2018-03-08 Thread Nicolas George
Calvin Walton (2018-02-22):
> This revision of the patch fixes statistics by counting the number of
> times each frame has been output, rather than trying to guess at the
> time each frame is output whether it was a duplicate or drop.
> 
> I ended up leaving the conditional check
> if (s->status && s->frames_count == 0) {
> at the bottom of the activate function. I think I agree that the
> condition will always be true, based on the code flow, but the if
> statement documents the condition just as well as an assert would, and
> it's not like the EOF handling is in a hot path where we'd want to
> compile out the check.
> 
> Calvin Walton (2):
>   libavfilter/vf_fps: Rewrite using activate callback
>   libavfilter/vf_fps: Minor cleanups
> 
>  libavfilter/vf_fps.c | 392 
> ++-
>  1 file changed, 202 insertions(+), 190 deletions(-)

I just pushed. Thanks for the patch and sorry for the delay.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH]lavfi/drawutils: Do not claim to support P016

2018-03-08 Thread Carl Eugen Hoyos
2018-03-07 16:55 GMT+01:00, Michael Niedermayer :
> On Wed, Mar 07, 2018 at 12:41:13AM +0100, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch fixes fate on big-endian, I failed to fix drawutils for
>> P016.
>>
>> Please comment (or fix the underlying issue), Carl Eugen
>
>>  libavfilter/drawutils.c   |2 +-
>>  tests/ref/fate/filter-pixfmts-pad |1 -
>>  2 files changed, 1 insertion(+), 2 deletions(-)
>> cd8e8de7521d6f2913de7368ba028308f1070e0a
>> 0001-lavfi-drawutils-Do-not-claim-to-support-P016.patch
>> From 5254acb48a67adc10e2651c6be449e11ecd8cb74 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos 
>> Date: Wed, 7 Mar 2018 00:36:21 +0100
>> Subject: [PATCH] lavfi/drawutils: Do not claim to support P016.
>>
>> Fixes fate on big-endian.
>> ---
>>  libavfilter/drawutils.c   |2 +-
>>  tests/ref/fate/filter-pixfmts-pad |1 -
>>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> LGTM unless someone is activly working on adding support for this

Patch applied.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/movenc: keep eac3_priv around; fixes eac3 in DASH

2018-03-08 Thread Derek Buitenhuis
On 3/8/2018 5:10 AM, Rodger Combs wrote:
> ---
>  libavformat/movenc.c | 1 -
>  1 file changed, 1 deletion(-)

Er, how/why?

No info is provided in this commit message.

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


[FFmpeg-devel] [PATCH] avcodec/extract_extradata: zero initialize the padding bytes of the exported extradata

2018-03-08 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/extract_extradata_bsf.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/extract_extradata_bsf.c 
b/libavcodec/extract_extradata_bsf.c
index d40907a675..0bffe8f42c 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -114,6 +114,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, 
AVPacket *pkt,
 ret = AVERROR(ENOMEM);
 goto fail;
 }
+memset(extradata + extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
 *data = extradata;
 *size = extradata_size;
@@ -169,6 +170,7 @@ static int extract_extradata_vc1(AVBSFContext *ctx, 
AVPacket *pkt,
 return AVERROR(ENOMEM);
 
 memcpy(*data, pkt->data, extradata_size);
+memset(*data + extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 *size = extradata_size;
 
 if (s->remove) {
@@ -199,6 +201,7 @@ static int extract_extradata_mpeg12(AVBSFContext *ctx, 
AVPacket *pkt,
 return AVERROR(ENOMEM);
 
 memcpy(*data, pkt->data, *size);
+memset(*data + *size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
 if (s->remove) {
 pkt->data += *size;
@@ -228,6 +231,7 @@ static int extract_extradata_mpeg4(AVBSFContext *ctx, 
AVPacket *pkt,
 return AVERROR(ENOMEM);
 
 memcpy(*data, pkt->data, *size);
+memset(*data + *size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
 if (s->remove) {
 pkt->data += *size;
-- 
2.16.2

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


Re: [FFmpeg-devel] [PATCH 1/3] http: do not print a warning message for expired cookies

2018-03-08 Thread Carl Eugen Hoyos
2018-03-08 4:53 GMT+01:00, wm4 :
> libavformat prints a warning that the cookie couldn't be parsed (see
> callers of parse_cookie()). This is obviously not true - it could be
> parsed, but was simply ignored. Don't return an error to avoid the
> warning.
> ---
>  libavformat/http.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 344fd603cb..d7a72e7129 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -802,7 +802,7 @@ static int parse_cookie(HTTPContext *s, const char *p,
> AVDictionary **cookies)
>  // if the cookie has already expired ignore it
>  if (av_timegm(&new_tm) < av_gettime() / 100) {
>  av_dict_free(&new_params);
> -return -1;
> +return 0;

Should a warning instead be printed here?

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] http: do not print a warning message for expired cookies

2018-03-08 Thread wm4
On Thu, 8 Mar 2018 17:47:33 +0100
Carl Eugen Hoyos  wrote:

> 2018-03-08 4:53 GMT+01:00, wm4 :
> > libavformat prints a warning that the cookie couldn't be parsed (see
> > callers of parse_cookie()). This is obviously not true - it could be
> > parsed, but was simply ignored. Don't return an error to avoid the
> > warning.
> > ---
> >  libavformat/http.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/http.c b/libavformat/http.c
> > index 344fd603cb..d7a72e7129 100644
> > --- a/libavformat/http.c
> > +++ b/libavformat/http.c
> > @@ -802,7 +802,7 @@ static int parse_cookie(HTTPContext *s, const char *p,
> > AVDictionary **cookies)
> >  // if the cookie has already expired ignore it
> >  if (av_timegm(&new_tm) < av_gettime() / 100) {
> >  av_dict_free(&new_params);
> > -return -1;
> > +return 0;  
> 
> Should a warning instead be printed here?

I don't think so - the warning is annoying when you save cookies from
an earlier HTTP request, which have a an expiry date very close to the
current time. Effectively this would make ffmpeg print useless messages.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] avformat/oggparsedaala: Do not adjust AV_NOPTS_VALUE

2018-03-08 Thread Michael Niedermayer
Fixes: potential signed integer overflow

Signed-off-by: Michael Niedermayer 
---
 libavformat/oggparsedaala.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c
index a373b41b4c..e944470aca 100644
--- a/libavformat/oggparsedaala.c
+++ b/libavformat/oggparsedaala.c
@@ -218,6 +218,7 @@ static int daala_packet(AVFormatContext *s, int idx)
 int seg, duration = 1;
 struct ogg *ogg = s->priv_data;
 struct ogg_stream *os = ogg->streams + idx;
+int64_t pts;
 
 /*
  * first packet handling: here we parse the duration of each packet in the
@@ -230,7 +231,10 @@ static int daala_packet(AVFormatContext *s, int idx)
 if (os->segments[seg] < 255)
 duration++;
 
-os->lastpts = os->lastdts = daala_gptopts(s, idx, os->granule, NULL) - 
duration;
+pts = daala_gptopts(s, idx, os->granule, NULL);
+if (pts != AV_NOPTS_VALUE)
+pts -= duration;
+os->lastpts = os->lastdts = pts;
 if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
 s->streams[idx]->start_time = os->lastpts;
 if (s->streams[idx]->duration != AV_NOPTS_VALUE)
-- 
2.16.2

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


[FFmpeg-devel] [PATCH 1/2] avformat/oggparsetheora: Do not adjust AV_NOPTS_VALUE

2018-03-08 Thread Michael Niedermayer
Fixes: Chromium bug 795653
Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented 
in type 'long'
Reported-by: Matt Wolenetz 

Signed-off-by: Michael Niedermayer 
---
 libavformat/oggparsetheora.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c
index b14f9f0669..b0c0edc7a5 100644
--- a/libavformat/oggparsetheora.c
+++ b/libavformat/oggparsetheora.c
@@ -181,6 +181,7 @@ static int theora_packet(AVFormatContext *s, int idx)
 
 if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & 
OGG_FLAG_EOS)) {
 int seg;
+int64_t pts;
 
 duration = 1;
 for (seg = os->segp; seg < os->nsegs; seg++) {
@@ -188,7 +189,10 @@ static int theora_packet(AVFormatContext *s, int idx)
 duration ++;
 }
 
-os->lastpts = os->lastdts   = theora_gptopts(s, idx, os->granule, 
NULL) - duration;
+pts = theora_gptopts(s, idx, os->granule, NULL);
+if (pts != AV_NOPTS_VALUE)
+pts -= duration;
+os->lastpts = os->lastdts = pts;
 if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
 s->streams[idx]->start_time = os->lastpts;
 if (s->streams[idx]->duration > 0)
-- 
2.16.2

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


[FFmpeg-devel] [PATCH]download: Use git.ffmpeg.org to browse repository

2018-03-08 Thread Carl Eugen Hoyos
Hi!

Is there a reason why we point users to another website to browse the
FFmpeg repository?

Carl Eugen
From 36be2bb8ceaa5d564e999aa6c748d826ebfe757b Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Thu, 8 Mar 2018 23:35:29 +0100
Subject: [PATCH] download: Use git.ffmpeg.org to browse repository.

---
 src/download |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/download b/src/download
index 6783c35..b03e3d0 100644
--- a/src/download
+++ b/src/download
@@ -143,7 +143,7 @@
   
   Snapshot
   
-https://github.com/FFmpeg/FFmpeg"; class="btn btn-success">
+https://git.ffmpeg.org/gitweb/ffmpeg.git"; class="btn btn-success">
   Browse
 
   
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [PATCH]download: Use git.ffmpeg.org to browse repository

2018-03-08 Thread Lou Logan
On Thu, 8 Mar 2018 23:37:19 +0100
Carl Eugen Hoyos  wrote:
> Hi!
> 
> Is there a reason why we point users to another website to browse the
> FFmpeg repository?

My guess is fa2da62:
src/download: use a https based link for main "Browse" button

But git.ffmpeg.org now has HTTPS so it's a moot point.

> Carl Eugen
> From 36be2bb8ceaa5d564e999aa6c748d826ebfe757b Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos 
> Date: Thu, 8 Mar 2018 23:35:29 +0100
> Subject: [PATCH] download: Use git.ffmpeg.org to browse repository.
> 
> ---
>  src/download |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/download b/src/download
> index 6783c35..b03e3d0 100644
> --- a/src/download
> +++ b/src/download
> @@ -143,7 +143,7 @@
>
>Snapshot
>    
> -https://github.com/FFmpeg/FFmpeg"; class="btn 
> btn-success">
> +https://git.ffmpeg.org/gitweb/ffmpeg.git"; class="btn 
> btn-success">
>Browse
>  
>

Fine with me.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]download: Use git.ffmpeg.org to browse repository

2018-03-08 Thread wm4
On Thu, 8 Mar 2018 23:37:19 +0100
Carl Eugen Hoyos  wrote:

> Hi!
> 
> Is there a reason why we point users to another website to browse the
> FFmpeg repository?

I didn't even know about it. Can someone make http://git.ffmpeg.org
redirect to this as well, instead of having it return 403?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]download: Use git.ffmpeg.org to browse repository

2018-03-08 Thread Lou Logan
On Thu, Mar 8, 2018, at 2:09 PM, wm4 wrote:
> I didn't even know about it. Can someone make http://git.ffmpeg.org
> redirect to this as well, instead of having it return 403?

While we're at it redirecting the http *.ffmpeg.org to https would be nice too.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/movenc : Change MOV_TIMESCALE from 1000 to 600

2018-03-08 Thread Mark Burton
From 9c3cb06bb869e33daaf0c0dacfb4fa66d18a5722 Mon Sep 17 00:00:00 2001
From: mwjburton 
Date: Thu, 8 Mar 2018 22:58:31 +
Subject: [PATCH] libavformat/movenc : Change MOV_TIMESCALE from 1000 to 600

Changing the MOV_TIMESCALE value from 1000 to 600 results in
files that seek accurately in professional Quicktime software. This is
due to the fact 600 is cleanly divisible by more frame rates than 1000, for
example 24fps and 30fps. The Quicktime specification default is set to 600
for this reason. When set to 1000 seeking can be inaccurate for these fame
rates.

---
 libavformat/movenc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index ca2a9c9722..b7fc2c029d 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -29,7 +29,7 @@
 
 #define MOV_FRAG_INFO_ALLOC_INCREMENT 64
 #define MOV_INDEX_CLUSTER_SIZE 1024
-#define MOV_TIMESCALE 1000
+#define MOV_TIMESCALE 600
 
 #define RTP_MAX_PACKET_SIZE 1450
 
-- 
2.16.2
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]download: Use git.ffmpeg.org to browse repository

2018-03-08 Thread James Almer
On 3/8/2018 8:14 PM, Lou Logan wrote:
> On Thu, Mar 8, 2018, at 2:09 PM, wm4 wrote:
>> I didn't even know about it. Can someone make http://git.ffmpeg.org
>> redirect to this as well, instead of having it return 403?
> 
> While we're at it redirecting the http *.ffmpeg.org to https would be nice 
> too.

It also needs to serve the nv-codec-headers repository.

For being the "main" git server, it's kinda lacking compared to the
videolan hosted one.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avformat/mxfdec: use binary search in mxf_absolute_bodysid_offset

2018-03-08 Thread Marton Balint



On Mon, 5 Mar 2018, Marton Balint wrote:




On Sun, 4 Mar 2018, Tomas Härdin wrote:


tor 2018-03-01 klockan 22:41 +0100 skrev Marton Balint:

> Signed-off-by: Marton Balint 
---
 libavformat/mxfdec.c | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index d4291f5dc7..70091e0dc9 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1347,24 +1347,30 @@ static int 

mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segment

  */
 static int mxf_absolute_bodysid_offset(MXFContext *mxf, int body_sid, 

int64_t offset, int64_t *offset_out)

 {
-int x;
 MXFPartition *last_p = NULL;
+int a, b, m, m0;
 
 if (offset < 0)
 return AVERROR(EINVAL);
 
-for (x = 0; x < mxf->partitions_count; x++) {
-MXFPartition *p = &mxf->partitions[x];
+a = -1;


I've got a bad feeling about this -1


There is an explicit check after the loop when we actually use the value 
of 'a' to see if it remained -1 or not. Other than that using this 
construct (a = -1, b = count) is also used in other places throughout the 
codebase for binary search.





+b = mxf->partitions_count;
 
-if (p->body_sid != body_sid)
-continue;
+while (b - a > 1) {
+m0 = m = (a + b) >> 1;


Could overflow with a specially crafted file. But I guess it would have
to be on the order of 1 TiB.


I guess we could limit the number of partitions to INT_MAX / 2, although 
it really needs a *huge* crafted file and parsing it would probably take 
ages for the demuxer anyway...




It also looks like this might behave incorrectly when a=-1, b=0


That can't happen as the loop condition would be false in that case.



Will push this soon.

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


Re: [FFmpeg-devel] [PATCH] avutil/parseutils: only accept full us duration, do not accept mss duration

2018-03-08 Thread Marton Balint



On Thu, 8 Mar 2018, Hendrik Leppkes wrote:


On Thu, Mar 8, 2018 at 9:47 AM, Tobias Rapp  wrote:

On 08.03.2018 00:14, Hendrik Leppkes wrote:


On Thu, Mar 8, 2018 at 12:05 AM, Aurelien Jacobs  wrote:


On Wed, Mar 07, 2018 at 11:45:03PM +0100, Marton Balint wrote:




On Wed, 7 Mar 2018, Aurelien Jacobs wrote:


On Tue, Mar 06, 2018 at 01:02:48AM +0100, Marton Balint wrote:


Accepting 'u' suffix for a time specification is neither intuitive nor
consistent (now that we don't accept m).



The 'm' SI prefix is still accepted in various time options, and the
'u'
prefix is still accepted in those options even after your patch, so you
can't really argue that this patch improve consistency.
(eg. -black_min_duration 5ms is still accepted).
So this will surprise nobody that I don't like this patch.



This really is a cursed topic, I am not sure I follow, after the patch:

5ms is accepted
5us is accepted
5m is not accepted
5u is not accepted



That is only for AV_OPT_TYPE_DURATION.
All other numeric options type still accept SI prefix without unit.
This include various time options such as black_min_duration.
So after the patch, for black_min_duration:

5m is accepted
5u is accepted



Because those use AV_OPT_TYPE_DOUBLE, a generic type without any
possiblity of a unit.
Ideally those should all be transitioned to AV_OPT_TYPE_DURATION if
they refer to a time for consistency, and not the actual time-type
bend to reflect some generic type. Why would we have the duration type
if its just a copy of the double type anyway?



As a user with technical background I find it logical that
AV_OPT_TYPE_DURATION is a superset of AV_OPT_TYPE_DOUBLE. Any
double-formatted string is treated as a value in seconds. Additionally
AV_OPT_TYPE_DURATION accepts HH:MM:SS formatted strings.

So I think Aurelien has a point here: Why should we enforce a unit suffix
for AV_OPT_TYPE_DURATION and loose the superset property?



Because something like "3m" for a time property is ambigious and
confusing. I would personally never expect that to mean "3ms", and as
this thread has shown here, I would not be alone with that
interpretation.


Ok, it seems there is no consensus/decision, but keeping it how it is 
locks us in accepting the prefix-only variants because of compatibility. 
So I will push this soon unless I get an explicit reject from somebody.


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


Re: [FFmpeg-devel] [PATCH v4] avformat/pcm: decrease delay when reading PCM streams.

2018-03-08 Thread Michael Niedermayer
On Wed, Mar 07, 2018 at 03:30:37PM +0100, Philipp M. Scholl wrote:
>  Here is the fourth version of the PCM patch with updated testcases.
> 
>  The blocksize of the PCM decoder is hard-coded. This creates
> unnecessary delay when reading low-rate (<100Hz) streams. This creates
> issues when multiplexing multiple streams, since other inputs are only
> opened/read after a low-rate input block was completely read.
> 
>  This patch decreases the blocksize for low-rate inputs, so
> approximately a block is read every 40ms. This decreases the startup
> delay when multiplexing inputs with different rates.
> 
> Signed-off-by: Philipp M. Scholl 
> ---
>  libavformat/pcm.c | 16 
>  tests/ref/seek/lavf-alaw  | 42 +-
>  tests/ref/seek/lavf-mulaw | 42 +-
>  3 files changed, 54 insertions(+), 46 deletions(-)
> 
> diff --git a/libavformat/pcm.c b/libavformat/pcm.c
> index 806f91b6b..1ea15a9e8 100644
> --- a/libavformat/pcm.c
> +++ b/libavformat/pcm.c
> @@ -28,13 +28,21 @@
>  
>  int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
>  {
> -int ret, size;
> +int ret, size = INT_MAX;
> +AVCodecParameters *par = s->streams[0]->codecpar;
>  
> -size= RAW_SAMPLES*s->streams[0]->codecpar->block_align;
> -if (size <= 0)
> +if (par->block_align <= 0)
>  return AVERROR(EINVAL);
>  
> -ret= av_get_packet(s->pb, pkt, size);
> +/*
> + * Compute read size to complete a read every 40ms.  Clamp to 
> RAW_SAMPLES if
> + * larger. Use power of two as readsize for I/O efficiency.
> + */

> +size = FFMAX(par->sample_rate/25, 1);

division is a bit slowish, and this is done per (small) packet.
Maybe a >>4 or >>5 could be used ? (this is a minor issue)


> +size = FFMIN(size, RAW_SAMPLES) * par->block_align;
> +size = 1 << ff_log2(size);
> +
> +ret = av_get_packet(s->pb, pkt, size);

what if block_align is not a power of 2?

for example with 6 channels there could be a reasonable block size
that is not a multiple of 2.
or am i missing something ?
[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


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


Re: [FFmpeg-devel] [PATCH] libavfilter/vf_convolution_opencl.c: add opencl version of libavfilter/convolution.c filter

2018-03-08 Thread Mark Thompson
On 07/03/18 22:32, Danil Iashchenko wrote:
> ---
>  configure   |   1 +
>  libavfilter/Makefile|   2 +
>  libavfilter/allfilters.c|   1 +
>  libavfilter/opencl/convolution.cl   |  80 
>  libavfilter/opencl_source.h |   2 +
>  libavfilter/vf_convolution_opencl.c | 374 
> 
>  6 files changed, 460 insertions(+)
>  create mode 100644 libavfilter/opencl/convolution.cl
>  create mode 100644 libavfilter/vf_convolution_opencl.c

Nice!  Works well for me on Beignet, I'll try to have a go with some other 
implementations in the next few days.

Review comments follow.

Thanks,

- Mark


> diff --git a/configure b/configure
> index 6916b45..7c79e20 100755
> --- a/configure
> +++ b/configure
> @@ -3212,6 +3212,7 @@ bs2b_filter_deps="libbs2b"
>  colormatrix_filter_deps="gpl"
>  convolve_filter_deps="avcodec"
>  convolve_filter_select="fft"
> +convolution_opencl_filter_deps="opencl"
>  coreimage_filter_deps="coreimage appkit"
>  coreimage_filter_extralibs="-framework OpenGL"
>  coreimagesrc_filter_deps="coreimage appkit"
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 6a60836..f288f8e 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -156,6 +156,8 @@ OBJS-$(CONFIG_COLORLEVELS_FILTER)+= 
> vf_colorlevels.o
>  OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o
>  OBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o 
> colorspacedsp.o
>  OBJS-$(CONFIG_CONVOLUTION_FILTER)+= vf_convolution.o
> +OBJS-$(CONFIG_CONVOLUTION_OPENCL_FILTER) += vf_convolution_opencl.o 
> opencl.o \

Funny spacing?

> +opencl/convolution.o
>  OBJS-$(CONFIG_CONVOLVE_FILTER)   += vf_convolve.o framesync.o
>  OBJS-$(CONFIG_COPY_FILTER)   += vf_copy.o
>  OBJS-$(CONFIG_COREIMAGE_FILTER)  += vf_coreimage.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 9adb109..f2dc55e 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -166,6 +166,7 @@ static void register_all(void)
>  REGISTER_FILTER(COLORMATRIX,colormatrix,vf);
>  REGISTER_FILTER(COLORSPACE, colorspace, vf);
>  REGISTER_FILTER(CONVOLUTION,convolution,vf);
> +REGISTER_FILTER(CONVOLUTION_OPENCL, convolution_opencl, vf);
>  REGISTER_FILTER(CONVOLVE,   convolve,   vf);
>  REGISTER_FILTER(COPY,   copy,   vf);
>  REGISTER_FILTER(COREIMAGE,  coreimage,  vf);
> diff --git a/libavfilter/opencl/convolution.cl 
> b/libavfilter/opencl/convolution.cl
> new file mode 100644
> index 000..5bc5839
> --- /dev/null
> +++ b/libavfilter/opencl/convolution.cl
> @@ -0,0 +1,80 @@
> +/*
> + * 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
> + */
> +
> +__kernel void convolution_global(__write_only image2d_t dst,
> + __read_only  image2d_t src,
> + int coef_matrix_size,
> + __constant float *coef_matrix,
> + float div,
> + float bias)
> +{
> +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE | 
> CLK_FILTER_NEAREST);
> +
> +const int half_matrix_size = (coef_matrix_size / 2);
> +int2 loc = (int2)(get_global_id(0), get_global_id(1));
> +float4 convPix = (float4)(0.0f, 0.0f, 0.0f, 0.0f);
> +
> +for (int conv_i = -half_matrix_size; conv_i <= half_matrix_size; 
> conv_i++) {
> +for (int conv_j = -half_matrix_size; conv_j <= half_matrix_size; 
> conv_j++) {
> +float4 px = read_imagef(src, sampler, loc + (int2)(conv_j, 
> conv_i));
> +convPix += px * 
> coef_matrix[(conv_i+1)*coef_matrix_size+(conv_j+1)];
> +}
> + }
> + write_imagef(dst, loc, convPix * div + bias);
> +}

Looks good.

> +__kernel void convolution_local(__write_only image2d_t dst,
> + __read_only  image2d_t src,
> + int coef_matrix_size,
> + __constant float *coef_matrix,
> +  

[FFmpeg-devel] [PATCH] vf_unsharp_opencl: Do not apply kernel to locations outside images

2018-03-08 Thread Mark Thompson
---
(Oops.)


 libavfilter/vf_unsharp_opencl.c | 24 
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_unsharp_opencl.c b/libavfilter/vf_unsharp_opencl.c
index 6a453c014b..3ee1b5b4ae 100644
--- a/libavfilter/vf_unsharp_opencl.c
+++ b/libavfilter/vf_unsharp_opencl.c
@@ -236,6 +236,7 @@ static int unsharp_opencl_filter_frame(AVFilterLink 
*inlink, AVFrame *input)
 size_t global_work[2];
 size_t local_work[2];
 cl_mem src, dst;
+size_t plane_width, plane_height;
 int err, p;
 
 av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
@@ -268,6 +269,21 @@ static int unsharp_opencl_filter_frame(AVFilterLink 
*inlink, AVFrame *input)
 if (!dst)
 break;
 
+cle = clGetImageInfo(src, CL_IMAGE_WIDTH,
+ sizeof(plane_width), &plane_width, NULL);
+if (cle != CL_SUCCESS) {
+av_log(avctx, AV_LOG_ERROR, "Failed to get plane %d "
+   "width: %d.\n", p, cle);
+goto fail;
+}
+cle = clGetImageInfo(src, CL_IMAGE_HEIGHT,
+ sizeof(plane_height), &plane_height, NULL);
+if (cle != CL_SUCCESS) {
+av_log(avctx, AV_LOG_ERROR, "Failed to get plane %d "
+   "height: %d.\n", p, cle);
+goto fail;
+}
+
 cle = clSetKernelArg(ctx->kernel, 0, sizeof(cl_mem), &dst);
 if (cle != CL_SUCCESS) {
 av_log(avctx, AV_LOG_ERROR, "Failed to set kernel "
@@ -321,11 +337,11 @@ static int unsharp_opencl_filter_frame(AVFilterLink 
*inlink, AVFrame *input)
 }
 
 if (ctx->global) {
-global_work[0] = output->width;
-global_work[1] = output->height;
+global_work[0] = plane_width;
+global_work[1] = plane_height;
 } else {
-global_work[0] = FFALIGN(output->width,  16);
-global_work[1] = FFALIGN(output->height, 16);
+global_work[0] = FFALIGN(plane_width,  16);
+global_work[1] = FFALIGN(plane_height, 16);
 local_work[0]  = 16;
 local_work[1]  = 16;
 }
-- 
2.16.1
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter: add panorama filter

2018-03-08 Thread Hazem Ashmawy
[PATCH] avfilter: add panorama filter

Sorry about that! I removed them now.
For the future, any recommendation for a tool for linting / checking formating
rules?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter: add panorama filter

2018-03-08 Thread Hazem Ashmawy
Add filter to convert between various panorama projections. It supports
Equirectangular and Cubemaps (3x2 and 6x1 cubemap layouts).

commit a8d80408bd9d99542cc29f30d7e6b00771846029
Author: Hazem Ashmawy 
Date:   Thu Mar 8 10:09:36 2018 +0200

avfilter: add convertion to/from cubemap 6x1

Signed-off-by: Hazem Ashmawy 

commit f9f6a6cc0ceb1a4e749041658b7a441696b82588
Author: Paul B Mahol 
Date:   Thu Dec 3 21:15:13 2015 +0100

avfilter: add panorama filter

Signed-off-by: Paul B Mahol 

Signed-off-by: Hazem Ashmawy 
---
 libavfilter/Makefile  |   1 +
 libavfilter/allfilters.c  |   1 +
 libavfilter/vf_panorama.c | 553 ++
 3 files changed, 555 insertions(+)
 create mode 100644 libavfilter/vf_panorama.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 6a60836..06f4502 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -267,6 +267,7 @@ OBJS-$(CONFIG_OWDENOISE_FILTER)  += 
vf_owdenoise.o
 OBJS-$(CONFIG_PAD_FILTER)+= vf_pad.o
 OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o
 OBJS-$(CONFIG_PALETTEUSE_FILTER) += vf_paletteuse.o framesync.o
+OBJS-$(CONFIG_PANORAMA_FILTER)   += vf_panorama.o
 OBJS-$(CONFIG_PERMS_FILTER)  += f_perms.o
 OBJS-$(CONFIG_PERSPECTIVE_FILTER)+= vf_perspective.o
 OBJS-$(CONFIG_PHASE_FILTER)  += vf_phase.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 9adb109..2bf232c 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -276,6 +276,7 @@ static void register_all(void)
 REGISTER_FILTER(PAD,pad,vf);
 REGISTER_FILTER(PALETTEGEN, palettegen, vf);
 REGISTER_FILTER(PALETTEUSE, paletteuse, vf);
+REGISTER_FILTER(PANORAMA,   panorama,   vf);
 REGISTER_FILTER(PERMS,  perms,  vf);
 REGISTER_FILTER(PERSPECTIVE,perspective,vf);
 REGISTER_FILTER(PHASE,  phase,  vf);
diff --git a/libavfilter/vf_panorama.c b/libavfilter/vf_panorama.c
new file mode 100644
index 000..de08ef4
--- /dev/null
+++ b/libavfilter/vf_panorama.c
@@ -0,0 +1,553 @@
+/*
+ * 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
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/eval.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+enum Projections {
+EQUIRECTANGULAR,
+CUBEMAP_6_1,
+CUBEMAP_3_2,
+NB_PROJECTIONS,
+};
+
+enum Faces {
+LEFT,
+FRONT,
+RIGHT,
+TOP,
+BACK,
+DOWN,
+};
+
+struct XYRemap {
+int vi, ui;
+int v2, u2;
+double a, b, c, d;
+};
+
+typedef struct PanoramaContext {
+const AVClass *class;
+int in, out;
+
+int planewidth[4], planeheight[4];
+int inplanewidth[4], inplaneheight[4];
+int nb_planes;
+
+struct XYRemap *remap[4];
+
+int (*panorama)(struct PanoramaContext *s,
+const uint8_t *src, uint8_t *dst,
+int width, int height,
+int in_linesize, int out_linesize,
+const struct XYRemap *remap);
+} PanoramaContext;
+
+#define OFFSET(x) offsetof(PanoramaContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption panorama_options[] = {
+{ "input",  "set input projection",   OFFSET(in), AV_OPT_TYPE_INT,   
{.i64=EQUIRECTANGULAR}, 0, NB_PROJECTIONS-1, FLAGS, "in" },
+{ "e", "equirectangular",  0, AV_OPT_TYPE_CONST, 
{.i64=EQUIRECTANGULAR}, 0,0, FLAGS, "in" },
+{  "c6x1", "cubemap",  0, AV_OPT_TYPE_CONST, 
{.i64=CUBEMAP_6_1}, 0,0, FLAGS, "in" },
+{  "c3x2", "cubemap",  0, AV_OPT_TYPE_CONST, 
{.i64=CUBEMAP_3_2}, 0,0, FLAGS, "in" },
+{ "output", "set output projection", OFFSET(out), AV_OPT_TYPE_INT,   
{.i64=CUBEMAP_3_2}, 0, NB_PROJECTIONS-1, FLAGS, "out" },
+{ "e", "equirectangular",  0, AV_OPT_TYPE_CONST, 
{.i64=EQUIRECTANGULAR}, 0,0, FLAG

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

2018-03-08 Thread James Almer
On 3/8/2018 9:50 PM, Hazem Ashmawy wrote:
> [PATCH] avfilter: add panorama filter
> 
> Sorry about that! I removed them now.
> For the future, any recommendation for a tool for linting / checking formating
> rules?

There's tools/patcheck. Feed it a git format-patch style of patch to
find common issues, but keep in mind it can generate a lot of false
positives.

I don't know if we have documentation about actual formatting rules
anywhere.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-08 Thread Michael Niedermayer
On Mon, Mar 05, 2018 at 05:09:04PM +0100, Sven Dueking wrote:
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> > von Sven Dueking
> > Gesendet: Dienstag, 27. Februar 2018 08:27
> > An: 'FFmpeg development discussions and patches'
> > Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > Open SRT protocol
> > 
> > 
> > 
> > > -Ursprüngliche Nachricht-
> > > Von: Sven Dueking [mailto:s...@nablet.com]
> > > Gesendet: Mittwoch, 21. Februar 2018 15:25
> > > An: 'FFmpeg development discussions and patches'
> > > Betreff: AW: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > > Open SRT protocol
> > >
> > >
> > >
> > > > -Ursprüngliche Nachricht-
> > > > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> > > > Auftrag von Michael Niedermayer
> > > > Gesendet: Mittwoch, 21. Februar 2018 14:35
> > > > An: FFmpeg development discussions and patches
> > > > Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > > > Open SRT protocol
> > > >
> > > > On Wed, Feb 21, 2018 at 10:16:48AM +0100, Sven Dueking wrote:
> > > > > protocol requires libsrt (https://github.com/Haivision/srt) to be
> > > > > installed
> > > > >
> > > > > Signed-off-by: Sven Dueking 
> > > > > ---
> > > > >  MAINTAINERS |   1 +
> > > > >  configure   |   5 +
> > > > >  doc/protocols.texi  | 134 ++-
> > > > >  libavformat/Makefile|   1 +
> > > > >  libavformat/opensrt.c   | 589
> > > > > 
> > > > >  libavformat/protocols.c |   1 +
> > > > >  6 files changed, 730 insertions(+), 1 deletion(-)  create mode
> > > > > 100644 libavformat/opensrt.c
> > > > >
> > > > > diff --git a/MAINTAINERS b/MAINTAINERS index b691bd5..3e0355a
> > > 100644
> > > > > --- a/MAINTAINERS
> > > > > +++ b/MAINTAINERS
> > > > > @@ -499,6 +499,7 @@ Protocols:
> > > > >http.cRonald S. Bultje
> > > > >libssh.c  Lukasz Marek
> > > > >mms*.cRonald S. Bultje
> > > > > +  opensrt.c sven Dueking
> > > > >udp.c Luca Abeni
> > > > >icecast.c Marvin Scholz
> > > > >
> > > > > diff --git a/configure b/configure index 013308c..9a78bae 100755
> > > > > --- a/configure
> > > > > +++ b/configure
> > > > > @@ -294,6 +294,7 @@ External library support:
> > > > >--enable-opengl  enable OpenGL rendering [no]
> > > > >--enable-openssl enable openssl, needed for https
> > > support
> > > > > if gnutls or libtls is not used [no]
> > > > > +  --enable-opensrt enable Haivision Open SRT protocol
> > [no]
> > > > >--disable-sndio  disable sndio support [autodetect]
> > > > >--disable-schannel   disable SChannel SSP, needed for TLS
> > > support
> > > > on
> > > > > Windows if openssl and gnutls are not
> > > > > used [autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
> > > > >  mediacodec
> > > > >  openal
> > > > >  opengl
> > > > > +opensrt
> > > >
> > > > there is something wrong with newlines this patch is corrupted and
> > > > cannot be tested or applied
> > > >
> > > > [...]
> > >
> > > Hi Michael,
> > >
> > > Sorry, no idea why this happens. Patch attached.
> > 
> > Ping ?!
> > 
> > >
> > > > --
> > > > Michael GnuPG fingerprint:
> > > 9FF2128B147EF6730BADF133611EC787040B0FAB
> > > >
> > > > Rewriting code that is poorly written but fully understood is good.
> > > > Rewriting code that one doesnt understand is a sign that one is
> > less
> > > > smart then the original author, trying to rewrite it will not make
> > > > it
> > > better.
> > 
> 
> Any chance to get feedback ? 

is anyone working on a review of this patch or intends to review it ?

If not i intend to push it after a light review (i think there are
other people around who are more qualified to review this than i am)

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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


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

2018-03-08 Thread wm4
On Thu, 8 Mar 2018 21:53:48 -0300
James Almer  wrote:

> On 3/8/2018 9:50 PM, Hazem Ashmawy wrote:
> > [PATCH] avfilter: add panorama filter
> > 
> > Sorry about that! I removed them now.
> > For the future, any recommendation for a tool for linting / checking 
> > formating
> > rules?  
> 
> There's tools/patcheck. Feed it a git format-patch style of patch to
> find common issues, but keep in mind it can generate a lot of false
> positives.
> 
> I don't know if we have documentation about actual formatting rules
> anywhere.

Also:

<_jamrial> shouldn't that panorama filter sent to the ml use the spherical 
frame side data?

I think so.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/movenc : Change MOV_TIMESCALE from 1000 to 600

2018-03-08 Thread Carl Eugen Hoyos
2018-03-09 0:26 GMT+01:00, Mark Burton :
> From 9c3cb06bb869e33daaf0c0dacfb4fa66d18a5722 Mon Sep 17 00:00:00 2001
> From: mwjburton 
> Date: Thu, 8 Mar 2018 22:58:31 +
> Subject: [PATCH] libavformat/movenc : Change MOV_TIMESCALE from 1000 to 600
>
> Changing the MOV_TIMESCALE value from 1000 to 600 results in
> files that seek accurately in professional Quicktime software. This is
> due to the fact 600 is cleanly divisible by more frame rates than 1000, for
> example 24fps and 30fps. The Quicktime specification default is set to 600
> for this reason. When set to 1000 seeking can be inaccurate for these fame
> rates.
>
> ---
>  libavformat/movenc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/movenc.h b/libavformat/movenc.h
> index ca2a9c9722..b7fc2c029d 100644
> --- a/libavformat/movenc.h
> +++ b/libavformat/movenc.h
> @@ -29,7 +29,7 @@
>
>  #define MOV_FRAG_INFO_ALLOC_INCREMENT 64
>  #define MOV_INDEX_CLUSTER_SIZE 1024
> -#define MOV_TIMESCALE 1000
> +#define MOV_TIMESCALE 600

This breaks fate, our regression testing suite (my mistake).
To download the test-suite:
$ make SAMPLES=fate-suite fate-rsync
$ make SAMPLES=fate-suite GEN=1 fate
This changes the values for fate, then commit again with:
$ git commit tests libavformat

Sorry, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/3] avformat/avidec: Fix integer overflow in cum_len check

2018-03-08 Thread Michael Niedermayer
Fixes: signed integer overflow: 3775922176 * 4278190080 cannot be represented 
in type 'long'
Fixes: Chromium bug 791237

Reported-by: Matt Wolenetz 
Reviewed-by: Matt Wolenetz 
Signed-off-by: Michael Niedermayer 
---
 libavformat/avidec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3ff515d492..bafe1dc8da 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -670,7 +670,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 st->start_time = 0;
 avio_rl32(pb); /* buffer size */
 avio_rl32(pb); /* quality */
-if (ast->cum_len*ast->scale/ast->rate > 3600) {
+if (ast->cum_len > 3600LL * ast->rate / ast->scale) {
 av_log(s, AV_LOG_ERROR, "crazy start time, iam scared, giving 
up\n");
 ast->cum_len = 0;
 }
-- 
2.16.2

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


[FFmpeg-devel] [PATCH 3/3] avformat/oggparseogm: Check lb against psize

2018-03-08 Thread Michael Niedermayer
No testcase, this was found during code review

Found-by: Matt Wolenetz 

Signed-off-by: Michael Niedermayer 
---
 libavformat/oggparseogm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index 4b4edf26ca..a07453760b 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -176,6 +176,9 @@ ogm_packet(AVFormatContext *s, int idx)
 os->pflags |= AV_PKT_FLAG_KEY;
 
 lb = ((*p & 2) << 1) | ((*p >> 6) & 3);
+if (os->psize < lb + 1)
+return AVERROR_INVALIDDATA;
+
 os->pstart += lb + 1;
 os->psize -= lb + 1;
 
-- 
2.16.2

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


[FFmpeg-devel] [PATCH 2/3] avformat/oggparseogm: Fix undefined shift in ogm_packet()

2018-03-08 Thread Michael Niedermayer
Fixes: shift exponent 48 is too large for 32-bit type 'int'
Fixes: Chromium bug 786793
Reported-by: Matt Wolenetz 
Reviewed-by: Matt Wolenetz 
Signed-off-by: Michael Niedermayer 
---
 libavformat/oggparseogm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index ca6b62669d..4b4edf26ca 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -180,7 +180,7 @@ ogm_packet(AVFormatContext *s, int idx)
 os->psize -= lb + 1;
 
 while (lb--)
-os->pduration += p[lb+1] << (lb*8);
+os->pduration += (uint64_t)p[lb+1] << (lb*8);
 
 return 0;
 }
-- 
2.16.2

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


Re: [FFmpeg-devel] Fix stts_data memory allocation

2018-03-08 Thread Michael Niedermayer
On Tue, Mar 06, 2018 at 02:24:51PM -0800, Xiaohan Wang (王消寒) wrote:
> kingly ping!

will apply

thx

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH 7/7] avcodec/ffv1enc: remove warning about transparency

2018-03-08 Thread Michael Niedermayer
On Wed, Mar 07, 2018 at 05:05:29PM +0100, Jerome Martinez wrote:
> The message about the need of a recent FFmpeg version when encoding alpha
> plane is 5+ year old, not really relevant anymore.
> 
> This patch removes the message.

>  ffv1enc.c |3 ---
>  1 file changed, 3 deletions(-)
> 180adaf36af61949c1a73b3358d417580d8fcec4  
> 0007-avcodec-ffv1enc-remove-warning-about-transparency.patch
> From 8e3bbad708b5a3a24920133c5bef0b7399375393 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> Date: Wed, 7 Mar 2018 13:26:36 +0100
> Subject: [PATCH 7/7] avcodec/ffv1enc: remove warning about transparency
> 
> ---
>  libavcodec/ffv1enc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
> index f0f9eaba79..c6e11a3f55 100644
> --- a/libavcodec/ffv1enc.c
> +++ b/libavcodec/ffv1enc.c
> @@ -699,9 +699,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  s->ac = AC_RANGE_CUSTOM_TAB;
>  }
>  }
> -if (s->transparency) {
> -av_log(avctx, AV_LOG_WARNING, "Storing alpha plane, this will 
> require a recent FFV1 decoder to playback!\n");
> -}

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott



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


Re: [FFmpeg-devel] [PATCH] vf_unsharp_opencl: Do not apply kernel to locations outside images

2018-03-08 Thread Jun Zhao


On 2018/3/9 8:47, Mark Thompson wrote:
> ---
> (Oops.)
>
>
>  libavfilter/vf_unsharp_opencl.c | 24 
>  1 file changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/libavfilter/vf_unsharp_opencl.c b/libavfilter/vf_unsharp_opencl.c
> index 6a453c014b..3ee1b5b4ae 100644
> --- a/libavfilter/vf_unsharp_opencl.c
> +++ b/libavfilter/vf_unsharp_opencl.c
> @@ -236,6 +236,7 @@ static int unsharp_opencl_filter_frame(AVFilterLink 
> *inlink, AVFrame *input)
>  size_t global_work[2];
>  size_t local_work[2];
>  cl_mem src, dst;
> +size_t plane_width, plane_height;
>  int err, p;
>  
>  av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
> @@ -268,6 +269,21 @@ static int unsharp_opencl_filter_frame(AVFilterLink 
> *inlink, AVFrame *input)
>  if (!dst)
>  break;
>  
> +cle = clGetImageInfo(src, CL_IMAGE_WIDTH,
> + sizeof(plane_width), &plane_width, NULL);
> +if (cle != CL_SUCCESS) {
> +av_log(avctx, AV_LOG_ERROR, "Failed to get plane %d "
> +   "width: %d.\n", p, cle);
> +goto fail;
> +}
> +cle = clGetImageInfo(src, CL_IMAGE_HEIGHT,
> + sizeof(plane_height), &plane_height, NULL);
> +if (cle != CL_SUCCESS) {
> +av_log(avctx, AV_LOG_ERROR, "Failed to get plane %d "
> +   "height: %d.\n", p, cle);
> +goto fail;
> +}
> +
>  cle = clSetKernelArg(ctx->kernel, 0, sizeof(cl_mem), &dst);
>  if (cle != CL_SUCCESS) {
>  av_log(avctx, AV_LOG_ERROR, "Failed to set kernel "
> @@ -321,11 +337,11 @@ static int unsharp_opencl_filter_frame(AVFilterLink 
> *inlink, AVFrame *input)
>  }
>  
>  if (ctx->global) {
> -global_work[0] = output->width;
> -global_work[1] = output->height;
> +global_work[0] = plane_width;
> +global_work[1] = plane_height;
>  } else {
> -global_work[0] = FFALIGN(output->width,  16);
> -global_work[1] = FFALIGN(output->height, 16);
> +global_work[0] = FFALIGN(plane_width,  16);
> +global_work[1] = FFALIGN(plane_height, 16);
>  local_work[0]  = 16;
>  local_work[1]  = 16;
>  }
LGTM, maybe add some commit message more better :)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/7] avcodec/ffv1enc: add information message when version is changed by the encoder

2018-03-08 Thread Michael Niedermayer
On Thu, Mar 08, 2018 at 03:12:26AM +0100, Jerome Martinez wrote:
> On 08/03/2018 01:33, Michael Niedermayer wrote:
> >On Wed, Mar 07, 2018 at 04:49:24PM +0100, Jerome Martinez wrote:
> >>There is a message when coder type is forced to a value not chosen by user,
> >>but no message when version is forced to a value not chosen by user.
> >>This patch adds such message for more coherency in the messages, and the
> >>user is informed that the command is not fully respected.
> >>
> >>ffmpeg f lavfi -i mandelbrot=s=1920x1080 -vf format=gbrp9 -vframes 1 -c ffv1
> >>-level 0 -coder 0 a.mkv
> >>
> >>Before:
> >>[ffv1 @ 02492CD69B40] bits_per_raw_sample > 8, forcing range coder
> >>
> >>After:
> >>[ffv1 @ 01A6E404A780] bits_per_raw_sample > 8, forcing version 1
> >>[ffv1 @ 01A6E404A780] bits_per_raw_sample > 8, forcing range coder
> >>
> >>
> >>  ffv1enc.c |8 +++-
> >>  1 file changed, 7 insertions(+), 1 deletion(-)
> >>cb1df919e21fe4d388df7de9349c5c2c46777862  
> >>0002-avcodec-ffv1enc-add-information-message-when-version.patch
> >> From 49db6049fa50976683fc651cf180ab8c7428225e Mon Sep 17 00:00:00 2001
> >>From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> >>Date: Wed, 7 Mar 2018 10:37:46 +0100
> >>Subject: [PATCH 2/7] avcodec/ffv1enc: add information message when version 
> >>is
> >>  changed by the encoder
> >>
> >>---
> >>  libavcodec/ffv1enc.c | 8 +++-
> >>  1 file changed, 7 insertions(+), 1 deletion(-)
> >>
> >>diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
> >>index d71d952c6d..ac8b715b74 100644
> >>--- a/libavcodec/ffv1enc.c
> >>+++ b/libavcodec/ffv1enc.c
> >>@@ -509,7 +509,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
> >>  {
> >>  FFV1Context *s = avctx->priv_data;
> >>  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
> >>-int i, j, k, m, ret;
> >>+int i, j, k, m, ret, oldversion;
> >>  if ((ret = ff_ffv1_common_init(avctx)) < 0)
> >>  return ret;
> >>@@ -534,6 +534,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
> >>  }
> >>  s->version = avctx->level;
> >>  }
> >>+oldversion = s->version;
> >>  if (s->ec < 0) {
> >>  s->ec = (s->version >= 3);
> >>@@ -679,6 +680,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >>  av_assert0(s->bits_per_raw_sample >= 8);
> >>  if (s->bits_per_raw_sample > 8) {
> >>+if (oldversion >= 0 && oldversion != s->version) {
> >>+av_log(avctx, AV_LOG_INFO,
> >>+"bits_per_raw_sample > 8, forcing version 1\n");
> >>+oldversion = s->version;
> >>+}
> >I dont think this works consistently
> >
> >The code does not seem to be limited to the case where the user has
> >specifified a version for example unless i miss something
> 
> checking range coder part, I see that currently there is actually a slight
> difference with the other AV_LOG_INFO, I don't indicate the message when
> level is not indicated, as I didn't see the value added of such information
> when level is not indicated on the command line when I implemented the test.
> 
> With patch proposal:
> 
> ffmpeg f lavfi -i mandelbrot=s=1920x1080 -vf format=gbrp9 -vframes 1 -c ffv1
> a.mkv
> [ffv1 @ 0232D35B9240] bits_per_raw_sample > 8, forcing range coder
> (no change)
> 
> ffmpeg f lavfi -i mandelbrot=s=1920x1080 -vf format=gbrp9 -vframes 1 -c ffv1
> -coder 0 a.mkv
> [ffv1 @ 014B9B1771C0] bits_per_raw_sample > 8, forcing range coder
> (no change)
> 
> ffmpeg f lavfi -i mandelbrot=s=1920x1080 -vf format=gbrp9 -vframes 1 -c ffv1
> -level 0 a.mkv
> [ffv1 @ 01BC2B881500] bits_per_raw_sample > 8, forcing version 1
> [ffv1 @ 01BC2B881500] bits_per_raw_sample > 8, forcing range coder
> ("version 1" line added because user specified version 0, IMO encoder should
> inform user that this is not respected)
> 
> ffmpeg f lavfi -i mandelbrot=s=1920x1080 -vf format=gbrp9 -vframes 1 -c ffv1
> -level 0 -coder 0 a.mkv
> [ffv1 @ 01EAC7685180] bits_per_raw_sample > 8, forcing version 1
> [ffv1 @ 01EAC7685180] bits_per_raw_sample > 8, forcing range coder
> ("version 1" line added because user specified version 0, IMO encoder should
> inform user that this is not respected)

I have the suspicion there are more corner cases that behave odd, but ive
no time ATM to test, ill do that tomorrow unless i forget


> 
> Just for being clear: do you want info message also when level/version is
> *not* indicated on the command line?

some sort of debug level message indicating the version may be usefull
if theres nothing showing it currently

at higher level i think it should only be shown if its worth it to the
user like for example if it overrides what was speified or somehow has
compatibility issues

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

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


signature.asc

Re: [FFmpeg-devel] [PATCH] lavf/movenc: keep eac3_priv around; fixes eac3 in DASH

2018-03-08 Thread Rodger Combs
Muxing DASH may involve calling mov_write_eac3_tag multiple times on the same 
stream. If we destroy eac3_priv after the first call, we don't have it  later, 
so we end up not writing that data. This is fine for lavf (since everything in 
that atom is redundant), but some other players require it.

> On Mar 8, 2018, at 05:46, Derek Buitenhuis  wrote:
> 
> On 3/8/2018 5:10 AM, Rodger Combs wrote:
>> ---
>> libavformat/movenc.c | 1 -
>> 1 file changed, 1 deletion(-)
> 
> Er, how/why?
> 
> No info is provided in this commit message.
> 
> - Derek
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-08 Thread Mike Goins
On Thu, Mar 8, 2018 at 7:55 PM, Michael Niedermayer
 wrote:
>
> On Mon, Mar 05, 2018 at 05:09:04PM +0100, Sven Dueking wrote:
> >
> >
> > > -Ursprüngliche Nachricht-
> > > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im Auftrag
> > > von Sven Dueking
> > > Gesendet: Dienstag, 27. Februar 2018 08:27
> > > An: 'FFmpeg development discussions and patches'
> > > Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > > Open SRT protocol
> > >
> > >
> > >
> > > > -Ursprüngliche Nachricht-
> > > > Von: Sven Dueking [mailto:s...@nablet.com]
> > > > Gesendet: Mittwoch, 21. Februar 2018 15:25
> > > > An: 'FFmpeg development discussions and patches'
> > > > Betreff: AW: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > > > Open SRT protocol
> > > >
> > > >
> > > >
> > > > > -Ursprüngliche Nachricht-
> > > > > Von: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] Im
> > > > > Auftrag von Michael Niedermayer
> > > > > Gesendet: Mittwoch, 21. Februar 2018 14:35
> > > > > An: FFmpeg development discussions and patches
> > > > > Betreff: Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision
> > > > > Open SRT protocol
> > > > >
> > > > > On Wed, Feb 21, 2018 at 10:16:48AM +0100, Sven Dueking wrote:
> > > > > > protocol requires libsrt (https://github.com/Haivision/srt) to be
> > > > > > installed
> > > > > >
> > > > > > Signed-off-by: Sven Dueking 
> > > > > > ---
> > > > > >  MAINTAINERS |   1 +
> > > > > >  configure   |   5 +
> > > > > >  doc/protocols.texi  | 134 ++-
> > > > > >  libavformat/Makefile|   1 +
> > > > > >  libavformat/opensrt.c   | 589
> > > > > > 
> > > > > >  libavformat/protocols.c |   1 +
> > > > > >  6 files changed, 730 insertions(+), 1 deletion(-)  create mode
> > > > > > 100644 libavformat/opensrt.c
> > > > > >
> > > > > > diff --git a/MAINTAINERS b/MAINTAINERS index b691bd5..3e0355a
> > > > 100644
> > > > > > --- a/MAINTAINERS
> > > > > > +++ b/MAINTAINERS
> > > > > > @@ -499,6 +499,7 @@ Protocols:
> > > > > >http.cRonald S. Bultje
> > > > > >libssh.c  Lukasz Marek
> > > > > >mms*.cRonald S. Bultje
> > > > > > +  opensrt.c sven Dueking
> > > > > >udp.c Luca Abeni
> > > > > >icecast.c Marvin Scholz
> > > > > >
> > > > > > diff --git a/configure b/configure index 013308c..9a78bae 100755
> > > > > > --- a/configure
> > > > > > +++ b/configure
> > > > > > @@ -294,6 +294,7 @@ External library support:
> > > > > >--enable-opengl  enable OpenGL rendering [no]
> > > > > >--enable-openssl enable openssl, needed for https
> > > > support
> > > > > > if gnutls or libtls is not used [no]
> > > > > > +  --enable-opensrt enable Haivision Open SRT protocol
> > > [no]
> > > > > >--disable-sndio  disable sndio support [autodetect]
> > > > > >--disable-schannel   disable SChannel SSP, needed for TLS
> > > > support
> > > > > on
> > > > > > Windows if openssl and gnutls are not
> > > > > > used [autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
> > > > > >  mediacodec
> > > > > >  openal
> > > > > >  opengl
> > > > > > +opensrt
> > > > >
> > > > > there is something wrong with newlines this patch is corrupted and
> > > > > cannot be tested or applied
> > > > >
> > > > > [...]
> > > >
> > > > Hi Michael,
> > > >
> > > > Sorry, no idea why this happens. Patch attached.
> > >
> > > Ping ?!
> > >
> > > >
> > > > > --
> > > > > Michael GnuPG fingerprint:
> > > > 9FF2128B147EF6730BADF133611EC787040B0FAB
> > > > >
> > > > > Rewriting code that is poorly written but fully understood is good.
> > > > > Rewriting code that one doesnt understand is a sign that one is
> > > less
> > > > > smart then the original author, trying to rewrite it will not make
> > > > > it
> > > > better.
> > >
> >
> > Any chance to get feedback ?
>
> is anyone working on a review of this patch or intends to review it ?
>
> If not i intend to push it after a light review (i think there are
> other people around who are more qualified to review this than i am)


Just a cursory glance at the moment, I can functionally test tomorrow
(pretty familiar with SRT).

+{ "timeout","set timeout of socket I/O operations",
  OFFSET(rw_timeout),
AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },
+{ "listen_timeout", "Connection awaiting timeout",
  OFFSET(listen_timeout),
AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },

Is there guidance for option descriptions?  The capitalization is inconsistent.

+{ "mss","the Maximum Transfer Unit",
  

Re: [FFmpeg-devel] [PATCH] avformat/opensrt: add Haivision Open SRT protocol

2018-03-08 Thread wm4
On Wed, 21 Feb 2018 10:16:48 +0100
"Sven Dueking"  wrote:

> protocol requires libsrt (https://github.com/Haivision/srt) to be installed
> 
> Signed-off-by: Sven Dueking 
> ---
>  MAINTAINERS |   1 +
>  configure   |   5 +
>  doc/protocols.texi  | 134 ++-
>  libavformat/Makefile|   1 +
>  libavformat/opensrt.c   | 589
> 
>  libavformat/protocols.c |   1 +
>  6 files changed, 730 insertions(+), 1 deletion(-)  create mode 100644
> libavformat/opensrt.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b691bd5..3e0355a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -499,6 +499,7 @@ Protocols:
>http.cRonald S. Bultje
>libssh.c  Lukasz Marek
>mms*.cRonald S. Bultje
> +  opensrt.c sven Dueking
>udp.c Luca Abeni
>icecast.c Marvin Scholz
>  
> diff --git a/configure b/configure
> index 013308c..9a78bae 100755
> --- a/configure
> +++ b/configure
> @@ -294,6 +294,7 @@ External library support:
>--enable-opengl  enable OpenGL rendering [no]
>--enable-openssl enable openssl, needed for https support
> if gnutls or libtls is not used [no]
> +  --enable-opensrt enable Haivision Open SRT protocol [no]
>--disable-sndio  disable sndio support [autodetect]
>--disable-schannel   disable SChannel SSP, needed for TLS support on
> Windows if openssl and gnutls are not used
> [autodetect] @@ -1648,6 +1649,7 @@ EXTERNAL_LIBRARY_LIST="
>  mediacodec
>  openal
>  opengl
> +opensrt
>  "
>  
>  HWACCEL_AUTODETECT_LIBRARY_LIST="
> @@ -3157,6 +3159,8 @@ libssh_protocol_deps="libssh"
>  libtls_conflict="openssl gnutls"
>  mmsh_protocol_select="http_protocol"
>  mmst_protocol_select="network"
> +opensrt_protocol_select="network"
> +opensrt_protocol_deps="opensrt"
>  rtmp_protocol_conflict="librtmp_protocol"
>  rtmp_protocol_select="tcp_protocol"
>  rtmp_protocol_suggest="zlib"
> @@ -6028,6 +6032,7 @@ enabled omx   && require_header OMX_Core.h
>  enabled omx_rpi   && { check_header OMX_Core.h ||
> { ! enabled cross_compile && add_cflags
> -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } ||
> die "ERROR: OpenMAX IL headers not found"; }
> && enable omx
> +enabled opensrt   && require_pkg_config libsrt "srt >= 1.2.0"
> srt/srt.h srt_socket
>  enabled openssl   && { check_pkg_config openssl openssl
> openssl/ssl.h OPENSSL_init_ssl ||
> check_pkg_config openssl openssl
> openssl/ssl.h SSL_library_init ||
> check_lib openssl openssl/ssl.h
> SSL_library_init -lssl -lcrypto || diff --git a/doc/protocols.texi
> b/doc/protocols.texi index c24dc74..1d49eaa 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -752,12 +752,144 @@ Truncate existing files on write, if set to 1. A
> value of 0 prevents  truncating. Default value is 1.
>  
>  @item workgroup
> -Set the workgroup used for making connections. By default workgroup is not
> specified.
> +Set the workgroup used for making connections. By default workgroup is 
> +not specified.
>  
>  @end table
>  
>  For more information see: @url{http://www.samba.org/}.
>  
> +@section srt
> +
> +Haivision Secure Reliable Transport Protocol via libsrt.
> +
> +The required syntax for a SRT url is:
> +@example
> +srt://@var{hostname}:@var{port}[?@var{options}]
> +@end example
> +
> +@var{options} contains a list of &-separated options of the form 
> +@var{key}=@var{val}.
> +
> +This protocol accepts the following options.
> +
> +@table @option
> +@item connect_timeout
> +Connection timeout. SRT cannot connect for RTT > 1500 msec
> +(2 handshake exchanges) with the default connect timeout of
> +3 seconds. This option applies to the caller and rendezvous connection 
> +modes. The connect timeout is 10 times the value set for the rendezvous 
> +mode (which can be used as a workaround for this connection problem 
> +with earlier versions).
> +
> +@item fc=@var{bytes}
> +Flight Flag Size (Window Size), in bytes. FC is actually an internal 
> +parameter and you should set it to not less than 
> +@option{recv_buffer_size} and @option{mss}. The default value is 
> +relatively large, therefore unless you set a very large receiver 
> +buffer, you do not need to change this option. Default value is 25600.
> +
> +@item inputbw=@var{bytes/seconds}
> +Sender nominal input rate, in bytes per seconds. Used along with 
> +@option{oheadbw}, when @option{maxbw} is set to relative (0), to 
> +calculate maximum sending rate when recovery packets are sent along 
> +with main media stream:
> +@option{inputbw} * (100 + @option{oheadbw}) /