tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

media_constants.cc (5678B)


      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 #include <cstddef>
     14 
     15 namespace webrtc {
     16 
     17 const int kVideoCodecClockrate = 90000;
     18 
     19 const int kVideoMtu = 1200;
     20 const int kVideoRtpSendBufferSize = 262144;
     21 const int kVideoRtpRecvBufferSize = 1048576;
     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 
     30 // TODO(brandtr): Change this to 'flexfec' when we are confident that the
     31 // header format is not changing anymore.
     32 const char kFlexfecCodecName[] = "flexfec-03";
     33 
     34 // draft-ietf-payload-flexible-fec-scheme-02.txt
     35 const char kFlexfecFmtpRepairWindow[] = "repair-window";
     36 
     37 // RFC 4588 RTP Retransmission Payload Format
     38 const char kRtxCodecName[] = "rtx";
     39 const char kCodecParamRtxTime[] = "rtx-time";
     40 const char kCodecParamAssociatedPayloadType[] = "apt";
     41 
     42 const char kCodecParamAssociatedCodecName[] = "acn";
     43 // Parameters that do not follow the key-value convention
     44 // are treated as having the empty string as key.
     45 const char kCodecParamNotInNameValueFormat[] = "";
     46 
     47 const char kOpusCodecName[] = "opus";
     48 const char kL16CodecName[] = "L16";
     49 const char kG722CodecName[] = "G722";
     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 kCodecParamCbr[] = "cbr";
     64 const char kCodecParamMaxAverageBitrate[] = "maxaveragebitrate";
     65 const char kCodecParamMaxPlaybackRate[] = "maxplaybackrate";
     66 
     67 const char kParamValueTrue[] = "1";
     68 const char kParamValueEmpty[] = "";
     69 
     70 const int kOpusDefaultMaxPTime = 120;
     71 const int kOpusDefaultPTime = 20;
     72 const int kOpusDefaultMinPTime = 3;
     73 const int kOpusDefaultSPropStereo = 0;
     74 const int kOpusDefaultStereo = 0;
     75 const int kOpusDefaultUseInbandFec = 0;
     76 const int kOpusDefaultUseDtx = 0;
     77 const int kOpusDefaultMaxPlaybackRate = 48000;
     78 
     79 const int kPreferredMaxPTime = 120;
     80 const int kPreferredMinPTime = 10;
     81 const int kPreferredSPropStereo = 0;
     82 const int kPreferredStereo = 0;
     83 const int kPreferredUseInbandFec = 0;
     84 
     85 const char kPacketizationParamRaw[] = "raw";
     86 
     87 const char kRtcpFbParamLntf[] = "goog-lntf";
     88 const char kRtcpFbParamNack[] = "nack";
     89 const char kRtcpFbNackParamPli[] = "pli";
     90 const char kRtcpFbParamRemb[] = "goog-remb";
     91 const char kRtcpFbParamTransportCc[] = "transport-cc";
     92 
     93 const char kRtcpFbParamCcm[] = "ccm";
     94 const char kRtcpFbCcmParamFir[] = "fir";
     95 const char kRtcpFbParamRrtr[] = "rrtr";
     96 const char kCodecParamMaxBitrate[] = "x-google-max-bitrate";
     97 const char kCodecParamMinBitrate[] = "x-google-min-bitrate";
     98 const char kCodecParamStartBitrate[] = "x-google-start-bitrate";
     99 const char kCodecParamMaxQuantization[] = "x-google-max-quantization";
    100 const char kCodecParamPerLayerPictureLossIndication[] =
    101    "x-google-per-layer-pli";
    102 
    103 const char kComfortNoiseCodecName[] = "CN";
    104 
    105 const char kVp8CodecName[] = "VP8";
    106 const char kVp9CodecName[] = "VP9";
    107 const char kAv1CodecName[] = "AV1";
    108 const char kH264CodecName[] = "H264";
    109 const char kH265CodecName[] = "H265";
    110 
    111 // RFC 6184 RTP Payload Format for H.264 video
    112 const char kH264FmtpProfileLevelId[] = "profile-level-id";
    113 const char kH264FmtpLevelAsymmetryAllowed[] = "level-asymmetry-allowed";
    114 const char kH264FmtpPacketizationMode[] = "packetization-mode";
    115 const char kH264FmtpSpropParameterSets[] = "sprop-parameter-sets";
    116 const char kH264FmtpSpsPpsIdrInKeyframe[] = "sps-pps-idr-in-keyframe";
    117 const char kH264ProfileLevelConstrainedBaseline[] = "42e01f";
    118 const char kH264ProfileLevelConstrainedHigh[] = "640c1f";
    119 
    120 // RFC 7798 RTP Payload Format for H.265 video
    121 const char kH265FmtpProfileSpace[] = "profile-space";
    122 const char kH265FmtpTierFlag[] = "tier-flag";
    123 const char kH265FmtpProfileId[] = "profile-id";
    124 const char kH265FmtpLevelId[] = "level-id";
    125 const char kH265FmtpProfileCompatibilityIndicator[] =
    126    "profile-compatibility-indicator";
    127 const char kH265FmtpInteropConstraints[] = "interop-constraints";
    128 const char kH265FmtpTxMode[] = "tx-mode";
    129 
    130 // draft-ietf-payload-vp9
    131 const char kVP9ProfileId[] = "profile-id";
    132 
    133 // https://aomediacodec.github.io/av1-rtp-spec/
    134 const char kAv1FmtpProfile[] = "profile";
    135 const char kAv1FmtpLevelIdx[] = "level-idx";
    136 const char kAv1FmtpTier[] = "tier";
    137 
    138 const int kDefaultVideoMaxFramerate = 60;
    139 // Max encode quantizer for VP8/9 and AV1 encoders assuming libvpx/libaom API
    140 // range [0, 63]
    141 const int kDefaultVideoMaxQpVpx = 56;
    142 const int kDefaultVideoMaxQpAv1 = 52;
    143 // Max encode quantizer for H264/5 assuming the bitstream range [0, 51].
    144 const int kDefaultVideoMaxQpH26x = 51;
    145 
    146 const size_t kConferenceMaxNumSpatialLayers = 3;
    147 const size_t kConferenceMaxNumTemporalLayers = 3;
    148 const size_t kConferenceDefaultNumTemporalLayers = 3;
    149 
    150 // RFC 3556 and RFC 3890
    151 const char kApplicationSpecificBandwidth[] = "AS";
    152 const char kTransportSpecificBandwidth[] = "TIAS";
    153 }  // namespace webrtc