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 // TODO(pbos): Wire up config_.render->IsTextureSupported() and convert if not | 389 // TODO(pbos): Wire up config_.render->IsTextureSupported() and convert if not |
392 // supported. Or provide methods for converting a texture frame in | 390 // supported. Or provide methods for converting a texture frame in |
393 // VideoFrame. | 391 // VideoFrame. |
394 | 392 |
395 if (config_.renderer != nullptr) | 393 if (config_.renderer != nullptr) |
396 config_.renderer->RenderFrame( | 394 config_.renderer->RenderFrame( |
397 video_frame, | 395 video_frame, |
398 video_frame.render_time_ms() - clock_->TimeInMilliseconds()); | 396 video_frame.render_time_ms() - clock_->TimeInMilliseconds()); |
399 | 397 |
400 stats_proxy_.OnRenderedFrame(video_frame); | 398 stats_proxy_.OnRenderedFrame(video_frame); |
401 | |
402 return 0; | |
403 } | 399 } |
404 | 400 |
405 // TODO(asapersson): Consider moving callback from video_encoder.h or | 401 // TODO(asapersson): Consider moving callback from video_encoder.h or |
406 // creating a different callback. | 402 // creating a different callback. |
407 int32_t VideoReceiveStream::Encoded( | 403 int32_t VideoReceiveStream::Encoded( |
408 const EncodedImage& encoded_image, | 404 const EncodedImage& encoded_image, |
409 const CodecSpecificInfo* codec_specific_info, | 405 const CodecSpecificInfo* codec_specific_info, |
410 const RTPFragmentationHeader* fragmentation) { | 406 const RTPFragmentationHeader* fragmentation) { |
411 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); | 407 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); |
412 if (config_.pre_decode_callback) { | 408 if (config_.pre_decode_callback) { |
(...skipping 23 matching lines...) Expand all Loading... |
436 const std::vector<uint16_t>& sequence_numbers) { | 432 const std::vector<uint16_t>& sequence_numbers) { |
437 rtp_rtcp_->SendNack(sequence_numbers); | 433 rtp_rtcp_->SendNack(sequence_numbers); |
438 } | 434 } |
439 | 435 |
440 void VideoReceiveStream::RequestKeyFrame() { | 436 void VideoReceiveStream::RequestKeyFrame() { |
441 rtp_rtcp_->RequestKeyFrame(); | 437 rtp_rtcp_->RequestKeyFrame(); |
442 } | 438 } |
443 | 439 |
444 } // namespace internal | 440 } // namespace internal |
445 } // namespace webrtc | 441 } // namespace webrtc |
OLD | NEW |