| 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..b87bf1b0fede4e10cbe3cafbddd94fa0f60c035d
|
| --- /dev/null
|
| +++ b/chrome/gpu/gpu_arc_video_service.h
|
| @@ -0,0 +1,63 @@
|
| +// 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 "base/macros.h"
|
| +#include "components/arc/common/video.mojom.h"
|
| +#include "mojo/public/cpp/bindings/strong_binding.h"
|
| +
|
| +namespace gpu {
|
| +struct GpuPreferences;
|
| +} // namespace gpu
|
| +
|
| +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.
|
| + GpuArcVideoService(mojo::InterfaceRequest<::arc::VideoHost> request,
|
| + const gpu::GpuPreferences& gpu_preferences);
|
| +
|
| + // 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(
|
| + uint32_t pid,
|
| + const OnRequestArcVideoAcceleratorChannelCallback& callback) override;
|
| +
|
| + base::ThreadChecker thread_checker_;
|
| +
|
| + // Binding of arc::VideoHost. It also takes ownership of |this|.
|
| + mojo::StrongBinding<::arc::VideoHost> binding_;
|
| +
|
| + const gpu::GpuPreferences& gpu_preferences_;
|
| +
|
| + // Bookkeeping all accelerator stubs.
|
| + std::map<AcceleratorStub*, scoped_ptr<AcceleratorStub>> accelerator_stubs_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(GpuArcVideoService);
|
| +};
|
| +
|
| +} // namespace arc
|
| +} // namespace chromeos
|
| +
|
| +#endif // CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_
|
|
|