audio_opensles_config.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
  2. *
  3. * This file is part of Open Source Doubango Framework.
  4. *
  5. * DOUBANGO is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * DOUBANGO is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with DOUBANGO.
  17. */
  18. #ifndef AUDIO_OPENSLES_CONFIG_H
  19. #define AUDIO_OPENSLES_CONFIG_H
  20. #ifdef __SYMBIAN32__
  21. #undef _WIN32 /* Because of WINSCW */
  22. #endif
  23. // Windows (XP/Vista/7/CE and Windows Mobile) macro definition
  24. #if defined(WIN32)|| defined(_WIN32) || defined(_WIN32_WCE)
  25. # define AUDIO_OPENSLES_UNDER_WINDOWS 1
  26. #endif
  27. // OS X or iOS
  28. #if defined(__APPLE__)
  29. # define AUDIO_OPENSLES_UNDER_APPLE 1
  30. #endif
  31. #if TARGET_OS_MAC
  32. # define AUDIO_OPENSLES_UNDER_MAC 1
  33. #endif
  34. #if TARGET_OS_IPHONE
  35. # define AUDIO_OPENSLES_UNDER_IPHONE 1
  36. #endif
  37. #if TARGET_IPHONE_SIMULATOR
  38. # define AUDIO_OPENSLES_UNDER_IPHONE_SIMULATOR 1
  39. #endif
  40. #if defined(ANDROID)
  41. # define AUDIO_OPENSLES_UNDER_ANDROID 1
  42. #endif
  43. // x86
  44. #if AUDIO_OPENSLES_UNDER_WINDOWS || defined(__x86_64__) || defined(__x86__) || defined(__i386__)
  45. # define AUDIO_OPENSLES_UNDER_X86 1
  46. #endif
  47. // Mobile
  48. #if defined(_WIN32_WCE) || defined(ANDROID) // iOS (not true)=> || defined(IOS)
  49. # define AUDIO_OPENSLES_UNDER_MOBILE 1
  50. #endif
  51. #if (AUDIO_OPENSLES_UNDER_WINDOWS || defined(__SYMBIAN32__)) && defined(AUDIO_OPENSLES_EXPORTS)
  52. # define AUDIO_OPENSLES_API __declspec(dllexport)
  53. # define AUDIO_OPENSLES_GEXTERN __declspec(dllexport)
  54. #elif (AUDIO_OPENSLES_UNDER_WINDOWS || defined(__SYMBIAN32__))
  55. # define AUDIO_OPENSLES_API __declspec(dllimport)
  56. # define AUDIO_OPENSLES_GEXTERN __declspec(dllimport)
  57. #else
  58. # define AUDIO_OPENSLES_API
  59. # define AUDIO_OPENSLES_GEXTERN extern
  60. #endif
  61. // Guards against C++ name mangling
  62. #ifdef __cplusplus
  63. # define AUDIO_OPENSLES_BEGIN_DECLS extern "C" {
  64. # define AUDIO_OPENSLES_END_DECLS }
  65. #else
  66. # define AUDIO_OPENSLES_BEGIN_DECLS
  67. # define AUDIO_OPENSLES_END_DECLS
  68. #endif
  69. #ifdef _MSC_VER
  70. #if HAVE_FFMPEG // FFMPeg warnings (treated as errors)
  71. # pragma warning (disable:4244)
  72. #endif
  73. # define inline __inline
  74. # define _CRT_SECURE_NO_WARNINGS
  75. #endif
  76. // Detecting C99 compilers
  77. #if (__STDC_VERSION__ == 199901L) && !defined(__C99__)
  78. # define __C99__
  79. #endif
  80. #include <stdint.h>
  81. #ifdef __SYMBIAN32__
  82. #include <stdlib.h>
  83. #endif
  84. #if HAVE_CONFIG_H
  85. #include "../config.h"
  86. #endif
  87. #if AUDIO_OPENSLES_UNDER_ANDROID
  88. # include <android/log.h>
  89. # define ANDROID_DEBUG_TAG "plugin_audio_opensles" // DDMS log tag when using eclise
  90. # define AUDIO_OPENSLES_DEBUG_INFO(FMT, ...) __android_log_print(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, FMT, ##__VA_ARGS__)
  91. # define AUDIO_OPENSLES_DEBUG_WARN(FMT, ...) __android_log_print(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, "***WARN: function: \"%s()\" \nfile: \"%s\" \nline: \"%u\" \nMSG: " FMT "\n", __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__)
  92. # define AUDIO_OPENSLES_DEBUG_ERROR(FMT, ...) __android_log_print(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, "***ERROR: function: \"%s()\" \nfile: \"%s\" \nline: \"%u\" \nMSG: " FMT "\n", __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__)
  93. # define AUDIO_OPENSLES_DEBUG_FATAL(FMT, ...) __android_log_print(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, "***FATAL: function: \"%s()\" \nfile: \"%s\" \nline: \"%u\" \nMSG: " FMT "\n", __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__)
  94. #else
  95. # include "tsk_debug.h"
  96. # define AUDIO_OPENSLES_DEBUG_INFO(FMT, ...) TSK_DEBUG_INFO(FMT, ##__VA_ARGS__)
  97. # define AUDIO_OPENSLES_DEBUG_WARN(FMT, ...) TSK_DEBUG_WARN(FMT, ##__VA_ARGS__)
  98. # define AUDIO_OPENSLES_DEBUG_ERROR(FMT, ...) TSK_DEBUG_ERROR(FMT, ##__VA_ARGS__)
  99. # define AUDIO_OPENSLES_DEBUG_FATAL(FMT, ...) TSK_DEBUG_FATAL(FMT, ##__VA_ARGS__)
  100. #endif /* AUDIO_OPENSLES_UNDER_ANDROID */
  101. #endif // AUDIO_OPENSLES_CONFIG_H