| Index: modules/video_coding/codecs/test/videoprocessor.cc
|
| diff --git a/modules/video_coding/codecs/test/videoprocessor.cc b/modules/video_coding/codecs/test/videoprocessor.cc
|
| index af5b4b35b5e75465823f89dbf0aaa5416568db21..fc6260abee44b14287b47c04466cc8a4dc2ad917 100644
|
| --- a/modules/video_coding/codecs/test/videoprocessor.cc
|
| +++ b/modules/video_coding/codecs/test/videoprocessor.cc
|
| @@ -16,6 +16,7 @@
|
| #include <memory>
|
| #include <utility>
|
| #include <vector>
|
| +#include <algorithm>
|
|
|
| #include "api/video/i420_buffer.h"
|
| #include "common_types.h" // NOLINT(build/include)
|
| @@ -108,6 +109,22 @@ void VerifyQpParser(const EncodedImage& encoded_frame,
|
| EXPECT_EQ(encoded_frame.qp_, qp) << "Encoder QP != parsed bitstream QP.";
|
| }
|
|
|
| +size_t GetMaxNaluLength(const EncodedImage& encoded_frame,
|
| + const TestConfig& config) {
|
| + if (config.hw_encoder || config.codec_settings.codecType != kVideoCodecH264)
|
| + return 0;
|
| +
|
| + std::vector<webrtc::H264::NaluIndex> nalu_indices =
|
| + webrtc::H264::FindNaluIndices(encoded_frame._buffer,
|
| + encoded_frame._length);
|
| +
|
| + size_t maxLength = 0;
|
| + for (const webrtc::H264::NaluIndex& index : nalu_indices)
|
| + maxLength = std::max(maxLength, index.payload_size);
|
| +
|
| + return maxLength;
|
| +}
|
| +
|
| int GetElapsedTimeMicroseconds(int64_t start_ns, int64_t stop_ns) {
|
| int64_t diff_us = (stop_ns - start_ns) / rtc::kNumNanosecsPerMicrosec;
|
| RTC_DCHECK_GE(diff_us, std::numeric_limits<int>::min());
|
| @@ -351,6 +368,8 @@ void VideoProcessor::FrameEncoded(webrtc::VideoCodecType codec,
|
| encoded_image._length / config_.networking_config.packet_size_in_bytes +
|
| 1;
|
|
|
| + frame_stat->max_nalu_length = GetMaxNaluLength(encoded_image, config_);
|
| +
|
| // Simulate packet loss.
|
| bool exclude_this_frame = false;
|
| if (encoded_image._frameType == kVideoFrameKey) {
|
|
|