#include "third_party/blink/renderer/platform/peerconnection/stats_collecting_encoder.h"
#include <algorithm>
#include <atomic>
#include "base/check.h"
#include "base/logging.h"
#include "media/base/video_codecs.h"
#include "third_party/blink/renderer/platform/webrtc/webrtc_video_utils.h"
#include "third_party/webrtc/modules/video_coding/include/video_error_codes.h"
namespace blink {
namespace {
constexpr int kMaximumEncodersToCollectStats = …;
constexpr base::TimeDelta kCheckSimultaneousEncodersInterval = …;
std::atomic_int* GetEncoderCounter() { … }
}
StatsCollectingEncoder::StatsCollectingEncoder(
const webrtc::SdpVideoFormat& format,
std::unique_ptr<webrtc::VideoEncoder> encoder,
StatsCollector::StoreProcessingStatsCB stats_callback)
: … { … }
StatsCollectingEncoder::~StatsCollectingEncoder() { … }
void StatsCollectingEncoder::SetFecControllerOverride(
webrtc::FecControllerOverride* fec_controller_override) { … }
int StatsCollectingEncoder::InitEncode(
const webrtc::VideoCodec* codec_settings,
const webrtc::VideoEncoder::Settings& settings) { … }
int32_t StatsCollectingEncoder::RegisterEncodeCompleteCallback(
EncodedImageCallback* callback) { … }
int32_t StatsCollectingEncoder::Release() { … }
int32_t StatsCollectingEncoder::Encode(
const webrtc::VideoFrame& frame,
const std::vector<webrtc::VideoFrameType>* frame_types) { … }
void StatsCollectingEncoder::SetRates(const RateControlParameters& parameters) { … }
void StatsCollectingEncoder::OnPacketLossRateUpdate(float packet_loss_rate) { … }
void StatsCollectingEncoder::OnRttUpdate(int64_t rtt_ms) { … }
void StatsCollectingEncoder::OnLossNotification(
const LossNotification& loss_notification) { … }
webrtc::VideoEncoder::EncoderInfo StatsCollectingEncoder::GetEncoderInfo()
const { … }
webrtc::EncodedImageCallback::Result StatsCollectingEncoder::OnEncodedImage(
const webrtc::EncodedImage& encoded_image,
const webrtc::CodecSpecificInfo* codec_specific_info) { … }
void StatsCollectingEncoder::OnDroppedFrame(DropReason reason) { … }
}