| 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 "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "remoting/codec/video_encoder.h" |
| 14 #include "remoting/protocol/video_stream.h" | 15 #include "remoting/protocol/video_stream.h" |
| 16 #include "remoting/protocol/webrtc_frame_scheduler.h" |
| 15 | 17 |
| 16 namespace webrtc { | 18 namespace webrtc { |
| 17 class DesktopSize; | 19 class DesktopSize; |
| 18 class DesktopCapturer; | 20 class DesktopCapturer; |
| 19 class MediaStreamInterface; | 21 class MediaStreamInterface; |
| 20 class PeerConnectionInterface; | 22 class PeerConnectionInterface; |
| 21 class PeerConnectionFactoryInterface; | 23 class PeerConnectionFactoryInterface; |
| 22 class VideoTrackInterface; | 24 class VideoTrackInterface; |
| 23 } // namespace webrtc | 25 } // namespace webrtc |
| 24 | 26 |
| 25 namespace remoting { | 27 namespace remoting { |
| 26 namespace protocol { | 28 namespace protocol { |
| 27 | 29 |
| 28 class WebrtcVideoCapturerAdapter; | 30 class WebrtcVideoCapturerAdapter; |
| 29 | 31 |
| 30 class WebrtcVideoStream : public VideoStream { | 32 class WebrtcVideoStream : public VideoStream { |
| 31 public: | 33 public: |
| 32 WebrtcVideoStream(); | 34 WebrtcVideoStream(); |
| 33 ~WebrtcVideoStream() override; | 35 ~WebrtcVideoStream() override; |
| 34 | 36 |
| 35 bool Start(scoped_ptr<webrtc::DesktopCapturer> desktop_capturer, | 37 bool Start( |
| 36 scoped_refptr<webrtc::PeerConnectionInterface> connection, | 38 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer, |
| 37 scoped_refptr<webrtc::PeerConnectionFactoryInterface> | 39 WebrtcTransport* webrtc_transport, |
| 38 peer_connection_factory); | 40 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, |
| 41 scoped_ptr<VideoEncoder> video_encoder); |
| 39 | 42 |
| 40 // VideoStream interface. | 43 // VideoStream interface. |
| 41 void Pause(bool pause) override; | 44 void Pause(bool pause) override; |
| 42 void OnInputEventReceived(int64_t event_timestamp) override; | 45 void OnInputEventReceived(int64_t event_timestamp) override; |
| 43 void SetLosslessEncode(bool want_lossless) override; | 46 void SetLosslessEncode(bool want_lossless) override; |
| 44 void SetLosslessColor(bool want_lossless) override; | 47 void SetLosslessColor(bool want_lossless) override; |
| 45 void SetSizeCallback(const SizeCallback& size_callback) override; | 48 void SetSizeCallback(const SizeCallback& size_callback) override; |
| 46 | 49 |
| 47 private: | 50 private: |
| 48 scoped_refptr<webrtc::PeerConnectionInterface> connection_; | 51 scoped_refptr<webrtc::PeerConnectionInterface> connection_; |
| 49 scoped_refptr<webrtc::MediaStreamInterface> stream_; | 52 scoped_refptr<webrtc::MediaStreamInterface> stream_; |
| 50 | 53 |
| 51 // Owned by the |stream_|. | 54 // Owned by the dummy video capturer. |
| 52 base::WeakPtr<WebrtcVideoCapturerAdapter> capturer_adapter_; | 55 WebRtcFrameScheduler* webrtc_frame_scheduler_; |
| 53 | 56 |
| 54 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream); | 57 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream); |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 } // namespace protocol | 60 } // namespace protocol |
| 58 } // namespace remoting | 61 } // namespace remoting |
| 59 | 62 |
| 60 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ | 63 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ |
| OLD | NEW |