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

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

Issue 2885653002: [Mojo Video Capture] Do not instantiate in-process VideoCaptureSystem when using service (Closed)
Patch Set: Remove |optional_| prefix Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
mcasas 2017/05/18 17:42:12 This class was landed in 2017: https://chromium.g
chfremer 2017/05/18 18:28:32 Done.
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_VIDEO_CAPTURE_SYSTEM_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_SYSTEM_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_SYSTEM_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_SYSTEM_H_
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/browser/renderer_host/media/video_capture_provider.h" 10 #include "content/browser/renderer_host/media/video_capture_provider.h"
11 #include "media/capture/video/video_capture_system.h" 11 #include "media/capture/video/video_capture_system.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 class CONTENT_EXPORT InProcessVideoCaptureProvider 15 class CONTENT_EXPORT InProcessVideoCaptureProvider
mcasas 2017/05/18 17:42:12 nit: CONTENT_EXPORT might not be needed since all
chfremer 2017/05/18 18:28:32 True. Just tried, but turns out you were right abo
16 : public VideoCaptureProvider { 16 : public VideoCaptureProvider {
17 public: 17 public:
18 InProcessVideoCaptureProvider( 18 InProcessVideoCaptureProvider(
19 std::unique_ptr<media::VideoCaptureSystem> optional_video_capture_system,
20 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner);
21
22 ~InProcessVideoCaptureProvider() override;
23
24 static std::unique_ptr<VideoCaptureProvider>
25 CreateInstanceForNonDeviceCapture(
26 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner);
27
28 static std::unique_ptr<VideoCaptureProvider> CreateInstance(
19 std::unique_ptr<media::VideoCaptureSystem> video_capture_system, 29 std::unique_ptr<media::VideoCaptureSystem> video_capture_system,
20 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner); 30 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner);
21 ~InProcessVideoCaptureProvider() override;
22 31
23 void Uninitialize() override; 32 void Uninitialize() override;
24 33
25 void GetDeviceInfosAsync( 34 void GetDeviceInfosAsync(
26 const base::Callback<void( 35 const GetDeviceInfosCallback& result_callback) override;
27 const std::vector<media::VideoCaptureDeviceInfo>&)>& result_callback)
28 override;
29 36
30 std::unique_ptr<VideoCaptureDeviceLauncher> CreateDeviceLauncher() override; 37 std::unique_ptr<VideoCaptureDeviceLauncher> CreateDeviceLauncher() override;
31 38
32 private: 39 private:
33 const std::unique_ptr<media::VideoCaptureSystem> video_capture_system_; 40 const std::unique_ptr<media::VideoCaptureSystem>
41 optional_video_capture_system_;
mcasas 2017/05/18 17:42:12 With the same rationale as in the other comments,
chfremer 2017/05/18 18:28:32 A DCHECK only enforces at runtime, though. At "rea
34 // The message loop of media stream device thread, where VCD's live. 42 // The message loop of media stream device thread, where VCD's live.
35 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; 43 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
mcasas 2017/05/18 17:42:12 nit: const?
chfremer 2017/05/18 18:28:32 Done.
36 }; 44 };
mcasas 2017/05/18 17:42:12 This class needs a thread checker.
chfremer 2017/05/18 18:28:32 Done.
37 45
38 } // namespace content 46 } // namespace content
39 47
40 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_SYSTEM_H _ 48 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_SYSTEM_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698