Migrate video/ except video/end_to_end_tests and video/adaptation to webrtc::Mutex.
Also migrates test/ partly. Bug: webrtc:11567 Change-Id: If5b2eae65c5f297f364b6e3c67f94946a09b4a96 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178862 Commit-Queue: Markus Handell <handellm@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31672}
This commit is contained in:
committed by
Commit Bot
parent
a9e1b49704
commit
a376518817
@ -39,6 +39,7 @@
|
||||
#include "rtc_base/gunit.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
#include "rtc_base/synchronization/mutex.h"
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
#include "system_wrappers/include/metrics.h"
|
||||
#include "system_wrappers/include/sleep.h"
|
||||
@ -139,14 +140,14 @@ class CpuOveruseDetectorProxy : public OveruseFrameDetector {
|
||||
virtual ~CpuOveruseDetectorProxy() {}
|
||||
|
||||
void OnTargetFramerateUpdated(int framerate_fps) override {
|
||||
rtc::CritScope cs(&lock_);
|
||||
MutexLock lock(&lock_);
|
||||
last_target_framerate_fps_ = framerate_fps;
|
||||
OveruseFrameDetector::OnTargetFramerateUpdated(framerate_fps);
|
||||
framerate_updated_event_.Set();
|
||||
}
|
||||
|
||||
int GetLastTargetFramerate() {
|
||||
rtc::CritScope cs(&lock_);
|
||||
MutexLock lock(&lock_);
|
||||
return last_target_framerate_fps_;
|
||||
}
|
||||
|
||||
@ -155,7 +156,7 @@ class CpuOveruseDetectorProxy : public OveruseFrameDetector {
|
||||
rtc::Event* framerate_updated_event() { return &framerate_updated_event_; }
|
||||
|
||||
private:
|
||||
rtc::CriticalSection lock_;
|
||||
Mutex lock_;
|
||||
int last_target_framerate_fps_ RTC_GUARDED_BY(lock_);
|
||||
rtc::Event framerate_updated_event_;
|
||||
};
|
||||
@ -499,17 +500,17 @@ class AdaptingFrameForwarder : public test::FrameForwarder {
|
||||
~AdaptingFrameForwarder() override {}
|
||||
|
||||
void set_adaptation_enabled(bool enabled) {
|
||||
rtc::CritScope cs(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
adaptation_enabled_ = enabled;
|
||||
}
|
||||
|
||||
bool adaption_enabled() const {
|
||||
rtc::CritScope cs(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return adaptation_enabled_;
|
||||
}
|
||||
|
||||
rtc::VideoSinkWants last_wants() const {
|
||||
rtc::CritScope cs(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return last_wants_;
|
||||
}
|
||||
|
||||
@ -558,14 +559,14 @@ class AdaptingFrameForwarder : public test::FrameForwarder {
|
||||
|
||||
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
||||
const rtc::VideoSinkWants& wants) override {
|
||||
rtc::CritScope cs(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
last_wants_ = sink_wants_locked();
|
||||
adapter_.OnSinkWants(wants);
|
||||
test::FrameForwarder::AddOrUpdateSinkLocked(sink, wants);
|
||||
}
|
||||
cricket::VideoAdapter adapter_;
|
||||
bool adaptation_enabled_ RTC_GUARDED_BY(crit_);
|
||||
rtc::VideoSinkWants last_wants_ RTC_GUARDED_BY(crit_);
|
||||
bool adaptation_enabled_ RTC_GUARDED_BY(mutex_);
|
||||
rtc::VideoSinkWants last_wants_ RTC_GUARDED_BY(mutex_);
|
||||
absl::optional<int> last_width_;
|
||||
absl::optional<int> last_height_;
|
||||
};
|
||||
@ -579,30 +580,30 @@ class MockableSendStatisticsProxy : public SendStatisticsProxy {
|
||||
: SendStatisticsProxy(clock, config, content_type) {}
|
||||
|
||||
VideoSendStream::Stats GetStats() override {
|
||||
rtc::CritScope cs(&lock_);
|
||||
MutexLock lock(&lock_);
|
||||
if (mock_stats_)
|
||||
return *mock_stats_;
|
||||
return SendStatisticsProxy::GetStats();
|
||||
}
|
||||
|
||||
int GetInputFrameRate() const override {
|
||||
rtc::CritScope cs(&lock_);
|
||||
MutexLock lock(&lock_);
|
||||
if (mock_stats_)
|
||||
return mock_stats_->input_frame_rate;
|
||||
return SendStatisticsProxy::GetInputFrameRate();
|
||||
}
|
||||
void SetMockStats(const VideoSendStream::Stats& stats) {
|
||||
rtc::CritScope cs(&lock_);
|
||||
MutexLock lock(&lock_);
|
||||
mock_stats_.emplace(stats);
|
||||
}
|
||||
|
||||
void ResetMockStats() {
|
||||
rtc::CritScope cs(&lock_);
|
||||
MutexLock lock(&lock_);
|
||||
mock_stats_.reset();
|
||||
}
|
||||
|
||||
private:
|
||||
rtc::CriticalSection lock_;
|
||||
mutable Mutex lock_;
|
||||
absl::optional<VideoSendStream::Stats> mock_stats_ RTC_GUARDED_BY(lock_);
|
||||
};
|
||||
|
||||
@ -830,17 +831,17 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
TestEncoder() : FakeEncoder(Clock::GetRealTimeClock()) {}
|
||||
|
||||
VideoCodec codec_config() const {
|
||||
rtc::CritScope lock(&crit_sect_);
|
||||
MutexLock lock(&mutex_);
|
||||
return config_;
|
||||
}
|
||||
|
||||
void BlockNextEncode() {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
block_next_encode_ = true;
|
||||
}
|
||||
|
||||
VideoEncoder::EncoderInfo GetEncoderInfo() const override {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
EncoderInfo info;
|
||||
if (initialized_ == EncoderState::kInitialized) {
|
||||
if (quality_scaling_) {
|
||||
@ -863,7 +864,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
|
||||
int32_t RegisterEncodeCompleteCallback(
|
||||
EncodedImageCallback* callback) override {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
encoded_image_callback_ = callback;
|
||||
return FakeEncoder::RegisterEncodeCompleteCallback(callback);
|
||||
}
|
||||
@ -872,60 +873,60 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
|
||||
void CheckLastTimeStampsMatch(int64_t ntp_time_ms,
|
||||
uint32_t timestamp) const {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
EXPECT_EQ(timestamp_, timestamp);
|
||||
EXPECT_EQ(ntp_time_ms_, ntp_time_ms);
|
||||
}
|
||||
|
||||
void SetQualityScaling(bool b) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
quality_scaling_ = b;
|
||||
}
|
||||
|
||||
void SetRequestedResolutionAlignment(int requested_resolution_alignment) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
requested_resolution_alignment_ = requested_resolution_alignment;
|
||||
}
|
||||
|
||||
void SetIsHardwareAccelerated(bool is_hardware_accelerated) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
is_hardware_accelerated_ = is_hardware_accelerated;
|
||||
}
|
||||
|
||||
void SetTemporalLayersSupported(size_t spatial_idx, bool supported) {
|
||||
RTC_DCHECK_LT(spatial_idx, kMaxSpatialLayers);
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
temporal_layers_supported_[spatial_idx] = supported;
|
||||
}
|
||||
|
||||
void SetResolutionBitrateLimits(
|
||||
std::vector<ResolutionBitrateLimits> thresholds) {
|
||||
rtc::CritScope cs(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
resolution_bitrate_limits_ = thresholds;
|
||||
}
|
||||
|
||||
void ForceInitEncodeFailure(bool force_failure) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
force_init_encode_failed_ = force_failure;
|
||||
}
|
||||
|
||||
void SimulateOvershoot(double rate_factor) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
rate_factor_ = rate_factor;
|
||||
}
|
||||
|
||||
uint32_t GetLastFramerate() const {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
return last_framerate_;
|
||||
}
|
||||
|
||||
VideoFrame::UpdateRect GetLastUpdateRect() const {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
return last_update_rect_;
|
||||
}
|
||||
|
||||
const std::vector<VideoFrameType>& LastFrameTypes() const {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
return last_frame_types_;
|
||||
}
|
||||
|
||||
@ -934,27 +935,27 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
keyframe ? VideoFrameType::kVideoFrameKey
|
||||
: VideoFrameType::kVideoFrameDelta};
|
||||
{
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
last_frame_types_ = frame_type;
|
||||
}
|
||||
FakeEncoder::Encode(input_image, &frame_type);
|
||||
}
|
||||
|
||||
void InjectEncodedImage(const EncodedImage& image) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
encoded_image_callback_->OnEncodedImage(image, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void InjectEncodedImage(const EncodedImage& image,
|
||||
const CodecSpecificInfo* codec_specific_info,
|
||||
const RTPFragmentationHeader* fragmentation) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
encoded_image_callback_->OnEncodedImage(image, codec_specific_info,
|
||||
fragmentation);
|
||||
}
|
||||
|
||||
void ExpectNullFrame() {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
expect_null_frame_ = true;
|
||||
}
|
||||
|
||||
@ -966,12 +967,12 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
int GetNumEncoderInitializations() const {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
return num_encoder_initializations_;
|
||||
}
|
||||
|
||||
int GetNumSetRates() const {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
return num_set_rates_;
|
||||
}
|
||||
|
||||
@ -980,7 +981,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
const std::vector<VideoFrameType>* frame_types) override {
|
||||
bool block_encode;
|
||||
{
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
if (expect_null_frame_) {
|
||||
EXPECT_EQ(input_image.timestamp(), 0u);
|
||||
EXPECT_EQ(input_image.width(), 1);
|
||||
@ -1011,7 +1012,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
const Settings& settings) override {
|
||||
int res = FakeEncoder::InitEncode(config, settings);
|
||||
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
EXPECT_EQ(initialized_, EncoderState::kUninitialized);
|
||||
|
||||
++num_encoder_initializations_;
|
||||
@ -1033,14 +1034,14 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
int32_t Release() override {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
EXPECT_NE(initialized_, EncoderState::kUninitialized);
|
||||
initialized_ = EncoderState::kUninitialized;
|
||||
return FakeEncoder::Release();
|
||||
}
|
||||
|
||||
void SetRates(const RateControlParameters& parameters) {
|
||||
rtc::CritScope lock(&local_crit_sect_);
|
||||
MutexLock lock(&local_mutex_);
|
||||
num_set_rates_++;
|
||||
VideoBitrateAllocation adjusted_rate_allocation;
|
||||
for (size_t si = 0; si < kMaxSpatialLayers; ++si) {
|
||||
@ -1060,43 +1061,42 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
FakeEncoder::SetRates(adjusted_paramters);
|
||||
}
|
||||
|
||||
rtc::CriticalSection local_crit_sect_;
|
||||
mutable Mutex local_mutex_;
|
||||
enum class EncoderState {
|
||||
kUninitialized,
|
||||
kInitializationFailed,
|
||||
kInitialized
|
||||
} initialized_ RTC_GUARDED_BY(local_crit_sect_) =
|
||||
EncoderState::kUninitialized;
|
||||
bool block_next_encode_ RTC_GUARDED_BY(local_crit_sect_) = false;
|
||||
} initialized_ RTC_GUARDED_BY(local_mutex_) = EncoderState::kUninitialized;
|
||||
bool block_next_encode_ RTC_GUARDED_BY(local_mutex_) = false;
|
||||
rtc::Event continue_encode_event_;
|
||||
uint32_t timestamp_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
||||
int64_t ntp_time_ms_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
||||
int last_input_width_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
||||
int last_input_height_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
||||
bool quality_scaling_ RTC_GUARDED_BY(local_crit_sect_) = true;
|
||||
int requested_resolution_alignment_ RTC_GUARDED_BY(local_crit_sect_) = 1;
|
||||
bool is_hardware_accelerated_ RTC_GUARDED_BY(local_crit_sect_) = false;
|
||||
uint32_t timestamp_ RTC_GUARDED_BY(local_mutex_) = 0;
|
||||
int64_t ntp_time_ms_ RTC_GUARDED_BY(local_mutex_) = 0;
|
||||
int last_input_width_ RTC_GUARDED_BY(local_mutex_) = 0;
|
||||
int last_input_height_ RTC_GUARDED_BY(local_mutex_) = 0;
|
||||
bool quality_scaling_ RTC_GUARDED_BY(local_mutex_) = true;
|
||||
int requested_resolution_alignment_ RTC_GUARDED_BY(local_mutex_) = 1;
|
||||
bool is_hardware_accelerated_ RTC_GUARDED_BY(local_mutex_) = false;
|
||||
std::unique_ptr<Vp8FrameBufferController> frame_buffer_controller_
|
||||
RTC_GUARDED_BY(local_crit_sect_);
|
||||
RTC_GUARDED_BY(local_mutex_);
|
||||
absl::optional<bool>
|
||||
temporal_layers_supported_[kMaxSpatialLayers] RTC_GUARDED_BY(
|
||||
local_crit_sect_);
|
||||
bool force_init_encode_failed_ RTC_GUARDED_BY(local_crit_sect_) = false;
|
||||
double rate_factor_ RTC_GUARDED_BY(local_crit_sect_) = 1.0;
|
||||
uint32_t last_framerate_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
||||
local_mutex_);
|
||||
bool force_init_encode_failed_ RTC_GUARDED_BY(local_mutex_) = false;
|
||||
double rate_factor_ RTC_GUARDED_BY(local_mutex_) = 1.0;
|
||||
uint32_t last_framerate_ RTC_GUARDED_BY(local_mutex_) = 0;
|
||||
absl::optional<VideoEncoder::RateControlParameters>
|
||||
last_rate_control_settings_;
|
||||
VideoFrame::UpdateRect last_update_rect_
|
||||
RTC_GUARDED_BY(local_crit_sect_) = {0, 0, 0, 0};
|
||||
VideoFrame::UpdateRect last_update_rect_ RTC_GUARDED_BY(local_mutex_) = {
|
||||
0, 0, 0, 0};
|
||||
std::vector<VideoFrameType> last_frame_types_;
|
||||
bool expect_null_frame_ = false;
|
||||
EncodedImageCallback* encoded_image_callback_
|
||||
RTC_GUARDED_BY(local_crit_sect_) = nullptr;
|
||||
EncodedImageCallback* encoded_image_callback_ RTC_GUARDED_BY(local_mutex_) =
|
||||
nullptr;
|
||||
NiceMock<MockFecControllerOverride> fec_controller_override_;
|
||||
int num_encoder_initializations_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
||||
int num_encoder_initializations_ RTC_GUARDED_BY(local_mutex_) = 0;
|
||||
std::vector<ResolutionBitrateLimits> resolution_bitrate_limits_
|
||||
RTC_GUARDED_BY(local_crit_sect_);
|
||||
int num_set_rates_ RTC_GUARDED_BY(local_crit_sect_) = 0;
|
||||
RTC_GUARDED_BY(local_mutex_);
|
||||
int num_set_rates_ RTC_GUARDED_BY(local_mutex_) = 0;
|
||||
};
|
||||
|
||||
class TestSink : public VideoStreamEncoder::EncoderSink {
|
||||
@ -1115,7 +1115,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
if (!encoded_frame_event_.Wait(timeout_ms))
|
||||
return false;
|
||||
{
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
timestamp = last_timestamp_;
|
||||
}
|
||||
test_encoder_->CheckLastTimeStampsMatch(expected_ntp_time, timestamp);
|
||||
@ -1133,7 +1133,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
uint32_t width = 0;
|
||||
uint32_t height = 0;
|
||||
{
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
width = last_width_;
|
||||
height = last_height_;
|
||||
}
|
||||
@ -1145,7 +1145,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
{
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
width = last_width_;
|
||||
height = last_height_;
|
||||
}
|
||||
@ -1156,7 +1156,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
void CheckLastFrameRotationMatches(VideoRotation expected_rotation) {
|
||||
VideoRotation rotation;
|
||||
{
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
rotation = last_rotation_;
|
||||
}
|
||||
EXPECT_EQ(expected_rotation, rotation);
|
||||
@ -1169,37 +1169,37 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
void SetExpectNoFrames() {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
expect_frames_ = false;
|
||||
}
|
||||
|
||||
int number_of_reconfigurations() const {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return number_of_reconfigurations_;
|
||||
}
|
||||
|
||||
int last_min_transmit_bitrate() const {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return min_transmit_bitrate_bps_;
|
||||
}
|
||||
|
||||
void SetNumExpectedLayers(size_t num_layers) {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
num_expected_layers_ = num_layers;
|
||||
}
|
||||
|
||||
int64_t GetLastCaptureTimeMs() const {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return last_capture_time_ms_;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> GetLastEncodedImageData() {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return std::move(last_encoded_image_data_);
|
||||
}
|
||||
|
||||
RTPFragmentationHeader GetLastFragmentation() {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return std::move(last_fragmentation_);
|
||||
}
|
||||
|
||||
@ -1208,7 +1208,7 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
const EncodedImage& encoded_image,
|
||||
const CodecSpecificInfo* codec_specific_info,
|
||||
const RTPFragmentationHeader* fragmentation) override {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
EXPECT_TRUE(expect_frames_);
|
||||
last_encoded_image_data_ = std::vector<uint8_t>(
|
||||
encoded_image.data(), encoded_image.data() + encoded_image.size());
|
||||
@ -1237,12 +1237,12 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
bool is_svc,
|
||||
VideoEncoderConfig::ContentType content_type,
|
||||
int min_transmit_bitrate_bps) override {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
++number_of_reconfigurations_;
|
||||
min_transmit_bitrate_bps_ = min_transmit_bitrate_bps;
|
||||
}
|
||||
|
||||
rtc::CriticalSection crit_;
|
||||
mutable Mutex mutex_;
|
||||
TestEncoder* test_encoder_;
|
||||
rtc::Event encoded_frame_event_;
|
||||
std::vector<uint8_t> last_encoded_image_data_;
|
||||
@ -1268,21 +1268,21 @@ class VideoStreamEncoderTest : public ::testing::Test {
|
||||
|
||||
std::unique_ptr<VideoBitrateAllocator> CreateVideoBitrateAllocator(
|
||||
const VideoCodec& codec) override {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
codec_config_ = codec;
|
||||
return bitrate_allocator_factory_->CreateVideoBitrateAllocator(codec);
|
||||
}
|
||||
|
||||
VideoCodec codec_config() const {
|
||||
rtc::CritScope lock(&crit_);
|
||||
MutexLock lock(&mutex_);
|
||||
return codec_config_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
|
||||
|
||||
rtc::CriticalSection crit_;
|
||||
VideoCodec codec_config_ RTC_GUARDED_BY(crit_);
|
||||
mutable Mutex mutex_;
|
||||
VideoCodec codec_config_ RTC_GUARDED_BY(mutex_);
|
||||
};
|
||||
|
||||
VideoSendStream::Config video_send_config_;
|
||||
|
||||
Reference in New Issue
Block a user