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.picture_id; |
| 68 } else { |
| 69 return kNoPictureId; |
| 70 } |
66 } | 71 } |
67 | 72 |
68 int VCMSessionInfo::TemporalId() const { | 73 int VCMSessionInfo::TemporalId() const { |
69 if (packets_.empty() || | 74 if (packets_.empty()) |
70 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | |
71 return kNoTemporalIdx; | 75 return kNoTemporalIdx; |
72 return packets_.front().codecSpecificHeader.codecHeader.VP8.temporalIdx; | 76 if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp8) { |
| 77 return packets_.front().codecSpecificHeader.codecHeader.VP8.temporalIdx; |
| 78 } else if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp9) { |
| 79 return packets_.front().codecSpecificHeader.codecHeader.VP9.temporal_idx; |
| 80 } else { |
| 81 return kNoTemporalIdx; |
| 82 } |
73 } | 83 } |
74 | 84 |
75 bool VCMSessionInfo::LayerSync() const { | 85 bool VCMSessionInfo::LayerSync() const { |
76 if (packets_.empty() || | 86 if (packets_.empty()) |
77 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | |
78 return false; | 87 return false; |
79 return packets_.front().codecSpecificHeader.codecHeader.VP8.layerSync; | 88 if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp8) { |
| 89 return packets_.front().codecSpecificHeader.codecHeader.VP8.layerSync; |
| 90 } else if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp9) { |
| 91 return |
| 92 packets_.front().codecSpecificHeader.codecHeader.VP9.temporal_up_switch; |
| 93 } else { |
| 94 return false; |
| 95 } |
80 } | 96 } |
81 | 97 |
82 int VCMSessionInfo::Tl0PicId() const { | 98 int VCMSessionInfo::Tl0PicId() const { |
83 if (packets_.empty() || | 99 if (packets_.empty()) |
84 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | |
85 return kNoTl0PicIdx; | 100 return kNoTl0PicIdx; |
86 return packets_.front().codecSpecificHeader.codecHeader.VP8.tl0PicIdx; | 101 if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp8) { |
| 102 return packets_.front().codecSpecificHeader.codecHeader.VP8.tl0PicIdx; |
| 103 } else if (packets_.front().codecSpecificHeader.codec == kRtpVideoVp9) { |
| 104 return packets_.front().codecSpecificHeader.codecHeader.VP9.tl0_pic_idx; |
| 105 } else { |
| 106 return kNoTl0PicIdx; |
| 107 } |
87 } | 108 } |
88 | 109 |
89 bool VCMSessionInfo::NonReference() const { | 110 bool VCMSessionInfo::NonReference() const { |
90 if (packets_.empty() || | 111 if (packets_.empty() || |
91 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) | 112 packets_.front().codecSpecificHeader.codec != kRtpVideoVp8) |
92 return false; | 113 return false; |
93 return packets_.front().codecSpecificHeader.codecHeader.VP8.nonReference; | 114 return packets_.front().codecSpecificHeader.codecHeader.VP8.nonReference; |
94 } | 115 } |
95 | 116 |
96 void VCMSessionInfo::Reset() { | 117 void VCMSessionInfo::Reset() { |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 if (empty_seq_num_high_ == -1) | 551 if (empty_seq_num_high_ == -1) |
531 empty_seq_num_high_ = seq_num; | 552 empty_seq_num_high_ = seq_num; |
532 else | 553 else |
533 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); | 554 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); |
534 if (empty_seq_num_low_ == -1 || IsNewerSequenceNumber(empty_seq_num_low_, | 555 if (empty_seq_num_low_ == -1 || IsNewerSequenceNumber(empty_seq_num_low_, |
535 seq_num)) | 556 seq_num)) |
536 empty_seq_num_low_ = seq_num; | 557 empty_seq_num_low_ = seq_num; |
537 } | 558 } |
538 | 559 |
539 } // namespace webrtc | 560 } // namespace webrtc |
OLD | NEW |