Make VideoFrameType an enum class, and move to separate file and target

Bug: webrtc:5876, webrtc:6883
Change-Id: I1435cfa9e8e54c4ba2978261048ff3fbb993ce0e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126225
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27239}
This commit is contained in:
Niels Möller
2019-03-21 15:43:58 +01:00
committed by Commit Bot
parent 3198fa4956
commit 8f7ce222e7
85 changed files with 685 additions and 589 deletions

View File

@ -332,11 +332,11 @@ void VideoCodecTestFixtureImpl::H264KeyframeChecker::CheckEncodedFrame(
contains_idr = true;
}
}
if (encoded_frame._frameType == kVideoFrameKey) {
if (encoded_frame._frameType == VideoFrameType::kVideoFrameKey) {
EXPECT_TRUE(contains_sps) << "Keyframe should contain SPS.";
EXPECT_TRUE(contains_pps) << "Keyframe should contain PPS.";
EXPECT_TRUE(contains_idr) << "Keyframe should contain IDR.";
} else if (encoded_frame._frameType == kVideoFrameDelta) {
} else if (encoded_frame._frameType == VideoFrameType::kVideoFrameDelta) {
EXPECT_FALSE(contains_sps) << "Delta frame should not contain SPS.";
EXPECT_FALSE(contains_pps) << "Delta frame should not contain PPS.";
EXPECT_FALSE(contains_idr) << "Delta frame should not contain IDR.";

View File

@ -222,7 +222,7 @@ VideoStatistics VideoCodecTestStatsImpl::SliceAndCalcVideoStatistic(
if (frame_stat.encoding_successful) {
++video_stat.num_encoded_frames;
if (frame_stat.frame_type == kVideoFrameKey) {
if (frame_stat.frame_type == VideoFrameType::kVideoFrameKey) {
key_frame_size_bytes.AddSample(frame_stat.length_bytes);
++video_stat.num_key_frames;
} else {

View File

@ -287,8 +287,9 @@ void VideoProcessor::ProcessFrame() {
// Encode.
const std::vector<VideoFrameType> frame_types =
(frame_number == 0) ? std::vector<VideoFrameType>{kVideoFrameKey}
: std::vector<VideoFrameType>{kVideoFrameDelta};
(frame_number == 0)
? std::vector<VideoFrameType>{VideoFrameType::kVideoFrameKey}
: std::vector<VideoFrameType>{VideoFrameType::kVideoFrameDelta};
const int encode_return_code = encoder_->Encode(input_frame, &frame_types);
for (size_t i = 0; i < num_simulcast_or_spatial_layers_; ++i) {
FrameStatistics* frame_stat = stats_->GetFrame(frame_number, i);