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

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

Issue 2803483003: [Mojo Video Capture] Split interface BuildableVideoCaptureDevice (Closed)
Patch Set: 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/video_capture_controller.h
diff --git a/content/browser/renderer_host/media/video_capture_controller.h b/content/browser/renderer_host/media/video_capture_controller.h
index 92a57987a1514f0ba8b226f50895258662f972b5..b195b583203c76b2f5b14b24f317f39606b3ad20 100644
--- a/content/browser/renderer_host/media/video_capture_controller.h
+++ b/content/browser/renderer_host/media/video_capture_controller.h
@@ -23,6 +23,8 @@
namespace content {
+class VideoCaptureDeviceLaunchObserver;
+
// Implementation of media::VideoFrameReceiver that distributes received frames
// to potentially multiple connected clients.
// A call to CreateAndStartDeviceAsync() asynchronously brings up the device. If
@@ -35,24 +37,17 @@ namespace content {
// CreateAndStartDeviceAsync().
class CONTENT_EXPORT VideoCaptureController
: public media::VideoFrameReceiver,
+ public VideoCaptureDeviceLauncher::Callbacks,
public base::RefCountedThreadSafe<VideoCaptureController> {
public:
VideoCaptureController(
const std::string& device_id,
MediaStreamType stream_type,
const media::VideoCaptureParams& params,
- std::unique_ptr<BuildableVideoCaptureDevice> buildable_device);
+ std::unique_ptr<VideoCaptureDeviceLauncher> device_launcher);
base::WeakPtr<VideoCaptureController> GetWeakPtrForIOThread();
- // Factory code creating instances of VideoCaptureController may optionally
- // set a VideoFrameConsumerFeedbackObserver. Setting the observer is done in
- // this method separate from the constructor to allow clients to create and
- // use instances before they can provide the observer. (This is the case with
- // VideoCaptureManager).
- void SetConsumerFeedbackObserver(
- std::unique_ptr<media::VideoFrameConsumerFeedbackObserver> observer);
-
// Start video capturing and try to use the resolution specified in |params|.
// Buffers will be shared to the client as necessary. The client will continue
// to receive frames from the device until RemoveClient() is called.
@@ -119,10 +114,15 @@ class CONTENT_EXPORT VideoCaptureController
void OnStarted() override;
void OnStartedUsingGpuDecode() override;
- void CreateAndStartDeviceAsync(
- const media::VideoCaptureParams& params,
- BuildableVideoCaptureDevice::Callbacks* callbacks,
- base::OnceClosure done_cb);
+ // Implementation of VideoCaptureDeviceLauncherCallbacks interface:
emircan 2017/04/14 17:19:38 VideoCaptureDeviceLauncher::Callbacks
chfremer 2017/04/14 20:00:30 Done.
+ void OnDeviceLaunched(
+ std::unique_ptr<LaunchedVideoCaptureDevice> device) override;
+ void OnDeviceLaunchFailed() override;
+ void OnDeviceLaunchAborted() override;
+
+ void CreateAndStartDeviceAsync(const media::VideoCaptureParams& params,
+ VideoCaptureDeviceLaunchObserver* callbacks,
+ base::OnceClosure done_cb);
void ReleaseDeviceAsync(base::OnceClosure done_cb);
bool IsDeviceAlive() const;
void GetPhotoCapabilities(
@@ -222,10 +222,9 @@ class CONTENT_EXPORT VideoCaptureController
const std::string device_id_;
const MediaStreamType stream_type_;
const media::VideoCaptureParams parameters_;
- std::unique_ptr<BuildableVideoCaptureDevice> buildable_device_;
-
- std::unique_ptr<media::VideoFrameConsumerFeedbackObserver>
- consumer_feedback_observer_;
+ std::unique_ptr<VideoCaptureDeviceLauncher> device_launcher_;
+ std::unique_ptr<LaunchedVideoCaptureDevice> launched_device_;
+ VideoCaptureDeviceLaunchObserver* device_launch_observer_;
std::vector<BufferContext> buffer_contexts_;

Powered by Google App Engine
This is Rietveld 408576698