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, |