• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
32 namespace cricket {
33 
34 const int kVideoCodecClockrate = 90000;
35 const int kDataCodecClockrate = 90000;
36 const int kDataMaxBandwidth = 30720;  // bps
37 
38 const float kHighSystemCpuThreshold = 0.85f;
39 const float kLowSystemCpuThreshold = 0.65f;
40 const float kProcessCpuThreshold = 0.10f;
41 
42 const char kRtxCodecName[] = "rtx";
43 const char kRedCodecName[] = "red";
44 const char kUlpfecCodecName[] = "ulpfec";
45 
46 const char kCodecParamAssociatedPayloadType[] = "apt";
47 
48 const char kOpusCodecName[] = "opus";
49 const char kIsacCodecName[] = "isac";
50 const char kL16CodecName[]  = "l16";
51 const char kG722CodecName[] = "g722";
52 const char kIlbcCodecName[] = "ilbc";
53 const char kPcmuCodecName[] = "pcmu";
54 const char kPcmaCodecName[] = "pcma";
55 const char kCnCodecName[]   = "cn";
56 const char kDtmfCodecName[] = "telephone-event";
57 
58 // draft-spittka-payload-rtp-opus-03.txt
59 const char kCodecParamPTime[] = "ptime";
60 const char kCodecParamMaxPTime[] = "maxptime";
61 const char kCodecParamMinPTime[] = "minptime";
62 const char kCodecParamSPropStereo[] = "sprop-stereo";
63 const char kCodecParamStereo[] = "stereo";
64 const char kCodecParamUseInbandFec[] = "useinbandfec";
65 const char kCodecParamUseDtx[] = "usedtx";
66 const char kCodecParamMaxAverageBitrate[] = "maxaveragebitrate";
67 const char kCodecParamMaxPlaybackRate[] = "maxplaybackrate";
68 
69 const char kCodecParamSctpProtocol[] = "protocol";
70 const char kCodecParamSctpStreams[] = "streams";
71 
72 const char kParamValueTrue[] = "1";
73 const char kParamValueEmpty[] = "";
74 
75 const int kOpusDefaultMaxPTime = 120;
76 const int kOpusDefaultPTime = 20;
77 const int kOpusDefaultMinPTime = 3;
78 const int kOpusDefaultSPropStereo = 0;
79 const int kOpusDefaultStereo = 0;
80 const int kOpusDefaultUseInbandFec = 0;
81 const int kOpusDefaultUseDtx = 0;
82 const int kOpusDefaultMaxPlaybackRate = 48000;
83 
84 const int kPreferredMaxPTime = 60;
85 const int kPreferredMinPTime = 10;
86 const int kPreferredSPropStereo = 0;
87 const int kPreferredStereo = 0;
88 const int kPreferredUseInbandFec = 0;
89 
90 const char kRtcpFbParamNack[] = "nack";
91 const char kRtcpFbNackParamPli[] = "pli";
92 const char kRtcpFbParamRemb[] = "goog-remb";
93 const char kRtcpFbParamTransportCc[] = "transport-cc";
94 
95 const char kRtcpFbParamCcm[] = "ccm";
96 const char kRtcpFbCcmParamFir[] = "fir";
97 const char kCodecParamMaxBitrate[] = "x-google-max-bitrate";
98 const char kCodecParamMinBitrate[] = "x-google-min-bitrate";
99 const char kCodecParamStartBitrate[] = "x-google-start-bitrate";
100 const char kCodecParamMaxQuantization[] = "x-google-max-quantization";
101 const char kCodecParamPort[] = "x-google-port";
102 
103 const int kGoogleRtpDataCodecId = 101;
104 const char kGoogleRtpDataCodecName[] = "google-data";
105 
106 const int kGoogleSctpDataCodecId = 108;
107 const char kGoogleSctpDataCodecName[] = "google-sctp-data";
108 
109 const char kComfortNoiseCodecName[] = "CN";
110 
111 const int kRtpAudioLevelHeaderExtensionDefaultId = 1;
112 const char kRtpAudioLevelHeaderExtension[] =
113     "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
114 
115 const int kRtpTimestampOffsetHeaderExtensionDefaultId = 2;
116 const char kRtpTimestampOffsetHeaderExtension[] =
117     "urn:ietf:params:rtp-hdrext:toffset";
118 
119 const int kRtpAbsoluteSenderTimeHeaderExtensionDefaultId = 3;
120 const char kRtpAbsoluteSenderTimeHeaderExtension[] =
121     "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
122 
123 const int kRtpVideoRotationHeaderExtensionDefaultId = 4;
124 const char kRtpVideoRotationHeaderExtension[] = "urn:3gpp:video-orientation";
125 const char kRtpVideoRotation6BitsHeaderExtensionForTesting[] =
126     "urn:3gpp:video-orientation:6";
127 
128 const int kRtpTransportSequenceNumberHeaderExtensionDefaultId = 5;
129 const char kRtpTransportSequenceNumberHeaderExtension[] =
130     "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions";
131 
132 const int kNumDefaultUnsignalledVideoRecvStreams = 0;
133 
134 const char kVp8CodecName[] = "VP8";
135 const char kVp9CodecName[] = "VP9";
136 const char kH264CodecName[] = "H264";
137 
138 const int kDefaultVp8PlType = 100;
139 const int kDefaultVp9PlType = 101;
140 const int kDefaultH264PlType = 107;
141 const int kDefaultRedPlType = 116;
142 const int kDefaultUlpfecType = 117;
143 const int kDefaultRtxVp8PlType = 96;
144 
145 const int kDefaultVideoMaxWidth = 640;
146 const int kDefaultVideoMaxHeight = 400;
147 const int kDefaultVideoMaxFramerate = 30;
148 }  // namespace cricket
149 
150