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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 233 } |
234 } | 234 } |
235 return 0; | 235 return 0; |
236 } | 236 } |
237 | 237 |
238 int32_t FileRecorderImpl::SetUpAudioEncoder() | 238 int32_t FileRecorderImpl::SetUpAudioEncoder() |
239 { | 239 { |
240 if (_fileFormat == kFileFormatPreencodedFile || | 240 if (_fileFormat == kFileFormatPreencodedFile || |
241 STR_CASE_CMP(codec_info_.plname, "L16") != 0) | 241 STR_CASE_CMP(codec_info_.plname, "L16") != 0) |
242 { | 242 { |
243 if(_audioEncoder.SetEncodeCodec(codec_info_,_amrFormat) == -1) | 243 if(_audioEncoder.SetEncodeCodec(codec_info_) == -1) |
244 { | 244 { |
245 LOG(LS_ERROR) << "SetUpAudioEncoder() codec " | 245 LOG(LS_ERROR) << "SetUpAudioEncoder() codec " |
246 << codec_info_.plname << " not supported."; | 246 << codec_info_.plname << " not supported."; |
247 return -1; | 247 return -1; |
248 } | 248 } |
249 } | 249 } |
250 return 0; | 250 return 0; |
251 } | 251 } |
252 | 252 |
253 int32_t FileRecorderImpl::codec_info(CodecInst& codecInst) const | 253 int32_t FileRecorderImpl::codec_info(CodecInst& codecInst) const |
254 { | 254 { |
255 if(codec_info_.plfreq == 0) | 255 if(codec_info_.plfreq == 0) |
256 { | 256 { |
257 return -1; | 257 return -1; |
258 } | 258 } |
259 codecInst = codec_info_; | 259 codecInst = codec_info_; |
260 return 0; | 260 return 0; |
261 } | 261 } |
262 | 262 |
263 int32_t FileRecorderImpl::WriteEncodedAudioData(const int8_t* audioBuffer, | 263 int32_t FileRecorderImpl::WriteEncodedAudioData(const int8_t* audioBuffer, |
264 size_t bufferLength) | 264 size_t bufferLength) |
265 { | 265 { |
266 return _moduleFile->IncomingAudioData(audioBuffer, bufferLength); | 266 return _moduleFile->IncomingAudioData(audioBuffer, bufferLength); |
267 } | 267 } |
268 } // namespace webrtc | 268 } // namespace webrtc |
OLD | NEW |