[FFmpeg-devel] [PATCH, v2 2/4] avc/avcodec: add AV_CODEC_CAP_VARIABLE_DIMENSIONS flag

Linjie Fu linjie.fu at intel.com
Tue Jul 30 07:45:24 EEST 2019


Add AV_CODEC_CAP_VARIABLE_DIMENSIONS flag to indicate whether encoder
supports variable dimension encoding.

Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
[v2]: update API changes.
 doc/APIchanges       | 3 +++
 fftools/cmdutils.c   | 2 ++
 libavcodec/avcodec.h | 5 +++++
 libavcodec/rawenc.c  | 1 +
 libavcodec/version.h | 2 +-
 5 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 07331b1..2e855f2 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2019-07-xx - xxxxxxxxxx - lavc 58.55.101 - avcodec.h
+  Add AV_CODEC_CAP_VARIABLE_DIMENSIONS
+
 -------- 8< --------- FFmpeg 4.2 was cut here -------- 8< ---------
 
 2019-06-21 - a30e44098a - lavu 56.30.100 - frame.h
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 9cfbc45..25ea1c6 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1424,6 +1424,8 @@ static void print_codec(const AVCodec *c)
         printf("hardware ");
     if (c->capabilities & AV_CODEC_CAP_HYBRID)
         printf("hybrid ");
+    if (c->capabilities & AV_CODEC_CAP_VARIABLE_DIMENSIONS)
+        printf("multidimension ");
     if (!c->capabilities)
         printf("none");
     printf("\n");
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index d234271..a7704ea 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1092,6 +1092,11 @@ typedef struct RcOverride{
 #define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
 
 /**
+ * Codec supports variable dimensions in encoding.
+ */
+#define AV_CODEC_CAP_VARIABLE_DIMENSIONS (1 << 21)
+
+/**
  * Pan Scan area.
  * This specifies the area which should be displayed.
  * Note there may be multiple such areas for one frame.
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c
index d181b74..486c0d7 100644
--- a/libavcodec/rawenc.c
+++ b/libavcodec/rawenc.c
@@ -92,4 +92,5 @@ AVCodec ff_rawvideo_encoder = {
     .id             = AV_CODEC_ID_RAWVIDEO,
     .init           = raw_encode_init,
     .encode2        = raw_encode,
+    .capabilities   = AV_CODEC_CAP_VARIABLE_DIMENSIONS,
 };
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 43c8cdb..e70ebc0 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  55
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
-- 
2.7.4



More information about the ffmpeg-devel mailing list