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 #include "media/base/media_constants.h"
12 
13 namespace cricket {
14 
15 const int kVideoCodecClockrate = 90000;
16 const int kDataCodecClockrate = 90000;
17 const int kRtpDataMaxBandwidth = 30720;  // bps
18 
19 const int kVideoMtu = 1200;
20 const int kVideoRtpSendBufferSize = 65536;
21 const int kVideoRtpRecvBufferSize = 262144;
22 
23 const float kHighSystemCpuThreshold = 0.85f;
24 const float kLowSystemCpuThreshold = 0.65f;
25 const float kProcessCpuThreshold = 0.10f;
26 
27 const char kRedCodecName[] = "red";
28 const char kUlpfecCodecName[] = "ulpfec";
29 const char kMultiplexCodecName[] = "multiplex";
30 
31 // TODO(brandtr): Change this to 'flexfec' when we are confident that the
32 // header format is not changing anymore.
33 const char kFlexfecCodecName[] = "flexfec-03";
34 
35 // draft-ietf-payload-flexible-fec-scheme-02.txt
36 const char kFlexfecFmtpRepairWindow[] = "repair-window";
37 
38 // RFC 4588 RTP Retransmission Payload Format
39 const char kRtxCodecName[] = "rtx";
40 const char kCodecParamRtxTime[] = "rtx-time";
41 const char kCodecParamAssociatedPayloadType[] = "apt";
42 
43 const char kCodecParamAssociatedCodecName[] = "acn";
44 
45 const char kOpusCodecName[] = "opus";
46 const char kIsacCodecName[] = "ISAC";
47 const char kL16CodecName[] = "L16";
48 const char kG722CodecName[] = "G722";
49 const char kIlbcCodecName[] = "ILBC";
50 const char kPcmuCodecName[] = "PCMU";
51 const char kPcmaCodecName[] = "PCMA";
52 const char kCnCodecName[] = "CN";
53 const char kDtmfCodecName[] = "telephone-event";
54 
55 // draft-spittka-payload-rtp-opus-03.txt
56 const char kCodecParamPTime[] = "ptime";
57 const char kCodecParamMaxPTime[] = "maxptime";
58 const char kCodecParamMinPTime[] = "minptime";
59 const char kCodecParamSPropStereo[] = "sprop-stereo";
60 const char kCodecParamStereo[] = "stereo";
61 const char kCodecParamUseInbandFec[] = "useinbandfec";
62 const char kCodecParamUseDtx[] = "usedtx";
63 const char kCodecParamMaxAverageBitrate[] = "maxaveragebitrate";
64 const char kCodecParamMaxPlaybackRate[] = "maxplaybackrate";
65 
66 const char kParamValueTrue[] = "1";
67 const char kParamValueEmpty[] = "";
68 
69 const int kOpusDefaultMaxPTime = 120;
70 const int kOpusDefaultPTime = 20;
71 const int kOpusDefaultMinPTime = 3;
72 const int kOpusDefaultSPropStereo = 0;
73 const int kOpusDefaultStereo = 0;
74 const int kOpusDefaultUseInbandFec = 0;
75 const int kOpusDefaultUseDtx = 0;
76 const int kOpusDefaultMaxPlaybackRate = 48000;
77 
78 const int kPreferredMaxPTime = 120;
79 const int kPreferredMinPTime = 10;
80 const int kPreferredSPropStereo = 0;
81 const int kPreferredStereo = 0;
82 const int kPreferredUseInbandFec = 0;
83 
84 const char kPacketizationParamRaw[] = "raw";
85 
86 const char kRtcpFbParamLntf[] = "goog-lntf";
87 const char kRtcpFbParamNack[] = "nack";
88 const char kRtcpFbNackParamPli[] = "pli";
89 const char kRtcpFbParamRemb[] = "goog-remb";
90 const char kRtcpFbParamTransportCc[] = "transport-cc";
91 
92 const char kRtcpFbParamCcm[] = "ccm";
93 const char kRtcpFbCcmParamFir[] = "fir";
94 const char kRtcpFbParamRrtr[] = "rrtr";
95 const char kCodecParamMaxBitrate[] = "x-google-max-bitrate";
96 const char kCodecParamMinBitrate[] = "x-google-min-bitrate";
97 const char kCodecParamStartBitrate[] = "x-google-start-bitrate";
98 const char kCodecParamMaxQuantization[] = "x-google-max-quantization";
99 
100 const int kGoogleRtpDataCodecPlType = 109;
101 const char kGoogleRtpDataCodecName[] = "google-data";
102 
103 const char kComfortNoiseCodecName[] = "CN";
104 
105 const char kVp8CodecName[] = "VP8";
106 const char kVp9CodecName[] = "VP9";
107 const char kAv1CodecName[] = "AV1X";
108 const char kH264CodecName[] = "H264";
109 #ifndef DISABLE_H265
110 const char kH265CodecName[] = "H265";
111 #endif
112 
113 // RFC 6184 RTP Payload Format for H.264 video
114 const char kH264FmtpProfileLevelId[] = "profile-level-id";
115 const char kH264FmtpLevelAsymmetryAllowed[] = "level-asymmetry-allowed";
116 const char kH264FmtpPacketizationMode[] = "packetization-mode";
117 const char kH264FmtpSpropParameterSets[] = "sprop-parameter-sets";
118 const char kH264FmtpSpsPpsIdrInKeyframe[] = "sps-pps-idr-in-keyframe";
119 const char kH264ProfileLevelConstrainedBaseline[] = "42e01f";
120 const char kH264ProfileLevelConstrainedHigh[] = "640c1f";
121 #ifndef DISABLE_H265
122 // RFC 7798 RTP Payload Format for H.265 video
123 const char kH265FmtpProfileSpace[] = "profile-space";
124 const char kH265FmtpProfileId[] = "profile-id";
125 const char kH265FmtpTierFlag[] = "tier-flag";
126 const char kH265FmtpLevelId[] = "level-id";
127 #endif
128 
129 const int kDefaultVideoMaxFramerate = 60;
130 
131 const size_t kConferenceMaxNumSpatialLayers = 3;
132 const size_t kConferenceMaxNumTemporalLayers = 3;
133 const size_t kConferenceDefaultNumTemporalLayers = 3;
134 
135 // RFC 3556 and RFC 3890
136 const char kApplicationSpecificBandwidth[] = "AS";
137 const char kTransportSpecificBandwidth[] = "TIAS";
138 }  // namespace cricket
139