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

Side by Side Diff: content/common/gpu/media/gpu_arc_video_service.h

Issue 1451353002: Implement GpuArcVideoService for arc video accelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Owen's comments: split GpuArcVideoServiceHost and named the new code arc::ArcVideoBridge Created 4 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_ARC_VIDEO_SERVICE_H_
6 #define CONTENT_COMMON_GPU_MEDIA_GPU_ARC_VIDEO_SERVICE_H_
7
8 #include <map>
9
10 #include "base/callback.h"
11 #include "base/threading/thread_checker.h"
12
13 namespace base {
14 class SingleThreadTaskRunner;
15 class WaitableEvent;
16 }
17
18 namespace IPC {
19 struct ChannelHandle;
20 }
21
22 namespace content {
23
24 // GpuArcVideoService manages life-cycle and IPC message translation for
25 // ArcVideoAccelerator.
26 //
27 // For each creation request from GpuChannelManager, GpuArcVideoService will
28 // create a new IPC channel.
29 class GpuArcVideoService {
30 public:
31 class AcceleratorStub;
32 using CreateChannelCallback = base::Callback<void(const IPC::ChannelHandle&)>;
33
34 // |shutdown_event| should signal an event when this process is about to be
35 // shut down in order to notify our new IPC channel to terminate.
36 GpuArcVideoService(
37 base::WaitableEvent* shutdown_event,
38 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
39
40 // Upon deletion, all ArcVideoAccelerator will be deleted and the associated
41 // IPC channels are closed.
42 ~GpuArcVideoService();
43
44 // Creates a new accelerator stub. The creation result will be sent back via
45 // |callback|.
46 void CreateChannel(const CreateChannelCallback& callback);
47
48 // Removes the reference of |stub| (and trigger deletion) from this class.
49 void RemoveClient(AcceleratorStub* stub);
50
51 private:
52 base::ThreadChecker thread_checker_;
53
54 // Shutdown event of GPU process.
55 base::WaitableEvent* shutdown_event_;
56
57 // GPU io thread task runner.
58 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
59
60 // Bookkeeping all accelerator stubs.
61 std::map<AcceleratorStub*, scoped_ptr<AcceleratorStub>> accelerator_stubs_;
62
63 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoService);
64 };
65
66 } // namespace content
67
68 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_ARC_VIDEO_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698