| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/gpu/gpu_arc_video_service.h" | 5 #include "chrome/gpu/gpu_arc_video_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 result.stride = input->stride; | 125 result.stride = input->stride; |
| 126 return result; | 126 return result; |
| 127 } | 127 } |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 } // namespace mojo | 130 } // namespace mojo |
| 131 | 131 |
| 132 namespace chromeos { | 132 namespace chromeos { |
| 133 namespace arc { | 133 namespace arc { |
| 134 | 134 |
| 135 GpuArcVideoService::GpuArcVideoService() : binding_(this) {} | 135 GpuArcVideoService::GpuArcVideoService( |
| 136 const gpu::GpuPreferences& gpu_preferences) |
| 137 : gpu_preferences_(gpu_preferences), binding_(this) {} |
| 136 | 138 |
| 137 GpuArcVideoService::GpuArcVideoService( | 139 GpuArcVideoService::GpuArcVideoService( |
| 138 ::arc::mojom::VideoAcceleratorServiceRequest request) | 140 ::arc::mojom::VideoAcceleratorServiceRequest request, |
| 139 : accelerator_(new ArcGpuVideoDecodeAccelerator()), | 141 const gpu::GpuPreferences& gpu_preferences) |
| 142 : gpu_preferences_(gpu_preferences), |
| 143 accelerator_(new ArcGpuVideoDecodeAccelerator(gpu_preferences_)), |
| 140 binding_(this, std::move(request)) { | 144 binding_(this, std::move(request)) { |
| 141 DVLOG(2) << "GpuArcVideoService connected"; | 145 DVLOG(2) << "GpuArcVideoService connected"; |
| 142 binding_.set_connection_error_handler(base::Bind(&OnConnectionError)); | 146 binding_.set_connection_error_handler(base::Bind(&OnConnectionError)); |
| 143 } | 147 } |
| 144 | 148 |
| 145 GpuArcVideoService::~GpuArcVideoService() { | 149 GpuArcVideoService::~GpuArcVideoService() { |
| 146 DCHECK(thread_checker_.CalledOnValidThread()); | 150 DCHECK(thread_checker_.CalledOnValidThread()); |
| 147 } | 151 } |
| 148 | 152 |
| 149 void GpuArcVideoService::Connect( | 153 void GpuArcVideoService::Connect( |
| 150 ::arc::mojom::VideoAcceleratorServiceClientRequest request) { | 154 ::arc::mojom::VideoAcceleratorServiceClientRequest request) { |
| 151 DVLOG(2) << "Connect"; | 155 DVLOG(2) << "Connect"; |
| 152 | 156 |
| 153 client_.Bind(::arc::mojom::VideoAcceleratorServiceClientPtrInfo( | 157 client_.Bind(::arc::mojom::VideoAcceleratorServiceClientPtrInfo( |
| 154 request.PassMessagePipe(), 0u)); | 158 request.PassMessagePipe(), 0u)); |
| 155 client_.set_connection_error_handler(base::Bind(&OnConnectionError)); | 159 client_.set_connection_error_handler(base::Bind(&OnConnectionError)); |
| 156 | 160 |
| 157 accelerator_.reset(new ArcGpuVideoDecodeAccelerator()); | 161 accelerator_.reset(new ArcGpuVideoDecodeAccelerator(gpu_preferences_)); |
| 158 | 162 |
| 159 ::arc::mojom::VideoAcceleratorServicePtr service; | 163 ::arc::mojom::VideoAcceleratorServicePtr service; |
| 160 binding_.Bind(GetProxy(&service)); | 164 binding_.Bind(GetProxy(&service)); |
| 161 binding_.set_connection_error_handler(base::Bind(&OnConnectionError)); | 165 binding_.set_connection_error_handler(base::Bind(&OnConnectionError)); |
| 162 | 166 |
| 163 client_->DeprecatedInit(std::move(service)); | 167 client_->DeprecatedInit(std::move(service)); |
| 164 } | 168 } |
| 165 | 169 |
| 166 void GpuArcVideoService::OnError(ArcVideoAccelerator::Result error) { | 170 void GpuArcVideoService::OnError(ArcVideoAccelerator::Result error) { |
| 167 DVLOG(2) << "OnError " << error; | 171 DVLOG(2) << "OnError " << error; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 accelerator_->Reset(); | 311 accelerator_->Reset(); |
| 308 } | 312 } |
| 309 | 313 |
| 310 void GpuArcVideoService::Flush() { | 314 void GpuArcVideoService::Flush() { |
| 311 DVLOG(2) << "Flush"; | 315 DVLOG(2) << "Flush"; |
| 312 accelerator_->Flush(); | 316 accelerator_->Flush(); |
| 313 } | 317 } |
| 314 | 318 |
| 315 } // namespace arc | 319 } // namespace arc |
| 316 } // namespace chromeos | 320 } // namespace chromeos |
| OLD | NEW |