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

Side by Side Diff: media/capture/video/chromeos/video_capture_device_factory_chromeos.h

Issue 2837273004: media: add video capture device for ARC++ camera HAL v3 (Closed)
Patch Set: address wuchengli's and chfremer's comments Created 3 years, 7 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 2017 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 MEDIA_CAPTURE_VIDEO_CHROMEOS_VIDEO_CAPTURE_DEVICE_FACTORY_CHROMEOS_H_
6 #define MEDIA_CAPTURE_VIDEO_CHROMEOS_VIDEO_CAPTURE_DEVICE_FACTORY_CHROMEOS_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "media/capture/video/chromeos/camera_hal_delegate.h"
12 #include "media/capture/video/video_capture_device_factory.h"
13
14 namespace media {
15
16 class CAPTURE_EXPORT VideoCaptureDeviceFactoryChromeOS final
17 : public VideoCaptureDeviceFactory {
18 public:
19 explicit VideoCaptureDeviceFactoryChromeOS(
20 scoped_refptr<base::SingleThreadTaskRunner>
21 task_runner_for_screen_observer);
22
23 ~VideoCaptureDeviceFactoryChromeOS();
24
25 // VideoCaptureDeviceFactory interface implementations.
26 std::unique_ptr<VideoCaptureDevice> CreateDevice(
27 const VideoCaptureDeviceDescriptor& device_descriptor) final;
28 void GetSupportedFormats(
29 const VideoCaptureDeviceDescriptor& device_descriptor,
30 VideoCaptureFormats* supported_formats) final;
31 void GetDeviceDescriptors(
32 VideoCaptureDeviceDescriptors* device_descriptors) final;
33
34 // Initializes the factory. The factory is functional only after this call
35 // succeeds. This method is called on the browser UI thread when the factory
36 // instance is created.
37 bool Init();
38
39 private:
40 const scoped_refptr<base::SingleThreadTaskRunner>
41 task_runner_for_screen_observer_;
42
43 // The thread that all the Mojo operations of |camera_hal_delegate_| take
44 // place. Started in Init and stopped when the class instance is destroyed.
45 base::Thread module_thread_;
46
47 // Communication interface to the camera HAL. |camera_hal_delegate_| is
48 // created on the thread on which Init is called. All the Mojo communication
49 // that |camera_hal_delegate_| issues and receives must be sequenced through
50 // |module_thread_|.
51 scoped_refptr<CameraHalDelegate> camera_hal_delegate_;
52
53 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactoryChromeOS);
54 };
55
56 } // namespace media
57
58 #endif // MEDIA_CAPTURE_VIDEO_CHROMEOS_VIDEO_CAPTURE_DEVICE_FACTORY_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698