Move rtp_timestamp_to_frame_num_ map from VideoProcessor to Stats class.
Let Stats class handle rtp timestamp to frame number mapping. Bug: none Change-Id: I2a29c89a25c75c4bbd6c6368a5d10514f90b3c42 Reviewed-on: https://webrtc-review.googlesource.com/41220 Commit-Queue: Åsa Persson <asapersson@webrtc.org> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21709}
This commit is contained in:
@ -32,8 +32,12 @@ std::string FrameStatistic::ToString() const {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
FrameStatistic* Stats::AddFrame() {
|
||||
stats_.emplace_back(stats_.size());
|
||||
FrameStatistic* Stats::AddFrame(size_t timestamp) {
|
||||
RTC_DCHECK(rtp_timestamp_to_frame_num_.find(timestamp) ==
|
||||
rtp_timestamp_to_frame_num_.end());
|
||||
const size_t frame_number = stats_.size();
|
||||
rtp_timestamp_to_frame_num_[timestamp] = frame_number;
|
||||
stats_.emplace_back(frame_number, timestamp);
|
||||
return &stats_.back();
|
||||
}
|
||||
|
||||
@ -42,6 +46,12 @@ FrameStatistic* Stats::GetFrame(size_t frame_number) {
|
||||
return &stats_[frame_number];
|
||||
}
|
||||
|
||||
FrameStatistic* Stats::GetFrameWithTimestamp(size_t timestamp) {
|
||||
RTC_DCHECK(rtp_timestamp_to_frame_num_.find(timestamp) !=
|
||||
rtp_timestamp_to_frame_num_.end());
|
||||
return GetFrame(rtp_timestamp_to_frame_num_[timestamp]);
|
||||
}
|
||||
|
||||
size_t Stats::size() const {
|
||||
return stats_.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user