[vlc-commits] videotoolbox: reverse logic to detect SoCs capable of decoding advanced H264 levels

Felix Paul Kühne git at videolan.org
Sun Nov 12 13:43:31 CET 2017


vlc | branch: master | Felix Paul Kühne <felix at serioese.gmbh> | Sun Nov 12 13:37:51 2017 +0100| [bdadcd7eb4a793fade458e69e282252376aedd32] | committer: Felix Paul Kühne

videotoolbox: reverse logic to detect SoCs capable of decoding advanced H264 levels

This enables decoding of advanced H264 levels on SoCs newer than Twister such as Hurricane or Monsoon

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bdadcd7eb4a793fade458e69e282252376aedd32
---

 modules/codec/videotoolbox.m | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 19bc9c4e85..020bd890a1 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1007,19 +1007,23 @@ static BOOL deviceSupportsAdvancedLevels()
     return YES;
 #endif
 #if TARGET_OS_IPHONE
-    size_t size;
-    int32_t cpufamily;
-
-    size = sizeof(cpufamily);
-    sysctlbyname("hw.cpufamily", &cpufamily, &size, NULL, 0);
+    #ifdef __LP64__
+        size_t size;
+        int32_t cpufamily;
+        size = sizeof(cpufamily);
+        sysctlbyname("hw.cpufamily", &cpufamily, &size, NULL, 0);
+
+        /* Proper 4K decoding requires a Twister SoC
+         * Everything below will kill the decoder daemon */
+        if (cpufamily == CPUFAMILY_ARM_CYCLONE || cpufamily == CPUFAMILY_ARM_TYPHOON) {
+            return NO;
+        }
 
-    /* Proper 4K decoding requires a Twister SoC
-     * Everything below will kill the decoder daemon */
-    if (cpufamily == CPUFAMILY_ARM_TWISTER) {
         return YES;
-    }
-
-    return NO;
+    #else
+        /* we need a 64bit SoC for advanced levels */
+        return NO;
+    #endif
 #else
     return YES;
 #endif



More information about the vlc-commits mailing list