| 1 | /* |
| 2 | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | */ |
| 18 | #ifndef __PJMEDIA_VIDEODEV_CONFIG_H__ |
| 19 | #define __PJMEDIA_VIDEODEV_CONFIG_H__ |
| 20 | |
| 21 | /** |
| 22 | * @file config.h |
| 23 | * @brief Video config. |
| 24 | */ |
| 25 | #include <pjmedia/types.h> |
| 26 | #include <pj/pool.h> |
| 27 | |
| 28 | |
| 29 | PJ_BEGIN_DECL |
| 30 | |
| 31 | /** |
| 32 | * @defgroup video_device_api Video Device API |
| 33 | * @brief PJMEDIA video device abstraction API. |
| 34 | */ |
| 35 | |
| 36 | /** |
| 37 | * @defgroup s1_video_device_config Compile time configurations |
| 38 | * @ingroup video_device_api |
| 39 | * @brief Compile time configurations |
| 40 | * @{ |
| 41 | */ |
| 42 | |
| 43 | /** |
| 44 | * This setting controls the maximum number of formats that can be |
| 45 | * supported by a video device. |
| 46 | * |
| 47 | * Default: 128 (for Android), 64 (for others) |
| 48 | */ |
| 49 | #ifndef PJMEDIA_VID_DEV_INFO_FMT_CNT |
| 50 | # if defined(PJ_ANDROID) && PJ_ANDROID != 0 |
| 51 | # define PJMEDIA_VID_DEV_INFO_FMT_CNT 128 |
| 52 | # else |
| 53 | # define PJMEDIA_VID_DEV_INFO_FMT_CNT 64 |
| 54 | # endif |
| 55 | #endif |
| 56 | |
| 57 | |
| 58 | /** |
| 59 | * This setting controls the maximum number of supported video device drivers. |
| 60 | * |
| 61 | * Default: 8 |
| 62 | */ |
| 63 | #ifndef PJMEDIA_VID_DEV_MAX_DRIVERS |
| 64 | # define PJMEDIA_VID_DEV_MAX_DRIVERS 8 |
| 65 | #endif |
| 66 | |
| 67 | /** |
| 68 | * This setting controls the maximum number of supported video devices. |
| 69 | * |
| 70 | * Default: 16 |
| 71 | */ |
| 72 | #ifndef PJMEDIA_VID_DEV_MAX_DEVS |
| 73 | # define PJMEDIA_VID_DEV_MAX_DEVS 16 |
| 74 | #endif |
| 75 | |
| 76 | |
| 77 | #if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) |
| 78 | |
| 79 | /** |
| 80 | * This setting controls whether OpenGL for iOS should be included. |
| 81 | * |
| 82 | * Default: 0 (or detected by configure) |
| 83 | */ |
| 84 | #ifndef PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL |
| 85 | # define PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL 0 |
| 86 | #else |
| 87 | # if defined(PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL) && \ |
| 88 | PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL != 0 |
| 89 | # undef PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES |
| 90 | # define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES 1 |
| 91 | # endif |
| 92 | #endif |
| 93 | |
| 94 | |
| 95 | /** |
| 96 | * This setting controls whether OpenGL for Android should be included. |
| 97 | * |
| 98 | * Default: 0 (or detected by configure) |
| 99 | */ |
| 100 | #ifndef PJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL |
| 101 | # define PJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL 0 |
| 102 | #else |
| 103 | # if defined(PJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL) && \ |
| 104 | PJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL != 0 |
| 105 | # undef PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES |
| 106 | # define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES 1 |
| 107 | # endif |
| 108 | #endif |
| 109 | |
| 110 | |
| 111 | /** |
| 112 | * This setting controls whether OpenGL ES support should be included. |
| 113 | * |
| 114 | * Default: 0 (or detected by configure) |
| 115 | */ |
| 116 | #ifndef PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES |
| 117 | # define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES 0 |
| 118 | #else |
| 119 | # if defined(PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES) && \ |
| 120 | PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES != 0 |
| 121 | # undef PJMEDIA_VIDEO_DEV_HAS_OPENGL |
| 122 | # define PJMEDIA_VIDEO_DEV_HAS_OPENGL 1 |
| 123 | # endif |
| 124 | #endif |
| 125 | |
| 126 | |
| 127 | /** |
| 128 | * This setting controls whether OpenGL support should be included. Note that as |
| 129 | * currently only OpenGLES is supported, when PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES is |
| 130 | * unset, PJMEDIA_VIDEO_DEV_HAS_OPENGL will automatically also be unset. |
| 131 | * |
| 132 | * Default: 0 (or detected by configure) |
| 133 | */ |
| 134 | #ifndef PJMEDIA_VIDEO_DEV_HAS_OPENGL |
| 135 | # define PJMEDIA_VIDEO_DEV_HAS_OPENGL 0 |
| 136 | #else |
| 137 | # if defined(PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES) && \ |
| 138 | PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES == 0 |
| 139 | # undef PJMEDIA_VIDEO_DEV_HAS_OPENGL |
| 140 | # define PJMEDIA_VIDEO_DEV_HAS_OPENGL 0 |
| 141 | # endif |
| 142 | #endif |
| 143 | |
| 144 | |
| 145 | /** |
| 146 | * This setting controls whether SDL support should be included. |
| 147 | * |
| 148 | * Default: 0 (or detected by configure) |
| 149 | */ |
| 150 | #ifndef PJMEDIA_VIDEO_DEV_HAS_SDL |
| 151 | # define PJMEDIA_VIDEO_DEV_HAS_SDL 0 |
| 152 | #endif |
| 153 | |
| 154 | |
| 155 | /** |
| 156 | * This setting controls whether SDL with OPENGL support should be included. |
| 157 | * |
| 158 | * Default: 0 |
| 159 | */ |
| 160 | #ifndef PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL |
| 161 | # define PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 0 |
| 162 | #endif |
| 163 | |
| 164 | |
| 165 | /** |
| 166 | * This setting controls whether QT support should be included. |
| 167 | * |
| 168 | * Default: 0 (or detected by configure) |
| 169 | */ |
| 170 | #ifndef PJMEDIA_VIDEO_DEV_HAS_QT |
| 171 | # define PJMEDIA_VIDEO_DEV_HAS_QT 0 |
| 172 | #endif |
| 173 | |
| 174 | |
| 175 | /** |
| 176 | * This setting controls whether IOS support should be included. |
| 177 | * |
| 178 | * Default: 0 (or detected by configure) |
| 179 | */ |
| 180 | #ifndef PJMEDIA_VIDEO_DEV_HAS_IOS |
| 181 | # define PJMEDIA_VIDEO_DEV_HAS_IOS 0 |
| 182 | #endif |
| 183 | |
| 184 | |
| 185 | /** |
| 186 | * This setting controls whether Direct Show support should be included. |
| 187 | * |
| 188 | * Default: 0 (unfinished) |
| 189 | */ |
| 190 | #ifndef PJMEDIA_VIDEO_DEV_HAS_DSHOW |
| 191 | # define PJMEDIA_VIDEO_DEV_HAS_DSHOW 0 //PJ_WIN32 |
| 192 | #endif |
| 193 | |
| 194 | |
| 195 | /** |
| 196 | * This setting controls whether colorbar source support should be included. |
| 197 | * |
| 198 | * Default: 1 |
| 199 | */ |
| 200 | #ifndef PJMEDIA_VIDEO_DEV_HAS_CBAR_SRC |
| 201 | # define PJMEDIA_VIDEO_DEV_HAS_CBAR_SRC 1 |
| 202 | #endif |
| 203 | |
| 204 | |
| 205 | /** |
| 206 | * This setting controls whether ffmpeg support should be included. |
| 207 | * |
| 208 | * Default: 0 (unfinished) |
| 209 | */ |
| 210 | #ifndef PJMEDIA_VIDEO_DEV_HAS_FFMPEG |
| 211 | # define PJMEDIA_VIDEO_DEV_HAS_FFMPEG 0 |
| 212 | #endif |
| 213 | |
| 214 | |
| 215 | /** |
| 216 | * Video4Linux2 |
| 217 | * |
| 218 | * Default: 0 (or detected by configure) |
| 219 | */ |
| 220 | #ifndef PJMEDIA_VIDEO_DEV_HAS_V4L2 |
| 221 | # define PJMEDIA_VIDEO_DEV_HAS_V4L2 0 |
| 222 | #endif |
| 223 | |
| 224 | |
| 225 | /** |
| 226 | * Enable support for AVI player virtual capture device. |
| 227 | * |
| 228 | * Default: 1 |
| 229 | */ |
| 230 | #ifndef PJMEDIA_VIDEO_DEV_HAS_AVI |
| 231 | # define PJMEDIA_VIDEO_DEV_HAS_AVI 1 |
| 232 | #endif |
| 233 | |
| 234 | |
| 235 | /** |
| 236 | * This setting controls whether Android support should be included. |
| 237 | * |
| 238 | * Default: 0 (or detected by configure) |
| 239 | */ |
| 240 | #ifndef PJMEDIA_VIDEO_DEV_HAS_ANDROID |
| 241 | # define PJMEDIA_VIDEO_DEV_HAS_ANDROID 0 |
| 242 | #endif |
| 243 | |
| 244 | |
| 245 | /** |
| 246 | * Specify the SDL library name to be linked with Visual Studio project. |
| 247 | * By default, the name is autodetected based on SDL version ("sdl.lib" or |
| 248 | * "sdl2.lib"), but application may explicitly specify the library name if this |
| 249 | * autodetection fails. Common names are: "sdl2.lib" or "sdl.lib". |
| 250 | * |
| 251 | * Default: undeclared. |
| 252 | */ |
| 253 | #ifndef PJMEDIA_SDL_LIB |
| 254 | # undef PJMEDIA_SDL_LIB |
| 255 | #endif |
| 256 | |
| 257 | #endif /* defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) */ |
| 258 | |
| 259 | /** |
| 260 | * @} |
| 261 | */ |
| 262 | |
| 263 | PJ_END_DECL |
| 264 | |
| 265 | |
| 266 | #endif /* __PJMEDIA_VIDEODEV_CONFIG_H__ */ |
| 267 | |
| 268 | /* |
| 269 | --------------------- DOCUMENTATION FOLLOWS --------------------------- |
| 270 | */ |
| 271 | |
| 272 | /** |
| 273 | * @addtogroup video_device_api Video Device API |
| 274 | * @{ |
| 275 | |
| 276 | PJMEDIA Video Device API is a cross-platform video API appropriate for use with |
| 277 | VoIP applications and many other types of video streaming applications. |
| 278 | |
| 279 | The API abstracts many different video API's on various platforms, such as: |
| 280 | - native Direct Show video for Win32 and Windows Mobile devices |
| 281 | - null-video implementation |
| 282 | - and more to be implemented in the future |
| 283 | |
| 284 | The Video Device API/library is an evolution from PJMEDIA @ref PJMED_SND and |
| 285 | contains many enhancements: |
| 286 | |
| 287 | - Forward compatibility: |
| 288 | \n |
| 289 | The new API has been designed to be extensible, it will support new API's as |
| 290 | well as new features that may be introduced in the future without breaking |
| 291 | compatibility with applications that use this API as well as compatibility |
| 292 | with existing device implementations. |
| 293 | |
| 294 | - Device capabilities: |
| 295 | \n |
| 296 | At the heart of the API is device capabilities management, where all possible |
| 297 | video capabilities of video devices should be able to be handled in a generic |
| 298 | manner. With this framework, new capabilities that may be discovered in the |
| 299 | future can be handled in manner without breaking existing applications. |
| 300 | |
| 301 | - Built-in features: |
| 302 | \n |
| 303 | The device capabilities framework enables applications to use and control |
| 304 | video features built-in in the device, such as: |
| 305 | - built-in formats, |
| 306 | - etc. |
| 307 | |
| 308 | - Codec support: |
| 309 | \n |
| 310 | Some video devices support built-in hardware video codecs, and application |
| 311 | can use the video device in encoded mode to make use of these hardware |
| 312 | codecs. |
| 313 | |
| 314 | - Multiple backends: |
| 315 | \n |
| 316 | The new API supports multiple video backends (called factories or drivers in |
| 317 | the code) to be active simultaneously, and video backends may be added or |
| 318 | removed during run-time. |
| 319 | |
| 320 | */ |
| 321 | |
| 322 | |
| 323 | /** |
| 324 | * @} |
| 325 | */ |
| 326 |