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

Unified Diff: chrome/gpu/gpu_arc_video_service.h

Issue 1641353003: GpuArcVideoService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arc-4-owen-ArcGpuVideoDecodeAccelerator
Patch Set: fix build Created 4 years, 8 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/chrome_content_gpu_client.cc ('k') | chrome/gpu/gpu_arc_video_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/gpu_arc_video_service.h
diff --git a/chrome/gpu/gpu_arc_video_service.h b/chrome/gpu/gpu_arc_video_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..951eb6e851bba6d47b0c133b17d5e3e047eb901f
--- /dev/null
+++ b/chrome/gpu/gpu_arc_video_service.h
@@ -0,0 +1,57 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_
+#define CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_
+
+#include <map>
+#include <memory>
+
+#include "base/macros.h"
+#include "components/arc/common/video.mojom.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace chromeos {
+namespace arc {
+
+// GpuArcVideoService manages life-cycle and IPC message translation for
+// ArcVideoAccelerator.
+//
+// For each creation request from GpuArcVideoServiceHost, GpuArcVideoService
+// will create a new IPC channel.
+class GpuArcVideoService : public ::arc::VideoHost {
+ public:
+ class AcceleratorStub;
+
+ // |request| is mojo interface request of arc::VideoHost.
+ explicit GpuArcVideoService(mojo::InterfaceRequest<::arc::VideoHost> request);
+
+ // Upon deletion, all ArcVideoAccelerator will be deleted and the associated
+ // IPC channels are closed.
+ ~GpuArcVideoService() override;
+
+ // Removes the reference of |stub| (and trigger deletion) from this class.
+ void RemoveClient(AcceleratorStub* stub);
+
+ private:
+ // arc::VideoHost implementation.
+ void OnRequestArcVideoAcceleratorChannel(
+ const OnRequestArcVideoAcceleratorChannelCallback& callback) override;
+
+ base::ThreadChecker thread_checker_;
+
+ // Binding of arc::VideoHost. It also takes ownership of |this|.
+ mojo::StrongBinding<::arc::VideoHost> binding_;
+
+ // Bookkeeping all accelerator stubs.
+ std::map<AcceleratorStub*, std::unique_ptr<AcceleratorStub>>
+ accelerator_stubs_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuArcVideoService);
+};
+
+} // namespace arc
+} // namespace chromeos
+
+#endif // CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_
« no previous file with comments | « chrome/gpu/chrome_content_gpu_client.cc ('k') | chrome/gpu/gpu_arc_video_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698