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

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: fix nits 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
« no previous file with comments | « chrome/gpu/gpu_arc_video_service.h ('k') | components/arc/common/video_accelerator.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
dcheng 2016/06/07 00:57:56 Until we have enum traits, can we static_assert so
kcwu 2016/06/07 01:50:08 Done.
}
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));
dcheng 2016/06/07 00:57:56 Ditto.
kcwu 2016/06/07 01:50:08 Done.
+}
+
+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();
}
« no previous file with comments | « chrome/gpu/gpu_arc_video_service.h ('k') | components/arc/common/video_accelerator.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698