[FFmpeg-devel] [PATCH v2 04/10] vtenc: Fixed iOS compilation.

kernrj at gmail.com kernrj at gmail.com
Wed Nov 18 19:49:52 CET 2015


From: Rick Kern <kernrj at gmail.com>

Removed dictionary keys that aren't supported on iOS builds.

Signed-off-by: Rick Kern <kernrj at gmail.com>
---
 libavcodec/vtenc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/vtenc.c b/libavcodec/vtenc.c
index b363492..7132411 100644
--- a/libavcodec/vtenc.c
+++ b/libavcodec/vtenc.c
@@ -499,8 +499,10 @@ static av_cold int vtenc_init(AVCodecContext* avctx){
         &kCFTypeDictionaryValueCallBacks
     );
 
+#if !TARGET_OS_IPHONE
     CFDictionarySetValue(enc_info, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, kCFBooleanTrue);
     CFDictionarySetValue(enc_info, kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kCFBooleanTrue);
+#endif
 
     status = VTCompressionSessionCreate(
         kCFAllocatorDefault,
@@ -515,6 +517,7 @@ static av_cold int vtenc_init(AVCodecContext* avctx){
         &vtctx->session
     );
 
+#if !TARGET_OS_IPHONE
     if(status != 0 || !vtctx->session){
         CFDictionaryRemoveValue(enc_info, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder);
 
@@ -531,6 +534,7 @@ static av_cold int vtenc_init(AVCodecContext* avctx){
             &vtctx->session
         );
     }
+#endif
 
     if(status || !vtctx->session){
         av_log(avctx, AV_LOG_ERROR, "Error: cannot create compression session: %d\n", status);
-- 
2.4.9 (Apple Git-60)



More information about the ffmpeg-devel mailing list