OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
11 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
12 #include "content/common/media/video_capture.h" | 12 #include "content/common/media/video_capture.h" |
13 #include "content/renderer/media/media_stream_video_source.h" | 13 #include "content/renderer/media/media_stream_video_source.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 // VideoCapturerDelegate is a delegate used by MediaStreamVideoCapturerSource | 17 // VideoCapturerDelegate is a delegate used by MediaStreamVideoCapturerSource |
18 // for local video capturer. It uses VideoCaptureImplManager to start / stop | 18 // for local video capturer. It uses VideoCaptureImplManager to start / stop |
19 // and receive I420 frames from Chrome's video capture implementation. | 19 // and receive I420 frames from Chrome's video capture implementation. |
20 // | 20 // |
21 // This is a render thread only object. | 21 // This is a render thread only object. |
22 class CONTENT_EXPORT VideoCapturerDelegate | 22 class CONTENT_EXPORT VideoCapturerDelegate |
23 : public base::RefCountedThreadSafe<VideoCapturerDelegate> { | 23 : public base::RefCountedThreadSafe<VideoCapturerDelegate> { |
24 public: | 24 public: |
25 typedef base::Callback<void(bool running)> RunningCallback; | 25 typedef base::Callback<void(MediaStreamRequestResult result)> RunningCallback; |
26 | 26 |
27 explicit VideoCapturerDelegate( | 27 explicit VideoCapturerDelegate(const StreamDeviceInfo& device_info); |
28 const StreamDeviceInfo& device_info); | |
29 | 28 |
30 // Collects the formats that can currently be used. | 29 // Collects the formats that can currently be used. |
31 // |max_requested_height|, |max_requested_width|, and | 30 // |max_requested_height|, |max_requested_width|, and |
32 // |max_requested_frame_rate| is used by Tab and Screen capture to decide what | 31 // |max_requested_frame_rate| is used by Tab and Screen capture to decide what |
33 // resolution/framerate to generate. |callback| is triggered when the formats | 32 // resolution/framerate to generate. |callback| is triggered when the formats |
34 // have been collected. | 33 // have been collected. |
35 virtual void GetCurrentSupportedFormats( | 34 virtual void GetCurrentSupportedFormats( |
36 int max_requested_width, | 35 int max_requested_width, |
37 int max_requested_height, | 36 int max_requested_height, |
38 double max_requested_frame_rate, | 37 double max_requested_frame_rate, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 private: | 115 private: |
117 // The delegate that provides video frames. | 116 // The delegate that provides video frames. |
118 scoped_refptr<VideoCapturerDelegate> delegate_; | 117 scoped_refptr<VideoCapturerDelegate> delegate_; |
119 | 118 |
120 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); | 119 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); |
121 }; | 120 }; |
122 | 121 |
123 } // namespace content | 122 } // namespace content |
124 | 123 |
125 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 124 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
OLD | NEW |