| 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| and |max_requested_width| is used by Tab and Screen | 30 // |max_requested_height| and |max_requested_width| is used by Tab and Screen |
| 32 // capture to decide what resolution to generate. | 31 // capture to decide what resolution to generate. |
| 33 // |callback| is triggered when the formats have been collected. | 32 // |callback| is triggered when the formats have been collected. |
| 34 virtual void GetCurrentSupportedFormats( | 33 virtual void GetCurrentSupportedFormats( |
| 35 int max_requested_width, | 34 int max_requested_width, |
| 36 int max_requested_height, | 35 int max_requested_height, |
| 37 const VideoCaptureDeviceFormatsCB& callback); | 36 const VideoCaptureDeviceFormatsCB& callback); |
| 38 | 37 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 private: | 112 private: |
| 114 // The delegate that provides video frames. | 113 // The delegate that provides video frames. |
| 115 scoped_refptr<VideoCapturerDelegate> delegate_; | 114 scoped_refptr<VideoCapturerDelegate> delegate_; |
| 116 | 115 |
| 117 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); | 116 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); |
| 118 }; | 117 }; |
| 119 | 118 |
| 120 } // namespace content | 119 } // namespace content |
| 121 | 120 |
| 122 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 121 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
| OLD | NEW |