Make the rtp timestamp member of EncodedImage private
A followup to https://webrtc-review.googlesource.com/c/src/+/82160, which added accessor methods. Bug: webrtc:9378 Change-Id: Id3cff46cde3a5a3fb6d6edd4e8dac26193e6481c Reviewed-on: https://webrtc-review.googlesource.com/95103 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24705}
This commit is contained in:
@ -40,10 +40,10 @@ class EncodedImage {
|
|||||||
// TODO(nisse): Change style to timestamp(), set_timestamp(), for consistency
|
// TODO(nisse): Change style to timestamp(), set_timestamp(), for consistency
|
||||||
// with the VideoFrame class.
|
// with the VideoFrame class.
|
||||||
// Set frame timestamp (90kHz).
|
// Set frame timestamp (90kHz).
|
||||||
void SetTimestamp(uint32_t timestamp) { _timeStamp = timestamp; }
|
void SetTimestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; }
|
||||||
|
|
||||||
// Get frame timestamp (90kHz).
|
// Get frame timestamp (90kHz).
|
||||||
uint32_t Timestamp() const { return _timeStamp; }
|
uint32_t Timestamp() const { return timestamp_rtp_; }
|
||||||
|
|
||||||
void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms);
|
void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms);
|
||||||
|
|
||||||
@ -60,9 +60,6 @@ class EncodedImage {
|
|||||||
|
|
||||||
uint32_t _encodedWidth = 0;
|
uint32_t _encodedWidth = 0;
|
||||||
uint32_t _encodedHeight = 0;
|
uint32_t _encodedHeight = 0;
|
||||||
// TODO(nisse): Make private, once users have been updated
|
|
||||||
// to use accessor methods.
|
|
||||||
uint32_t _timeStamp = 0;
|
|
||||||
// NTP time of the capture time in local timebase in milliseconds.
|
// NTP time of the capture time in local timebase in milliseconds.
|
||||||
int64_t ntp_time_ms_ = 0;
|
int64_t ntp_time_ms_ = 0;
|
||||||
int64_t capture_time_ms_ = 0;
|
int64_t capture_time_ms_ = 0;
|
||||||
@ -93,6 +90,7 @@ class EncodedImage {
|
|||||||
} timing_;
|
} timing_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
uint32_t timestamp_rtp_ = 0;
|
||||||
// -1 means not set. Use a plain int rather than optional, to keep this class
|
// -1 means not set. Use a plain int rather than optional, to keep this class
|
||||||
// copyable with memcpy.
|
// copyable with memcpy.
|
||||||
int spatial_index_ = -1;
|
int spatial_index_ = -1;
|
||||||
|
@ -342,7 +342,7 @@ class TestSimulcastEncoderAdapterFake : public ::testing::Test,
|
|||||||
last_encoded_image_simulcast_index_ =
|
last_encoded_image_simulcast_index_ =
|
||||||
encoded_image.SpatialIndex().value_or(-1);
|
encoded_image.SpatialIndex().value_or(-1);
|
||||||
|
|
||||||
return Result(Result::OK, encoded_image._timeStamp);
|
return Result(Result::OK, encoded_image.Timestamp());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetLastEncodedImageInfo(int* out_width,
|
bool GetLastEncodedImageInfo(int* out_width,
|
||||||
|
@ -131,10 +131,11 @@ int32_t MultiplexDecoderAdapter::Decode(
|
|||||||
MultiplexImage image = MultiplexEncodedImagePacker::Unpack(input_image);
|
MultiplexImage image = MultiplexEncodedImagePacker::Unpack(input_image);
|
||||||
|
|
||||||
if (supports_augmenting_data_) {
|
if (supports_augmenting_data_) {
|
||||||
RTC_DCHECK(decoded_augmenting_data_.find(input_image._timeStamp) ==
|
RTC_DCHECK(decoded_augmenting_data_.find(input_image.Timestamp()) ==
|
||||||
decoded_augmenting_data_.end());
|
decoded_augmenting_data_.end());
|
||||||
decoded_augmenting_data_.emplace(
|
decoded_augmenting_data_.emplace(
|
||||||
std::piecewise_construct, std::forward_as_tuple(input_image._timeStamp),
|
std::piecewise_construct,
|
||||||
|
std::forward_as_tuple(input_image.Timestamp()),
|
||||||
std::forward_as_tuple(std::move(image.augmenting_data),
|
std::forward_as_tuple(std::move(image.augmenting_data),
|
||||||
image.augmenting_data_size));
|
image.augmenting_data_size));
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ int32_t FakeEncoder::Encode(const VideoFrame& input_image,
|
|||||||
memcpy(encoded_buffer.get(), encoded_buffer_, frame_info.layers[i].size);
|
memcpy(encoded_buffer.get(), encoded_buffer_, frame_info.layers[i].size);
|
||||||
EncodedImage encoded(encoded_buffer.get(), frame_info.layers[i].size,
|
EncodedImage encoded(encoded_buffer.get(), frame_info.layers[i].size,
|
||||||
sizeof(encoded_buffer_));
|
sizeof(encoded_buffer_));
|
||||||
encoded._timeStamp = input_image.timestamp();
|
encoded.SetTimestamp(input_image.timestamp());
|
||||||
encoded.capture_time_ms_ = input_image.render_time_ms();
|
encoded.capture_time_ms_ = input_image.render_time_ms();
|
||||||
encoded._frameType =
|
encoded._frameType =
|
||||||
frame_info.keyframe ? kVideoFrameKey : kVideoFrameDelta;
|
frame_info.keyframe ? kVideoFrameKey : kVideoFrameDelta;
|
||||||
|
@ -102,11 +102,12 @@ EncodedImageCallback::Result FakeVP8Encoder::OnEncodedImage(
|
|||||||
uint8_t stream_idx = encoded_image.SpatialIndex().value_or(0);
|
uint8_t stream_idx = encoded_image.SpatialIndex().value_or(0);
|
||||||
CodecSpecificInfo overrided_specific_info;
|
CodecSpecificInfo overrided_specific_info;
|
||||||
TemporalLayers::FrameConfig tl_config =
|
TemporalLayers::FrameConfig tl_config =
|
||||||
temporal_layers_[stream_idx]->UpdateLayerConfig(encoded_image._timeStamp);
|
temporal_layers_[stream_idx]->UpdateLayerConfig(
|
||||||
|
encoded_image.Timestamp());
|
||||||
PopulateCodecSpecific(&overrided_specific_info, tl_config,
|
PopulateCodecSpecific(&overrided_specific_info, tl_config,
|
||||||
encoded_image._frameType, stream_idx,
|
encoded_image._frameType, stream_idx,
|
||||||
encoded_image._timeStamp);
|
encoded_image.Timestamp());
|
||||||
temporal_layers_[stream_idx]->FrameEncoded(encoded_image._timeStamp,
|
temporal_layers_[stream_idx]->FrameEncoded(encoded_image.Timestamp(),
|
||||||
encoded_image._length, -1);
|
encoded_image._length, -1);
|
||||||
|
|
||||||
return callback_->OnEncodedImage(encoded_image, &overrided_specific_info,
|
return callback_->OnEncodedImage(encoded_image, &overrided_specific_info,
|
||||||
|
@ -260,7 +260,7 @@ bool SendStatisticsProxy::UmaSamplesContainer::InsertEncodedFrame(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto it = encoded_frames_.find(encoded_frame._timeStamp);
|
auto it = encoded_frames_.find(encoded_frame.Timestamp());
|
||||||
if (it == encoded_frames_.end()) {
|
if (it == encoded_frames_.end()) {
|
||||||
// First frame with this timestamp.
|
// First frame with this timestamp.
|
||||||
encoded_frames_.insert(
|
encoded_frames_.insert(
|
||||||
|
Reference in New Issue
Block a user