OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Allow wrap-around of value in counter below. | 116 // Allow wrap-around of value in counter below. |
117 for (size_t i = 0; i != payload.size(); ++i, ++value) { | 117 for (size_t i = 0; i != payload.size(); ++i, ++value) { |
118 payload[i] = value; | 118 payload[i] = value; |
119 } | 119 } |
120 return payload; | 120 return payload; |
121 }; | 121 }; |
122 | 122 |
123 const auto results = LegacyEncodedAudioFrame::SplitBySamples( | 123 const auto results = LegacyEncodedAudioFrame::SplitBySamples( |
124 nullptr, | 124 nullptr, |
125 generate_payload(expected_split.payload_size_ms * bytes_per_ms_), | 125 generate_payload(expected_split.payload_size_ms * bytes_per_ms_), |
126 kBaseTimestamp, true, bytes_per_ms_, samples_per_ms_); | 126 kBaseTimestamp, bytes_per_ms_, samples_per_ms_); |
127 | 127 |
128 EXPECT_EQ(expected_split.num_frames, results.size()); | 128 EXPECT_EQ(expected_split.num_frames, results.size()); |
129 uint32_t expected_timestamp = kBaseTimestamp; | 129 uint32_t expected_timestamp = kBaseTimestamp; |
130 uint32_t expected_byte_offset = 0; | 130 uint32_t expected_byte_offset = 0; |
131 uint8_t value = 0; | 131 uint8_t value = 0; |
132 for (size_t i = 0; i != expected_split.num_frames; ++i) { | 132 for (size_t i = 0; i != expected_split.num_frames; ++i) { |
133 const auto& result = results[i]; | 133 const auto& result = results[i]; |
134 const LegacyEncodedAudioFrame* frame = | 134 const LegacyEncodedAudioFrame* frame = |
135 static_cast<const LegacyEncodedAudioFrame*>(result.frame.get()); | 135 static_cast<const LegacyEncodedAudioFrame*>(result.frame.get()); |
136 const size_t length_bytes = expected_split.frame_sizes[i] * bytes_per_ms_; | 136 const size_t length_bytes = expected_split.frame_sizes[i] * bytes_per_ms_; |
(...skipping 23 matching lines...) Expand all Loading... |
160 NetEqDecoder::kDecoderPCM16Bwb, | 160 NetEqDecoder::kDecoderPCM16Bwb, |
161 NetEqDecoder::kDecoderPCM16Bswb32kHz, | 161 NetEqDecoder::kDecoderPCM16Bswb32kHz, |
162 NetEqDecoder::kDecoderPCM16Bswb48kHz, | 162 NetEqDecoder::kDecoderPCM16Bswb48kHz, |
163 NetEqDecoder::kDecoderPCM16B_2ch, | 163 NetEqDecoder::kDecoderPCM16B_2ch, |
164 NetEqDecoder::kDecoderPCM16Bwb_2ch, | 164 NetEqDecoder::kDecoderPCM16Bwb_2ch, |
165 NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch, | 165 NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch, |
166 NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch, | 166 NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch, |
167 NetEqDecoder::kDecoderPCM16B_5ch)); | 167 NetEqDecoder::kDecoderPCM16B_5ch)); |
168 | 168 |
169 } // namespace webrtc | 169 } // namespace webrtc |
OLD | NEW |