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

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

Issue 2837273004: media: add video capture device for ARC++ camera HAL v3 (Closed)
Patch Set: set CL dependency Created 3 years, 6 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_CHROMEOS_H_
Pawel Osciak 2017/06/13 08:40:16 MEDIA_CAPTURE_VIDEO_CHROMEOS_VIDEO_CAPTURE_DEVICE_
jcliang 2017/06/14 04:46:08 Done.
6 #define MEDIA_CAPTURE_VIDEO_CHROMEOS_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_
7
8 #include <stdint.h>
Pawel Osciak 2017/06/13 08:40:16 Is this header needed?
jcliang 2017/06/14 04:46:07 Removed.
9
10 #include <memory>
11 #include <string>
Pawel Osciak 2017/06/13 08:40:16 Is this header needed?
jcliang 2017/06/14 04:46:07 Removed.
12
13 #include "base/macros.h"
14 #include "base/threading/thread.h"
15 #include "media/capture/video/chromeos/display_rotation_observer.h"
16 #include "media/capture/video/chromeos/mojo/arc_camera3.mojom.h"
17 #include "media/capture/video/video_capture_device.h"
18 #include "media/capture/video/video_capture_device_descriptor.h"
19 #include "media/capture/video_capture_types.h"
20
21 namespace display {
22
23 class Display;
24
25 } // namespace display
26
27 namespace media {
28
29 class CameraHalDelegate;
30 class CameraDeviceDelegate;
31
32 // Implementation of VideoCaptureDevice for ChromeOS with ARC++ camera HALv3.
33 class CAPTURE_EXPORT VideoCaptureDeviceArcChromeOS final
34 : public VideoCaptureDevice,
35 public DisplayRotationObserver {
36 public:
37 VideoCaptureDeviceArcChromeOS(
38 scoped_refptr<base::SingleThreadTaskRunner>
39 task_runner_for_screen_observer,
40 const VideoCaptureDeviceDescriptor& device_descriptor,
41 scoped_refptr<CameraHalDelegate> camera_hal_delegate);
42
43 ~VideoCaptureDeviceArcChromeOS() final;
44
45 // VideoCaptureDevice implementation.
46 void AllocateAndStart(const VideoCaptureParams& params,
47 std::unique_ptr<Client> client) final;
48 void StopAndDeAllocate() final;
49 void TakePhoto(TakePhotoCallback callback) final;
50 void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) final;
51 void SetPhotoOptions(mojom::PhotoSettingsPtr settings,
52 SetPhotoOptionsCallback callback) final;
53
54 private:
55 // DisplayRotationDelegate implementation.
56 void SetDisplayRotation(const display::Display& display) final;
57 void SetRotation(int rotation);
58
59 const VideoCaptureDeviceDescriptor device_descriptor_;
60
61 // A reference to the CameraHalDelegate instance in the VCD factory. This is
62 // used by AllocateAndStart to query camera info and create the camera device.
63 const scoped_refptr<CameraHalDelegate> camera_hal_delegate_;
64
65 // A reference to the thread that all the VideoCaptureDevice interface methods
66 // are expected to be called on.
67 const scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;
68
69 // The thread that all the Mojo operations of |camera_device_delegate_| take
70 // place. Started in AllocateAndStart and stopped in StopAndDeAllocate, where
71 // the access to the base::Thread methods are sequenced on
72 // |capture_task_runner_|.
73 base::Thread camera_device_ipc_thread_;
74
75 // Internal delegate doing the actual capture setting, buffer allocation and
76 // circulation with the camera HAL. Created in AllocateAndStart and deleted in
77 // StopAndDeAllocate on |capture_task_runner_|. All methods of
78 // |camera_device_delegate_| operate on |camera_device_ipc_thread_|.
79 scoped_refptr<CameraDeviceDelegate> camera_device_delegate_;
Pawel Osciak 2017/06/13 08:40:16 Would it make sense to consider unique_ptr and pos
jcliang 2017/06/14 04:46:08 The CameraDeviceDelegate posts itself to the ipc t
80
81 scoped_refptr<ScreenObserverDelegate> screen_observer_delegate_;
82 const VideoFacingMode lens_facing_;
83 const int camera_orientation_;
84 // Whether the incoming frames should rotate when the device rotates.
85 const bool rotates_with_device_;
86 int rotation_;
87
88 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceArcChromeOS);
89 };
90
91 } // namespace media
92
93 #endif // MEDIA_CAPTURE_VIDEO_CHROMEOS_VIDEO_CAPTURE_DEVICE_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698