Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4730)

Unified Diff: chrome/gpu/arc_gpu_video_decode_accelerator.cc

Issue 1641353003: GpuArcVideoService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arc-4-owen-ArcGpuVideoDecodeAccelerator
Patch Set: address dcheng's comments (uint32) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/gpu/arc_gpu_video_decode_accelerator.cc
diff --git a/chrome/gpu/arc_gpu_video_decode_accelerator.cc b/chrome/gpu/arc_gpu_video_decode_accelerator.cc
index 4c6ec79c571eeb3664ebc1d5774e05b521b080da..48519a27875808e25ff46da039b9c38c72ecf22d 100644
--- a/chrome/gpu/arc_gpu_video_decode_accelerator.cc
+++ b/chrome/gpu/arc_gpu_video_decode_accelerator.cc
@@ -23,13 +23,11 @@ ArcGpuVideoDecodeAccelerator::InputRecord::InputRecord(
buffer_index(buffer_index),
timestamp(timestamp) {}
-ArcGpuVideoDecodeAccelerator::ArcGpuVideoDecodeAccelerator(
- const gpu::GpuPreferences& gpu_preferences)
+ArcGpuVideoDecodeAccelerator::ArcGpuVideoDecodeAccelerator()
: pending_eos_output_buffer_(false),
arc_client_(nullptr),
next_bitstream_buffer_id_(0),
- output_buffer_size_(0),
- gpu_preferences_(gpu_preferences) {}
+ output_buffer_size_(0) {}
ArcGpuVideoDecodeAccelerator::~ArcGpuVideoDecodeAccelerator() {}
@@ -118,7 +116,7 @@ void ArcGpuVideoDecodeAccelerator::SetNumberOfOutputBuffers(size_t number) {
void ArcGpuVideoDecodeAccelerator::BindSharedMemory(PortType port,
uint32_t index,
- int ashmem_fd,
+ base::ScopedFD ashmem_fd,
off_t offset,
size_t length) {
DVLOG(5) << "ArcGVDA::BindSharedMemory, offset: " << offset
@@ -129,8 +127,6 @@ void ArcGpuVideoDecodeAccelerator::BindSharedMemory(PortType port,
return;
}
- // Make sure we will close the file descriptor.
- base::ScopedFD handle(ashmem_fd);
if (port != PORT_INPUT) {
DLOG(ERROR) << "SharedBuffer is only supported for input";
arc_client_->OnError(INVALID_ARGUMENT);
@@ -141,14 +137,14 @@ void ArcGpuVideoDecodeAccelerator::BindSharedMemory(PortType port,
return;
}
InputBufferInfo* input_info = &input_buffer_info_[index];
- input_info->handle = std::move(handle);
+ input_info->handle = std::move(ashmem_fd);
input_info->offset = offset;
input_info->length = length;
}
void ArcGpuVideoDecodeAccelerator::BindDmabuf(PortType port,
uint32_t index,
- int dmabuf_fd) {
+ base::ScopedFD dmabuf_fd) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!vda_) {
@@ -156,8 +152,6 @@ void ArcGpuVideoDecodeAccelerator::BindDmabuf(PortType port,
return;
}
- // Make sure we will close the file descriptor.
- base::ScopedFD handle(dmabuf_fd);
if (port != PORT_OUTPUT) {
DLOG(ERROR) << "Dmabuf is only supported for input";
arc_client_->OnError(INVALID_ARGUMENT);
@@ -167,7 +161,7 @@ void ArcGpuVideoDecodeAccelerator::BindDmabuf(PortType port,
arc_client_->OnError(INVALID_ARGUMENT);
return;
}
- buffers_pending_import_[index] = std::move(handle);
+ buffers_pending_import_[index] = std::move(dmabuf_fd);
}
void ArcGpuVideoDecodeAccelerator::UseBuffer(PortType port,

Powered by Google App Engine
This is Rietveld 408576698