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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return kNoTl0PicIdx; | 104 return kNoTl0PicIdx; |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 bool VCMSessionInfo::NonReference() const { | 108 bool VCMSessionInfo::NonReference() const { |
109 if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp8) | 109 if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp8) |
110 return false; | 110 return false; |
111 return packets_.front().video_header.codecHeader.VP8.nonReference; | 111 return packets_.front().video_header.codecHeader.VP8.nonReference; |
112 } | 112 } |
113 | 113 |
| 114 std::vector<NaluInfo> VCMSessionInfo::GetNaluInfos() const { |
| 115 if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoH264) |
| 116 return std::vector<NaluInfo>(); |
| 117 std::vector<NaluInfo> nalu_infos; |
| 118 for (const VCMPacket& packet : packets_) { |
| 119 for (size_t i = 0; i < packet.video_header.codecHeader.H264.nalus_length; |
| 120 ++i) { |
| 121 nalu_infos.push_back(packet.video_header.codecHeader.H264.nalus[i]); |
| 122 } |
| 123 } |
| 124 return nalu_infos; |
| 125 } |
| 126 |
114 void VCMSessionInfo::SetGofInfo(const GofInfoVP9& gof_info, size_t idx) { | 127 void VCMSessionInfo::SetGofInfo(const GofInfoVP9& gof_info, size_t idx) { |
115 if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp9 || | 128 if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp9 || |
116 packets_.front().video_header.codecHeader.VP9.flexible_mode) { | 129 packets_.front().video_header.codecHeader.VP9.flexible_mode) { |
117 return; | 130 return; |
118 } | 131 } |
119 packets_.front().video_header.codecHeader.VP9.temporal_idx = | 132 packets_.front().video_header.codecHeader.VP9.temporal_idx = |
120 gof_info.temporal_idx[idx]; | 133 gof_info.temporal_idx[idx]; |
121 packets_.front().video_header.codecHeader.VP9.temporal_up_switch = | 134 packets_.front().video_header.codecHeader.VP9.temporal_up_switch = |
122 gof_info.temporal_up_switch[idx]; | 135 gof_info.temporal_up_switch[idx]; |
123 packets_.front().video_header.codecHeader.VP9.num_ref_pics = | 136 packets_.front().video_header.codecHeader.VP9.num_ref_pics = |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 if (empty_seq_num_high_ == -1) | 518 if (empty_seq_num_high_ == -1) |
506 empty_seq_num_high_ = seq_num; | 519 empty_seq_num_high_ = seq_num; |
507 else | 520 else |
508 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); | 521 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); |
509 if (empty_seq_num_low_ == -1 || | 522 if (empty_seq_num_low_ == -1 || |
510 IsNewerSequenceNumber(empty_seq_num_low_, seq_num)) | 523 IsNewerSequenceNumber(empty_seq_num_low_, seq_num)) |
511 empty_seq_num_low_ = seq_num; | 524 empty_seq_num_low_ = seq_num; |
512 } | 525 } |
513 | 526 |
514 } // namespace webrtc | 527 } // namespace webrtc |
OLD | NEW |