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 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 PCMFile(); | 27 PCMFile(); |
28 PCMFile(uint32_t timestamp); | 28 PCMFile(uint32_t timestamp); |
29 ~PCMFile(); | 29 ~PCMFile(); |
30 | 30 |
31 void Open(const std::string& filename, uint16_t frequency, const char* mode, | 31 void Open(const std::string& filename, uint16_t frequency, const char* mode, |
32 bool auto_rewind = false); | 32 bool auto_rewind = false); |
33 | 33 |
34 int32_t Read10MsData(AudioFrame& audio_frame); | 34 int32_t Read10MsData(AudioFrame& audio_frame); |
35 | 35 |
36 void Write10MsData(int16_t *playout_buffer, size_t length_smpls); | 36 void Write10MsData(const int16_t *playout_buffer, size_t length_smpls); |
37 void Write10MsData(AudioFrame& audio_frame); | 37 void Write10MsData(const AudioFrame& audio_frame); |
38 | 38 |
39 uint16_t PayloadLength10Ms() const; | 39 uint16_t PayloadLength10Ms() const; |
40 int32_t SamplingFrequency() const; | 40 int32_t SamplingFrequency() const; |
41 void Close(); | 41 void Close(); |
42 bool EndOfFile() const { | 42 bool EndOfFile() const { |
43 return end_of_file_; | 43 return end_of_file_; |
44 } | 44 } |
45 // Moves forward the specified number of 10 ms blocks. If a limit has been set | 45 // Moves forward the specified number of 10 ms blocks. If a limit has been set |
46 // with SetNum10MsBlocksToRead, fast-forwarding does not count towards this | 46 // with SetNum10MsBlocksToRead, fast-forwarding does not count towards this |
47 // limit. | 47 // limit. |
(...skipping 19 matching lines...) Expand all Loading... |
67 uint32_t timestamp_; | 67 uint32_t timestamp_; |
68 bool read_stereo_; | 68 bool read_stereo_; |
69 bool save_stereo_; | 69 bool save_stereo_; |
70 rtc::Optional<int> num_10ms_blocks_to_read_; | 70 rtc::Optional<int> num_10ms_blocks_to_read_; |
71 int blocks_read_ = 0; | 71 int blocks_read_ = 0; |
72 }; | 72 }; |
73 | 73 |
74 } // namespace webrtc | 74 } // namespace webrtc |
75 | 75 |
76 #endif // WEBRTC_MODULES_AUDIO_CODING_TEST_PCMFILE_H_ | 76 #endif // WEBRTC_MODULES_AUDIO_CODING_TEST_PCMFILE_H_ |
OLD | NEW |