Chromium Code Reviews| 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_VIDEO_CAPTURE_DEVICE_LAUN CHER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUN CHER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUN CHER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUN CHER_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/browser/renderer_host/media/video_capture_provider.h" | 9 #include "content/browser/renderer_host/media/video_capture_provider.h" |
| 10 #include "content/public/common/media_stream_request.h" | 10 #include "content/public/common/media_stream_request.h" |
| 11 #include "media/capture/video/video_capture_device.h" | 11 #include "media/capture/video/video_capture_device.h" |
| 12 #include "media/capture/video/video_capture_device_client.h" | 12 #include "media/capture/video/video_capture_device_client.h" |
| 13 #include "media/capture/video/video_capture_device_descriptor.h" | 13 #include "media/capture/video/video_capture_device_descriptor.h" |
| 14 #include "media/capture/video/video_capture_system.h" | 14 #include "media/capture/video/video_capture_system.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 // Implementation of BuildableVideoCaptureDevice that creates capture devices | 18 // Implementation of BuildableVideoCaptureDevice that creates capture devices |
| 19 // in the same process as it is being operated on, which must be the Browser | 19 // in the same process as it is being operated on, which must be the Browser |
| 20 // process. The devices are operated on the given |device_task_runner|. | 20 // process. The devices are operated on the given |device_task_runner|. |
| 21 // Instances of this class must be operated from the Browser process IO thread. | 21 // Instances of this class must be operated from the Browser process IO thread. |
| 22 class InProcessVideoCaptureDeviceLauncher : public VideoCaptureDeviceLauncher { | 22 class InProcessVideoCaptureDeviceLauncher : public VideoCaptureDeviceLauncher { |
| 23 public: | 23 public: |
| 24 InProcessVideoCaptureDeviceLauncher( | 24 InProcessVideoCaptureDeviceLauncher( |
| 25 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner, | 25 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner, |
| 26 media::VideoCaptureSystem* video_capture_system); | 26 media::VideoCaptureSystem* optional_video_capture_system); |
| 27 ~InProcessVideoCaptureDeviceLauncher() override; | 27 ~InProcessVideoCaptureDeviceLauncher() override; |
| 28 | 28 |
| 29 void LaunchDeviceAsync(const std::string& device_id, | 29 void LaunchDeviceAsync(const std::string& device_id, |
| 30 MediaStreamType stream_type, | 30 MediaStreamType stream_type, |
| 31 const media::VideoCaptureParams& params, | 31 const media::VideoCaptureParams& params, |
| 32 base::WeakPtr<media::VideoFrameReceiver> receiver, | 32 base::WeakPtr<media::VideoFrameReceiver> receiver, |
| 33 Callbacks* callbacks, | 33 Callbacks* callbacks, |
| 34 base::OnceClosure done_cb) override; | 34 base::OnceClosure done_cb) override; |
| 35 | 35 |
| 36 void AbortLaunch() override; | 36 void AbortLaunch() override; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 65 std::unique_ptr<media::VideoCaptureDeviceClient> client, | 65 std::unique_ptr<media::VideoCaptureDeviceClient> client, |
| 66 ReceiveDeviceCallback result_callback); | 66 ReceiveDeviceCallback result_callback); |
| 67 | 67 |
| 68 void DoStartDesktopCaptureOnDeviceThread( | 68 void DoStartDesktopCaptureOnDeviceThread( |
| 69 const std::string& device_id, | 69 const std::string& device_id, |
| 70 const media::VideoCaptureParams& params, | 70 const media::VideoCaptureParams& params, |
| 71 std::unique_ptr<media::VideoCaptureDeviceClient> client, | 71 std::unique_ptr<media::VideoCaptureDeviceClient> client, |
| 72 ReceiveDeviceCallback result_callback); | 72 ReceiveDeviceCallback result_callback); |
| 73 | 73 |
| 74 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; | 74 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
| 75 media::VideoCaptureSystem* const video_capture_system_; | 75 media::VideoCaptureSystem* const optional_video_capture_system_; |
|
mcasas
2017/05/16 22:22:22
I think having a naked pointer here is enough
to i
chfremer
2017/05/16 22:45:02
I disagree with the idea that the raw pointer woul
mcasas
2017/05/17 23:19:03
A quick search [1] yields no |optional_| members i
chfremer
2017/05/18 17:06:16
It appears that my reasoning for why I feel that a
| |
| 76 State state_; | 76 State state_; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace content | 79 } // namespace content |
| 80 | 80 |
| 81 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_L AUNCHER_H_ | 81 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_L AUNCHER_H_ |
| OLD | NEW |