[PCLF] Fix ExampleVideoQualityAnalyzer to not use VideoFrame::kNotSetId as frame id

Bug: b/240540204
Change-Id: I7d529f22c93e529a26787dd4c0b5448ad27bb644
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280382
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Auto-Submit: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@google.com>
Reviewed-by: Andrey Logvin <landrey@google.com>
Cr-Commit-Position: refs/heads/main@{#38466}
This commit is contained in:
Artem Titov 2022-10-25 13:56:57 +02:00 committed by WebRTC LUCI CQ
parent 0137e730b7
commit 28da5462be
2 changed files with 4 additions and 1 deletions

View file

@ -29,6 +29,9 @@ uint16_t ExampleVideoQualityAnalyzer::OnFrameCaptured(
const webrtc::VideoFrame& frame) {
MutexLock lock(&lock_);
uint16_t frame_id = next_frame_id_++;
if (frame_id == VideoFrame::kNotSetId) {
frame_id = next_frame_id_++;
}
auto it = frames_in_flight_.find(frame_id);
if (it == frames_in_flight_.end()) {
frames_in_flight_.insert(frame_id);

View file

@ -86,7 +86,7 @@ class ExampleVideoQualityAnalyzer : public VideoQualityAnalyzerInterface {
// process frame id overlap.
std::set<uint16_t> frames_in_flight_ RTC_GUARDED_BY(lock_);
std::map<uint16_t, std::string> frames_to_stream_label_ RTC_GUARDED_BY(lock_);
uint16_t next_frame_id_ RTC_GUARDED_BY(lock_) = 0;
uint16_t next_frame_id_ RTC_GUARDED_BY(lock_) = 1;
uint64_t frames_captured_ RTC_GUARDED_BY(lock_) = 0;
uint64_t frames_pre_encoded_ RTC_GUARDED_BY(lock_) = 0;
uint64_t frames_encoded_ RTC_GUARDED_BY(lock_) = 0;