Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2] avcodec/mediacodecdec: add AV1 decoding support
@ 2022-12-19 12:45 Zhao Zhili
  2022-12-20 18:03 ` Tomas Härdin
  0 siblings, 1 reply; 3+ messages in thread
From: Zhao Zhili @ 2022-12-19 12:45 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Zhao Zhili

From: Zhao Zhili <zhilizhao@tencent.com>

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 configure                  |  2 ++
 libavcodec/Makefile        |  1 +
 libavcodec/allcodecs.c     |  1 +
 libavcodec/mediacodecdec.c | 16 +++++++++++++++-
 libavcodec/version.h       |  4 ++--
 5 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 2180ebb4f1..3ae9eb768f 100755
--- a/configure
+++ b/configure
@@ -3156,6 +3156,8 @@ nvenc_deps_any="libdl LoadLibrary"
 aac_mf_encoder_deps="mediafoundation"
 ac3_mf_encoder_deps="mediafoundation"
 av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
+av1_mediacodec_decoder_deps="mediacodec"
+av1_mediacodec_decoder_extralibs="-landroid"
 av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1"
 av1_nvenc_encoder_select="atsc_a53"
 h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 98841ed07c..3ab448dd49 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -249,6 +249,7 @@ OBJS-$(CONFIG_AURA_DECODER)            += cyuv.o
 OBJS-$(CONFIG_AURA2_DECODER)           += aura.o
 OBJS-$(CONFIG_AV1_DECODER)             += av1dec.o
 OBJS-$(CONFIG_AV1_CUVID_DECODER)       += cuviddec.o
+OBJS-$(CONFIG_AV1_MEDIACODEC_DECODER)  += mediacodecdec.o
 OBJS-$(CONFIG_AV1_NVENC_ENCODER)       += nvenc_av1.o nvenc.o
 OBJS-$(CONFIG_AV1_QSV_ENCODER)         += qsvenc_av1.o
 OBJS-$(CONFIG_AVRN_DECODER)            += avrndec.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index d5a6c427e1..b009848a44 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -828,6 +828,7 @@ extern const FFCodec ff_libaom_av1_decoder;
 /* hwaccel hooks only, so prefer external decoders */
 extern const FFCodec ff_av1_decoder;
 extern const FFCodec ff_av1_cuvid_decoder;
+extern const FFCodec ff_av1_mediacodec_decoder;
 extern const FFCodec ff_av1_nvenc_encoder;
 extern const FFCodec ff_av1_qsv_decoder;
 extern const FFCodec ff_av1_qsv_encoder;
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 2c231d1a34..11f655a9aa 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -289,7 +289,8 @@ done:
 #if CONFIG_MPEG2_MEDIACODEC_DECODER || \
     CONFIG_MPEG4_MEDIACODEC_DECODER || \
     CONFIG_VP8_MEDIACODEC_DECODER   || \
-    CONFIG_VP9_MEDIACODEC_DECODER
+    CONFIG_VP9_MEDIACODEC_DECODER   || \
+    CONFIG_AV1_MEDIACODEC_DECODER
 static int common_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
 {
     int ret = 0;
@@ -323,6 +324,15 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
     }
 
     switch (avctx->codec_id) {
+#if CONFIG_AV1_MEDIACODEC_DECODER
+    case AV_CODEC_ID_AV1:
+        codec_mime = "video/av01";
+
+        ret = common_set_extradata(avctx, format);
+        if (ret < 0)
+            goto done;
+        break;
+#endif
 #if CONFIG_H264_MEDIACODEC_DECODER
     case AV_CODEC_ID_H264:
         codec_mime = "video/avc";
@@ -591,3 +601,7 @@ DECLARE_MEDIACODEC_VDEC(vp8, "VP8", AV_CODEC_ID_VP8, NULL)
 #if CONFIG_VP9_MEDIACODEC_DECODER
 DECLARE_MEDIACODEC_VDEC(vp9, "VP9", AV_CODEC_ID_VP9, NULL)
 #endif
+
+#if CONFIG_AV1_MEDIACODEC_DECODER
+DECLARE_MEDIACODEC_VDEC(av1, "AV1", AV_CODEC_ID_AV1, NULL)
+#endif
diff --git a/libavcodec/version.h b/libavcodec/version.h
index eb95a0f827..6b8a1dbb79 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,8 +29,8 @@
 
 #include "version_major.h"
 
-#define LIBAVCODEC_VERSION_MINOR  55
-#define LIBAVCODEC_VERSION_MICRO 103
+#define LIBAVCODEC_VERSION_MINOR  56
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
-- 
2.25.1

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avcodec/mediacodecdec: add AV1 decoding support
  2022-12-19 12:45 [FFmpeg-devel] [PATCH v2] avcodec/mediacodecdec: add AV1 decoding support Zhao Zhili
@ 2022-12-20 18:03 ` Tomas Härdin
  2022-12-28 17:36   ` Zhao Zhili
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Härdin @ 2022-12-20 18:03 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

mån 2022-12-19 klockan 20:45 +0800 skrev Zhao Zhili:
> From: Zhao Zhili <zhilizhao@tencent.com>
> 
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
>  configure                  |  2 ++
>  libavcodec/Makefile        |  1 +
>  libavcodec/allcodecs.c     |  1 +
>  libavcodec/mediacodecdec.c | 16 +++++++++++++++-
>  libavcodec/version.h       |  4 ++--
>  5 files changed, 21 insertions(+), 3 deletions(-)

Looks OK

/Tomas

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avcodec/mediacodecdec: add AV1 decoding support
  2022-12-20 18:03 ` Tomas Härdin
@ 2022-12-28 17:36   ` Zhao Zhili
  0 siblings, 0 replies; 3+ messages in thread
From: Zhao Zhili @ 2022-12-28 17:36 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Tue, 2022-12-20 at 19:03 +0100, Tomas Härdin wrote:
> mån 2022-12-19 klockan 20:45 +0800 skrev Zhao Zhili:
> > From: Zhao Zhili <zhilizhao@tencent.com>
> > 
> > Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> > ---
> >  configure                  |  2 ++
> >  libavcodec/Makefile        |  1 +
> >  libavcodec/allcodecs.c     |  1 +
> >  libavcodec/mediacodecdec.c | 16 +++++++++++++++-
> >  libavcodec/version.h       |  4 ++--
> >  5 files changed, 21 insertions(+), 3 deletions(-)
> 
> Looks OK
> 
> /Tomas

Thanks for the review. Will apply this week.

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-28 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-19 12:45 [FFmpeg-devel] [PATCH v2] avcodec/mediacodecdec: add AV1 decoding support Zhao Zhili
2022-12-20 18:03 ` Tomas Härdin
2022-12-28 17:36   ` Zhao Zhili

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git