diff mbox series

[FFmpeg-devel,1/2] avcodec/videotoolboxenc: Set profile (main/main10) on HEVC encode

Message ID 20200921111659.85445-1-harry.mallon@codex.online
State Accepted
Commit 80384a6ec3074aeb27dfbd28cebd614c6fc72ce7
Headers show
Series [FFmpeg-devel,1/2] avcodec/videotoolboxenc: Set profile (main/main10) on HEVC encode | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Harry Mallon Sept. 21, 2020, 11:16 a.m. UTC
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
---
 libavcodec/videotoolboxenc.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index e89cfaeed8..212f41b19a 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1114,15 +1114,12 @@  static int vtenc_create_encoder(AVCodecContext   *avctx,
         }
     }
 
-    if (vtctx->codec_id == AV_CODEC_ID_H264) {
-        // kVTCompressionPropertyKey_ProfileLevel is not available for HEVC
-        if (profile_level) {
-            status = VTSessionSetProperty(vtctx->session,
-                                        kVTCompressionPropertyKey_ProfileLevel,
-                                        profile_level);
-            if (status) {
-                av_log(avctx, AV_LOG_ERROR, "Error setting profile/level property: %d. Output will be encoded using a supported profile/level combination.\n", status);
-            }
+    if (profile_level) {
+        status = VTSessionSetProperty(vtctx->session,
+                                      kVTCompressionPropertyKey_ProfileLevel,
+                                      profile_level);
+        if (status) {
+            av_log(avctx, AV_LOG_ERROR, "Error setting profile/level property: %d. Output will be encoded using a supported profile/level combination.\n", status);
         }
     }