[FFmpeg-cvslog] avcodec: add max_samples

Michael Niedermayer git at videolan.org
Wed Sep 25 18:33:59 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Sep  2 23:17:57 2019 +0200| [f8406ab4b9f40408f0c559fa1c0aab5ecd159970] | committer: Michael Niedermayer

avcodec: add max_samples

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 doc/APIchanges                       | 3 +++
 libavcodec/avcodec.h                 | 8 ++++++++
 libavcodec/options_table.h           | 1 +
 libavcodec/version.h                 | 4 ++--
 tests/ref/fate/api-mjpeg-codec-param | 2 ++
 tests/ref/fate/api-png-codec-param   | 2 ++
 6 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 80558a49c7..9bfe153099 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2019-09-25 - xxxxxxxxxx - lavc 58.59.100 - avcodec.h
+  Add max_samples
+
 2019-09-04 - 2a9d461abc - lavu 56.35.100 - hwcontext_videotoolbox.h
   Add av_map_videotoolbox_format_from_pixfmt2() for full range pixfmt
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c91ee4af5b..bcb931f0dd 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3373,6 +3373,14 @@ typedef struct AVCodecContext {
      * - encoding: unused
      */
     int discard_damaged_percentage;
+
+    /**
+     * The number of samples per frame to maximally accept.
+     *
+     * - decoding: set by user
+     * - encoding: set by user
+     */
+    int64_t max_samples;
 } AVCodecContext;
 
 #if FF_API_CODEC_GET_SET
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index c3a500a629..b56e653bf6 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -476,6 +476,7 @@ static const AVOption avcodec_options[] = {
 {"pixel_format", "set pixel format", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64=AV_PIX_FMT_NONE}, -1, INT_MAX, 0 },
 {"video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str=NULL}, 0, INT_MAX, 0 },
 {"max_pixels", "Maximum number of pixels", OFFSET(max_pixels), AV_OPT_TYPE_INT64, {.i64 = INT_MAX }, 0, INT_MAX, A|V|S|D|E },
+{"max_samples", "Maximum number of samples", OFFSET(max_samples), AV_OPT_TYPE_INT64, {.i64 = INT_MAX }, 0, INT_MAX, A|D|E },
 {"hwaccel_flags", NULL, OFFSET(hwaccel_flags), AV_OPT_TYPE_FLAGS, {.i64 = AV_HWACCEL_FLAG_IGNORE_LEVEL }, 0, UINT_MAX, V|D, "hwaccel_flags"},
 {"ignore_level", "ignore level even if the codec level used is unknown or higher than the maximum supported level reported by the hardware driver", 0, AV_OPT_TYPE_CONST, { .i64 = AV_HWACCEL_FLAG_IGNORE_LEVEL }, INT_MIN, INT_MAX, V | D, "hwaccel_flags" },
 {"allow_high_depth", "allow to output YUV pixel formats with a different chroma sampling than 4:2:0 and/or other than 8 bits per component", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 59d5758e1f..67f2a90739 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,8 +28,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR  58
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MINOR  59
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
diff --git a/tests/ref/fate/api-mjpeg-codec-param b/tests/ref/fate/api-mjpeg-codec-param
index 0815919d7d..e55cef0eb9 100644
--- a/tests/ref/fate/api-mjpeg-codec-param
+++ b/tests/ref/fate/api-mjpeg-codec-param
@@ -136,6 +136,7 @@ stream=0, decode=0
     pixel_format=yuvj422p
     video_size=400x225
     max_pixels=2147483647
+    max_samples=2147483647
     hwaccel_flags=0x00000001
     extra_hw_frames=-1
     discard_damaged_percentage=95
@@ -277,6 +278,7 @@ stream=0, decode=1
     pixel_format=yuvj422p
     video_size=400x225
     max_pixels=2147483647
+    max_samples=2147483647
     hwaccel_flags=0x00000001
     extra_hw_frames=-1
     discard_damaged_percentage=95
diff --git a/tests/ref/fate/api-png-codec-param b/tests/ref/fate/api-png-codec-param
index a47d0963da..c04c8cc7c1 100644
--- a/tests/ref/fate/api-png-codec-param
+++ b/tests/ref/fate/api-png-codec-param
@@ -136,6 +136,7 @@ stream=0, decode=0
     pixel_format=rgba
     video_size=128x128
     max_pixels=2147483647
+    max_samples=2147483647
     hwaccel_flags=0x00000001
     extra_hw_frames=-1
     discard_damaged_percentage=95
@@ -277,6 +278,7 @@ stream=0, decode=1
     pixel_format=rgba
     video_size=128x128
     max_pixels=2147483647
+    max_samples=2147483647
     hwaccel_flags=0x00000001
     extra_hw_frames=-1
     discard_damaged_percentage=95



More information about the ffmpeg-cvslog mailing list