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

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: Created 3 years, 9 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void RequestRefreshFrame() override; 49 void RequestRefreshFrame() override;
50 50
51 void SetDesktopCaptureWindowIdAsync( 51 void SetDesktopCaptureWindowIdAsync(
52 gfx::NativeViewId window_id, 52 gfx::NativeViewId window_id,
53 std::unique_ptr<Ownership> context_reference) override; 53 std::unique_ptr<Ownership> context_reference) override;
54 54
55 private: 55 private:
56 using ReceiveDeviceCallback = 56 using ReceiveDeviceCallback =
57 base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>; 57 base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>;
58 58
59 enum class State {
60 NO_DEVICE,
61 DEVICE_START_IN_PROGRESS,
62 DEVICE_START_ABORTING,
63 DEVICE_STARTED
64 };
65
59 std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient( 66 std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient(
60 int buffer_pool_max_buffer_count, 67 int buffer_pool_max_buffer_count,
61 base::WeakPtr<media::VideoFrameReceiver> receiver); 68 base::WeakPtr<media::VideoFrameReceiver> receiver);
62 69
63 void OnDeviceStarted(VideoCaptureController* controller, 70 void OnDeviceStarted(VideoCaptureController* controller,
64 BuildableDeviceCallbacks* callbacks, 71 BuildableDeviceCallbacks* callbacks,
65 std::unique_ptr<Ownership> ownership, 72 std::unique_ptr<Ownership> ownership,
66 std::unique_ptr<media::VideoCaptureDevice> device); 73 std::unique_ptr<media::VideoCaptureDevice> device);
67 74
68 void DoStartDeviceCaptureOnDeviceThread( 75 void DoStartDeviceCaptureOnDeviceThread(
(...skipping 15 matching lines...) Expand all
84 ReceiveDeviceCallback result_callback); 91 ReceiveDeviceCallback result_callback);
85 92
86 void SetDesktopCaptureWindowIdOnDeviceThread( 93 void SetDesktopCaptureWindowIdOnDeviceThread(
87 media::VideoCaptureDevice* device, 94 media::VideoCaptureDevice* device,
88 gfx::NativeViewId window_id, 95 gfx::NativeViewId window_id,
89 std::unique_ptr<Ownership> ownership); 96 std::unique_ptr<Ownership> ownership);
90 97
91 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; 98 const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
92 media::VideoCaptureDeviceFactory* const device_factory_; 99 media::VideoCaptureDeviceFactory* const device_factory_;
93 std::unique_ptr<media::VideoCaptureDevice> device_; 100 std::unique_ptr<media::VideoCaptureDevice> device_;
101 State state_ = State::NO_DEVICE;
94 }; 102 };
95 103
96 } // namespace content 104 } // namespace content
97 105
98 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTUR E_DEVICE_H_ 106 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTUR E_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698