| Index: chrome/gpu/gpu_arc_video_service.cc
|
| diff --git a/chrome/gpu/gpu_arc_video_service.cc b/chrome/gpu/gpu_arc_video_service.cc
|
| index 3d788ec4c2fc2fde1bc9e4a39d4540f24e6a5a7c..a6651a3fd2d14c1e7e0e3d92333b1efeef32a058 100644
|
| --- a/chrome/gpu/gpu_arc_video_service.cc
|
| +++ b/chrome/gpu/gpu_arc_video_service.cc
|
| @@ -106,10 +106,11 @@ void GpuArcVideoService::Connect(
|
| client_->Init(std::move(service));
|
| }
|
|
|
| -void GpuArcVideoService::OnError(ArcVideoAccelerator::Error error) {
|
| +void GpuArcVideoService::OnError(ArcVideoAccelerator::Result error) {
|
| DVLOG(2) << "OnError " << error;
|
| + DCHECK_NE(error, ArcVideoAccelerator::NO_ERROR);
|
| client_->OnError(
|
| - static_cast<::arc::mojom::VideoAcceleratorServiceClient::Error>(error));
|
| + static_cast<::arc::mojom::VideoAcceleratorService::Result>(error));
|
| }
|
|
|
| void GpuArcVideoService::OnBufferDone(PortType port,
|
| @@ -139,9 +140,15 @@ void GpuArcVideoService::Initialize(
|
| ::arc::mojom::ArcVideoAcceleratorConfigPtr config,
|
| const InitializeCallback& callback) {
|
| DVLOG(2) << "Initialize";
|
| - bool result =
|
| + ArcVideoAccelerator::Result result =
|
| accelerator_->Initialize(config.To<ArcVideoAccelerator::Config>(), this);
|
| - callback.Run(result);
|
| + if (result == ArcVideoAccelerator::NO_ERROR) {
|
| + callback.Run(true, ::arc::mojom::VideoAcceleratorService::Result::NO_ERROR);
|
| + } else {
|
| + callback.Run(
|
| + false,
|
| + static_cast<::arc::mojom::VideoAcceleratorService::Result>(result));
|
| + }
|
| }
|
|
|
| base::ScopedFD GpuArcVideoService::UnwrapFdFromMojoHandle(
|
| @@ -149,7 +156,7 @@ base::ScopedFD GpuArcVideoService::UnwrapFdFromMojoHandle(
|
| if (!handle.is_valid()) {
|
| LOG(ERROR) << "handle is invalid";
|
| client_->OnError(
|
| - ::arc::mojom::VideoAcceleratorServiceClient::Error::INVALID_ARGUMENT);
|
| + ::arc::mojom::VideoAcceleratorService::Result::INVALID_ARGUMENT);
|
| return base::ScopedFD();
|
| }
|
|
|
| @@ -159,7 +166,7 @@ base::ScopedFD GpuArcVideoService::UnwrapFdFromMojoHandle(
|
| if (mojo_result != MOJO_RESULT_OK) {
|
| LOG(ERROR) << "UnwrapPlatformFile failed: " << mojo_result;
|
| client_->OnError(
|
| - ::arc::mojom::VideoAcceleratorServiceClient::Error::PLATFORM_FAILURE);
|
| + ::arc::mojom::VideoAcceleratorService::Result::PLATFORM_FAILURE);
|
| return base::ScopedFD();
|
| }
|
|
|
|
|