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(
fuchsia::media::Packet media_packet;
media_packet.mutable_header()->set_buffer_lifetime_ordinal(
input_buffer_lifetime_ordinal_);
media_packet.mutable_header()->set_packet_index(packet.index());
media_packet.set_buffer_index(packet.index());
media_packet.mutable_header()->set_packet_index(packet.buffer_index());
media_packet.set_buffer_index(packet.buffer_index());
media_packet.set_timestamp_ish(packet.timestamp().InNanoseconds());
media_packet.set_stream_lifetime_ordinal(stream_lifetime_ordinal_);
media_packet.set_start_offset(packet.offset());
......@@ -657,10 +657,10 @@ void FuchsiaVideoDecoder::SendInputPacket(
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_.insert_or_assign(
packet.index(), InputDecoderPacket{std::move(packet)});
packet.buffer_index(), InputDecoderPacket{std::move(packet)});
}
void FuchsiaVideoDecoder::ProcessEndOfStream() {
......
......@@ -305,7 +305,7 @@ void FuchsiaClearStreamDecryptor::OnOutputPacket(
output_data_.resize(pos + packet.size());
bool read_success = output_reader_->Read(
packet.index(), packet.offset(),
packet.buffer_index(), packet.offset(),
base::make_span(output_data_.data() + pos, packet.size()));
if (!read_success) {
......@@ -333,7 +333,7 @@ void FuchsiaClearStreamDecryptor::OnOutputPacket(
// Copy data received in the last packet
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(),
packet.size()));
......
......@@ -95,7 +95,7 @@ void StreamProcessorHelper::Process(IoPacket input) {
fuchsia::media::Packet packet;
packet.mutable_header()->set_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_timestamp_ish(input.timestamp().InNanoseconds());
packet.set_stream_lifetime_ordinal(stream_lifetime_ordinal_);
......@@ -110,8 +110,8 @@ void StreamProcessorHelper::Process(IoPacket input) {
fidl::Clone(input.format()));
}
DCHECK(input_packets_.find(input.index()) == input_packets_.end());
input_packets_.insert_or_assign(input.index(), std::move(input));
DCHECK(input_packets_.find(input.buffer_index()) == input_packets_.end());
input_packets_.insert_or_assign(input.buffer_index(), std::move(input));
processor_->QueueInputPacket(std::move(packet));
}
......
......@@ -51,7 +51,7 @@ class StreamProcessorHelper {
IoPacket(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 size() const { return size_; }
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