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

Unified Diff: content/browser/renderer_host/media/in_process_video_capture_device_launcher.h

Issue 2803483003: [Mojo Video Capture] Split interface BuildableVideoCaptureDevice (Closed)
Patch Set: Remove fallback mechanism. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/in_process_video_capture_device_launcher.h
diff --git a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.h b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.h
similarity index 55%
rename from content/browser/renderer_host/media/in_process_buildable_video_capture_device.h
rename to content/browser/renderer_host/media/in_process_video_capture_device_launcher.h
index 6ec80cf4de8e05544c321e4bd9e59ee389a3f6e0..0a58ebab1dad4280a584b22fbb13eb6d13d0fa80 100644
--- a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.h
+++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.h
@@ -2,8 +2,8 @@
// 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_VIDEO_CAPTURE_DEVICE_LAUNCHER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUNCHER_H_
#include "content/browser/renderer_host/media/video_capture_controller.h"
#include "content/browser/renderer_host/media/video_capture_provider.h"
@@ -19,54 +19,37 @@ namespace content {
// 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 InProcessVideoCaptureDeviceLauncher : public VideoCaptureDeviceLauncher {
public:
- InProcessBuildableVideoCaptureDevice(
+ InProcessVideoCaptureDeviceLauncher(
scoped_refptr<base::SingleThreadTaskRunner> device_task_runner,
media::VideoCaptureSystem* video_capture_system);
- ~InProcessBuildableVideoCaptureDevice() 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;
- void SetPhotoOptions(
- media::mojom::PhotoSettingsPtr settings,
- media::VideoCaptureDevice::SetPhotoOptionsCallback callback) override;
- void TakePhoto(
- media::VideoCaptureDevice::TakePhotoCallback callback) override;
- void MaybeSuspendDevice() override;
- void ResumeDevice() override;
- void RequestRefreshFrame() override;
-
- void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id,
- base::OnceClosure done_cb) override;
+ ~InProcessVideoCaptureDeviceLauncher() override;
+
+ void LaunchDeviceAsync(const std::string& device_id,
+ MediaStreamType stream_type,
+ const media::VideoCaptureParams& params,
+ base::WeakPtr<media::VideoFrameReceiver> receiver,
+ Callbacks* callbacks,
+ base::OnceClosure done_cb) override;
+
+ void AbortLaunch() override;
private:
using ReceiveDeviceCallback =
base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>;
enum class State {
- NO_DEVICE,
+ READY_TO_LAUNCH,
DEVICE_START_IN_PROGRESS,
- DEVICE_START_ABORTING,
- DEVICE_STARTED
+ DEVICE_START_ABORTING
};
std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient(
int buffer_pool_max_buffer_count,
base::WeakPtr<media::VideoFrameReceiver> receiver);
- void OnDeviceStarted(VideoCaptureController* controller,
- Callbacks* callbacks,
+ void OnDeviceStarted(Callbacks* callbacks,
base::OnceClosure done_cb,
std::unique_ptr<media::VideoCaptureDevice> device);
@@ -88,17 +71,11 @@ class InProcessBuildableVideoCaptureDevice
std::unique_ptr<media::VideoCaptureDeviceClient> client,
ReceiveDeviceCallback result_callback);
- 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;
+ State state_;
};
} // namespace content
-#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUNCHER_H_

Powered by Google App Engine
This is Rietveld 408576698