OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 // Register codec type with VCM, but do not register RED or ULPFEC. | 421 // Register codec type with VCM, but do not register RED or ULPFEC. |
422 if (vcm_->RegisterReceiveCodec(&video_codec, number_of_cores_, false) != | 422 if (vcm_->RegisterReceiveCodec(&video_codec, number_of_cores_, false) != |
423 VCM_OK) { | 423 VCM_OK) { |
424 return -1; | 424 return -1; |
425 } | 425 } |
426 } | 426 } |
427 return 0; | 427 return 0; |
428 } | 428 } |
429 | 429 |
430 | 430 |
431 int32_t ViEChannel::RegisterExternalDecoder(const uint8_t pl_type, | 431 int32_t ViEChannel::RegisterExternalDecoder(const uint8_t pl_type, |
pbos-webrtc
2015/11/05 17:47:30
I think you can make this void and CHECK that this
| |
432 VideoDecoder* decoder, | 432 VideoDecoder* decoder) { |
433 bool buffered_rendering, | |
434 int32_t render_delay) { | |
435 RTC_DCHECK(!sender_); | 433 RTC_DCHECK(!sender_); |
436 int32_t result; | 434 return vcm_->RegisterExternalDecoder(decoder, pl_type); |
437 result = vcm_->RegisterExternalDecoder(decoder, pl_type, buffered_rendering); | |
438 if (result != VCM_OK) { | |
439 return result; | |
440 } | |
441 return vcm_->SetRenderDelay(render_delay); | |
442 } | 435 } |
443 | 436 |
444 int32_t ViEChannel::DeRegisterExternalDecoder(const uint8_t pl_type) { | 437 int32_t ViEChannel::DeRegisterExternalDecoder(const uint8_t pl_type) { |
445 RTC_DCHECK(!sender_); | 438 RTC_DCHECK(!sender_); |
446 VideoCodec current_receive_codec; | 439 VideoCodec current_receive_codec; |
447 int32_t result = 0; | 440 int32_t result = 0; |
448 result = vcm_->ReceiveCodec(¤t_receive_codec); | 441 result = vcm_->ReceiveCodec(¤t_receive_codec); |
449 if (vcm_->RegisterExternalDecoder(NULL, pl_type, false) != VCM_OK) { | 442 if (vcm_->RegisterExternalDecoder(NULL, pl_type) != VCM_OK) { |
450 return -1; | 443 return -1; |
451 } | 444 } |
452 | 445 |
453 if (result == 0 && current_receive_codec.plType == pl_type) { | 446 if (result == 0 && current_receive_codec.plType == pl_type) { |
454 result = vcm_->RegisterReceiveCodec(¤t_receive_codec, | 447 result = vcm_->RegisterReceiveCodec(¤t_receive_codec, |
455 number_of_cores_, false); | 448 number_of_cores_, false); |
456 } | 449 } |
457 return result; | 450 return result; |
458 } | 451 } |
459 | 452 |
460 int32_t ViEChannel::ReceiveCodecStatistics(uint32_t* num_key_frames, | 453 int32_t ViEChannel::ReceiveCodecStatistics(uint32_t* num_key_frames, |
461 uint32_t* num_delta_frames) { | 454 uint32_t* num_delta_frames) { |
462 CriticalSectionScoped cs(crit_.get()); | 455 CriticalSectionScoped cs(crit_.get()); |
463 *num_key_frames = receive_frame_counts_.key_frames; | 456 *num_key_frames = receive_frame_counts_.key_frames; |
464 *num_delta_frames = receive_frame_counts_.delta_frames; | 457 *num_delta_frames = receive_frame_counts_.delta_frames; |
465 return 0; | 458 return 0; |
466 } | 459 } |
467 | 460 |
468 uint32_t ViEChannel::DiscardedPackets() const { | 461 uint32_t ViEChannel::DiscardedPackets() const { |
469 return vcm_->DiscardedPackets(); | 462 return vcm_->DiscardedPackets(); |
470 } | 463 } |
471 | 464 |
472 int ViEChannel::ReceiveDelay() const { | 465 int ViEChannel::ReceiveDelay() const { |
473 return vcm_->Delay(); | 466 return vcm_->Delay(); |
474 } | 467 } |
475 | 468 |
469 void ViEChannel::SetExpectedRenderDelay(int32_t delay_ms) { | |
470 vcm_->SetRenderDelay(delay_ms); | |
471 } | |
472 | |
476 void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) { | 473 void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) { |
477 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) | 474 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
478 rtp_rtcp->SetRTCPStatus(rtcp_mode); | 475 rtp_rtcp->SetRTCPStatus(rtcp_mode); |
479 } | 476 } |
480 | 477 |
481 void ViEChannel::SetProtectionMode(bool enable_nack, | 478 void ViEChannel::SetProtectionMode(bool enable_nack, |
482 bool enable_fec, | 479 bool enable_fec, |
483 int payload_type_red, | 480 int payload_type_red, |
484 int payload_type_fec) { | 481 int payload_type_fec) { |
485 // Validate payload types. | 482 // Validate payload types. |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1244 CriticalSectionScoped cs(crit_.get()); | 1241 CriticalSectionScoped cs(crit_.get()); |
1245 receive_stats_callback_ = receive_statistics_proxy; | 1242 receive_stats_callback_ = receive_statistics_proxy; |
1246 } | 1243 } |
1247 | 1244 |
1248 void ViEChannel::SetIncomingVideoStream( | 1245 void ViEChannel::SetIncomingVideoStream( |
1249 IncomingVideoStream* incoming_video_stream) { | 1246 IncomingVideoStream* incoming_video_stream) { |
1250 CriticalSectionScoped cs(crit_.get()); | 1247 CriticalSectionScoped cs(crit_.get()); |
1251 incoming_video_stream_ = incoming_video_stream; | 1248 incoming_video_stream_ = incoming_video_stream; |
1252 } | 1249 } |
1253 } // namespace webrtc | 1250 } // namespace webrtc |
OLD | NEW |