constants.cc revision 704bf9ebec9c9425e1898f6c3f15eff685175b23
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";
43
44// RTP payload type is in the 0-127 range. Use 128 to indicate "all" payload
45// types.
46const int kWildcardPayloadType = -1;
47
48const char kCodecParamAssociatedPayloadType[] = "apt";
49
50const char kOpusCodecName[] = "opus";
51
52// draft-spittka-payload-rtp-opus-03.txt
53const char kCodecParamPTime[] = "ptime";
54const char kCodecParamMaxPTime[] = "maxptime";
55const char kCodecParamMinPTime[] = "minptime";
56const char kCodecParamSPropStereo[] = "sprop-stereo";
57const char kCodecParamStereo[] = "stereo";
58const char kCodecParamUseInbandFec[] = "useinbandfec";
59const char kCodecParamMaxAverageBitrate[] = "maxaveragebitrate";
60
61const char kCodecParamSctpProtocol[] = "protocol";
62const char kCodecParamSctpStreams[] = "streams";
63
64const char kParamValueTrue[] = "1";
65const char kParamValueEmpty[] = "";
66
67const int kOpusDefaultMaxPTime = 120;
68const int kOpusDefaultPTime = 20;
69const int kOpusDefaultMinPTime = 3;
70const int kOpusDefaultSPropStereo = 0;
71const int kOpusDefaultStereo = 0;
72const int kOpusDefaultUseInbandFec = 0;
73
74const int kPreferredMaxPTime = 60;
75const int kPreferredMinPTime = 10;
76const int kPreferredSPropStereo = 0;
77const int kPreferredStereo = 0;
78const int kPreferredUseInbandFec = 0;
79
80const char kRtcpFbParamNack[] = "nack";
81const char kRtcpFbNackParamPli[] = "pli";
82const char kRtcpFbParamRemb[] = "goog-remb";
83
84const char kRtcpFbParamCcm[] = "ccm";
85const char kRtcpFbCcmParamFir[] = "fir";
86const char kCodecParamMaxBitrate[] = "x-google-max-bitrate";
87const char kCodecParamMinBitrate[] = "x-google-min-bitrate";
88const char kCodecParamMaxQuantization[] = "x-google-max-quantization";
89const char kCodecParamPort[] = "x-google-port";
90
91const int kGoogleRtpDataCodecId = 101;
92const char kGoogleRtpDataCodecName[] = "google-data";
93
94const int kGoogleSctpDataCodecId = 108;
95const char kGoogleSctpDataCodecName[] = "google-sctp-data";
96
97const char kComfortNoiseCodecName[] = "CN";
98
99const char kRtpAbsoluteSendTimeHeaderExtension[] =
100    "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
101
102const int kNumDefaultUnsignalledVideoRecvStreams = 0;
103
104
105}  // namespace cricket
106
107