Deprecate old names for EncodedImage::RtpTimestamp accessor and setter

Replace remaining webrtc usage of the deprecated names.

Bug: webrtc:9378
Change-Id: Ie5bd2d3eaf68316e7c827fc35c7c7d8e2eadeb9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321584
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40824}
This commit is contained in:
Danil Chapovalov 2023-09-27 18:13:04 +02:00 committed by WebRTC LUCI CQ
parent f97058e9ed
commit 2d508f10d3
7 changed files with 15 additions and 13 deletions

View file

@ -83,9 +83,11 @@ class RTC_EXPORT EncodedImage {
void SetRtpTimestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; } void SetRtpTimestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; }
uint32_t RtpTimestamp() const { return timestamp_rtp_; } uint32_t RtpTimestamp() const { return timestamp_rtp_; }
// TODO(bugs.webrtc.org/9378): Delete two functions below. // TODO(bugs.webrtc.org/9378): Delete two functions below after 2023-10-12
void SetTimestamp(uint32_t timestamp) { SetRtpTimestamp(timestamp); } [[deprecated]] void SetTimestamp(uint32_t timestamp) {
uint32_t Timestamp() const { return RtpTimestamp(); } SetRtpTimestamp(timestamp);
}
[[deprecated]] uint32_t Timestamp() const { return RtpTimestamp(); }
void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms); void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms);

View file

@ -46,17 +46,17 @@ class RTC_EXPORT VCMEncodedFrame : public EncodedImage {
using EncodedImage::GetEncodedData; using EncodedImage::GetEncodedData;
using EncodedImage::NtpTimeMs; using EncodedImage::NtpTimeMs;
using EncodedImage::PacketInfos; using EncodedImage::PacketInfos;
using EncodedImage::RtpTimestamp;
using EncodedImage::set_size; using EncodedImage::set_size;
using EncodedImage::SetColorSpace; using EncodedImage::SetColorSpace;
using EncodedImage::SetEncodedData; using EncodedImage::SetEncodedData;
using EncodedImage::SetPacketInfos; using EncodedImage::SetPacketInfos;
using EncodedImage::SetRtpTimestamp;
using EncodedImage::SetSpatialIndex; using EncodedImage::SetSpatialIndex;
using EncodedImage::SetSpatialLayerFrameSize; using EncodedImage::SetSpatialLayerFrameSize;
using EncodedImage::SetTimestamp;
using EncodedImage::size; using EncodedImage::size;
using EncodedImage::SpatialIndex; using EncodedImage::SpatialIndex;
using EncodedImage::SpatialLayerFrameSize; using EncodedImage::SpatialLayerFrameSize;
using EncodedImage::Timestamp;
/** /**
* Get render time in milliseconds * Get render time in milliseconds

View file

@ -108,7 +108,7 @@ TEST_F(GenericDecoderTest, FrameDroppedIfTooManyFramesInFlight) {
decoder_.SetDelayedDecoding(10); decoder_.SetDelayedDecoding(10);
for (int i = 0; i < kMaxFramesInFlight + 1; ++i) { for (int i = 0; i < kMaxFramesInFlight + 1; ++i) {
EncodedFrame encoded_frame; EncodedFrame encoded_frame;
encoded_frame.SetTimestamp(90000 * i); encoded_frame.SetRtpTimestamp(90000 * i);
generic_decoder_.Decode(encoded_frame, clock_->CurrentTime()); generic_decoder_.Decode(encoded_frame, clock_->CurrentTime());
} }

View file

@ -100,12 +100,12 @@ int32_t VideoDecoderWrapper::Decode(const EncodedImage& image_param,
EncodedImage input_image(image_param); EncodedImage input_image(image_param);
// We use RTP timestamp for capture time because capture_time_ms_ is always 0. // We use RTP timestamp for capture time because capture_time_ms_ is always 0.
input_image.capture_time_ms_ = input_image.capture_time_ms_ =
input_image.Timestamp() / kNumRtpTicksPerMillisec; input_image.RtpTimestamp() / kNumRtpTicksPerMillisec;
FrameExtraInfo frame_extra_info; FrameExtraInfo frame_extra_info;
frame_extra_info.timestamp_ns = frame_extra_info.timestamp_ns =
input_image.capture_time_ms_ * rtc::kNumNanosecsPerMillisec; input_image.capture_time_ms_ * rtc::kNumNanosecsPerMillisec;
frame_extra_info.timestamp_rtp = input_image.Timestamp(); frame_extra_info.timestamp_rtp = input_image.RtpTimestamp();
frame_extra_info.timestamp_ntp = input_image.ntp_time_ms_; frame_extra_info.timestamp_ntp = input_image.ntp_time_ms_;
frame_extra_info.qp = frame_extra_info.qp =
qp_parsing_enabled_ ? ParseQP(input_image) : absl::nullopt; qp_parsing_enabled_ ? ParseQP(input_image) : absl::nullopt;

View file

@ -305,7 +305,7 @@ void VideoEncoderWrapper::OnEncodedFrame(
// CopyOnWriteBuffer. // CopyOnWriteBuffer.
EncodedImage frame_copy = frame; EncodedImage frame_copy = frame;
frame_copy.SetTimestamp(frame_extra_info.timestamp_rtp); frame_copy.SetRtpTimestamp(frame_extra_info.timestamp_rtp);
frame_copy.capture_time_ms_ = capture_time_ns / rtc::kNumNanosecsPerMillisec; frame_copy.capture_time_ms_ = capture_time_ns / rtc::kNumNanosecsPerMillisec;
if (frame_copy.qp_ < 0) if (frame_copy.qp_ < 0)

View file

@ -83,7 +83,7 @@ class ObjCEncodedImageBuffer : public webrtc::EncodedImageBufferInterface {
freeWhenDone:NO]; freeWhenDone:NO];
self.encodedWidth = rtc::dchecked_cast<int32_t>(encodedImage._encodedWidth); self.encodedWidth = rtc::dchecked_cast<int32_t>(encodedImage._encodedWidth);
self.encodedHeight = rtc::dchecked_cast<int32_t>(encodedImage._encodedHeight); self.encodedHeight = rtc::dchecked_cast<int32_t>(encodedImage._encodedHeight);
self.timeStamp = encodedImage.Timestamp(); self.timeStamp = encodedImage.RtpTimestamp();
self.captureTimeMs = encodedImage.capture_time_ms_; self.captureTimeMs = encodedImage.capture_time_ms_;
self.ntpTimeMs = encodedImage.ntp_time_ms_; self.ntpTimeMs = encodedImage.ntp_time_ms_;
self.flags = encodedImage.timing_.flags; self.flags = encodedImage.timing_.flags;
@ -111,7 +111,7 @@ class ObjCEncodedImageBuffer : public webrtc::EncodedImageBufferInterface {
encodedImage.set_size(self.buffer.length); encodedImage.set_size(self.buffer.length);
encodedImage._encodedWidth = rtc::dchecked_cast<uint32_t>(self.encodedWidth); encodedImage._encodedWidth = rtc::dchecked_cast<uint32_t>(self.encodedWidth);
encodedImage._encodedHeight = rtc::dchecked_cast<uint32_t>(self.encodedHeight); encodedImage._encodedHeight = rtc::dchecked_cast<uint32_t>(self.encodedHeight);
encodedImage.SetTimestamp(self.timeStamp); encodedImage.SetRtpTimestamp(self.timeStamp);
encodedImage.capture_time_ms_ = self.captureTimeMs; encodedImage.capture_time_ms_ = self.captureTimeMs;
encodedImage.ntp_time_ms_ = self.ntpTimeMs; encodedImage.ntp_time_ms_ = self.ntpTimeMs;
encodedImage.timing_.flags = self.flags; encodedImage.timing_.flags = self.flags;

View file

@ -252,7 +252,7 @@ EncodedImageCallback::Result QualityAnalyzingVideoEncoder::OnEncodedImage(
std::pair<uint32_t, uint16_t> timestamp_frame_id; std::pair<uint32_t, uint16_t> timestamp_frame_id;
while (!timestamp_to_frame_id_list_.empty()) { while (!timestamp_to_frame_id_list_.empty()) {
timestamp_frame_id = timestamp_to_frame_id_list_.front(); timestamp_frame_id = timestamp_to_frame_id_list_.front();
if (timestamp_frame_id.first == encoded_image.Timestamp()) { if (timestamp_frame_id.first == encoded_image.RtpTimestamp()) {
break; break;
} }
timestamp_to_frame_id_list_.pop_front(); timestamp_to_frame_id_list_.pop_front();
@ -271,7 +271,7 @@ EncodedImageCallback::Result QualityAnalyzingVideoEncoder::OnEncodedImage(
// posting frame to it, but then call the callback for this frame. // posting frame to it, but then call the callback for this frame.
RTC_LOG(LS_ERROR) << "QualityAnalyzingVideoEncoder::OnEncodedImage: No " RTC_LOG(LS_ERROR) << "QualityAnalyzingVideoEncoder::OnEncodedImage: No "
"frame id for encoded_image.Timestamp()=" "frame id for encoded_image.Timestamp()="
<< encoded_image.Timestamp(); << encoded_image.RtpTimestamp();
return EncodedImageCallback::Result( return EncodedImageCallback::Result(
EncodedImageCallback::Result::Error::OK); EncodedImageCallback::Result::Error::OK);
} }