Commit 8f05b8bf authored by Chih-Hsuan Kuo's avatar Chih-Hsuan Kuo Committed by Commit Bot

Rename index() to buffer_index()

cpp-blacklist blocks the usages of functions named index(), so renaming
index() to buffer_index().

Bug: b/161843942
Change-Id: I1baaf7b591c0a59381f820b16a2f1976d772df57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2311596
Commit-Queue: Chih-Hsuan Kuo <chkuo@google.com>
Auto-Submit: Chih-Hsuan Kuo <chkuo@google.com>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791134}
parent 0498040d
...@@ -646,8 +646,8 @@ void FuchsiaVideoDecoder::SendInputPacket( ...@@ -646,8 +646,8 @@ void FuchsiaVideoDecoder::SendInputPacket(
fuchsia::media::Packet media_packet; fuchsia::media::Packet media_packet;
media_packet.mutable_header()->set_buffer_lifetime_ordinal( media_packet.mutable_header()->set_buffer_lifetime_ordinal(
input_buffer_lifetime_ordinal_); input_buffer_lifetime_ordinal_);
media_packet.mutable_header()->set_packet_index(packet.index()); media_packet.mutable_header()->set_packet_index(packet.buffer_index());
media_packet.set_buffer_index(packet.index()); media_packet.set_buffer_index(packet.buffer_index());
media_packet.set_timestamp_ish(packet.timestamp().InNanoseconds()); media_packet.set_timestamp_ish(packet.timestamp().InNanoseconds());
media_packet.set_stream_lifetime_ordinal(stream_lifetime_ordinal_); media_packet.set_stream_lifetime_ordinal(stream_lifetime_ordinal_);
media_packet.set_start_offset(packet.offset()); media_packet.set_start_offset(packet.offset());
...@@ -657,10 +657,10 @@ void FuchsiaVideoDecoder::SendInputPacket( ...@@ -657,10 +657,10 @@ void FuchsiaVideoDecoder::SendInputPacket(
active_stream_ = true; active_stream_ = true;
DCHECK(in_flight_input_packets_.find(packet.index()) == DCHECK(in_flight_input_packets_.find(packet.buffer_index()) ==
in_flight_input_packets_.end()); in_flight_input_packets_.end());
in_flight_input_packets_.insert_or_assign( in_flight_input_packets_.insert_or_assign(
packet.index(), InputDecoderPacket{std::move(packet)}); packet.buffer_index(), InputDecoderPacket{std::move(packet)});
} }
void FuchsiaVideoDecoder::ProcessEndOfStream() { void FuchsiaVideoDecoder::ProcessEndOfStream() {
......
...@@ -305,7 +305,7 @@ void FuchsiaClearStreamDecryptor::OnOutputPacket( ...@@ -305,7 +305,7 @@ void FuchsiaClearStreamDecryptor::OnOutputPacket(
output_data_.resize(pos + packet.size()); output_data_.resize(pos + packet.size());
bool read_success = output_reader_->Read( bool read_success = output_reader_->Read(
packet.index(), packet.offset(), packet.buffer_index(), packet.offset(),
base::make_span(output_data_.data() + pos, packet.size())); base::make_span(output_data_.data() + pos, packet.size()));
if (!read_success) { if (!read_success) {
...@@ -333,7 +333,7 @@ void FuchsiaClearStreamDecryptor::OnOutputPacket( ...@@ -333,7 +333,7 @@ void FuchsiaClearStreamDecryptor::OnOutputPacket(
// Copy data received in the last packet // Copy data received in the last packet
bool read_success = output_reader_->Read( bool read_success = output_reader_->Read(
packet.index(), packet.offset(), packet.buffer_index(), packet.offset(),
base::make_span(clear_buffer->writable_data() + output_data_.size(), base::make_span(clear_buffer->writable_data() + output_data_.size(),
packet.size())); packet.size()));
......
...@@ -95,7 +95,7 @@ void StreamProcessorHelper::Process(IoPacket input) { ...@@ -95,7 +95,7 @@ void StreamProcessorHelper::Process(IoPacket input) {
fuchsia::media::Packet packet; fuchsia::media::Packet packet;
packet.mutable_header()->set_buffer_lifetime_ordinal( packet.mutable_header()->set_buffer_lifetime_ordinal(
input_buffer_lifetime_ordinal_); input_buffer_lifetime_ordinal_);
packet.mutable_header()->set_packet_index(input.index()); packet.mutable_header()->set_packet_index(input.buffer_index());
packet.set_buffer_index(packet.header().packet_index()); packet.set_buffer_index(packet.header().packet_index());
packet.set_timestamp_ish(input.timestamp().InNanoseconds()); packet.set_timestamp_ish(input.timestamp().InNanoseconds());
packet.set_stream_lifetime_ordinal(stream_lifetime_ordinal_); packet.set_stream_lifetime_ordinal(stream_lifetime_ordinal_);
...@@ -110,8 +110,8 @@ void StreamProcessorHelper::Process(IoPacket input) { ...@@ -110,8 +110,8 @@ void StreamProcessorHelper::Process(IoPacket input) {
fidl::Clone(input.format())); fidl::Clone(input.format()));
} }
DCHECK(input_packets_.find(input.index()) == input_packets_.end()); DCHECK(input_packets_.find(input.buffer_index()) == input_packets_.end());
input_packets_.insert_or_assign(input.index(), std::move(input)); input_packets_.insert_or_assign(input.buffer_index(), std::move(input));
processor_->QueueInputPacket(std::move(packet)); processor_->QueueInputPacket(std::move(packet));
} }
......
...@@ -51,7 +51,7 @@ class StreamProcessorHelper { ...@@ -51,7 +51,7 @@ class StreamProcessorHelper {
IoPacket(IoPacket&&); IoPacket(IoPacket&&);
IoPacket& operator=(IoPacket&&); IoPacket& operator=(IoPacket&&);
size_t index() const { return index_; } size_t buffer_index() const { return index_; }
size_t offset() const { return offset_; } size_t offset() const { return offset_; }
size_t size() const { return size_; } size_t size() const { return size_; }
base::TimeDelta timestamp() const { return timestamp_; } base::TimeDelta timestamp() const { return timestamp_; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment