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

Submitted by Linjie Fu on July 29, 2019, 2:43 p.m.

Details

Message ID 1564411432-26238-1-git-send-email-linjie.fu@intel.com
State New
Headers show

Commit Message

Linjie Fu July 29, 2019, 2:43 p.m.
Add AV_CODEC_CAP_VARIABLE_DIMENSIONS flag to indicate whether encoder
supports variable dimension encoding.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
---
 fftools/cmdutils.c   | 2 ++
 libavcodec/avcodec.h | 5 +++++
 libavcodec/rawenc.c  | 1 +
 libavcodec/version.h | 2 +-
 4 files changed, 9 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer July 29, 2019, 7:33 p.m.
On Mon, Jul 29, 2019 at 10:43:52PM +0800, Linjie Fu wrote:
> Add AV_CODEC_CAP_VARIABLE_DIMENSIONS flag to indicate whether encoder
> supports variable dimension encoding.
> 
> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
> ---
>  fftools/cmdutils.c   | 2 ++
>  libavcodec/avcodec.h | 5 +++++
>  libavcodec/rawenc.c  | 1 +
>  libavcodec/version.h | 2 +-
>  4 files changed, 9 insertions(+), 1 deletion(-)

Needs a update to APIchanges

thx

[...]

Patch hide | download patch | download mbox

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, \