OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // -audio_frame : an audio frame were output data and | 73 // -audio_frame : an audio frame were output data and |
74 // associated parameters are written to. | 74 // associated parameters are written to. |
75 // -muted : if true, the sample data in audio_frame is not | 75 // -muted : if true, the sample data in audio_frame is not |
76 // populated, and must be interpreted as all zero. | 76 // populated, and must be interpreted as all zero. |
77 // | 77 // |
78 // Return value : 0 if OK. | 78 // Return value : 0 if OK. |
79 // -1 if NetEq returned an error. | 79 // -1 if NetEq returned an error. |
80 // | 80 // |
81 int GetAudio(int desired_freq_hz, AudioFrame* audio_frame, bool* muted); | 81 int GetAudio(int desired_freq_hz, AudioFrame* audio_frame, bool* muted); |
82 | 82 |
83 // | |
84 // Adds a new codec to the NetEq codec database. | |
85 // | |
86 // Input: | |
87 // - acm_codec_id : ACM codec ID; -1 means external decoder. | |
88 // - payload_type : payload type. | |
89 // - sample_rate_hz : sample rate. | |
90 // - audio_decoder : pointer to a decoder object. If it's null, then | |
91 // NetEq will internally create a decoder object | |
92 // based on the value of |acm_codec_id| (which | |
93 // mustn't be -1). Otherwise, NetEq will use the | |
94 // given decoder for the given payload type. NetEq | |
95 // won't take ownership of the decoder; it's up to | |
96 // the caller to delete it when it's no longer | |
97 // needed. | |
98 // | |
99 // Providing an existing decoder object here is | |
100 // necessary for external decoders, but may also be | |
101 // used for built-in decoders if NetEq doesn't have | |
102 // all the info it needs to construct them properly | |
103 // (e.g. iSAC, where the decoder needs to be paired | |
104 // with an encoder). | |
105 // | |
106 // Return value : 0 if OK. | |
107 // <0 if NetEq returned an error. | |
108 // | |
109 int AddCodec(int acm_codec_id, | |
110 uint8_t payload_type, | |
111 size_t channels, | |
112 int sample_rate_hz, | |
113 AudioDecoder* audio_decoder, | |
114 const std::string& name); | |
115 | |
116 // Adds a new decoder to the NetEq codec database. Returns true iff | 83 // Adds a new decoder to the NetEq codec database. Returns true iff |
117 // successful. | 84 // successful. |
118 bool AddCodec(int rtp_payload_type, const SdpAudioFormat& audio_format); | 85 bool AddCodec(int rtp_payload_type, const SdpAudioFormat& audio_format); |
119 | 86 |
120 // | 87 // |
121 // Sets a minimum delay for packet buffer. The given delay is maintained, | 88 // Sets a minimum delay for packet buffer. The given delay is maintained, |
122 // unless channel condition dictates a higher delay. | 89 // unless channel condition dictates a higher delay. |
123 // | 90 // |
124 // Input: | 91 // Input: |
125 // - delay_ms : minimum delay in milliseconds. | 92 // - delay_ms : minimum delay in milliseconds. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 Clock* clock_; // TODO(henrik.lundin) Make const if possible. | 250 Clock* clock_; // TODO(henrik.lundin) Make const if possible. |
284 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); | 251 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); |
285 rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_); | 252 rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_); |
286 }; | 253 }; |
287 | 254 |
288 } // namespace acm2 | 255 } // namespace acm2 |
289 | 256 |
290 } // namespace webrtc | 257 } // namespace webrtc |
291 | 258 |
292 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVER_H_ | 259 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVER_H_ |
OLD | NEW |