Index: webrtc/common_types.h |
diff --git a/webrtc/common_types.h b/webrtc/common_types.h |
index cdc493aafcf297b8b279d1f8f1694c374604427a..1ef5f91674b581f1d39e79bfa3f2098f8271b42e 100644 |
--- a/webrtc/common_types.h |
+++ b/webrtc/common_types.h |
@@ -23,7 +23,7 @@ |
#if defined(_MSC_VER) |
// Disable "new behavior: elements of array will be default initialized" |
// warning. Affects OverUseDetectorOptions. |
-#pragma warning(disable:4351) |
+#pragma warning(disable : 4351) |
#endif |
#ifdef WEBRTC_EXPORT |
@@ -74,54 +74,52 @@ class OutStream : public RewindableStream { |
virtual bool Write(const void* buf, size_t len) = 0; |
}; |
-enum TraceModule |
-{ |
- kTraceUndefined = 0, |
- // not a module, triggered from the engine code |
- kTraceVoice = 0x0001, |
- // not a module, triggered from the engine code |
- kTraceVideo = 0x0002, |
- // not a module, triggered from the utility code |
- kTraceUtility = 0x0003, |
- kTraceRtpRtcp = 0x0004, |
- kTraceTransport = 0x0005, |
- kTraceSrtp = 0x0006, |
- kTraceAudioCoding = 0x0007, |
- kTraceAudioMixerServer = 0x0008, |
- kTraceAudioMixerClient = 0x0009, |
- kTraceFile = 0x000a, |
- kTraceAudioProcessing = 0x000b, |
- kTraceVideoCoding = 0x0010, |
- kTraceVideoMixer = 0x0011, |
- kTraceAudioDevice = 0x0012, |
- kTraceVideoRenderer = 0x0014, |
- kTraceVideoCapture = 0x0015, |
- kTraceRemoteBitrateEstimator = 0x0017, |
-}; |
- |
-enum TraceLevel |
-{ |
- kTraceNone = 0x0000, // no trace |
- kTraceStateInfo = 0x0001, |
- kTraceWarning = 0x0002, |
- kTraceError = 0x0004, |
- kTraceCritical = 0x0008, |
- kTraceApiCall = 0x0010, |
- kTraceDefault = 0x00ff, |
- |
- kTraceModuleCall = 0x0020, |
- kTraceMemory = 0x0100, // memory info |
- kTraceTimer = 0x0200, // timing info |
- kTraceStream = 0x0400, // "continuous" stream of data |
- |
- // used for debug purposes |
- kTraceDebug = 0x0800, // debug |
- kTraceInfo = 0x1000, // debug info |
- |
- // Non-verbose level used by LS_INFO of logging.h. Do not use directly. |
- kTraceTerseInfo = 0x2000, |
- |
- kTraceAll = 0xffff |
+enum TraceModule { |
+ kTraceUndefined = 0, |
+ // not a module, triggered from the engine code |
+ kTraceVoice = 0x0001, |
+ // not a module, triggered from the engine code |
+ kTraceVideo = 0x0002, |
+ // not a module, triggered from the utility code |
+ kTraceUtility = 0x0003, |
+ kTraceRtpRtcp = 0x0004, |
+ kTraceTransport = 0x0005, |
+ kTraceSrtp = 0x0006, |
+ kTraceAudioCoding = 0x0007, |
+ kTraceAudioMixerServer = 0x0008, |
+ kTraceAudioMixerClient = 0x0009, |
+ kTraceFile = 0x000a, |
+ kTraceAudioProcessing = 0x000b, |
+ kTraceVideoCoding = 0x0010, |
+ kTraceVideoMixer = 0x0011, |
+ kTraceAudioDevice = 0x0012, |
+ kTraceVideoRenderer = 0x0014, |
+ kTraceVideoCapture = 0x0015, |
+ kTraceRemoteBitrateEstimator = 0x0017, |
+}; |
+ |
+enum TraceLevel { |
+ kTraceNone = 0x0000, // no trace |
+ kTraceStateInfo = 0x0001, |
+ kTraceWarning = 0x0002, |
+ kTraceError = 0x0004, |
+ kTraceCritical = 0x0008, |
+ kTraceApiCall = 0x0010, |
+ kTraceDefault = 0x00ff, |
+ |
+ kTraceModuleCall = 0x0020, |
+ kTraceMemory = 0x0100, // memory info |
+ kTraceTimer = 0x0200, // timing info |
+ kTraceStream = 0x0400, // "continuous" stream of data |
+ |
+ // used for debug purposes |
+ kTraceDebug = 0x0800, // debug |
+ kTraceInfo = 0x1000, // debug info |
+ |
+ // Non-verbose level used by LS_INFO of logging.h. Do not use directly. |
+ kTraceTerseInfo = 0x2000, |
+ |
+ kTraceAll = 0xffff |
}; |
// External Trace API |
@@ -134,23 +132,21 @@ class TraceCallback { |
TraceCallback() {} |
}; |
-enum FileFormats |
-{ |
- kFileFormatWavFile = 1, |
- kFileFormatCompressedFile = 2, |
- kFileFormatPreencodedFile = 4, |
- kFileFormatPcm16kHzFile = 7, |
- kFileFormatPcm8kHzFile = 8, |
- kFileFormatPcm32kHzFile = 9 |
+enum FileFormats { |
+ kFileFormatWavFile = 1, |
+ kFileFormatCompressedFile = 2, |
+ kFileFormatPreencodedFile = 4, |
+ kFileFormatPcm16kHzFile = 7, |
+ kFileFormatPcm8kHzFile = 8, |
+ kFileFormatPcm32kHzFile = 9 |
}; |
-enum ProcessingTypes |
-{ |
- kPlaybackPerChannel = 0, |
- kPlaybackAllChannelsMixed, |
- kRecordingPerChannel, |
- kRecordingAllChannelsMixed, |
- kRecordingPreprocessing |
+enum ProcessingTypes { |
+ kPlaybackPerChannel = 0, |
+ kPlaybackAllChannelsMixed, |
+ kRecordingPerChannel, |
+ kRecordingAllChannelsMixed, |
+ kRecordingPreprocessing |
}; |
enum FrameType { |
@@ -164,10 +160,10 @@ enum FrameType { |
// Statistics for an RTCP channel |
struct RtcpStatistics { |
RtcpStatistics() |
- : fraction_lost(0), |
- cumulative_lost(0), |
- extended_max_sequence_number(0), |
- jitter(0) {} |
+ : fraction_lost(0), |
+ cumulative_lost(0), |
+ extended_max_sequence_number(0), |
+ jitter(0) {} |
uint8_t fraction_lost; |
uint32_t cumulative_lost; |
@@ -187,12 +183,12 @@ class RtcpStatisticsCallback { |
// Statistics for RTCP packet types. |
struct RtcpPacketTypeCounter { |
RtcpPacketTypeCounter() |
- : first_packet_time_ms(-1), |
- nack_packets(0), |
- fir_packets(0), |
- pli_packets(0), |
- nack_requests(0), |
- unique_nack_requests(0) {} |
+ : first_packet_time_ms(-1), |
+ nack_packets(0), |
+ fir_packets(0), |
+ pli_packets(0), |
+ nack_requests(0), |
+ unique_nack_requests(0) {} |
void Add(const RtcpPacketTypeCounter& other) { |
nack_packets += other.nack_packets; |
@@ -201,8 +197,8 @@ struct RtcpPacketTypeCounter { |
nack_requests += other.nack_requests; |
unique_nack_requests += other.unique_nack_requests; |
if (other.first_packet_time_ms != -1 && |
- (other.first_packet_time_ms < first_packet_time_ms || |
- first_packet_time_ms == -1)) { |
+ (other.first_packet_time_ms < first_packet_time_ms || |
+ first_packet_time_ms == -1)) { |
// Use oldest time. |
first_packet_time_ms = other.first_packet_time_ms; |
} |
@@ -230,15 +226,15 @@ struct RtcpPacketTypeCounter { |
if (nack_requests == 0) { |
return 0; |
} |
- return static_cast<int>( |
- (unique_nack_requests * 100.0f / nack_requests) + 0.5f); |
+ return static_cast<int>((unique_nack_requests * 100.0f / nack_requests) + |
+ 0.5f); |
} |
- int64_t first_packet_time_ms; // Time when first packet is sent/received. |
- uint32_t nack_packets; // Number of RTCP NACK packets. |
- uint32_t fir_packets; // Number of RTCP FIR packets. |
- uint32_t pli_packets; // Number of RTCP PLI packets. |
- uint32_t nack_requests; // Number of NACKed RTP packets. |
+ int64_t first_packet_time_ms; // Time when first packet is sent/received. |
+ uint32_t nack_packets; // Number of RTCP NACK packets. |
+ uint32_t fir_packets; // Number of RTCP FIR packets. |
+ uint32_t pli_packets; // Number of RTCP PLI packets. |
+ uint32_t nack_requests; // Number of NACKed RTP packets. |
uint32_t unique_nack_requests; // Number of unique NACKed RTP packets. |
}; |
@@ -254,8 +250,8 @@ class RtcpPacketTypeCounterObserver { |
struct BitrateStatistics { |
BitrateStatistics() : bitrate_bps(0), packet_rate(0) {} |
- uint32_t bitrate_bps; // Bitrate in bits per second. |
- uint32_t packet_rate; // Packet rate in packets per second. |
+ uint32_t bitrate_bps; // Bitrate in bits per second. |
+ uint32_t packet_rate; // Packet rate in packets per second. |
}; |
// Callback, used to notify an observer whenever new rates have been estimated. |
@@ -319,72 +315,67 @@ struct CodecInst { |
bool operator==(const CodecInst& other) const { |
return pltype == other.pltype && |
(STR_CASE_CMP(plname, other.plname) == 0) && |
- plfreq == other.plfreq && |
- pacsize == other.pacsize && |
- channels == other.channels && |
- rate == other.rate; |
+ plfreq == other.plfreq && pacsize == other.pacsize && |
+ channels == other.channels && rate == other.rate; |
} |
- bool operator!=(const CodecInst& other) const { |
- return !(*this == other); |
- } |
+ bool operator!=(const CodecInst& other) const { return !(*this == other); } |
}; |
// RTP |
-enum {kRtpCsrcSize = 15}; // RFC 3550 page 13 |
- |
-enum PayloadFrequencies |
-{ |
- kFreq8000Hz = 8000, |
- kFreq16000Hz = 16000, |
- kFreq32000Hz = 32000 |
-}; |
- |
-enum VadModes // degree of bandwidth reduction |
-{ |
- kVadConventional = 0, // lowest reduction |
- kVadAggressiveLow, |
- kVadAggressiveMid, |
- kVadAggressiveHigh // highest reduction |
-}; |
- |
-struct NetworkStatistics // NETEQ statistics |
-{ |
- // current jitter buffer size in ms |
- uint16_t currentBufferSize; |
- // preferred (optimal) buffer size in ms |
- uint16_t preferredBufferSize; |
- // adding extra delay due to "peaky jitter" |
- bool jitterPeaksFound; |
- // Loss rate (network + late); fraction between 0 and 1, scaled to Q14. |
- uint16_t currentPacketLossRate; |
- // Late loss rate; fraction between 0 and 1, scaled to Q14. |
- uint16_t currentDiscardRate; |
- // fraction (of original stream) of synthesized audio inserted through |
- // expansion (in Q14) |
- uint16_t currentExpandRate; |
- // fraction (of original stream) of synthesized speech inserted through |
- // expansion (in Q14) |
- uint16_t currentSpeechExpandRate; |
- // fraction of synthesized speech inserted through pre-emptive expansion |
- // (in Q14) |
- uint16_t currentPreemptiveRate; |
- // fraction of data removed through acceleration (in Q14) |
- uint16_t currentAccelerateRate; |
- // fraction of data coming from secondary decoding (in Q14) |
- uint16_t currentSecondaryDecodedRate; |
- // clock-drift in parts-per-million (negative or positive) |
- int32_t clockDriftPPM; |
- // average packet waiting time in the jitter buffer (ms) |
- int meanWaitingTimeMs; |
- // median packet waiting time in the jitter buffer (ms) |
- int medianWaitingTimeMs; |
- // min packet waiting time in the jitter buffer (ms) |
- int minWaitingTimeMs; |
- // max packet waiting time in the jitter buffer (ms) |
- int maxWaitingTimeMs; |
- // added samples in off mode due to packet loss |
- size_t addedSamples; |
+enum { kRtpCsrcSize = 15 }; // RFC 3550 page 13 |
+ |
+enum PayloadFrequencies { |
+ kFreq8000Hz = 8000, |
+ kFreq16000Hz = 16000, |
+ kFreq32000Hz = 32000 |
+}; |
+ |
+// Degree of bandwidth reduction. |
+enum VadModes { |
+ kVadConventional = 0, // lowest reduction |
+ kVadAggressiveLow, |
+ kVadAggressiveMid, |
+ kVadAggressiveHigh // highest reduction |
+}; |
+ |
+// NETEQ statistics. |
+struct NetworkStatistics { |
+ // current jitter buffer size in ms |
+ uint16_t currentBufferSize; |
+ // preferred (optimal) buffer size in ms |
+ uint16_t preferredBufferSize; |
+ // adding extra delay due to "peaky jitter" |
+ bool jitterPeaksFound; |
+ // Loss rate (network + late); fraction between 0 and 1, scaled to Q14. |
+ uint16_t currentPacketLossRate; |
+ // Late loss rate; fraction between 0 and 1, scaled to Q14. |
+ uint16_t currentDiscardRate; |
+ // fraction (of original stream) of synthesized audio inserted through |
+ // expansion (in Q14) |
+ uint16_t currentExpandRate; |
+ // fraction (of original stream) of synthesized speech inserted through |
+ // expansion (in Q14) |
+ uint16_t currentSpeechExpandRate; |
+ // fraction of synthesized speech inserted through pre-emptive expansion |
+ // (in Q14) |
+ uint16_t currentPreemptiveRate; |
+ // fraction of data removed through acceleration (in Q14) |
+ uint16_t currentAccelerateRate; |
+ // fraction of data coming from secondary decoding (in Q14) |
+ uint16_t currentSecondaryDecodedRate; |
+ // clock-drift in parts-per-million (negative or positive) |
+ int32_t clockDriftPPM; |
+ // average packet waiting time in the jitter buffer (ms) |
+ int meanWaitingTimeMs; |
+ // median packet waiting time in the jitter buffer (ms) |
+ int medianWaitingTimeMs; |
+ // min packet waiting time in the jitter buffer (ms) |
+ int minWaitingTimeMs; |
+ // max packet waiting time in the jitter buffer (ms) |
+ int maxWaitingTimeMs; |
+ // added samples in off mode due to packet loss |
+ size_t addedSamples; |
}; |
// Statistics for calls to AudioCodingModule::PlayoutData10Ms(). |
@@ -399,83 +390,74 @@ struct AudioDecodingCallStats { |
int calls_to_silence_generator; // Number of calls where silence generated, |
// and NetEq was disengaged from decoding. |
- int calls_to_neteq; // Number of calls to NetEq. |
+ int calls_to_neteq; // Number of calls to NetEq. |
int decoded_normal; // Number of calls where audio RTP packet decoded. |
- int decoded_plc; // Number of calls resulted in PLC. |
+ int decoded_plc; // Number of calls resulted in PLC. |
int decoded_cng; // Number of calls where comfort noise generated due to DTX. |
int decoded_plc_cng; // Number of calls resulted where PLC faded to CNG. |
}; |
-enum NsModes // type of Noise Suppression |
-{ |
- kNsUnchanged = 0, // previously set mode |
- kNsDefault, // platform default |
- kNsConference, // conferencing default |
- kNsLowSuppression, // lowest suppression |
- kNsModerateSuppression, |
- kNsHighSuppression, |
- kNsVeryHighSuppression, // highest suppression |
-}; |
- |
-enum AgcModes // type of Automatic Gain Control |
-{ |
- kAgcUnchanged = 0, // previously set mode |
- kAgcDefault, // platform default |
- // adaptive mode for use when analog volume control exists (e.g. for |
- // PC softphone) |
- kAgcAdaptiveAnalog, |
- // scaling takes place in the digital domain (e.g. for conference servers |
- // and embedded devices) |
- kAgcAdaptiveDigital, |
- // can be used on embedded devices where the capture signal level |
- // is predictable |
- kAgcFixedDigital |
-}; |
- |
-// EC modes |
-enum EcModes // type of Echo Control |
-{ |
- kEcUnchanged = 0, // previously set mode |
- kEcDefault, // platform default |
- kEcConference, // conferencing default (aggressive AEC) |
- kEcAec, // Acoustic Echo Cancellation |
- kEcAecm, // AEC mobile |
-}; |
- |
-// AECM modes |
-enum AecmModes // mode of AECM |
-{ |
- kAecmQuietEarpieceOrHeadset = 0, |
- // Quiet earpiece or headset use |
- kAecmEarpiece, // most earpiece use |
- kAecmLoudEarpiece, // Loud earpiece or quiet speakerphone use |
- kAecmSpeakerphone, // most speakerphone use (default) |
- kAecmLoudSpeakerphone // Loud speakerphone |
+// Type of Noise Suppression. |
+enum NsModes { |
+ kNsUnchanged = 0, // previously set mode |
+ kNsDefault, // platform default |
+ kNsConference, // conferencing default |
+ kNsLowSuppression, // lowest suppression |
+ kNsModerateSuppression, |
+ kNsHighSuppression, |
+ kNsVeryHighSuppression, // highest suppression |
+}; |
+ |
+// Type of Automatic Gain Control. |
+enum AgcModes { |
+ kAgcUnchanged = 0, // previously set mode |
+ kAgcDefault, // platform default |
+ // adaptive mode for use when analog volume control exists (e.g. for |
+ // PC softphone) |
+ kAgcAdaptiveAnalog, |
+ // scaling takes place in the digital domain (e.g. for conference servers |
+ // and embedded devices) |
+ kAgcAdaptiveDigital, |
+ // can be used on embedded devices where the capture signal level |
+ // is predictable |
+ kAgcFixedDigital |
+}; |
+ |
+// Type of Echo Control. |
+enum EcModes { |
+ kEcUnchanged = 0, // previously set mode |
+ kEcDefault, // platform default |
+ kEcConference, // conferencing default (aggressive AEC) |
+ kEcAec, // Acoustic Echo Cancellation |
+ kEcAecm, // AEC mobile |
+}; |
+ |
+// Mode of AECM. |
+enum AecmModes { |
+ kAecmQuietEarpieceOrHeadset = 0, |
+ // Quiet earpiece or headset use |
+ kAecmEarpiece, // most earpiece use |
+ kAecmLoudEarpiece, // Loud earpiece or quiet speakerphone use |
+ kAecmSpeakerphone, // most speakerphone use (default) |
+ kAecmLoudSpeakerphone // Loud speakerphone |
}; |
// AGC configuration parameters |
-struct AgcConfig |
-{ |
- unsigned short targetLeveldBOv; |
- unsigned short digitalCompressionGaindB; |
- bool limiterEnable; |
+struct AgcConfig { |
+ unsigned short targetLeveldBOv; |
+ unsigned short digitalCompressionGaindB; |
+ bool limiterEnable; |
}; |
-enum StereoChannel |
-{ |
- kStereoLeft = 0, |
- kStereoRight, |
- kStereoBoth |
-}; |
+enum StereoChannel { kStereoLeft = 0, kStereoRight, kStereoBoth }; |
// Audio device layers |
-enum AudioLayers |
-{ |
- kAudioPlatformDefault = 0, |
- kAudioWindowsWave = 1, |
- kAudioWindowsCore = 2, |
- kAudioLinuxAlsa = 3, |
- kAudioLinuxPulse = 4 |
+enum AudioLayers { |
+ kAudioPlatformDefault = 0, |
+ kAudioWindowsWave = 1, |
+ kAudioWindowsCore = 2, |
+ kAudioLinuxAlsa = 3, |
+ kAudioLinuxPulse = 4 |
}; |
// ================================================================== |
@@ -483,45 +465,39 @@ enum AudioLayers |
// ================================================================== |
// Raw video types |
-enum RawVideoType |
-{ |
- kVideoI420 = 0, |
- kVideoYV12 = 1, |
- kVideoYUY2 = 2, |
- kVideoUYVY = 3, |
- kVideoIYUV = 4, |
- kVideoARGB = 5, |
- kVideoRGB24 = 6, |
- kVideoRGB565 = 7, |
- kVideoARGB4444 = 8, |
- kVideoARGB1555 = 9, |
- kVideoMJPEG = 10, |
- kVideoNV12 = 11, |
- kVideoNV21 = 12, |
- kVideoBGRA = 13, |
- kVideoUnknown = 99 |
+enum RawVideoType { |
+ kVideoI420 = 0, |
+ kVideoYV12 = 1, |
+ kVideoYUY2 = 2, |
+ kVideoUYVY = 3, |
+ kVideoIYUV = 4, |
+ kVideoARGB = 5, |
+ kVideoRGB24 = 6, |
+ kVideoRGB565 = 7, |
+ kVideoARGB4444 = 8, |
+ kVideoARGB1555 = 9, |
+ kVideoMJPEG = 10, |
+ kVideoNV12 = 11, |
+ kVideoNV21 = 12, |
+ kVideoBGRA = 13, |
+ kVideoUnknown = 99 |
}; |
// Video codec |
-enum { kConfigParameterSize = 128}; |
-enum { kPayloadNameSize = 32}; |
-enum { kMaxSimulcastStreams = 4}; |
+enum { kConfigParameterSize = 128 }; |
+enum { kPayloadNameSize = 32 }; |
+enum { kMaxSimulcastStreams = 4 }; |
enum { kMaxSpatialLayers = 5 }; |
-enum { kMaxTemporalStreams = 4}; |
+enum { kMaxTemporalStreams = 4 }; |
-enum VideoCodecComplexity |
-{ |
- kComplexityNormal = 0, |
- kComplexityHigh = 1, |
- kComplexityHigher = 2, |
- kComplexityMax = 3 |
+enum VideoCodecComplexity { |
+ kComplexityNormal = 0, |
+ kComplexityHigh = 1, |
+ kComplexityHigher = 2, |
+ kComplexityMax = 3 |
}; |
-enum VideoCodecProfile |
-{ |
- kProfileBase = 0x00, |
- kProfileMain = 0x01 |
-}; |
+enum VideoCodecProfile { kProfileBase = 0x00, kProfileMain = 0x01 }; |
enum VP8ResilienceMode { |
kResilienceOff, // The stream produced by the encoder requires a |
@@ -537,43 +513,43 @@ enum VP8ResilienceMode { |
class TemporalLayersFactory; |
// VP8 specific |
struct VideoCodecVP8 { |
- bool pictureLossIndicationOn; |
- bool feedbackModeOn; |
+ bool pictureLossIndicationOn; |
+ bool feedbackModeOn; |
VideoCodecComplexity complexity; |
- VP8ResilienceMode resilience; |
- unsigned char numberOfTemporalLayers; |
- bool denoisingOn; |
- bool errorConcealmentOn; |
- bool automaticResizeOn; |
- bool frameDroppingOn; |
- int keyFrameInterval; |
+ VP8ResilienceMode resilience; |
+ unsigned char numberOfTemporalLayers; |
+ bool denoisingOn; |
+ bool errorConcealmentOn; |
+ bool automaticResizeOn; |
+ bool frameDroppingOn; |
+ int keyFrameInterval; |
const TemporalLayersFactory* tl_factory; |
}; |
// VP9 specific. |
struct VideoCodecVP9 { |
VideoCodecComplexity complexity; |
- int resilience; |
- unsigned char numberOfTemporalLayers; |
- bool denoisingOn; |
- bool frameDroppingOn; |
- int keyFrameInterval; |
- bool adaptiveQpMode; |
- bool automaticResizeOn; |
- unsigned char numberOfSpatialLayers; |
- bool flexibleMode; |
+ int resilience; |
+ unsigned char numberOfTemporalLayers; |
+ bool denoisingOn; |
+ bool frameDroppingOn; |
+ int keyFrameInterval; |
+ bool adaptiveQpMode; |
+ bool automaticResizeOn; |
+ unsigned char numberOfSpatialLayers; |
+ bool flexibleMode; |
}; |
// H264 specific. |
struct VideoCodecH264 { |
VideoCodecProfile profile; |
- bool frameDroppingOn; |
- int keyFrameInterval; |
+ bool frameDroppingOn; |
+ int keyFrameInterval; |
// These are NULL/0 if not externally negotiated. |
const uint8_t* spsData; |
- size_t spsLen; |
+ size_t spsLen; |
const uint8_t* ppsData; |
- size_t ppsLen; |
+ size_t ppsLen; |
}; |
// Video codec types |
@@ -589,22 +565,21 @@ enum VideoCodecType { |
}; |
union VideoCodecUnion { |
- VideoCodecVP8 VP8; |
- VideoCodecVP9 VP9; |
- VideoCodecH264 H264; |
+ VideoCodecVP8 VP8; |
+ VideoCodecVP9 VP9; |
+ VideoCodecH264 H264; |
}; |
- |
// Simulcast is when the same stream is encoded multiple times with different |
// settings such as resolution. |
struct SimulcastStream { |
- unsigned short width; |
- unsigned short height; |
- unsigned char numberOfTemporalLayers; |
- unsigned int maxBitrate; // kilobits/sec. |
- unsigned int targetBitrate; // kilobits/sec. |
- unsigned int minBitrate; // kilobits/sec. |
- unsigned int qpMax; // minimum quality |
+ unsigned short width; |
+ unsigned short height; |
+ unsigned char numberOfTemporalLayers; |
+ unsigned int maxBitrate; // kilobits/sec. |
+ unsigned int targetBitrate; // kilobits/sec. |
+ unsigned int minBitrate; // kilobits/sec. |
+ unsigned int qpMax; // minimum quality |
}; |
struct SpatialLayer { |
@@ -614,36 +589,33 @@ struct SpatialLayer { |
// TODO(ivica): Add max_quantizer and min_quantizer? |
}; |
-enum VideoCodecMode { |
- kRealtimeVideo, |
- kScreensharing |
-}; |
+enum VideoCodecMode { kRealtimeVideo, kScreensharing }; |
// Common video codec properties |
struct VideoCodec { |
- VideoCodecType codecType; |
- char plName[kPayloadNameSize]; |
- unsigned char plType; |
+ VideoCodecType codecType; |
+ char plName[kPayloadNameSize]; |
+ unsigned char plType; |
- unsigned short width; |
- unsigned short height; |
+ unsigned short width; |
+ unsigned short height; |
- unsigned int startBitrate; // kilobits/sec. |
- unsigned int maxBitrate; // kilobits/sec. |
- unsigned int minBitrate; // kilobits/sec. |
- unsigned int targetBitrate; // kilobits/sec. |
+ unsigned int startBitrate; // kilobits/sec. |
+ unsigned int maxBitrate; // kilobits/sec. |
+ unsigned int minBitrate; // kilobits/sec. |
+ unsigned int targetBitrate; // kilobits/sec. |
- unsigned char maxFramerate; |
+ unsigned char maxFramerate; |
- VideoCodecUnion codecSpecific; |
+ VideoCodecUnion codecSpecific; |
- unsigned int qpMax; |
- unsigned char numberOfSimulcastStreams; |
- SimulcastStream simulcastStream[kMaxSimulcastStreams]; |
+ unsigned int qpMax; |
+ unsigned char numberOfSimulcastStreams; |
+ SimulcastStream simulcastStream[kMaxSimulcastStreams]; |
SpatialLayer spatialLayers[kMaxSpatialLayers]; |
- VideoCodecMode mode; |
- bool expect_encode_from_texture; |
+ VideoCodecMode mode; |
+ bool expect_encode_from_texture; |
bool operator==(const VideoCodec& other) const = delete; |
bool operator!=(const VideoCodec& other) const = delete; |
@@ -654,7 +626,7 @@ struct VideoCodec { |
// See modules/remote_bitrate_estimator/overuse_detector.h |
struct OverUseDetectorOptions { |
OverUseDetectorOptions() |
- : initial_slope(8.0/512.0), |
+ : initial_slope(8.0 / 512.0), |
initial_offset(0), |
initial_e(), |
initial_process_noise(), |
@@ -679,8 +651,7 @@ struct OverUseDetectorOptions { |
struct PacketTime { |
PacketTime() : timestamp(-1), not_before(-1) {} |
PacketTime(int64_t timestamp, int64_t not_before) |
- : timestamp(timestamp), not_before(not_before) { |
- } |
+ : timestamp(timestamp), not_before(not_before) {} |
int64_t timestamp; // Receive time after socket delivers the data. |
int64_t not_before; // Earliest possible time the data could have arrived, |
@@ -751,10 +722,7 @@ struct RTPHeader { |
struct RtpPacketCounter { |
RtpPacketCounter() |
- : header_bytes(0), |
- payload_bytes(0), |
- padding_bytes(0), |
- packets(0) {} |
+ : header_bytes(0), payload_bytes(0), padding_bytes(0), packets(0) {} |
void Add(const RtpPacketCounter& other) { |
header_bytes += other.header_bytes; |
@@ -801,8 +769,8 @@ struct StreamDataCounters { |
retransmitted.Add(other.retransmitted); |
fec.Add(other.fec); |
if (other.first_packet_time_ms != -1 && |
- (other.first_packet_time_ms < first_packet_time_ms || |
- first_packet_time_ms == -1)) { |
+ (other.first_packet_time_ms < first_packet_time_ms || |
+ first_packet_time_ms == -1)) { |
// Use oldest time. |
first_packet_time_ms = other.first_packet_time_ms; |
} |
@@ -832,10 +800,10 @@ struct StreamDataCounters { |
fec.payload_bytes; |
} |
- int64_t first_packet_time_ms; // Time when first packet is sent/received. |
- RtpPacketCounter transmitted; // Number of transmitted packets/bytes. |
+ int64_t first_packet_time_ms; // Time when first packet is sent/received. |
+ RtpPacketCounter transmitted; // Number of transmitted packets/bytes. |
RtpPacketCounter retransmitted; // Number of retransmitted packets/bytes. |
- RtpPacketCounter fec; // Number of redundancy packets/bytes. |
+ RtpPacketCounter fec; // Number of redundancy packets/bytes. |
}; |
// Callback, called whenever byte/packet counts have been updated. |