OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 config, | 174 config, |
175 &stats_proxy_, | 175 &stats_proxy_, |
176 process_thread_), | 176 process_thread_), |
177 video_stream_decoder_(&video_receiver_, | 177 video_stream_decoder_(&video_receiver_, |
178 &rtp_stream_receiver_, | 178 &rtp_stream_receiver_, |
179 &rtp_stream_receiver_, | 179 &rtp_stream_receiver_, |
180 rtp_stream_receiver_.IsRetransmissionsEnabled(), | 180 rtp_stream_receiver_.IsRetransmissionsEnabled(), |
181 rtp_stream_receiver_.IsFecEnabled(), | 181 rtp_stream_receiver_.IsFecEnabled(), |
182 &stats_proxy_, | 182 &stats_proxy_, |
183 &incoming_video_stream_, | 183 &incoming_video_stream_, |
184 this), | 184 config.pre_render_callback), |
185 vie_sync_(&video_receiver_) { | 185 vie_sync_(&video_receiver_) { |
186 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); | 186 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); |
187 | 187 |
188 RTC_DCHECK(process_thread_); | 188 RTC_DCHECK(process_thread_); |
189 RTC_DCHECK(congestion_controller_); | 189 RTC_DCHECK(congestion_controller_); |
190 RTC_DCHECK(call_stats_); | 190 RTC_DCHECK(call_stats_); |
191 | 191 |
192 // Register the channel to receive stats updates. | 192 // Register the channel to receive stats updates. |
193 call_stats_->RegisterStatsObserver(&video_stream_decoder_); | 193 call_stats_->RegisterStatsObserver(&video_stream_decoder_); |
194 | 194 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 } else { | 283 } else { |
284 vie_sync_.ConfigureSync(-1, nullptr, rtp_stream_receiver_.rtp_rtcp(), | 284 vie_sync_.ConfigureSync(-1, nullptr, rtp_stream_receiver_.rtp_rtcp(), |
285 rtp_stream_receiver_.GetRtpReceiver()); | 285 rtp_stream_receiver_.GetRtpReceiver()); |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { | 289 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { |
290 return stats_proxy_.GetStats(); | 290 return stats_proxy_.GetStats(); |
291 } | 291 } |
292 | 292 |
293 void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) { | 293 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) { |
294 stats_proxy_.OnDecodedFrame(); | 294 stats_proxy_.OnDecodedFrame(); |
295 | 295 |
296 // Post processing is not supported if the frame is backed by a texture. | |
297 if (!video_frame->video_frame_buffer()->native_handle()) { | |
298 if (config_.pre_render_callback) | |
299 config_.pre_render_callback->FrameCallback(video_frame); | |
300 } | |
301 } | |
302 | |
303 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) { | |
304 int64_t sync_offset_ms; | 296 int64_t sync_offset_ms; |
305 if (vie_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms)) | 297 if (vie_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms)) |
306 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms); | 298 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms); |
307 | 299 |
308 if (config_.renderer) | 300 if (config_.renderer) |
309 config_.renderer->OnFrame(video_frame); | 301 config_.renderer->OnFrame(video_frame); |
310 | 302 |
311 stats_proxy_.OnRenderedFrame(video_frame.width(), video_frame.height()); | 303 stats_proxy_.OnRenderedFrame(video_frame.width(), video_frame.height()); |
312 } | 304 } |
313 | 305 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 const std::vector<uint16_t>& sequence_numbers) { | 346 const std::vector<uint16_t>& sequence_numbers) { |
355 rtp_stream_receiver_.RequestPacketRetransmit(sequence_numbers); | 347 rtp_stream_receiver_.RequestPacketRetransmit(sequence_numbers); |
356 } | 348 } |
357 | 349 |
358 void VideoReceiveStream::RequestKeyFrame() { | 350 void VideoReceiveStream::RequestKeyFrame() { |
359 rtp_stream_receiver_.RequestKeyFrame(); | 351 rtp_stream_receiver_.RequestKeyFrame(); |
360 } | 352 } |
361 | 353 |
362 } // namespace internal | 354 } // namespace internal |
363 } // namespace webrtc | 355 } // namespace webrtc |
OLD | NEW |