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:
@ -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.";
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user