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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), | 158 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), |
159 congestion_controller_(congestion_controller), | 159 congestion_controller_(congestion_controller), |
160 call_stats_(call_stats), | 160 call_stats_(call_stats), |
161 remb_(remb), | 161 remb_(remb), |
162 vcm_(VideoCodingModule::Create(clock_, | 162 vcm_(VideoCodingModule::Create(clock_, |
163 nullptr, | 163 nullptr, |
164 nullptr, | 164 nullptr, |
165 this, | 165 this, |
166 this)), | 166 this)), |
167 incoming_video_stream_( | 167 incoming_video_stream_( |
168 0, | |
169 config.renderer ? config.renderer->SmoothsRenderedFrames() : false), | 168 config.renderer ? config.renderer->SmoothsRenderedFrames() : false), |
170 stats_proxy_(config_, clock_), | 169 stats_proxy_(config_, clock_), |
171 vie_channel_(&transport_adapter_, | 170 vie_channel_(&transport_adapter_, |
172 process_thread, | 171 process_thread, |
173 nullptr, | 172 nullptr, |
174 vcm_.get(), | 173 vcm_.get(), |
175 nullptr, | 174 nullptr, |
176 nullptr, | 175 nullptr, |
177 nullptr, | 176 nullptr, |
178 congestion_controller_->GetRemoteBitrateEstimator( | 177 congestion_controller_->GetRemoteBitrateEstimator( |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) { | 374 void VideoReceiveStream::FrameCallback(VideoFrame* video_frame) { |
376 stats_proxy_.OnDecodedFrame(); | 375 stats_proxy_.OnDecodedFrame(); |
377 | 376 |
378 // Post processing is not supported if the frame is backed by a texture. | 377 // Post processing is not supported if the frame is backed by a texture. |
379 if (video_frame->native_handle() == NULL) { | 378 if (video_frame->native_handle() == NULL) { |
380 if (config_.pre_render_callback) | 379 if (config_.pre_render_callback) |
381 config_.pre_render_callback->FrameCallback(video_frame); | 380 config_.pre_render_callback->FrameCallback(video_frame); |
382 } | 381 } |
383 } | 382 } |
384 | 383 |
385 int VideoReceiveStream::RenderFrame(const uint32_t /*stream_id*/, | 384 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) { |
386 const VideoFrame& video_frame) { | |
387 int64_t sync_offset_ms; | 385 int64_t sync_offset_ms; |
388 if (vie_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms)) | 386 if (vie_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms)) |
389 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms); | 387 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms); |
390 | 388 |
391 if (config_.renderer != nullptr) | 389 if (config_.renderer != nullptr) |
392 config_.renderer->OnFrame(video_frame); | 390 config_.renderer->OnFrame(video_frame); |
393 | 391 |
394 stats_proxy_.OnRenderedFrame(video_frame); | 392 stats_proxy_.OnRenderedFrame(video_frame); |
395 | |
396 return 0; | |
397 } | 393 } |
398 | 394 |
399 // TODO(asapersson): Consider moving callback from video_encoder.h or | 395 // TODO(asapersson): Consider moving callback from video_encoder.h or |
400 // creating a different callback. | 396 // creating a different callback. |
401 int32_t VideoReceiveStream::Encoded( | 397 int32_t VideoReceiveStream::Encoded( |
402 const EncodedImage& encoded_image, | 398 const EncodedImage& encoded_image, |
403 const CodecSpecificInfo* codec_specific_info, | 399 const CodecSpecificInfo* codec_specific_info, |
404 const RTPFragmentationHeader* fragmentation) { | 400 const RTPFragmentationHeader* fragmentation) { |
405 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); | 401 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); |
406 if (config_.pre_decode_callback) { | 402 if (config_.pre_decode_callback) { |
(...skipping 23 matching lines...) Expand all Loading... |
430 const std::vector<uint16_t>& sequence_numbers) { | 426 const std::vector<uint16_t>& sequence_numbers) { |
431 rtp_rtcp_->SendNack(sequence_numbers); | 427 rtp_rtcp_->SendNack(sequence_numbers); |
432 } | 428 } |
433 | 429 |
434 void VideoReceiveStream::RequestKeyFrame() { | 430 void VideoReceiveStream::RequestKeyFrame() { |
435 rtp_rtcp_->RequestKeyFrame(); | 431 rtp_rtcp_->RequestKeyFrame(); |
436 } | 432 } |
437 | 433 |
438 } // namespace internal | 434 } // namespace internal |
439 } // namespace webrtc | 435 } // namespace webrtc |
OLD | NEW |