Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili <quinkblack@foxmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Zhao Zhili <zhilizhao@tencent.com>
Subject: [FFmpeg-devel] [PATCH] avcodec/mediacodecenc: add profile names to options
Date: Fri,  9 Jun 2023 19:14:24 +0800
Message-ID: <tencent_8168467FFEAF023B89C021B790680203190A@qq.com> (raw)

From: Zhao Zhili <zhilizhao@tencent.com>

H.264 high10/high422/high44 are unlikely supported by devices.
It's there for developers to do the experiment.

H.265 main10 works on my device with AV_PIX_FMT_MEDIACODEC.
OMX_COLOR_FormatYUV420Planar16 doesn't work.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 libavcodec/mediacodecenc.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index d23745c1c1..1da705d113 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -36,6 +36,7 @@
 #include "mediacodec.h"
 #include "mediacodec_wrapper.h"
 #include "mediacodecdec_common.h"
+#include "profiles.h"
 
 #define INPUT_DEQUEUE_TIMEOUT_US 8000
 #define OUTPUT_DEQUEUE_TIMEOUT_US 8000
@@ -658,6 +659,16 @@ enum MediaCodecAvcLevel {
 
 static const AVOption h264_options[] = {
     COMMON_OPTION
+
+    FF_AVCTX_PROFILE_OPTION("baseline",             NULL, VIDEO, FF_PROFILE_H264_BASELINE)
+    FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, FF_PROFILE_H264_CONSTRAINED_BASELINE)
+    FF_AVCTX_PROFILE_OPTION("main",                 NULL, VIDEO, FF_PROFILE_H264_MAIN)
+    FF_AVCTX_PROFILE_OPTION("extended",             NULL, VIDEO, FF_PROFILE_H264_EXTENDED)
+    FF_AVCTX_PROFILE_OPTION("high",                 NULL, VIDEO, FF_PROFILE_H264_HIGH)
+    FF_AVCTX_PROFILE_OPTION("high10",               NULL, VIDEO, FF_PROFILE_H264_HIGH_10)
+    FF_AVCTX_PROFILE_OPTION("high422",              NULL, VIDEO, FF_PROFILE_H264_HIGH_422)
+    FF_AVCTX_PROFILE_OPTION("high444",              NULL, VIDEO, FF_PROFILE_H264_HIGH_444)
+
     { "level", "Specify level",
                 OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
     { "1",      "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel1  },  0, 0, VE, "level" },
@@ -720,6 +731,10 @@ enum MediaCodecHevcLevel {
 
 static const AVOption hevc_options[] = {
     COMMON_OPTION
+
+    FF_AVCTX_PROFILE_OPTION("main",   NULL, VIDEO, FF_PROFILE_HEVC_MAIN)
+    FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, FF_PROFILE_HEVC_MAIN_10)
+
     { "level", "Specify tier and level",
                 OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
     { "m1",    "Main tier level 1",
@@ -830,6 +845,12 @@ enum MediaCodecVP9Level {
 
 static const AVOption vp9_options[] = {
     COMMON_OPTION
+
+    FF_AVCTX_PROFILE_OPTION("profile0",   NULL, VIDEO, FF_PROFILE_VP9_0)
+    FF_AVCTX_PROFILE_OPTION("profile1",   NULL, VIDEO, FF_PROFILE_VP9_1)
+    FF_AVCTX_PROFILE_OPTION("profile2",   NULL, VIDEO, FF_PROFILE_VP9_2)
+    FF_AVCTX_PROFILE_OPTION("profile3",   NULL, VIDEO, FF_PROFILE_VP9_3)
+
     { "level", "Specify tier and level",
                 OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
     { "1",     "Level 1",
@@ -884,6 +905,9 @@ enum MediaCodecMpeg4Level {
 
 static const AVOption mpeg4_options[] = {
     COMMON_OPTION
+
+    FF_MPEG4_PROFILE_OPTS
+
     { "level", "Specify tier and level",
                 OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
     { "0",     "Level 0",
@@ -944,6 +968,9 @@ enum MediaCodecAV1Level {
 
 static const AVOption av1_options[] = {
     COMMON_OPTION
+
+    FF_AV1_PROFILE_OPTS
+
     { "level", "Specify tier and level",
                 OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
     { "2",     "Level 2",
-- 
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".

             reply	other threads:[~2023-06-09 11:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 11:14 Zhao Zhili [this message]
2023-06-24  9:16 ` Tomas Härdin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_8168467FFEAF023B89C021B790680203190A@qq.com \
    --to=quinkblack@foxmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=zhilizhao@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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