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

Unified Diff: chrome/gpu/gpu_arc_video_service.cc

Issue 2036723002: Limit the number of ARC codec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address posciak's comments; add DeprecatedInitialize() Created 4 years, 6 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/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..18e93725518178d6e2d2714715a715de8626157c 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::SUCCESS);
client_->OnError(
- static_cast<::arc::mojom::VideoAcceleratorServiceClient::Error>(error));
+ static_cast<::arc::mojom::VideoAcceleratorService::Result>(error));
}
void GpuArcVideoService::OnBufferDone(PortType port,
@@ -139,9 +140,19 @@ 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);
+ callback.Run(
+ static_cast<::arc::mojom::VideoAcceleratorService::Result>(result));
+}
+
+void GpuArcVideoService::DeprecatedInitialize(
+ ::arc::mojom::ArcVideoAcceleratorConfigPtr config,
+ const DeprecatedInitializeCallback& callback) {
+ DVLOG(2) << "DeprecatedInitialize";
+ ArcVideoAccelerator::Result result =
+ accelerator_->Initialize(config.To<ArcVideoAccelerator::Config>(), this);
+ callback.Run(result == ArcVideoAccelerator::SUCCESS);
}
base::ScopedFD GpuArcVideoService::UnwrapFdFromMojoHandle(
@@ -149,7 +160,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 +170,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();
}

Powered by Google App Engine
This is Rietveld 408576698