ijksdl_ios.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * ijksdl_ios.h
  3. *
  4. * Copyright (c) 2013 Bilibili
  5. * Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
  6. *
  7. * This file is part of ijkPlayer.
  8. *
  9. * ijkPlayer is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2.1 of the License, or (at your option) any later version.
  13. *
  14. * ijkPlayer is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with ijkPlayer; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. //#include "ijksdl/ijksdl.h"
  24. //#include "ijksdl_aout_ios_audiounit.h"
  25. //#include "ijksdl_vout_ios_gles2.h"
  26. #import <UIKit/UIKit.h>
  27. #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
  28. #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
  29. #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
  30. #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
  31. #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
  32. inline static BOOL isIOS9OrLater()
  33. {
  34. return SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0");
  35. }
  36. inline static BOOL isIOS8OrLater()
  37. {
  38. return SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0");
  39. }
  40. inline static BOOL isIOS7OrLater()
  41. {
  42. return SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0");
  43. }
  44. inline static BOOL isIOS6OrLater()
  45. {
  46. return SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0");
  47. }