| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 frame->CodecSpecific(), nullptr); | 299 frame->CodecSpecific(), nullptr); |
| 300 } | 300 } |
| 301 return Decode(*frame); | 301 return Decode(*frame); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void VideoReceiver::DecodingStopped() { | 304 void VideoReceiver::DecodingStopped() { |
| 305 // No further calls to Decode() will be made after this point. | 305 // No further calls to Decode() will be made after this point. |
| 306 // TODO(tommi): Make use of this to clarify and check threading model. | 306 // TODO(tommi): Make use of this to clarify and check threading model. |
| 307 } | 307 } |
| 308 | 308 |
| 309 int32_t VideoReceiver::RequestSliceLossIndication( | |
| 310 const uint64_t pictureID) const { | |
| 311 TRACE_EVENT1("webrtc", "RequestSLI", "picture_id", pictureID); | |
| 312 rtc::CritScope cs(&process_crit_); | |
| 313 if (_frameTypeCallback != nullptr) { | |
| 314 const int32_t ret = | |
| 315 _frameTypeCallback->SliceLossIndicationRequest(pictureID); | |
| 316 if (ret < 0) { | |
| 317 return ret; | |
| 318 } | |
| 319 } else { | |
| 320 return VCM_MISSING_CALLBACK; | |
| 321 } | |
| 322 return VCM_OK; | |
| 323 } | |
| 324 | |
| 325 int32_t VideoReceiver::RequestKeyFrame() { | 309 int32_t VideoReceiver::RequestKeyFrame() { |
| 326 TRACE_EVENT0("webrtc", "RequestKeyFrame"); | 310 TRACE_EVENT0("webrtc", "RequestKeyFrame"); |
| 327 rtc::CritScope cs(&process_crit_); | 311 rtc::CritScope cs(&process_crit_); |
| 328 if (_frameTypeCallback != nullptr) { | 312 if (_frameTypeCallback != nullptr) { |
| 329 const int32_t ret = _frameTypeCallback->RequestKeyFrame(); | 313 const int32_t ret = _frameTypeCallback->RequestKeyFrame(); |
| 330 if (ret < 0) { | 314 if (ret < 0) { |
| 331 return ret; | 315 return ret; |
| 332 } | 316 } |
| 333 _scheduleKeyRequest = false; | 317 _scheduleKeyRequest = false; |
| 334 } else { | 318 } else { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 345 _codecDataBase.GetDecoder(frame, &_decodedFrameCallback); | 329 _codecDataBase.GetDecoder(frame, &_decodedFrameCallback); |
| 346 if (decoder == nullptr) { | 330 if (decoder == nullptr) { |
| 347 return VCM_NO_CODEC_REGISTERED; | 331 return VCM_NO_CODEC_REGISTERED; |
| 348 } | 332 } |
| 349 // Decode a frame | 333 // Decode a frame |
| 350 int32_t ret = decoder->Decode(frame, clock_->TimeInMilliseconds()); | 334 int32_t ret = decoder->Decode(frame, clock_->TimeInMilliseconds()); |
| 351 | 335 |
| 352 // Check for failed decoding, run frame type request callback if needed. | 336 // Check for failed decoding, run frame type request callback if needed. |
| 353 bool request_key_frame = false; | 337 bool request_key_frame = false; |
| 354 if (ret < 0) { | 338 if (ret < 0) { |
| 355 if (ret == VCM_ERROR_REQUEST_SLI) { | 339 request_key_frame = true; |
| 356 return RequestSliceLossIndication( | |
| 357 _decodedFrameCallback.LastReceivedPictureID() + 1); | |
| 358 } else { | |
| 359 request_key_frame = true; | |
| 360 } | |
| 361 } else if (ret == VCM_REQUEST_SLI) { | |
| 362 ret = RequestSliceLossIndication( | |
| 363 _decodedFrameCallback.LastReceivedPictureID() + 1); | |
| 364 } | 340 } |
| 341 |
| 365 if (!frame.Complete() || frame.MissingFrame()) { | 342 if (!frame.Complete() || frame.MissingFrame()) { |
| 366 request_key_frame = true; | 343 request_key_frame = true; |
| 367 ret = VCM_OK; | 344 ret = VCM_OK; |
| 368 } | 345 } |
| 369 if (request_key_frame) { | 346 if (request_key_frame) { |
| 370 rtc::CritScope cs(&process_crit_); | 347 rtc::CritScope cs(&process_crit_); |
| 371 _scheduleKeyRequest = true; | 348 _scheduleKeyRequest = true; |
| 372 } | 349 } |
| 373 return ret; | 350 return ret; |
| 374 } | 351 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, | 497 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, |
| 521 max_incomplete_time_ms); | 498 max_incomplete_time_ms); |
| 522 } | 499 } |
| 523 | 500 |
| 524 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { | 501 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { |
| 525 return _receiver.SetMinReceiverDelay(desired_delay_ms); | 502 return _receiver.SetMinReceiverDelay(desired_delay_ms); |
| 526 } | 503 } |
| 527 | 504 |
| 528 } // namespace vcm | 505 } // namespace vcm |
| 529 } // namespace webrtc | 506 } // namespace webrtc |
| OLD | NEW |