1/*
2 * libjingle
3 * Copyright 2012 Google Inc.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 *  1. Redistributions of source code must retain the above copyright notice,
9 *     this list of conditions and the following disclaimer.
10 *  2. Redistributions in binary form must reproduce the above copyright notice,
11 *     this list of conditions and the following disclaimer in the documentation
12 *     and/or other materials provided with the distribution.
13 *  3. The name of the author may not be used to endorse or promote products
14 *     derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include "talk/media/base/constants.h"
29
30#include <string>
31
32namespace cricket {
33
34const int kVideoCodecClockrate = 90000;
35const int kDataCodecClockrate = 90000;
36const int kDataMaxBandwidth = 30720;  // bps
37
38const float kHighSystemCpuThreshold = 0.85f;
39const float kLowSystemCpuThreshold = 0.65f;
40const float kProcessCpuThreshold = 0.10f;
41
42const char kRtxCodecName[] = "rtx";
43const char kRedCodecName[] = "red";
44const char kUlpfecCodecName[] = "ulpfec";
45
46const char kCodecParamAssociatedPayloadType[] = "apt";
47
48const char kOpusCodecName[] = "opus";
49const char kIsacCodecName[] = "isac";
50const char kL16CodecName[]  = "l16";
51const char kG722CodecName[] = "g722";
52const char kIlbcCodecName[] = "ilbc";
53const char kPcmuCodecName[] = "pcmu";
54const char kPcmaCodecName[] = "pcma";
55const char kCnCodecName[]   = "cn";
56const char kDtmfCodecName[] = "telephone-event";
57
58// draft-spittka-payload-rtp-opus-03.txt
59const char kCodecParamPTime[] = "ptime";
60const char kCodecParamMaxPTime[] = "maxptime";
61const char kCodecParamMinPTime[] = "minptime";
62const char kCodecParamSPropStereo[] = "sprop-stereo";
63const char kCodecParamStereo[] = "stereo";
64const char kCodecParamUseInbandFec[] = "useinbandfec";
65const char kCodecParamUseDtx[] = "usedtx";
66const char kCodecParamMaxAverageBitrate[] = "maxaveragebitrate";
67const char kCodecParamMaxPlaybackRate[] = "maxplaybackrate";
68
69const char kCodecParamSctpProtocol[] = "protocol";
70const char kCodecParamSctpStreams[] = "streams";
71
72const char kParamValueTrue[] = "1";
73const char kParamValueEmpty[] = "";
74
75const int kOpusDefaultMaxPTime = 120;
76const int kOpusDefaultPTime = 20;
77const int kOpusDefaultMinPTime = 3;
78const int kOpusDefaultSPropStereo = 0;
79const int kOpusDefaultStereo = 0;
80const int kOpusDefaultUseInbandFec = 0;
81const int kOpusDefaultUseDtx = 0;
82const int kOpusDefaultMaxPlaybackRate = 48000;
83
84const int kPreferredMaxPTime = 60;
85const int kPreferredMinPTime = 10;
86const int kPreferredSPropStereo = 0;
87const int kPreferredStereo = 0;
88const int kPreferredUseInbandFec = 0;
89
90const char kRtcpFbParamNack[] = "nack";
91const char kRtcpFbNackParamPli[] = "pli";
92const char kRtcpFbParamRemb[] = "goog-remb";
93const char kRtcpFbParamTransportCc[] = "transport-cc";
94
95const char kRtcpFbParamCcm[] = "ccm";
96const char kRtcpFbCcmParamFir[] = "fir";
97const char kCodecParamMaxBitrate[] = "x-google-max-bitrate";
98const char kCodecParamMinBitrate[] = "x-google-min-bitrate";
99const char kCodecParamStartBitrate[] = "x-google-start-bitrate";
100const char kCodecParamMaxQuantization[] = "x-google-max-quantization";
101const char kCodecParamPort[] = "x-google-port";
102
103const int kGoogleRtpDataCodecId = 101;
104const char kGoogleRtpDataCodecName[] = "google-data";
105
106const int kGoogleSctpDataCodecId = 108;
107const char kGoogleSctpDataCodecName[] = "google-sctp-data";
108
109const char kComfortNoiseCodecName[] = "CN";
110
111const int kRtpAudioLevelHeaderExtensionDefaultId = 1;
112const char kRtpAudioLevelHeaderExtension[] =
113    "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
114
115const int kRtpTimestampOffsetHeaderExtensionDefaultId = 2;
116const char kRtpTimestampOffsetHeaderExtension[] =
117    "urn:ietf:params:rtp-hdrext:toffset";
118
119const int kRtpAbsoluteSenderTimeHeaderExtensionDefaultId = 3;
120const char kRtpAbsoluteSenderTimeHeaderExtension[] =
121    "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
122
123const int kRtpVideoRotationHeaderExtensionDefaultId = 4;
124const char kRtpVideoRotationHeaderExtension[] = "urn:3gpp:video-orientation";
125const char kRtpVideoRotation6BitsHeaderExtensionForTesting[] =
126    "urn:3gpp:video-orientation:6";
127
128const int kRtpTransportSequenceNumberHeaderExtensionDefaultId = 5;
129const char kRtpTransportSequenceNumberHeaderExtension[] =
130    "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions";
131
132const int kNumDefaultUnsignalledVideoRecvStreams = 0;
133
134const char kVp8CodecName[] = "VP8";
135const char kVp9CodecName[] = "VP9";
136const char kH264CodecName[] = "H264";
137
138const int kDefaultVp8PlType = 100;
139const int kDefaultVp9PlType = 101;
140const int kDefaultH264PlType = 107;
141const int kDefaultRedPlType = 116;
142const int kDefaultUlpfecType = 117;
143const int kDefaultRtxVp8PlType = 96;
144
145const int kDefaultVideoMaxWidth = 640;
146const int kDefaultVideoMaxHeight = 400;
147const int kDefaultVideoMaxFramerate = 30;
148}  // namespace cricket
149
150