Use enum class for VideoCodecMode and VideoCodecComplexity.

Bug: webrtc:7660
Change-Id: I6a8ef01f8abcc25c8efaf0af387408343a7c8ba3
Reviewed-on: https://webrtc-review.googlesource.com/81240
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23595}
This commit is contained in:
Niels Möller
2018-06-13 11:52:16 +02:00
committed by Commit Bot
parent 037b37a192
commit e3cf3d0496
19 changed files with 49 additions and 42 deletions

View File

@ -38,7 +38,7 @@ VideoBitrateAllocation SvcRateAllocator::GetAllocation(
VideoBitrateAllocation bitrate_allocation;
bitrate_allocation.SetBitrate(0, 0, total_bitrate_bps);
return bitrate_allocation;
} else if (codec_.mode == kRealtimeVideo) {
} else if (codec_.mode == VideoCodecMode::kRealtimeVideo) {
return GetAllocationNormalVideo(total_bitrate_bps);
} else {
return GetAllocationScreenSharing(total_bitrate_bps);

View File

@ -25,7 +25,8 @@ static VideoCodec Configure(size_t width,
codec.width = width;
codec.height = height;
codec.codecType = kVideoCodecVP9;
codec.mode = is_screen_sharing ? kScreensharing : kRealtimeVideo;
codec.mode = is_screen_sharing ? VideoCodecMode::kScreensharing
: VideoCodecMode::kRealtimeVideo;
std::vector<SpatialLayer> spatial_layers =
GetSvcConfig(width, height, num_spatial_layers, num_temporal_layers,

View File

@ -434,7 +434,7 @@ class TestVp9ImplFrameDropping : public TestVp9Impl {
// to reduce execution time.
codec_settings->width = 64;
codec_settings->height = 64;
codec_settings->mode = kScreensharing;
codec_settings->mode = VideoCodecMode::kScreensharing;
}
};

View File

@ -287,7 +287,7 @@ int VP9EncoderImpl::InitEncode(const VideoCodec* inst,
// Init framerate controller.
output_framerate_.Reset();
if (codec_.mode == kScreensharing) {
if (codec_.mode == VideoCodecMode::kScreensharing) {
target_framerate_fps_ = kMaxScreenSharingFramerateFps;
} else {
target_framerate_fps_.reset();
@ -538,7 +538,7 @@ int VP9EncoderImpl::InitAndSetControlSettings(const VideoCodec* inst) {
inst->VP9().denoisingOn ? 1 : 0);
#endif
if (codec_.mode == kScreensharing) {
if (codec_.mode == VideoCodecMode::kScreensharing) {
// Adjust internal parameters to screen content.
vpx_codec_control(encoder_, VP9E_SET_TUNE_CONTENT, 1);
}
@ -580,7 +580,7 @@ int VP9EncoderImpl::Encode(const VideoFrame& input_image,
}
}
if (kScreensharing == codec_.mode && !force_key_frame_) {
if (VideoCodecMode::kScreensharing == codec_.mode && !force_key_frame_) {
if (DropFrame(input_image.timestamp())) {
return WEBRTC_VIDEO_CODEC_OK;
}
@ -881,7 +881,7 @@ int VP9EncoderImpl::GetEncodedLayerFrame(const vpx_codec_cx_pkt* pkt) {
encoded_image_._timeStamp = input_image_->timestamp();
encoded_image_.capture_time_ms_ = input_image_->render_time_ms();
encoded_image_.rotation_ = input_image_->rotation();
encoded_image_.content_type_ = (codec_.mode == kScreensharing)
encoded_image_.content_type_ = (codec_.mode == VideoCodecMode::kScreensharing)
? VideoContentType::SCREENSHARE
: VideoContentType::UNSPECIFIED;
encoded_image_._encodedHeight =