2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_
12 #define WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_
14 #include "webrtc/engine_configurations.h"
16 // TODO(mflodman) Remove.
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
25 #include <sys/socket.h> // NOLINT
26 #include <sys/time.h> // NOLINT
27 #include <sys/types.h> // NOLINT
28 #include <time.h> // NOLINT
34 enum { kViEMinKeyRequestIntervalMs = 300 };
37 enum { kViEMaxNumberOfChannels = 64 };
40 enum { kViEMaxCaptureDevices = 256 };
41 enum { kViECaptureDefaultWidth = 352 };
42 enum { kViECaptureDefaultHeight = 288 };
43 enum { kViECaptureDefaultFramerate = 30 };
44 enum { kViECaptureMaxSnapshotWaitTimeMs = 500 };
47 enum { kViEMaxCodecWidth = 4096 };
48 enum { kViEMaxCodecHeight = 3072 };
49 enum { kViEMaxCodecFramerate = 60 };
50 enum { kViEMinCodecBitrate = 30 };
53 enum { kViEMaxMtu = 1500 };
54 enum { kViESocketThreads = 1 };
55 enum { kViENumReceiveSocketBuffers = 500 };
58 // Max valid time set in SetRenderTimeoutImage
59 enum { kViEMaxRenderTimeoutTimeMs = 10000 };
60 // Min valid time set in SetRenderTimeoutImage
61 enum { kViEMinRenderTimeoutTimeMs = 33 };
62 enum { kViEDefaultRenderDelayMs = 10 };
65 enum { kSendSidePacketHistorySize = 600 };
68 enum { kMaxPacketAgeToNack = 450 }; // In sequence numbers.
69 enum { kMaxNackListSize = 250 };
73 kViEChannelIdBase = 0x0,
74 kViEChannelIdMax = 0xFF,
75 kViECaptureIdBase = 0x1001,
76 kViECaptureIdMax = 0x10FF,
77 kViEDummyChannelId = 0xFFFF
81 // Create a unique id based on the ViE instance id and the
82 // channel id. ViE id > 0 and 0 <= channel id <= 255
84 inline int ViEId(const int vieId, const int channelId = -1) {
85 if (channelId == -1) {
86 return static_cast<int>((vieId << 16) + kViEDummyChannelId);
88 return static_cast<int>((vieId << 16) + channelId);
91 inline int ViEModuleId(const int vieId, const int channelId = -1) {
92 if (channelId == -1) {
93 return static_cast<int>((vieId << 16) + kViEDummyChannelId);
95 return static_cast<int>((vieId << 16) + channelId);
98 inline int ChannelId(const int moduleId) {
99 return static_cast<int>(moduleId & 0xffff);
104 #define RENDER_MODULE_TYPE kRenderWindows
106 // Include libraries.
107 #pragma comment(lib, "winmm.lib")
109 #ifndef WEBRTC_EXTERNAL_TRANSPORT
110 #pragma comment(lib, "ws2_32.lib")
111 #pragma comment(lib, "Iphlpapi.lib") // _GetAdaptersAddresses
117 #define SLEEP(x) usleep(x * 1000)
118 #define RENDER_MODULE_TYPE kRenderWindows
122 #ifdef WEBRTC_ANDROID
125 #endif // WEBRTC_ANDROID
127 } // namespace webrtc
129 #endif // WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_