| Index: content/common/gpu/media/gpu_arc_accelerator.h
|
| diff --git a/content/common/gpu/media/gpu_arc_accelerator.h b/content/common/gpu/media/gpu_arc_accelerator.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5379c612aee5c1e90baa4aef92ec212d3faa424d
|
| --- /dev/null
|
| +++ b/content/common/gpu/media/gpu_arc_accelerator.h
|
| @@ -0,0 +1,74 @@
|
| +// 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_COMMON_GPU_MEDIA_GPU_ARC_ACCELERATOR_H_
|
| +#define CONTENT_COMMON_GPU_MEDIA_GPU_ARC_ACCELERATOR_H_
|
| +
|
| +#include <map>
|
| +
|
| +#include "base/memory/ref_counted.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/threading/non_thread_safe.h"
|
| +#include "base/threading/thread.h"
|
| +#include "media/video/arc_video_accelerator.h"
|
| +
|
| +namespace base {
|
| +class SingleThreadTaskRunner;
|
| +class WaitableEvent;
|
| +}
|
| +
|
| +namespace IPC {
|
| +struct ChannelHandle;
|
| +}
|
| +
|
| +namespace content {
|
| +class GpuChannel;
|
| +
|
| +class GpuArcAccelerator : public base::NonThreadSafe {
|
| + public:
|
| + class Client;
|
| +
|
| + GpuArcAccelerator(
|
| + GpuChannel* channel,
|
| + base::WaitableEvent* shutdown_event,
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
|
| + ~GpuArcAccelerator();
|
| +
|
| + void Initialize();
|
| +
|
| + void CreateClient(uint32_t device_type);
|
| +
|
| + void RemoveClientOnArcThread(Client* client);
|
| +
|
| + private:
|
| + void CreateClientOnArcThread(uint32_t device_type);
|
| + void RemoveAllClientsOnArcThread(base::WaitableEvent* done);
|
| +
|
| + // GpuChannel outlives this class. So a raw pointer is safe.
|
| + GpuChannel* gpu_channel_;
|
| +
|
| + // Shutdown event of GPU process.
|
| + base::WaitableEvent* shutdown_event_;
|
| +
|
| + // GPU io thread task runner.
|
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
|
| +
|
| + // GPU main thread task runner.
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
| +
|
| + // Arc accelerator thread.
|
| + base::Thread arc_accelerator_thread_;
|
| +
|
| + // Arc accelerator task runner.
|
| + scoped_refptr<base::SingleThreadTaskRunner> arc_task_runner_;
|
| +
|
| + // Bookkeeping all clients. Only accessed on arc thread.
|
| + std::map<Client*, scoped_ptr<Client>> clients_;
|
| +
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(GpuArcAccelerator);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_COMMON_GPU_MEDIA_GPU_ARC_ACCELERATOR_H_
|
|
|