Commit f4f94d4f authored by Ricky Liang's avatar Ricky Liang Committed by Commit Bot

media: make the buffer_id in stream_buffer_manager consistent

The buffer_id is passed through Mojo as uint64, so we should refer to
the buffer_id throughout the code consistently as uint64_t.

BUG=832772
TBR=wuchengli

Change-Id: Ib6f260c4242e8c68510903cefcc997bf7a6bbd4d
Reviewed-on: https://chromium-review.googlesource.com/1073213Reviewed-by: default avatarRicky Liang <jcliang@chromium.org>
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561854}
parent eed0f181
...@@ -239,7 +239,7 @@ void StreamBufferManager::SetCaptureMetadata(cros::mojom::CameraMetadataTag tag, ...@@ -239,7 +239,7 @@ void StreamBufferManager::SetCaptureMetadata(cros::mojom::CameraMetadataTag tag,
uint64_t StreamBufferManager::GetBufferIpcId(StreamType stream_type, uint64_t StreamBufferManager::GetBufferIpcId(StreamType stream_type,
size_t index) { size_t index) {
uint64_t id = 0; uint64_t id = 0;
id |= static_cast<int64_t>(stream_type) << 32; id |= static_cast<uint64_t>(stream_type) << 32;
id |= index; id |= index;
return id; return id;
} }
...@@ -284,7 +284,7 @@ void StreamBufferManager::RegisterBuffer(StreamType stream_type) { ...@@ -284,7 +284,7 @@ void StreamBufferManager::RegisterBuffer(StreamType stream_type) {
return; return;
} }
size_t buffer_id = stream_context_[stream_type]->free_buffers.front(); uint64_t buffer_id = stream_context_[stream_type]->free_buffers.front();
stream_context_[stream_type]->free_buffers.pop(); stream_context_[stream_type]->free_buffers.pop();
const gfx::GpuMemoryBuffer* buffer = const gfx::GpuMemoryBuffer* buffer =
stream_context_[stream_type]->buffers[GetBufferIndex(buffer_id)].get(); stream_context_[stream_type]->buffers[GetBufferIndex(buffer_id)].get();
......
...@@ -235,10 +235,10 @@ class CAPTURE_EXPORT StreamBufferManager final ...@@ -235,10 +235,10 @@ class CAPTURE_EXPORT StreamBufferManager final
std::vector<std::unique_ptr<gfx::GpuMemoryBuffer>> buffers; std::vector<std::unique_ptr<gfx::GpuMemoryBuffer>> buffers;
// The free buffers of this stream. The queue stores indices into the // The free buffers of this stream. The queue stores indices into the
// |buffers| vector. // |buffers| vector.
std::queue<size_t> free_buffers; std::queue<uint64_t> free_buffers;
// The buffers that are registered to the HAL, which can be used as the // The buffers that are registered to the HAL, which can be used as the
// output buffers for capture requests. // output buffers for capture requests.
std::queue<size_t> registered_buffers; std::queue<uint64_t> registered_buffers;
// The pointers to the pending capture results that have unsubmitted result // The pointers to the pending capture results that have unsubmitted result
// buffers. // buffers.
std::map<uint32_t, CaptureResult*> capture_results_with_buffer; std::map<uint32_t, CaptureResult*> capture_results_with_buffer;
......
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