| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ | 5 #ifndef REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ |
| 6 #define REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ | 6 #define REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "remoting/protocol/video_stream.h" | 15 #include "remoting/protocol/video_stream.h" |
| 15 | 16 |
| 16 namespace webrtc { | 17 namespace webrtc { |
| 17 class DesktopSize; | 18 class DesktopSize; |
| 18 class DesktopCapturer; | 19 class DesktopCapturer; |
| 19 class MediaStreamInterface; | 20 class MediaStreamInterface; |
| 20 class PeerConnectionInterface; | 21 class PeerConnectionInterface; |
| 21 class PeerConnectionFactoryInterface; | 22 class PeerConnectionFactoryInterface; |
| 22 class VideoTrackInterface; | 23 class VideoTrackInterface; |
| 23 } // namespace webrtc | 24 } // namespace webrtc |
| 24 | 25 |
| 25 namespace remoting { | 26 namespace remoting { |
| 26 namespace protocol { | 27 namespace protocol { |
| 27 | 28 |
| 28 class WebrtcVideoCapturerAdapter; | 29 class WebrtcVideoCapturerAdapter; |
| 29 | 30 |
| 30 class WebrtcVideoStream : public VideoStream { | 31 class WebrtcVideoStream : public VideoStream { |
| 31 public: | 32 public: |
| 32 WebrtcVideoStream(); | 33 WebrtcVideoStream(); |
| 33 ~WebrtcVideoStream() override; | 34 ~WebrtcVideoStream() override; |
| 34 | 35 |
| 35 bool Start(scoped_ptr<webrtc::DesktopCapturer> desktop_capturer, | 36 bool Start(std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer, |
| 36 scoped_refptr<webrtc::PeerConnectionInterface> connection, | 37 scoped_refptr<webrtc::PeerConnectionInterface> connection, |
| 37 scoped_refptr<webrtc::PeerConnectionFactoryInterface> | 38 scoped_refptr<webrtc::PeerConnectionFactoryInterface> |
| 38 peer_connection_factory); | 39 peer_connection_factory); |
| 39 | 40 |
| 40 // VideoStream interface. | 41 // VideoStream interface. |
| 41 void Pause(bool pause) override; | 42 void Pause(bool pause) override; |
| 42 void OnInputEventReceived(int64_t event_timestamp) override; | 43 void OnInputEventReceived(int64_t event_timestamp) override; |
| 43 void SetLosslessEncode(bool want_lossless) override; | 44 void SetLosslessEncode(bool want_lossless) override; |
| 44 void SetLosslessColor(bool want_lossless) override; | 45 void SetLosslessColor(bool want_lossless) override; |
| 45 void SetSizeCallback(const SizeCallback& size_callback) override; | 46 void SetSizeCallback(const SizeCallback& size_callback) override; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 scoped_refptr<webrtc::PeerConnectionInterface> connection_; | 49 scoped_refptr<webrtc::PeerConnectionInterface> connection_; |
| 49 scoped_refptr<webrtc::MediaStreamInterface> stream_; | 50 scoped_refptr<webrtc::MediaStreamInterface> stream_; |
| 50 | 51 |
| 51 // Owned by the |stream_|. | 52 // Owned by the |stream_|. |
| 52 base::WeakPtr<WebrtcVideoCapturerAdapter> capturer_adapter_; | 53 base::WeakPtr<WebrtcVideoCapturerAdapter> capturer_adapter_; |
| 53 | 54 |
| 54 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream); | 55 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace protocol | 58 } // namespace protocol |
| 58 } // namespace remoting | 59 } // namespace remoting |
| 59 | 60 |
| 60 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ | 61 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ |
| OLD | NEW |