Chromium Code Reviews| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 | 52 |
| 53 int VCMSessionInfo::HighSequenceNumber() const { | 53 int VCMSessionInfo::HighSequenceNumber() const { |
| 54 if (packets_.empty()) | 54 if (packets_.empty()) |
| 55 return empty_seq_num_high_; | 55 return empty_seq_num_high_; |
| 56 if (empty_seq_num_high_ == -1) | 56 if (empty_seq_num_high_ == -1) |
| 57 return packets_.back().seqNum; | 57 return packets_.back().seqNum; |
| 58 return LatestSequenceNumber(packets_.back().seqNum, empty_seq_num_high_); | 58 return LatestSequenceNumber(packets_.back().seqNum, empty_seq_num_high_); |
| 59 } | 59 } |
| 60 | 60 |
| 61 int VCMSessionInfo::PictureId() const { | 61 int VCMSessionInfo::PictureId() const { |
| 62 if (packets_.empty() || | 62 if (packets_.empty()) |
| 63 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | |
| 64 return kNoPictureId; | 63 return kNoPictureId; |
| 65 return packets_.front().codecSpecificHeader.codecHeader.VP8.pictureId; | 64 if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp8) |
| 65 return packets_.front().codecSpecificHeader.codecHeader.VP8.pictureId; | |
| 66 else if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp9) | |
| 67 return packets_.front().codecSpecificHeader.codecHeader.VP9.pictureId; | |
| 68 else | |
|
stefan-webrtc
2015/07/09 14:49:00
This starts to grow out of control... We should th
åsapersson
2015/07/29 12:10:13
Agree. Maybe in a separate cl.
| |
| 69 return kNoPictureId; | |
| 66 } | 70 } |
| 67 | 71 |
| 68 int VCMSessionInfo::TemporalId() const { | 72 int VCMSessionInfo::TemporalId() const { |
| 69 if (packets_.empty() || | 73 if (packets_.empty()) |
| 70 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | |
| 71 return kNoTemporalIdx; | 74 return kNoTemporalIdx; |
| 72 return packets_.front().codecSpecificHeader.codecHeader.VP8.temporalIdx; | 75 if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp8) |
| 76 return packets_.front().codecSpecificHeader.codecHeader.VP8.temporalIdx; | |
| 77 else if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp9) | |
| 78 return packets_.front().codecSpecificHeader.codecHeader.VP9.temporalIdx; | |
| 79 else | |
| 80 return kNoTemporalIdx; | |
| 73 } | 81 } |
| 74 | 82 |
| 75 bool VCMSessionInfo::LayerSync() const { | 83 bool VCMSessionInfo::LayerSync() const { |
| 76 if (packets_.empty() || | 84 if (packets_.empty() || |
| 77 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | 85 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) |
| 78 return false; | 86 return false; |
| 79 return packets_.front().codecSpecificHeader.codecHeader.VP8.layerSync; | 87 return packets_.front().codecSpecificHeader.codecHeader.VP8.layerSync; |
| 80 } | 88 } |
| 81 | 89 |
| 82 int VCMSessionInfo::Tl0PicId() const { | 90 int VCMSessionInfo::Tl0PicId() const { |
| 83 if (packets_.empty() || | 91 if (packets_.empty()) |
| 84 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | |
| 85 return kNoTl0PicIdx; | 92 return kNoTl0PicIdx; |
| 86 return packets_.front().codecSpecificHeader.codecHeader.VP8.tl0PicIdx; | 93 if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp8) |
| 94 return packets_.front().codecSpecificHeader.codecHeader.VP8.tl0PicIdx; | |
| 95 else if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp9) | |
| 96 return packets_.front().codecSpecificHeader.codecHeader.VP9.tl0PicIdx; | |
| 97 else | |
| 98 return kNoTl0PicIdx; | |
|
stefan-webrtc
2015/07/09 14:49:00
{} for all multi-line if-statements.
åsapersson
2015/07/29 12:10:13
Done.
| |
| 87 } | 99 } |
| 88 | 100 |
| 89 bool VCMSessionInfo::NonReference() const { | 101 bool VCMSessionInfo::NonReference() const { |
| 90 if (packets_.empty() || | 102 if (packets_.empty() || |
| 91 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | 103 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) |
| 92 return false; | 104 return false; |
| 93 return packets_.front().codecSpecificHeader.codecHeader.VP8.nonReference; | 105 return packets_.front().codecSpecificHeader.codecHeader.VP8.nonReference; |
| 94 } | 106 } |
| 95 | 107 |
| 96 void VCMSessionInfo::Reset() { | 108 void VCMSessionInfo::Reset() { |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 530 if (empty_seq_num_high_ == -1) | 542 if (empty_seq_num_high_ == -1) |
| 531 empty_seq_num_high_ = seq_num; | 543 empty_seq_num_high_ = seq_num; |
| 532 else | 544 else |
| 533 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); | 545 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); |
| 534 if (empty_seq_num_low_ == -1 || IsNewerSequenceNumber(empty_seq_num_low_, | 546 if (empty_seq_num_low_ == -1 || IsNewerSequenceNumber(empty_seq_num_low_, |
| 535 seq_num)) | 547 seq_num)) |
| 536 empty_seq_num_low_ = seq_num; | 548 empty_seq_num_low_ = seq_num; |
| 537 } | 549 } |
| 538 | 550 |
| 539 } // namespace webrtc | 551 } // namespace webrtc |
| OLD | NEW |