#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/peerconnection/video_encoder_state_observer_impl.h"
#include <queue>
#include "base/atomic_ref_count.h"
#include "base/containers/contains.h"
#include "base/sequence_checker.h"
#include "third_party/webrtc/api/video/encoded_image.h"
namespace blink {
namespace {
std::atomic_int g_encoder_counter_{ … };
}
class VideoEncoderStateObserverImpl::EncoderState { … };
VideoEncoderStateObserverImpl::VideoEncoderStateObserverImpl(
media::VideoCodecProfile profile,
const StatsCollector::StoreProcessingStatsCB& store_processing_stats_cb)
: … { … }
VideoEncoderStateObserverImpl::~VideoEncoderStateObserverImpl() { … }
void VideoEncoderStateObserverImpl::OnEncoderCreated(
int encoder_id,
const webrtc::VideoCodec& config) { … }
void VideoEncoderStateObserverImpl::OnEncoderDestroyed(int encoder_id) { … }
void VideoEncoderStateObserverImpl::OnRatesUpdated(
int encoder_id,
const Vector<bool>& active_spatial_layers) { … }
VideoEncoderStateObserverImpl::EncoderState*
VideoEncoderStateObserverImpl::GetEncoderState(int encoder_id,
base::Location location) { … }
void VideoEncoderStateObserverImpl::OnEncode(int encoder_id,
uint32_t rtp_timestamp) { … }
void VideoEncoderStateObserverImpl::OnEncodedImage(int encoder_id,
const EncodeResult& result) { … }
void VideoEncoderStateObserverImpl::UpdateStatsCollection(base::TimeTicks now) { … }
std::optional<VideoEncoderStateObserverImpl::TopLayerInfo>
VideoEncoderStateObserverImpl::FindHighestActiveEncoding() const { … }
}