| 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> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 18 #include "remoting/codec/webrtc_video_encoder.h" | 18 #include "remoting/codec/webrtc_video_encoder.h" |
| 19 #include "remoting/protocol/host_video_stats_dispatcher.h" | 19 #include "remoting/protocol/host_video_stats_dispatcher.h" |
| 20 #include "remoting/protocol/video_stream.h" | 20 #include "remoting/protocol/video_stream.h" |
| 21 #include "third_party/webrtc/common_types.h" |
| 21 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" | 22 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| 22 | 23 |
| 23 namespace webrtc { | 24 namespace webrtc { |
| 24 class MediaStreamInterface; | 25 class MediaStreamInterface; |
| 25 class PeerConnectionInterface; | 26 class PeerConnectionInterface; |
| 26 } // namespace webrtc | 27 } // namespace webrtc |
| 27 | 28 |
| 28 namespace remoting { | 29 namespace remoting { |
| 29 namespace protocol { | 30 namespace protocol { |
| 30 | 31 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void CaptureNextFrame(); | 68 void CaptureNextFrame(); |
| 68 | 69 |
| 69 // Task running on the encoder thread to encode the |frame|. | 70 // Task running on the encoder thread to encode the |frame|. |
| 70 static EncodedFrameWithStats EncodeFrame( | 71 static EncodedFrameWithStats EncodeFrame( |
| 71 WebrtcVideoEncoder* encoder, | 72 WebrtcVideoEncoder* encoder, |
| 72 std::unique_ptr<webrtc::DesktopFrame> frame, | 73 std::unique_ptr<webrtc::DesktopFrame> frame, |
| 73 WebrtcVideoEncoder::FrameParams params, | 74 WebrtcVideoEncoder::FrameParams params, |
| 74 std::unique_ptr<WebrtcVideoStream::FrameStats> stats); | 75 std::unique_ptr<WebrtcVideoStream::FrameStats> stats); |
| 75 void OnFrameEncoded(EncodedFrameWithStats frame); | 76 void OnFrameEncoded(EncodedFrameWithStats frame); |
| 76 | 77 |
| 78 void OnEncoderCreated(webrtc::VideoCodecType codec_type); |
| 79 |
| 77 // Capturer used to capture the screen. | 80 // Capturer used to capture the screen. |
| 78 std::unique_ptr<webrtc::DesktopCapturer> capturer_; | 81 std::unique_ptr<webrtc::DesktopCapturer> capturer_; |
| 79 // Used to send across encoded frames. | 82 // Used to send across encoded frames. |
| 80 WebrtcTransport* webrtc_transport_ = nullptr; | 83 WebrtcTransport* webrtc_transport_ = nullptr; |
| 81 // Task runner used to run |encoder_|. | 84 // Task runner used to run |encoder_|. |
| 82 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_; | 85 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_; |
| 83 // Used to encode captured frames. Always accessed on the encode thread. | 86 // Used to encode captured frames. Always accessed on the encode thread. |
| 84 std::unique_ptr<WebrtcVideoEncoder> encoder_; | 87 std::unique_ptr<WebrtcVideoEncoder> encoder_; |
| 85 | 88 |
| 86 scoped_refptr<InputEventTimestampsSource> event_timestamps_source_; | 89 scoped_refptr<InputEventTimestampsSource> event_timestamps_source_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 103 | 106 |
| 104 base::WeakPtrFactory<WebrtcVideoStream> weak_factory_; | 107 base::WeakPtrFactory<WebrtcVideoStream> weak_factory_; |
| 105 | 108 |
| 106 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream); | 109 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoStream); |
| 107 }; | 110 }; |
| 108 | 111 |
| 109 } // namespace protocol | 112 } // namespace protocol |
| 110 } // namespace remoting | 113 } // namespace remoting |
| 111 | 114 |
| 112 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ | 115 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_STREAM_H_ |
| OLD | NEW |