Chromium Code Reviews| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 // WebMediaStreamSource. Objects of this class are created and live on main | 25 // WebMediaStreamSource. Objects of this class are created and live on main |
| 26 // Render thread. Objects can be constructed either by indicating a |device| to | 26 // Render thread. Objects can be constructed either by indicating a |device| to |
| 27 // look for, or by plugging in a |source| constructed elsewhere. | 27 // look for, or by plugging in a |source| constructed elsewhere. |
| 28 class CONTENT_EXPORT MediaStreamVideoCapturerSource | 28 class CONTENT_EXPORT MediaStreamVideoCapturerSource |
| 29 : public MediaStreamVideoSource, | 29 : public MediaStreamVideoSource, |
| 30 public RenderFrameObserver { | 30 public RenderFrameObserver { |
| 31 public: | 31 public: |
| 32 MediaStreamVideoCapturerSource( | 32 MediaStreamVideoCapturerSource( |
| 33 const SourceStoppedCallback& stop_callback, | 33 const SourceStoppedCallback& stop_callback, |
| 34 std::unique_ptr<media::VideoCapturerSource> source); | 34 std::unique_ptr<media::VideoCapturerSource> source); |
| 35 // TODO(guidou): Remove this constructor. http://crbug.com/706408 | |
| 36 MediaStreamVideoCapturerSource(const SourceStoppedCallback& stop_callback, | |
| 37 const StreamDeviceInfo& device_info, | |
| 38 RenderFrame* render_frame); | |
| 39 MediaStreamVideoCapturerSource( | 35 MediaStreamVideoCapturerSource( |
| 40 const SourceStoppedCallback& stop_callback, | 36 const SourceStoppedCallback& stop_callback, |
| 41 const StreamDeviceInfo& device_info, | 37 const StreamDeviceInfo& device_info, |
| 42 const media::VideoCaptureParams& capture_params, | 38 const media::VideoCaptureParams& capture_params, |
| 43 RenderFrame* render_frame); | 39 RenderFrame* render_frame); |
| 44 ~MediaStreamVideoCapturerSource() override; | 40 ~MediaStreamVideoCapturerSource() override; |
| 45 | 41 |
| 46 private: | 42 private: |
| 47 friend class CanvasCaptureHandlerTest; | 43 friend class CanvasCaptureHandlerTest; |
| 48 friend class MediaStreamVideoCapturerSourceTest; | 44 friend class MediaStreamVideoCapturerSourceTest; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 64 void StopSourceImpl() override; | 60 void StopSourceImpl() override; |
| 65 base::Optional<media::VideoCaptureFormat> GetCurrentFormatImpl() | 61 base::Optional<media::VideoCaptureFormat> GetCurrentFormatImpl() |
| 66 const override; | 62 const override; |
| 67 | 63 |
| 68 // RenderFrameObserver implementation. | 64 // RenderFrameObserver implementation. |
| 69 void OnDestruct() final {} | 65 void OnDestruct() final {} |
| 70 | 66 |
| 71 // Method to bind as RunningCallback in VideoCapturerSource::StartCapture(). | 67 // Method to bind as RunningCallback in VideoCapturerSource::StartCapture(). |
| 72 void OnRunStateChanged(bool is_running); | 68 void OnRunStateChanged(bool is_running); |
| 73 | 69 |
| 74 const char* GetPowerLineFrequencyForTesting() const; | 70 const char* GetPowerLineFrequencyForTesting() const; |
|
hbos_chromium
2017/06/30 15:04:12
Power line: remove this?
I think this is not used
Guido Urdaneta
2017/07/03 18:43:16
Done.
| |
| 75 | 71 |
| 76 // The source that provides video frames. | 72 // The source that provides video frames. |
| 77 const std::unique_ptr<media::VideoCapturerSource> source_; | 73 const std::unique_ptr<media::VideoCapturerSource> source_; |
| 78 | 74 |
| 79 // Indicates whether the capture is in starting. It is set to true by | 75 // Indicates whether the capture is in starting. It is set to true by |
| 80 // StartSourceImpl() when starting the capture, and is reset after starting | 76 // StartSourceImpl() when starting the capture, and is reset after starting |
| 81 // is completed. | 77 // is completed. |
| 82 bool is_capture_starting_ = false; | 78 bool is_capture_starting_ = false; |
| 83 | 79 |
| 84 media::VideoCaptureParams capture_params_; | 80 media::VideoCaptureParams capture_params_; |
| 85 | 81 |
| 86 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); | 82 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); |
| 87 }; | 83 }; |
| 88 | 84 |
| 89 } // namespace content | 85 } // namespace content |
| 90 | 86 |
| 91 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 87 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
| OLD | NEW |