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

Side by Side Diff: content/browser/renderer_host/media/in_process_buildable_video_capture_device.h

Issue 2753073006: [Mojo Video Capture] Add support to BuildableVideoCaptureDevice for aborting the device start. (Closed)
Patch Set: Incorporated mcasas@'s suggestions from PatchSet 2 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 unified diff | Download patch
OLDNEW
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"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void ResumeDevice() override; 46 void ResumeDevice() override;
47 void RequestRefreshFrame() override; 47 void RequestRefreshFrame() override;
48 48
49 void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, 49 void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id,
50 base::OnceClosure done_cb) override; 50 base::OnceClosure done_cb) override;
51 51
52 private: 52 private:
53 using ReceiveDeviceCallback = 53 using ReceiveDeviceCallback =
54 base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>; 54 base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>;
55 55
56 enum class State {
57 NO_DEVICE,
58 DEVICE_START_IN_PROGRESS,
59 DEVICE_START_ABORTING,
60 DEVICE_STARTED
61 };
62
56 std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient( 63 std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient(
57 int buffer_pool_max_buffer_count, 64 int buffer_pool_max_buffer_count,
58 base::WeakPtr<media::VideoFrameReceiver> receiver); 65 base::WeakPtr<media::VideoFrameReceiver> receiver);
59 66
60 void OnDeviceStarted(VideoCaptureController* controller, 67 void OnDeviceStarted(VideoCaptureController* controller,
61 Callbacks* callbacks, 68 Callbacks* callbacks,
62 base::OnceClosure done_cb, 69 base::OnceClosure done_cb,
63 std::unique_ptr<media::VideoCaptureDevice> device); 70 std::unique_ptr<media::VideoCaptureDevice> device);
64 71
65 void DoStartDeviceCaptureOnDeviceThread( 72 void DoStartDeviceCaptureOnDeviceThread(
(...skipping 15 matching lines...) Expand all
81 ReceiveDeviceCallback result_callback); 88 ReceiveDeviceCallback result_callback);
82 89
83 void SetDesktopCaptureWindowIdOnDeviceThread( 90 void SetDesktopCaptureWindowIdOnDeviceThread(
84 media::VideoCaptureDevice* device, 91 media::VideoCaptureDevice* device,
85 gfx::NativeViewId window_id, 92 gfx::NativeViewId window_id,
86 base::OnceClosure done_cb); 93 base::OnceClosure done_cb);
87 94
88 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; 95 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
89 media::VideoCaptureDeviceFactory* const device_factory_; 96 media::VideoCaptureDeviceFactory* const device_factory_;
90 std::unique_ptr<media::VideoCaptureDevice> device_; 97 std::unique_ptr<media::VideoCaptureDevice> device_;
98 State state_ = State::NO_DEVICE;
91 }; 99 };
92 100
93 } // namespace content 101 } // namespace content
94 102
95 #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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698