Chromium Code Reviews| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 _bitStreamBeforeDecoder(NULL), | 42 _bitStreamBeforeDecoder(NULL), |
| 43 #endif | 43 #endif |
| 44 _frameFromFile(), | 44 _frameFromFile(), |
| 45 _scheduleKeyRequest(false), | 45 _scheduleKeyRequest(false), |
| 46 drop_frames_until_keyframe_(false), | 46 drop_frames_until_keyframe_(false), |
| 47 max_nack_list_size_(0), | 47 max_nack_list_size_(0), |
| 48 _codecDataBase(nullptr, nullptr), | 48 _codecDataBase(nullptr, nullptr), |
| 49 pre_decode_image_callback_(NULL), | 49 pre_decode_image_callback_(NULL), |
| 50 _receiveStatsTimer(1000, clock_), | 50 _receiveStatsTimer(1000, clock_), |
| 51 _retransmissionTimer(10, clock_), | 51 _retransmissionTimer(10, clock_), |
| 52 _keyRequestTimer(500, clock_) { | 52 _keyRequestTimer(500, clock_), |
| 53 received_first_frame_(false) { | |
| 53 assert(clock_); | 54 assert(clock_); |
| 54 #ifdef DEBUG_DECODER_BIT_STREAM | 55 #ifdef DEBUG_DECODER_BIT_STREAM |
| 55 _bitStreamBeforeDecoder = fopen("decoderBitStream.bit", "wb"); | 56 _bitStreamBeforeDecoder = fopen("decoderBitStream.bit", "wb"); |
| 56 #endif | 57 #endif |
| 57 } | 58 } |
| 58 | 59 |
| 59 VideoReceiver::~VideoReceiver() { | 60 VideoReceiver::~VideoReceiver() { |
| 60 delete _receiveCritSect; | 61 delete _receiveCritSect; |
| 61 #ifdef DEBUG_DECODER_BIT_STREAM | 62 #ifdef DEBUG_DECODER_BIT_STREAM |
| 62 fclose(_bitStreamBeforeDecoder); | 63 fclose(_bitStreamBeforeDecoder); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 | 304 |
| 304 #ifdef DEBUG_DECODER_BIT_STREAM | 305 #ifdef DEBUG_DECODER_BIT_STREAM |
| 305 if (_bitStreamBeforeDecoder != NULL) { | 306 if (_bitStreamBeforeDecoder != NULL) { |
| 306 // Write bit stream to file for debugging purposes | 307 // Write bit stream to file for debugging purposes |
| 307 if (fwrite(frame->Buffer(), 1, frame->Length(), _bitStreamBeforeDecoder) != | 308 if (fwrite(frame->Buffer(), 1, frame->Length(), _bitStreamBeforeDecoder) != |
| 308 frame->Length()) { | 309 frame->Length()) { |
| 309 return -1; | 310 return -1; |
| 310 } | 311 } |
| 311 } | 312 } |
| 312 #endif | 313 #endif |
| 314 | |
| 315 if (!received_first_frame_) { | |
| 316 received_first_frame_ = true; | |
| 317 LOG(LS_INFO) << "First decodable video frame received, complete = " << | |
| 318 (frame->Complete() ? "true" : "false"); | |
|
pthatcher1
2016/03/05 01:17:05
And here :) "Received first ...
skvlad
2016/03/07 19:36:53
Done.
| |
| 319 } | |
| 320 | |
| 313 const int32_t ret = Decode(*frame); | 321 const int32_t ret = Decode(*frame); |
| 314 _receiver.ReleaseFrame(frame); | 322 _receiver.ReleaseFrame(frame); |
| 315 return ret; | 323 return ret; |
| 316 } | 324 } |
| 317 | 325 |
| 318 int32_t VideoReceiver::RequestSliceLossIndication( | 326 int32_t VideoReceiver::RequestSliceLossIndication( |
| 319 const uint64_t pictureID) const { | 327 const uint64_t pictureID) const { |
| 320 TRACE_EVENT1("webrtc", "RequestSLI", "picture_id", pictureID); | 328 TRACE_EVENT1("webrtc", "RequestSLI", "picture_id", pictureID); |
| 321 CriticalSectionScoped cs(process_crit_sect_.get()); | 329 CriticalSectionScoped cs(process_crit_sect_.get()); |
| 322 if (_frameTypeCallback != NULL) { | 330 if (_frameTypeCallback != NULL) { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 527 } | 535 } |
| 528 | 536 |
| 529 void VideoReceiver::RegisterPreDecodeImageCallback( | 537 void VideoReceiver::RegisterPreDecodeImageCallback( |
| 530 EncodedImageCallback* observer) { | 538 EncodedImageCallback* observer) { |
| 531 CriticalSectionScoped cs(_receiveCritSect); | 539 CriticalSectionScoped cs(_receiveCritSect); |
| 532 pre_decode_image_callback_ = observer; | 540 pre_decode_image_callback_ = observer; |
| 533 } | 541 } |
| 534 | 542 |
| 535 } // namespace vcm | 543 } // namespace vcm |
| 536 } // namespace webrtc | 544 } // namespace webrtc |
| OLD | NEW |