OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
11 #include "webrtc/modules/audio_coding/neteq/tools/constant_pcm_packet_source.h" | 11 #include "webrtc/modules/audio_coding/neteq/tools/constant_pcm_packet_source.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 | 14 |
| 15 #include "webrtc/base/checks.h" |
15 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" | 16 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" |
16 #include "webrtc/modules/audio_coding/neteq/tools/packet.h" | 17 #include "webrtc/modules/audio_coding/neteq/tools/packet.h" |
17 #include "webrtc/rtc_base/checks.h" | |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 namespace test { | 20 namespace test { |
21 | 21 |
22 ConstantPcmPacketSource::ConstantPcmPacketSource(size_t payload_len_samples, | 22 ConstantPcmPacketSource::ConstantPcmPacketSource(size_t payload_len_samples, |
23 int16_t sample_value, | 23 int16_t sample_value, |
24 int sample_rate_hz, | 24 int sample_rate_hz, |
25 int payload_type) | 25 int payload_type) |
26 : payload_len_samples_(payload_len_samples), | 26 : payload_len_samples_(payload_len_samples), |
27 packet_len_bytes_(2 * payload_len_samples_ + kHeaderLenBytes), | 27 packet_len_bytes_(2 * payload_len_samples_ + kHeaderLenBytes), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 packet_memory[8] = payload_ssrc_ >> 24; | 61 packet_memory[8] = payload_ssrc_ >> 24; |
62 packet_memory[9] = (payload_ssrc_ >> 16) & 0xFF; | 62 packet_memory[9] = (payload_ssrc_ >> 16) & 0xFF; |
63 packet_memory[10] = (payload_ssrc_ >> 8) & 0xFF; | 63 packet_memory[10] = (payload_ssrc_ >> 8) & 0xFF; |
64 packet_memory[11] = payload_ssrc_ & 0xFF; | 64 packet_memory[11] = payload_ssrc_ & 0xFF; |
65 ++seq_number_; | 65 ++seq_number_; |
66 timestamp_ += static_cast<uint32_t>(payload_len_samples_); | 66 timestamp_ += static_cast<uint32_t>(payload_len_samples_); |
67 } | 67 } |
68 | 68 |
69 } // namespace test | 69 } // namespace test |
70 } // namespace webrtc | 70 } // namespace webrtc |
OLD | NEW |