andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
niklas.enbom@webrtc.org | ab360a7 | 2012-10-31 14:35:11 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_ |
| 12 | #define WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_ |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 13 | |
pbos@webrtc.org | 281cff8 | 2013-05-17 13:44:48 +0000 | [diff] [blame] | 14 | #include "webrtc/engine_configurations.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 15 | |
| 16 | // TODO(mflodman) Remove. |
| 17 | #ifdef WEBRTC_ANDROID |
| 18 | #include <arpa/inet.h> // NOLINT |
| 19 | #include <linux/net.h> // NOLINT |
| 20 | #include <netinet/in.h> // NOLINT |
| 21 | #include <pthread.h> // NOLINT |
| 22 | #include <stdio.h> // NOLINT |
| 23 | #include <stdlib.h> // NOLINT |
| 24 | #include <string.h> // NOLINT |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 25 | #include <sys/socket.h> // NOLINT |
| 26 | #include <sys/time.h> // NOLINT |
pbos@webrtc.org | 281cff8 | 2013-05-17 13:44:48 +0000 | [diff] [blame] | 27 | #include <sys/types.h> // NOLINT |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 28 | #include <time.h> // NOLINT |
| 29 | #endif |
| 30 | |
| 31 | namespace webrtc { |
| 32 | |
| 33 | // General |
| 34 | enum { kViEMinKeyRequestIntervalMs = 300 }; |
| 35 | |
| 36 | // ViEBase |
| 37 | enum { kViEMaxNumberOfChannels = 32 }; |
| 38 | enum { kViEVersionMaxMessageSize = 1024 }; |
| 39 | enum { kViEMaxModuleVersionSize = 960 }; |
| 40 | |
| 41 | // ViECapture |
vikasmarwaha@webrtc.org | dcfeff7 | 2013-05-13 20:28:23 +0000 | [diff] [blame] | 42 | enum { kViEMaxCaptureDevices = 256 }; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 43 | enum { kViECaptureDefaultWidth = 352 }; |
| 44 | enum { kViECaptureDefaultHeight = 288 }; |
| 45 | enum { kViECaptureDefaultFramerate = 30 }; |
| 46 | enum { kViECaptureMaxSnapshotWaitTimeMs = 500 }; |
| 47 | |
| 48 | // ViECodec |
fbarchard@google.com | f093410 | 2013-02-12 04:57:56 +0000 | [diff] [blame] | 49 | enum { kViEMaxCodecWidth = 4096 }; |
| 50 | enum { kViEMaxCodecHeight = 3072 }; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 51 | enum { kViEMaxCodecFramerate = 60 }; |
| 52 | enum { kViEMinCodecBitrate = 30 }; |
| 53 | |
| 54 | // ViEEncryption |
| 55 | enum { kViEMaxSrtpKeyLength = 30 }; |
| 56 | enum { kViEMinSrtpEncryptLength = 16 }; |
| 57 | enum { kViEMaxSrtpEncryptLength = 256 }; |
| 58 | enum { kViEMaxSrtpAuthSh1Length = 20 }; |
| 59 | enum { kViEMaxSrtpTagAuthNullLength = 12 }; |
| 60 | enum { kViEMaxSrtpKeyAuthNullLength = 256 }; |
| 61 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 62 | // ViENetwork |
| 63 | enum { kViEMaxMtu = 1500 }; |
| 64 | enum { kViESocketThreads = 1 }; |
| 65 | enum { kViENumReceiveSocketBuffers = 500 }; |
| 66 | |
| 67 | // ViERender |
| 68 | // Max valid time set in SetRenderTimeoutImage |
| 69 | enum { kViEMaxRenderTimeoutTimeMs = 10000 }; |
| 70 | // Min valid time set in SetRenderTimeoutImage |
| 71 | enum { kViEMinRenderTimeoutTimeMs = 33 }; |
| 72 | enum { kViEDefaultRenderDelayMs = 10 }; |
| 73 | |
| 74 | // ViERTP_RTCP |
stefan@webrtc.org | 7fff32c | 2013-02-01 15:09:57 +0000 | [diff] [blame] | 75 | enum { kSendSidePacketHistorySize = 600 }; |
| 76 | |
| 77 | // NACK |
| 78 | enum { kMaxPacketAgeToNack = 450 }; // In sequence numbers. |
| 79 | enum { kMaxNackListSize = 250 }; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 80 | |
| 81 | // Id definitions |
| 82 | enum { |
| 83 | kViEChannelIdBase = 0x0, |
| 84 | kViEChannelIdMax = 0xFF, |
| 85 | kViECaptureIdBase = 0x1001, |
| 86 | kViECaptureIdMax = 0x10FF, |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 87 | kViEDummyChannelId = 0xFFFF |
| 88 | }; |
| 89 | |
| 90 | // Module id |
| 91 | // Create a unique id based on the ViE instance id and the |
| 92 | // channel id. ViE id > 0 and 0 <= channel id <= 255 |
| 93 | |
| 94 | inline int ViEId(const int vieId, const int channelId = -1) { |
| 95 | if (channelId == -1) { |
| 96 | return static_cast<int>((vieId << 16) + kViEDummyChannelId); |
| 97 | } |
| 98 | return static_cast<int>((vieId << 16) + channelId); |
| 99 | } |
| 100 | |
| 101 | inline int ViEModuleId(const int vieId, const int channelId = -1) { |
| 102 | if (channelId == -1) { |
| 103 | return static_cast<int>((vieId << 16) + kViEDummyChannelId); |
| 104 | } |
| 105 | return static_cast<int>((vieId << 16) + channelId); |
| 106 | } |
| 107 | |
| 108 | inline int ChannelId(const int moduleId) { |
| 109 | return static_cast<int>(moduleId & 0xffff); |
| 110 | } |
| 111 | |
pbos@webrtc.org | 7d6e2a0 | 2013-05-13 09:29:03 +0000 | [diff] [blame] | 112 | // Build information macros |
| 113 | #if defined(_DEBUG) || defined(DEBUG) |
| 114 | #define BUILDMODE "d" |
| 115 | #elif defined(NDEBUG) |
| 116 | #define BUILDMODE "r" |
| 117 | #else |
| 118 | #define BUILDMODE "?" |
| 119 | #endif |
| 120 | |
| 121 | #define BUILDTIME __TIME__ |
| 122 | #define BUILDDATE __DATE__ |
| 123 | |
| 124 | // Example: "Oct 10 2002 12:05:30 r". |
| 125 | #define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE |
| 126 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 127 | // Windows specific. |
| 128 | #if defined(_WIN32) |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 129 | #define RENDER_MODULE_TYPE kRenderWindows |
| 130 | |
| 131 | // Warning pragmas. |
| 132 | // new behavior: elements of array 'XXX' will be default initialized. |
| 133 | #pragma warning(disable: 4351) |
| 134 | // 'this' : used in base member initializer list. |
| 135 | #pragma warning(disable: 4355) |
| 136 | // Frame pointer register 'ebp' modified by inline assembly code. |
| 137 | #pragma warning(disable: 4731) |
| 138 | |
| 139 | // Include libraries. |
| 140 | #pragma comment(lib, "winmm.lib") |
| 141 | |
| 142 | #ifndef WEBRTC_EXTERNAL_TRANSPORT |
| 143 | #pragma comment(lib, "ws2_32.lib") |
| 144 | #pragma comment(lib, "Iphlpapi.lib") // _GetAdaptersAddresses |
| 145 | #endif |
| 146 | #endif |
| 147 | |
| 148 | // Mac specific. |
| 149 | #ifdef WEBRTC_MAC |
| 150 | #define SLEEP(x) usleep(x * 1000) |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 151 | #define RENDER_MODULE_TYPE kRenderWindows |
| 152 | #endif |
| 153 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 154 | // Android specific. |
| 155 | #ifdef WEBRTC_ANDROID |
| 156 | #define FAR |
| 157 | #define __cdecl |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 158 | #endif // WEBRTC_ANDROID |
| 159 | |
| 160 | } // namespace webrtc |
| 161 | |
niklas.enbom@webrtc.org | ab360a7 | 2012-10-31 14:35:11 +0000 | [diff] [blame] | 162 | #endif // WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_ |