Index: content/browser/renderer_host/media/in_process_launched_video_capture_device.h |
diff --git a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.h b/content/browser/renderer_host/media/in_process_launched_video_capture_device.h |
similarity index 30% |
copy from content/browser/renderer_host/media/in_process_buildable_video_capture_device.h |
copy to content/browser/renderer_host/media/in_process_launched_video_capture_device.h |
index 6ec80cf4de8e05544c321e4bd9e59ee389a3f6e0..4c482fa356f43a4e0ad3155de6686c4356c60830 100644 |
--- a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.h |
+++ b/content/browser/renderer_host/media/in_process_launched_video_capture_device.h |
@@ -2,39 +2,21 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
-#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
+#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_LAUNCHED_VIDEO_CAPTURE_DEVICE_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_LAUNCHED_VIDEO_CAPTURE_DEVICE_H_ |
-#include "content/browser/renderer_host/media/video_capture_controller.h" |
#include "content/browser/renderer_host/media/video_capture_provider.h" |
-#include "content/public/common/media_stream_request.h" |
#include "media/capture/video/video_capture_device.h" |
-#include "media/capture/video/video_capture_device_client.h" |
-#include "media/capture/video/video_capture_device_descriptor.h" |
-#include "media/capture/video/video_capture_system.h" |
namespace content { |
-// Implementation of BuildableVideoCaptureDevice that creates capture devices |
-// in the same process as it is being operated on, which must be the Browser |
-// process. The devices are operated on the given |device_task_runner|. |
-// Instances of this class must be operated from the Browser process IO thread. |
-class InProcessBuildableVideoCaptureDevice |
- : public BuildableVideoCaptureDevice { |
+class InProcessLaunchedVideoCaptureDevice : public LaunchedVideoCaptureDevice { |
public: |
- InProcessBuildableVideoCaptureDevice( |
- scoped_refptr<base::SingleThreadTaskRunner> device_task_runner, |
- media::VideoCaptureSystem* video_capture_system); |
- ~InProcessBuildableVideoCaptureDevice() override; |
+ InProcessLaunchedVideoCaptureDevice( |
+ std::unique_ptr<media::VideoCaptureDevice> device, |
+ scoped_refptr<base::SingleThreadTaskRunner> device_task_runner); |
+ ~InProcessLaunchedVideoCaptureDevice() override; |
- // BuildableVideoCaptureDevice implementation: |
- void CreateAndStartDeviceAsync(VideoCaptureController* controller, |
- const media::VideoCaptureParams& params, |
- Callbacks* callbacks, |
- base::OnceClosure done_cb) override; |
- void ReleaseDeviceAsync(VideoCaptureController* controller, |
- base::OnceClosure done_cb) override; |
- bool IsDeviceAlive() const override; |
void GetPhotoCapabilities( |
media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) |
const override; |
@@ -50,55 +32,18 @@ class InProcessBuildableVideoCaptureDevice |
void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, |
base::OnceClosure done_cb) override; |
- private: |
- using ReceiveDeviceCallback = |
- base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>; |
- |
- enum class State { |
- NO_DEVICE, |
- DEVICE_START_IN_PROGRESS, |
- DEVICE_START_ABORTING, |
- DEVICE_STARTED |
- }; |
- |
- std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient( |
- int buffer_pool_max_buffer_count, |
- base::WeakPtr<media::VideoFrameReceiver> receiver); |
- |
- void OnDeviceStarted(VideoCaptureController* controller, |
- Callbacks* callbacks, |
- base::OnceClosure done_cb, |
- std::unique_ptr<media::VideoCaptureDevice> device); |
- |
- void DoStartDeviceCaptureOnDeviceThread( |
- const std::string& device_id, |
- const media::VideoCaptureParams& params, |
- std::unique_ptr<media::VideoCaptureDeviceClient> client, |
- ReceiveDeviceCallback result_callback); |
- |
- void DoStartTabCaptureOnDeviceThread( |
- const std::string& device_id, |
- const media::VideoCaptureParams& params, |
- std::unique_ptr<media::VideoCaptureDeviceClient> client, |
- ReceiveDeviceCallback result_callback); |
- |
- void DoStartDesktopCaptureOnDeviceThread( |
- const std::string& device_id, |
- const media::VideoCaptureParams& params, |
- std::unique_ptr<media::VideoCaptureDeviceClient> client, |
- ReceiveDeviceCallback result_callback); |
+ void OnUtilizationReport(int frame_feedback_id, double utilization) override; |
+ private: |
void SetDesktopCaptureWindowIdOnDeviceThread( |
media::VideoCaptureDevice* device, |
gfx::NativeViewId window_id, |
base::OnceClosure done_cb); |
- const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
- media::VideoCaptureSystem* const video_capture_system_; |
std::unique_ptr<media::VideoCaptureDevice> device_; |
- State state_ = State::NO_DEVICE; |
+ const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
}; |
} // namespace content |
-#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_LAUNCHED_VIDEO_CAPTURE_DEVICE_H_ |