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

Unified Diff: content/browser/gpu/gpu_arc_video_service_host.h

Issue 1451353002: Implement GpuArcVideoService for arc video accelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years 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: content/browser/gpu/gpu_arc_video_service_host.h
diff --git a/content/browser/gpu/gpu_arc_video_service_host.h b/content/browser/gpu/gpu_arc_video_service_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c1c587f49e4166a09ad9f4061fb322d164efa83
--- /dev/null
+++ b/content/browser/gpu/gpu_arc_video_service_host.h
@@ -0,0 +1,55 @@
+// Copyright 2015 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 CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_
+#define CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_
+
+#include <queue>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/non_thread_safe.h"
+#include "components/arc/arc_bridge_service.h"
+#include "ipc/ipc_channel_handle.h"
+#include "ipc/ipc_listener.h"
+
+namespace content {
+
+// This class passes requests from ArcBridgeService to GpuArcVideoService in
+// GPU process and sends the created channel back to ArcBridgeService.
+class GpuArcVideoServiceHost : public base::NonThreadSafe,
+ public arc::ArcBridgeService::Observer,
+ public arc::ArcBridgeService::VideoService {
Luis Héctor Chávez 2015/12/16 16:37:22 instead of an arc::ArcBridgeService::VideoService,
kcwu 2015/12/22 11:58:25 Done.
+ public:
+ GpuArcVideoServiceHost(
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
+ ~GpuArcVideoServiceHost() override;
+
+ void Initialize();
+
+ // arc::ArcBridgeService::Observer implementation.
+ void OnStateChanged(arc::ArcBridgeService::State state) override;
+
+ // arc::ArcBridgeService::VideoService implementation.
+ void OnRequestArcVideoAcceleratorChannel() override;
+
+ private:
+ void NotifyArcAcceleratorChannelCreated(const IPC::ChannelHandle& handle);
+ void Shutdown();
+
+ // IO task runner, where GpuProcessHost tasks run.
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+
+ // Number of requests are send to GPU but not responsed yet.
+ int num_pending_requests_;
+
+ base::WeakPtrFactory<GpuArcVideoServiceHost> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuArcVideoServiceHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698