/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
class SendStatisticsProxy : public VideoStreamEncoderObserver, public ReportBlockDataObserver, public RtcpPacketTypeCounterObserver, public StreamDataCountersCallback, public BitrateStatisticsObserver, public FrameCountObserver { public: static constexpr TimeDelta kStatsTimeout = TimeDelta::Seconds(5); // Number of required samples to be collected before a metric is added // to a rtc histogram. staticconstint kMinRequiredMetricsSamples = 200;
// Used to indicate change in content type, which may require a change in // how stats are collected. void OnEncoderReconfigured(const VideoEncoderConfig& encoder_config, const std::vector<VideoStream>& streams) override;
// Used to update the encoder target rate. void OnSetEncoderTargetRate(uint32_t bitrate_bps);
// Implements CpuOveruseMetricsObserver. void OnEncodedFrameTimeMeasured(int encode_time_ms, int encode_usage_percent) override;
// Map holding encoded frames (mapped by timestamp). // If simulcast layers are encoded on different threads, there is no guarantee // that one frame of all layers are encoded before the next start. struct TimestampOlderThan { booloperator()(uint32_t ts1, uint32_t ts2) const { return IsNewerTimestamp(ts2, ts1);
}
}; struct Frame {
Frame(int64_t send_ms, uint32_t width, uint32_t height, int simulcast_idx)
: send_ms(send_ms),
max_width(width),
max_height(height),
max_simulcast_idx(simulcast_idx) {} const int64_t
send_ms; // Time when first frame with this timestamp is sent.
uint32_t max_width; // Max width with this timestamp.
uint32_t max_height; // Max height with this timestamp. int max_simulcast_idx; // Max simulcast index with this timestamp.
}; typedef std::map<uint32_t, Frame, TimestampOlderThan> EncodedFrameMap;
void UpdateEncoderFallbackStats(const CodecSpecificInfo* codec_info, int pixels, int simulcast_index)
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_); void UpdateFallbackDisabledStats(const CodecSpecificInfo* codec_info, int pixels, int simulcast_index)
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
int last_num_spatial_layers_ RTC_GUARDED_BY(mutex_); int last_num_simulcast_streams_ RTC_GUARDED_BY(mutex_);
std::array<bool, kMaxSpatialLayers> last_spatial_layer_use_
RTC_GUARDED_BY(mutex_); // Indicates if the latest bitrate allocation had layers disabled by low // available bandwidth. bool bw_limited_layers_ RTC_GUARDED_BY(mutex_); // Indicastes if the encoder internally downscales input image. bool internal_encoder_scaler_ RTC_GUARDED_BY(mutex_);
Adaptations adaptation_limitations_ RTC_GUARDED_BY(mutex_);
struct EncoderChangeEvent {
std::string previous_encoder_implementation;
std::string new_encoder_implementation;
}; // Stores the last change in encoder implementation in an optional, so that // the event can be consumed.
std::optional<EncoderChangeEvent> encoder_changed_;
// Contains stats used for UMA histograms. These stats will be reset if // content type changes between real-time video and screenshare, since these // will be reported separately. struct UmaSamplesContainer {
UmaSamplesContainer(constchar* prefix, const VideoSendStream::Stats& start_stats,
Clock* clock);
~UmaSamplesContainer();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.