Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / video_engine / vie_defines.h
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
11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_
12 #define WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_
13
14 #include "webrtc/engine_configurations.h"
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
25 #include <sys/socket.h>  // NOLINT
26 #include <sys/time.h>  // NOLINT
27 #include <sys/types.h>  // NOLINT
28 #include <time.h>  // NOLINT
29 #endif
30
31 namespace webrtc {
32
33 // General
34 enum { kViEMinKeyRequestIntervalMs = 300 };
35
36 // ViEBase
37 enum { kViEMaxNumberOfChannels = 64 };
38
39 // ViECapture
40 enum { kViEMaxCaptureDevices = 256 };
41 enum { kViECaptureDefaultWidth = 352 };
42 enum { kViECaptureDefaultHeight = 288 };
43 enum { kViECaptureDefaultFramerate = 30 };
44 enum { kViECaptureMaxSnapshotWaitTimeMs = 500 };
45
46 // ViECodec
47 enum { kViEMaxCodecWidth = 4096 };
48 enum { kViEMaxCodecHeight = 3072 };
49 enum { kViEMaxCodecFramerate = 60 };
50 enum { kViEMinCodecBitrate = 30 };
51
52 // ViENetwork
53 enum { kViEMaxMtu = 1500 };
54 enum { kViESocketThreads = 1 };
55 enum { kViENumReceiveSocketBuffers = 500 };
56
57 // ViERender
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 };
63
64 // ViERTP_RTCP
65 enum { kSendSidePacketHistorySize = 600 };
66
67 // NACK
68 enum { kMaxPacketAgeToNack = 450 };  // In sequence numbers.
69 enum { kMaxNackListSize = 250 };
70
71 // Id definitions
72 enum {
73   kViEChannelIdBase = 0x0,
74   kViEChannelIdMax = 0xFF,
75   kViECaptureIdBase = 0x1001,
76   kViECaptureIdMax = 0x10FF,
77   kViEDummyChannelId = 0xFFFF
78 };
79
80 // Module id
81 // Create a unique id based on the ViE instance id and the
82 // channel id. ViE id > 0 and 0 <= channel id <= 255
83
84 inline int ViEId(const int vieId, const int channelId = -1) {
85   if (channelId == -1) {
86     return static_cast<int>((vieId << 16) + kViEDummyChannelId);
87   }
88   return static_cast<int>((vieId << 16) + channelId);
89 }
90
91 inline int ViEModuleId(const int vieId, const int channelId = -1) {
92   if (channelId == -1) {
93     return static_cast<int>((vieId << 16) + kViEDummyChannelId);
94   }
95   return static_cast<int>((vieId << 16) + channelId);
96 }
97
98 inline int ChannelId(const int moduleId) {
99   return static_cast<int>(moduleId & 0xffff);
100 }
101
102 // Windows specific.
103 #if defined(_WIN32)
104   #define RENDER_MODULE_TYPE kRenderWindows
105
106   // Include libraries.
107   #pragma comment(lib, "winmm.lib")
108
109   #ifndef WEBRTC_EXTERNAL_TRANSPORT
110   #pragma comment(lib, "ws2_32.lib")
111   #pragma comment(lib, "Iphlpapi.lib")   // _GetAdaptersAddresses
112   #endif
113 #endif
114
115 // Mac specific.
116 #ifdef WEBRTC_MAC
117   #define SLEEP(x) usleep(x * 1000)
118   #define RENDER_MODULE_TYPE kRenderWindows
119 #endif
120
121 // Android specific.
122 #ifdef WEBRTC_ANDROID
123   #define FAR
124   #define __cdecl
125 #endif  // WEBRTC_ANDROID
126
127 }  // namespace webrtc
128
129 #endif  // WEBRTC_VIDEO_ENGINE_VIE_DEFINES_H_