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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 : transport_adapter_(config.rtcp_send_transport), | 156 : transport_adapter_(config.rtcp_send_transport), |
157 encoded_frame_proxy_(config.pre_decode_callback), | 157 encoded_frame_proxy_(config.pre_decode_callback), |
158 config_(config), | 158 config_(config), |
159 process_thread_(process_thread), | 159 process_thread_(process_thread), |
160 clock_(Clock::GetRealTimeClock()), | 160 clock_(Clock::GetRealTimeClock()), |
161 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), | 161 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), |
162 congestion_controller_(congestion_controller), | 162 congestion_controller_(congestion_controller), |
163 call_stats_(call_stats), | 163 call_stats_(call_stats), |
164 remb_(remb), | 164 remb_(remb), |
165 video_receiver_(clock_, nullptr, this, this, this), | 165 video_receiver_(clock_, nullptr, this, this, this), |
166 incoming_video_stream_(0, config.disable_prerenderer_smoothing), | 166 incoming_video_stream_(config.disable_prerenderer_smoothing), |
167 stats_proxy_(config_, clock_), | 167 stats_proxy_(config_, clock_), |
168 rtp_stream_receiver_(&video_receiver_, | 168 rtp_stream_receiver_(&video_receiver_, |
169 congestion_controller_->GetRemoteBitrateEstimator( | 169 congestion_controller_->GetRemoteBitrateEstimator( |
170 UseSendSideBwe(config_)), | 170 UseSendSideBwe(config_)), |
171 &transport_adapter_, | 171 &transport_adapter_, |
172 call_stats_->rtcp_rtt_stats(), | 172 call_stats_->rtcp_rtt_stats(), |
173 congestion_controller_->pacer(), | 173 congestion_controller_->pacer(), |
174 congestion_controller_->packet_router()), | 174 congestion_controller_->packet_router()), |
175 vie_channel_(&video_receiver_, | 175 vie_channel_(&video_receiver_, |
176 &rtp_stream_receiver_), | 176 &rtp_stream_receiver_), |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) { | 377 void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) { |
378 stats_proxy_.OnDecodedFrame(); | 378 stats_proxy_.OnDecodedFrame(); |
379 | 379 |
380 // Post processing is not supported if the frame is backed by a texture. | 380 // Post processing is not supported if the frame is backed by a texture. |
381 if (!video_frame->video_frame_buffer()->native_handle()) { | 381 if (!video_frame->video_frame_buffer()->native_handle()) { |
382 if (config_.pre_render_callback) | 382 if (config_.pre_render_callback) |
383 config_.pre_render_callback->FrameCallback(video_frame); | 383 config_.pre_render_callback->FrameCallback(video_frame); |
384 } | 384 } |
385 } | 385 } |
386 | 386 |
387 int VideoReceiveStream::RenderFrame(const uint32_t /*stream_id*/, | 387 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) { |
388 const VideoFrame& video_frame) { | |
389 int64_t sync_offset_ms; | 388 int64_t sync_offset_ms; |
390 if (vie_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms)) | 389 if (vie_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms)) |
391 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms); | 390 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms); |
392 | 391 |
393 if (config_.renderer) | 392 if (config_.renderer) |
394 config_.renderer->OnFrame(video_frame); | 393 config_.renderer->OnFrame(video_frame); |
395 | 394 |
396 stats_proxy_.OnRenderedFrame(video_frame.width(), video_frame.height()); | 395 stats_proxy_.OnRenderedFrame(video_frame.width(), video_frame.height()); |
397 | |
398 return 0; | |
399 } | 396 } |
400 | 397 |
401 // TODO(asapersson): Consider moving callback from video_encoder.h or | 398 // TODO(asapersson): Consider moving callback from video_encoder.h or |
402 // creating a different callback. | 399 // creating a different callback. |
403 int32_t VideoReceiveStream::Encoded( | 400 int32_t VideoReceiveStream::Encoded( |
404 const EncodedImage& encoded_image, | 401 const EncodedImage& encoded_image, |
405 const CodecSpecificInfo* codec_specific_info, | 402 const CodecSpecificInfo* codec_specific_info, |
406 const RTPFragmentationHeader* fragmentation) { | 403 const RTPFragmentationHeader* fragmentation) { |
407 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); | 404 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); |
408 if (config_.pre_decode_callback) { | 405 if (config_.pre_decode_callback) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 const std::vector<uint16_t>& sequence_numbers) { | 438 const std::vector<uint16_t>& sequence_numbers) { |
442 rtp_rtcp_->SendNack(sequence_numbers); | 439 rtp_rtcp_->SendNack(sequence_numbers); |
443 } | 440 } |
444 | 441 |
445 void VideoReceiveStream::RequestKeyFrame() { | 442 void VideoReceiveStream::RequestKeyFrame() { |
446 rtp_rtcp_->RequestKeyFrame(); | 443 rtp_rtcp_->RequestKeyFrame(); |
447 } | 444 } |
448 | 445 |
449 } // namespace internal | 446 } // namespace internal |
450 } // namespace webrtc | 447 } // namespace webrtc |
OLD | NEW |