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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 if (receiveCodec == nullptr) { | 362 if (receiveCodec == nullptr) { |
363 return VCM_PARAMETER_ERROR; | 363 return VCM_PARAMETER_ERROR; |
364 } | 364 } |
365 if (!_codecDataBase.RegisterReceiveCodec(receiveCodec, numberOfCores, | 365 if (!_codecDataBase.RegisterReceiveCodec(receiveCodec, numberOfCores, |
366 requireKeyFrame)) { | 366 requireKeyFrame)) { |
367 return -1; | 367 return -1; |
368 } | 368 } |
369 return 0; | 369 return 0; |
370 } | 370 } |
371 | 371 |
372 // Get current received codec | |
373 // TODO(tommi): See if there are any actual callers to this method. | |
374 // Neither me nor Stefan could find callers. If we can remove it, threading | |
375 // will be simpler. | |
376 int32_t VideoReceiver::ReceiveCodec(VideoCodec* currentReceiveCodec) const { | |
377 rtc::CritScope cs(&receive_crit_); | |
378 if (currentReceiveCodec == nullptr) { | |
379 return VCM_PARAMETER_ERROR; | |
380 } | |
381 return _codecDataBase.ReceiveCodec(currentReceiveCodec) ? 0 : -1; | |
382 } | |
383 | |
384 // Get current received codec | |
385 // TODO(tommi): See if there are any actual callers to this method. | |
386 // If not, it will make threading simpler. | |
387 VideoCodecType VideoReceiver::ReceiveCodec() const { | |
388 rtc::CritScope cs(&receive_crit_); | |
389 return _codecDataBase.ReceiveCodec(); | |
390 } | |
391 | |
392 // Incoming packet from network parsed and ready for decode, non blocking. | 372 // Incoming packet from network parsed and ready for decode, non blocking. |
393 int32_t VideoReceiver::IncomingPacket(const uint8_t* incomingPayload, | 373 int32_t VideoReceiver::IncomingPacket(const uint8_t* incomingPayload, |
394 size_t payloadLength, | 374 size_t payloadLength, |
395 const WebRtcRTPHeader& rtpInfo) { | 375 const WebRtcRTPHeader& rtpInfo) { |
396 if (rtpInfo.frameType == kVideoFrameKey) { | 376 if (rtpInfo.frameType == kVideoFrameKey) { |
397 TRACE_EVENT1("webrtc", "VCM::PacketKeyFrame", "seqnum", | 377 TRACE_EVENT1("webrtc", "VCM::PacketKeyFrame", "seqnum", |
398 rtpInfo.header.sequenceNumber); | 378 rtpInfo.header.sequenceNumber); |
399 } | 379 } |
400 if (incomingPayload == nullptr) { | 380 if (incomingPayload == nullptr) { |
401 // The jitter buffer doesn't handle non-zero payload lengths for packets | 381 // The jitter buffer doesn't handle non-zero payload lengths for packets |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, | 477 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, |
498 max_incomplete_time_ms); | 478 max_incomplete_time_ms); |
499 } | 479 } |
500 | 480 |
501 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { | 481 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { |
502 return _receiver.SetMinReceiverDelay(desired_delay_ms); | 482 return _receiver.SetMinReceiverDelay(desired_delay_ms); |
503 } | 483 } |
504 | 484 |
505 } // namespace vcm | 485 } // namespace vcm |
506 } // namespace webrtc | 486 } // namespace webrtc |
OLD | NEW |