Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: remoting/protocol/webrtc_video_stream.h

Issue 1846893002: Interface with webrtc through encoded frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sergey comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "remoting/codec/video_encoder.h"
15 #include "remoting/protocol/video_stream.h" 16 #include "remoting/protocol/video_stream.h"
17 #include "remoting/protocol/webrtc_frame_scheduler.h"
16 18
17 namespace webrtc { 19 namespace webrtc {
18 class DesktopSize; 20 class DesktopSize;
19 class DesktopCapturer; 21 class DesktopCapturer;
20 class MediaStreamInterface; 22 class MediaStreamInterface;
21 class PeerConnectionInterface; 23 class PeerConnectionInterface;
22 class PeerConnectionFactoryInterface; 24 class PeerConnectionFactoryInterface;
23 class VideoTrackInterface; 25 class VideoTrackInterface;
24 } // namespace webrtc 26 } // namespace webrtc
25 27
26 namespace remoting { 28 namespace remoting {
27 namespace protocol { 29 namespace protocol {
28 30
29 class WebrtcVideoCapturerAdapter; 31 class WebrtcVideoCapturerAdapter;
30 32
31 class WebrtcVideoStream : public VideoStream { 33 class WebrtcVideoStream : public VideoStream {
32 public: 34 public:
33 WebrtcVideoStream(); 35 WebrtcVideoStream();
34 ~WebrtcVideoStream() override; 36 ~WebrtcVideoStream() override;
35 37
36 bool Start(std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer, 38 bool Start(
37 scoped_refptr<webrtc::PeerConnectionInterface> connection, 39 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer,
38 scoped_refptr<webrtc::PeerConnectionFactoryInterface> 40 WebrtcTransport* webrtc_transport,
39 peer_connection_factory); 41 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
42 std::unique_ptr<VideoEncoder> video_encoder);
40 43
41 // VideoStream interface. 44 // VideoStream interface.
42 void Pause(bool pause) override; 45 void Pause(bool pause) override;
43 void OnInputEventReceived(int64_t event_timestamp) override; 46 void OnInputEventReceived(int64_t event_timestamp) override;
44 void SetLosslessEncode(bool want_lossless) override; 47 void SetLosslessEncode(bool want_lossless) override;
45 void SetLosslessColor(bool want_lossless) override; 48 void SetLosslessColor(bool want_lossless) override;
46 void SetSizeCallback(const SizeCallback& size_callback) override; 49 void SetSizeCallback(const SizeCallback& size_callback) override;
47 50
48 private: 51 private:
49 scoped_refptr<webrtc::PeerConnectionInterface> connection_; 52 scoped_refptr<webrtc::PeerConnectionInterface> connection_;
50 scoped_refptr<webrtc::MediaStreamInterface> stream_; 53 scoped_refptr<webrtc::MediaStreamInterface> stream_;
51 54
52 // Owned by the |stream_|. 55 // Owned by the dummy video capturer.
53 base::WeakPtr<WebrtcVideoCapturerAdapter> capturer_adapter_; 56 WebRtcFrameScheduler* webrtc_frame_scheduler_;
54 57
55 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream); 58 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream);
56 }; 59 };
57 60
58 } // namespace protocol 61 } // namespace protocol
59 } // namespace remoting 62 } // namespace remoting
60 63
61 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ 64 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_
OLDNEW
« no previous file with comments | « remoting/protocol/webrtc_video_renderer_adapter.cc ('k') | remoting/protocol/webrtc_video_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698