| 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 #include "remoting/protocol/video_frame_pump.h" | 5 #include "remoting/protocol/video_frame_pump.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // static | 165 // static |
| 166 std::unique_ptr<VideoFramePump::PacketWithTimestamps> | 166 std::unique_ptr<VideoFramePump::PacketWithTimestamps> |
| 167 VideoFramePump::EncodeFrame(VideoEncoder* encoder, | 167 VideoFramePump::EncodeFrame(VideoEncoder* encoder, |
| 168 std::unique_ptr<webrtc::DesktopFrame> frame, | 168 std::unique_ptr<webrtc::DesktopFrame> frame, |
| 169 std::unique_ptr<FrameTimestamps> timestamps) { | 169 std::unique_ptr<FrameTimestamps> timestamps) { |
| 170 timestamps->encode_started_time = base::TimeTicks::Now(); | 170 timestamps->encode_started_time = base::TimeTicks::Now(); |
| 171 | 171 |
| 172 std::unique_ptr<VideoPacket> packet; | 172 std::unique_ptr<VideoPacket> packet; |
| 173 // If |frame| is non-NULL then let the encoder process it. | 173 // If |frame| is non-NULL then let the encoder process it. |
| 174 if (frame) | 174 if (frame) |
| 175 packet = encoder->Encode(*frame); | 175 packet = encoder->Encode(*frame, 0); |
| 176 | 176 |
| 177 // If |frame| is NULL, or the encoder returned nothing, return an empty | 177 // If |frame| is NULL, or the encoder returned nothing, return an empty |
| 178 // packet. | 178 // packet. |
| 179 if (!packet) | 179 if (!packet) |
| 180 packet.reset(new VideoPacket()); | 180 packet.reset(new VideoPacket()); |
| 181 | 181 |
| 182 if (frame) | 182 if (frame) |
| 183 packet->set_capture_time_ms(frame->capture_time_ms()); | 183 packet->set_capture_time_ms(frame->capture_time_ms()); |
| 184 | 184 |
| 185 timestamps->encode_ended_time = base::TimeTicks::Now(); | 185 timestamps->encode_ended_time = base::TimeTicks::Now(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 | 271 |
| 272 void VideoFramePump::OnKeepAlivePacketSent() { | 272 void VideoFramePump::OnKeepAlivePacketSent() { |
| 273 DCHECK(thread_checker_.CalledOnValidThread()); | 273 DCHECK(thread_checker_.CalledOnValidThread()); |
| 274 | 274 |
| 275 keep_alive_timer_.Reset(); | 275 keep_alive_timer_.Reset(); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace protocol | 278 } // namespace protocol |
| 279 } // namespace remoting | 279 } // namespace remoting |
| OLD | NEW |