| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 std::unique_ptr<GpuArcVideoService> service, | 130 std::unique_ptr<GpuArcVideoService> service, |
| 131 ::arc::mojom::VideoAcceleratorServiceClientRequest client_request) { | 131 ::arc::mojom::VideoAcceleratorServiceClientRequest client_request) { |
| 132 DVLOG(2) << "Connect"; | 132 DVLOG(2) << "Connect"; |
| 133 | 133 |
| 134 service->client_.Bind(::arc::mojom::VideoAcceleratorServiceClientPtrInfo( | 134 service->client_.Bind(::arc::mojom::VideoAcceleratorServiceClientPtrInfo( |
| 135 client_request.PassMessagePipe(), 0u)); | 135 client_request.PassMessagePipe(), 0u)); |
| 136 service->client_.set_connection_error_handler(base::Bind(&OnConnectionError)); | 136 service->client_.set_connection_error_handler(base::Bind(&OnConnectionError)); |
| 137 | 137 |
| 138 ::arc::mojom::VideoAcceleratorServicePtr service_proxy; | 138 ::arc::mojom::VideoAcceleratorServicePtr service_proxy; |
| 139 ::arc::mojom::VideoAcceleratorServiceRequest request = | 139 ::arc::mojom::VideoAcceleratorServiceRequest request = |
| 140 mojo::GetProxy(&service_proxy); | 140 mojo::MakeRequest(&service_proxy); |
| 141 service->client_->DeprecatedInit(std::move(service_proxy)); | 141 service->client_->DeprecatedInit(std::move(service_proxy)); |
| 142 | 142 |
| 143 auto binding = mojo::MakeStrongBinding(std::move(service), | 143 auto binding = mojo::MakeStrongBinding(std::move(service), |
| 144 mojo::GetProxy(&service_proxy)); | 144 mojo::MakeRequest(&service_proxy)); |
| 145 binding->set_connection_error_handler(base::Bind(&OnConnectionError)); | 145 binding->set_connection_error_handler(base::Bind(&OnConnectionError)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void GpuArcVideoService::OnError(ArcVideoAccelerator::Result error) { | 148 void GpuArcVideoService::OnError(ArcVideoAccelerator::Result error) { |
| 149 DVLOG(2) << "OnError " << error; | 149 DVLOG(2) << "OnError " << error; |
| 150 DCHECK_NE(error, ArcVideoAccelerator::SUCCESS); | 150 DCHECK_NE(error, ArcVideoAccelerator::SUCCESS); |
| 151 DCHECK(client_); | 151 DCHECK(client_); |
| 152 client_->OnError( | 152 client_->OnError( |
| 153 static_cast<::arc::mojom::VideoAcceleratorService::Result>(error)); | 153 static_cast<::arc::mojom::VideoAcceleratorService::Result>(error)); |
| 154 } | 154 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 accelerator_->Reset(); | 285 accelerator_->Reset(); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void GpuArcVideoService::Flush() { | 288 void GpuArcVideoService::Flush() { |
| 289 DVLOG(2) << "Flush"; | 289 DVLOG(2) << "Flush"; |
| 290 accelerator_->Flush(); | 290 accelerator_->Flush(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace arc | 293 } // namespace arc |
| 294 } // namespace chromeos | 294 } // namespace chromeos |
| OLD | NEW |