OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_D EVICE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_D EVICE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_D EVICE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_D EVICE_H_ |
7 | 7 |
8 #include "content/browser/renderer_host/media/video_capture_controller.h" | 8 #include "content/browser/renderer_host/media/video_capture_controller.h" |
9 #include "content/public/common/media_stream_request.h" | 9 #include "content/public/common/media_stream_request.h" |
10 #include "media/capture/video/video_capture_device.h" | 10 #include "media/capture/video/video_capture_device.h" |
11 #include "media/capture/video/video_capture_device_client.h" | 11 #include "media/capture/video/video_capture_device_client.h" |
12 #include "media/capture/video/video_capture_device_descriptor.h" | 12 #include "media/capture/video/video_capture_device_descriptor.h" |
13 #include "media/capture/video/video_capture_device_factory.h" | 13 #include "media/capture/video/video_capture_system.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 // Implementation of BuildableVideoCaptureDevice that creates capture devices | 17 // Implementation of BuildableVideoCaptureDevice that creates capture devices |
18 // in the same process as it is being operated on, which must be the Browser | 18 // in the same process as it is being operated on, which must be the Browser |
19 // process. The devices are operated on the given |device_task_runner|. | 19 // process. The devices are operated on the given |device_task_runner|. |
20 // Instances of this class must be operated from the Browser process IO thread. | 20 // Instances of this class must be operated from the Browser process IO thread. |
21 class InProcessBuildableVideoCaptureDevice | 21 class InProcessBuildableVideoCaptureDevice |
22 : public BuildableVideoCaptureDevice { | 22 : public BuildableVideoCaptureDevice { |
23 public: | 23 public: |
24 InProcessBuildableVideoCaptureDevice( | 24 InProcessBuildableVideoCaptureDevice( |
25 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner, | 25 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner, |
26 media::VideoCaptureDeviceFactory* device_factory); | 26 media::VideoCaptureSystem* device_factory); |
miu
2017/03/22 22:51:23
arg rename too?
chfremer
2017/03/23 00:34:13
Done.
| |
27 ~InProcessBuildableVideoCaptureDevice() override; | 27 ~InProcessBuildableVideoCaptureDevice() override; |
28 | 28 |
29 // BuildableVideoCaptureDevice implementation: | 29 // BuildableVideoCaptureDevice implementation: |
30 void CreateAndStartDeviceAsync(VideoCaptureController* controller, | 30 void CreateAndStartDeviceAsync(VideoCaptureController* controller, |
31 const media::VideoCaptureParams& params, | 31 const media::VideoCaptureParams& params, |
32 BuildableDeviceCallbacks* callbacks, | 32 BuildableDeviceCallbacks* callbacks, |
33 base::OnceClosure done_cb) override; | 33 base::OnceClosure done_cb) override; |
34 void ReleaseDeviceAsync(VideoCaptureController* controller, | 34 void ReleaseDeviceAsync(VideoCaptureController* controller, |
35 base::OnceClosure done_cb) override; | 35 base::OnceClosure done_cb) override; |
36 bool IsDeviceAlive() const override; | 36 bool IsDeviceAlive() const override; |
(...skipping 26 matching lines...) Expand all Loading... | |
63 std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient( | 63 std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient( |
64 int buffer_pool_max_buffer_count, | 64 int buffer_pool_max_buffer_count, |
65 base::WeakPtr<media::VideoFrameReceiver> receiver); | 65 base::WeakPtr<media::VideoFrameReceiver> receiver); |
66 | 66 |
67 void OnDeviceStarted(VideoCaptureController* controller, | 67 void OnDeviceStarted(VideoCaptureController* controller, |
68 BuildableDeviceCallbacks* callbacks, | 68 BuildableDeviceCallbacks* callbacks, |
69 base::OnceClosure done_cb, | 69 base::OnceClosure done_cb, |
70 std::unique_ptr<media::VideoCaptureDevice> device); | 70 std::unique_ptr<media::VideoCaptureDevice> device); |
71 | 71 |
72 void DoStartDeviceCaptureOnDeviceThread( | 72 void DoStartDeviceCaptureOnDeviceThread( |
73 const media::VideoCaptureDeviceDescriptor& descriptor, | 73 const std::string& device_id, |
74 const media::VideoCaptureParams& params, | 74 const media::VideoCaptureParams& params, |
75 std::unique_ptr<media::VideoCaptureDeviceClient> client, | 75 std::unique_ptr<media::VideoCaptureDeviceClient> client, |
76 ReceiveDeviceCallback result_callback); | 76 ReceiveDeviceCallback result_callback); |
77 | 77 |
78 void DoStartTabCaptureOnDeviceThread( | 78 void DoStartTabCaptureOnDeviceThread( |
79 const std::string& device_id, | 79 const std::string& device_id, |
80 const media::VideoCaptureParams& params, | 80 const media::VideoCaptureParams& params, |
81 std::unique_ptr<media::VideoCaptureDeviceClient> client, | 81 std::unique_ptr<media::VideoCaptureDeviceClient> client, |
82 ReceiveDeviceCallback result_callback); | 82 ReceiveDeviceCallback result_callback); |
83 | 83 |
84 void DoStartDesktopCaptureOnDeviceThread( | 84 void DoStartDesktopCaptureOnDeviceThread( |
85 const std::string& device_id, | 85 const std::string& device_id, |
86 const media::VideoCaptureParams& params, | 86 const media::VideoCaptureParams& params, |
87 std::unique_ptr<media::VideoCaptureDeviceClient> client, | 87 std::unique_ptr<media::VideoCaptureDeviceClient> client, |
88 ReceiveDeviceCallback result_callback); | 88 ReceiveDeviceCallback result_callback); |
89 | 89 |
90 void SetDesktopCaptureWindowIdOnDeviceThread( | 90 void SetDesktopCaptureWindowIdOnDeviceThread( |
91 media::VideoCaptureDevice* device, | 91 media::VideoCaptureDevice* device, |
92 gfx::NativeViewId window_id, | 92 gfx::NativeViewId window_id, |
93 base::OnceClosure done_cb); | 93 base::OnceClosure done_cb); |
94 | 94 |
95 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; | 95 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
96 media::VideoCaptureDeviceFactory* const device_factory_; | 96 media::VideoCaptureSystem* const device_factory_; |
miu
2017/03/22 22:51:23
ditto: rename variable too?
chfremer
2017/03/23 00:34:13
Done.
| |
97 std::unique_ptr<media::VideoCaptureDevice> device_; | 97 std::unique_ptr<media::VideoCaptureDevice> device_; |
98 State state_ = State::NO_DEVICE; | 98 State state_ = State::NO_DEVICE; |
99 }; | 99 }; |
100 | 100 |
101 } // namespace content | 101 } // namespace content |
102 | 102 |
103 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTUR E_DEVICE_H_ | 103 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTUR E_DEVICE_H_ |
OLD | NEW |