| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public RenderFrameObserver { | 28 public RenderFrameObserver { |
| 29 public: | 29 public: |
| 30 MediaStreamVideoCapturerSource( | 30 MediaStreamVideoCapturerSource( |
| 31 const SourceStoppedCallback& stop_callback, | 31 const SourceStoppedCallback& stop_callback, |
| 32 std::unique_ptr<media::VideoCapturerSource> source); | 32 std::unique_ptr<media::VideoCapturerSource> source); |
| 33 MediaStreamVideoCapturerSource(const SourceStoppedCallback& stop_callback, | 33 MediaStreamVideoCapturerSource(const SourceStoppedCallback& stop_callback, |
| 34 const StreamDeviceInfo& device_info, | 34 const StreamDeviceInfo& device_info, |
| 35 RenderFrame* render_frame); | 35 RenderFrame* render_frame); |
| 36 ~MediaStreamVideoCapturerSource() override; | 36 ~MediaStreamVideoCapturerSource() override; |
| 37 | 37 |
| 38 // Implements MediaStreamVideoSource. | |
| 39 void RequestRefreshFrame() override; | |
| 40 | |
| 41 void SetCapturingLinkSecured(bool is_secure) override; | |
| 42 | |
| 43 private: | 38 private: |
| 44 friend class CanvasCaptureHandlerTest; | 39 friend class CanvasCaptureHandlerTest; |
| 45 friend class MediaStreamVideoCapturerSourceTest; | 40 friend class MediaStreamVideoCapturerSourceTest; |
| 46 | 41 |
| 47 // Implements MediaStreamVideoSource. | 42 // MediaStreamVideoSource overrides. |
| 43 void RequestRefreshFrame() override; |
| 44 void OnHasConsumers(bool has_consumers) override; |
| 45 void OnCapturingLinkSecured(bool is_secure) override; |
| 48 void GetCurrentSupportedFormats( | 46 void GetCurrentSupportedFormats( |
| 49 int max_requested_width, | 47 int max_requested_width, |
| 50 int max_requested_height, | 48 int max_requested_height, |
| 51 double max_requested_frame_rate, | 49 double max_requested_frame_rate, |
| 52 const VideoCaptureDeviceFormatsCB& callback) override; | 50 const VideoCaptureDeviceFormatsCB& callback) override; |
| 53 void StartSourceImpl( | 51 void StartSourceImpl( |
| 54 const media::VideoCaptureFormat& format, | 52 const media::VideoCaptureFormat& format, |
| 55 const blink::WebMediaConstraints& constraints, | 53 const blink::WebMediaConstraints& constraints, |
| 56 const VideoCaptureDeliverFrameCB& frame_callback) override; | 54 const VideoCaptureDeliverFrameCB& frame_callback) override; |
| 57 void StopSourceImpl() override; | 55 void StopSourceImpl() override; |
| 58 | 56 |
| 59 // RenderFrameObserver implementation. | 57 // RenderFrameObserver implementation. |
| 60 void OnDestruct() final {} | 58 void OnDestruct() final {} |
| 61 | 59 |
| 62 // Method to bind as RunningCallback in VideoCapturerSource::StartCapture(). | 60 // Method to bind as RunningCallback in VideoCapturerSource::StartCapture(). |
| 63 void OnStarted(bool result); | 61 void OnStarted(bool result); |
| 64 | 62 |
| 65 const char* GetPowerLineFrequencyForTesting() const; | 63 const char* GetPowerLineFrequencyForTesting() const; |
| 66 | 64 |
| 67 // The source that provides video frames. | 65 // The source that provides video frames. |
| 68 const std::unique_ptr<media::VideoCapturerSource> source_; | 66 const std::unique_ptr<media::VideoCapturerSource> source_; |
| 69 | 67 |
| 70 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); | 68 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); |
| 71 }; | 69 }; |
| 72 | 70 |
| 73 } // namespace content | 71 } // namespace content |
| 74 | 72 |
| 75 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 73 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
| OLD | NEW |