Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: webrtc/modules/media_file/media_file_impl.cc

Issue 2790493004: Supporting 48kHz PCM file. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/media_file/media_file_impl.cc
diff --git a/webrtc/modules/media_file/media_file_impl.cc b/webrtc/modules/media_file/media_file_impl.cc
index e35626c76068d13574d2f4a27402b20dabe1021e..88310a5ef6d0ed01f1bf013325939a92cf4575de 100644
--- a/webrtc/modules/media_file/media_file_impl.cc
+++ b/webrtc/modules/media_file/media_file_impl.cc
@@ -132,6 +132,7 @@ int32_t MediaFileImpl::PlayoutAudioData(int8_t* buffer,
switch(_fileFormat)
{
+ case kFileFormatPcm48kHzFile:
case kFileFormatPcm32kHzFile:
case kFileFormatPcm16kHzFile:
case kFileFormatPcm8kHzFile:
@@ -479,6 +480,7 @@ int32_t MediaFileImpl::StartPlayingStream(
case kFileFormatPcm8kHzFile:
case kFileFormatPcm16kHzFile:
case kFileFormatPcm32kHzFile:
+ case kFileFormatPcm48kHzFile:
{
// ValidFileFormat() called in the beginneing of this function
// prevents codecInst from being NULL here.
@@ -631,6 +633,7 @@ int32_t MediaFileImpl::IncomingAudioData(
case kFileFormatPcm8kHzFile:
case kFileFormatPcm16kHzFile:
case kFileFormatPcm32kHzFile:
+ case kFileFormatPcm48kHzFile:
bytesWritten = _ptrFileUtilityObj->WritePCMData(
*_ptrOutStream,
buffer,
@@ -845,13 +848,15 @@ int32_t MediaFileImpl::StartRecordingAudioStream(
}
case kFileFormatPcm8kHzFile:
case kFileFormatPcm16kHzFile:
+ case kFileFormatPcm32kHzFile:
+ case kFileFormatPcm48kHzFile:
{
if(!ValidFrequency(codecInst.plfreq) ||
_ptrFileUtilityObj->InitPCMWriting(stream, codecInst.plfreq) ==
-1)
{
WEBRTC_TRACE(kTraceError, kTraceFile, _id,
- "Failed to initialize 8 or 16KHz PCM file!");
+ "Failed to initialize PCM file!");
delete _ptrFileUtilityObj;
_ptrFileUtilityObj = NULL;
return -1;
@@ -1070,7 +1075,8 @@ bool MediaFileImpl::ValidFileFormat(const FileFormats format,
if(format == kFileFormatPreencodedFile ||
format == kFileFormatPcm8kHzFile ||
format == kFileFormatPcm16kHzFile ||
- format == kFileFormatPcm32kHzFile)
+ format == kFileFormatPcm32kHzFile ||
+ format == kFileFormatPcm48kHzFile)
{
WEBRTC_TRACE(kTraceError, kTraceFile, -1,
"Codec info required for file format specified!");
@@ -1115,12 +1121,12 @@ bool MediaFileImpl::ValidFilePositions(const uint32_t startPointMs,
bool MediaFileImpl::ValidFrequency(const uint32_t frequency)
{
- if((frequency == 8000) || (frequency == 16000)|| (frequency == 32000))
+ if((frequency == 8000) || (frequency == 16000)|| (frequency == 32000) || (frequency == 48000))
{
return true;
}
WEBRTC_TRACE(kTraceError, kTraceFile, -1,
- "Frequency should be 8000, 16000 or 32000 (Hz)");
+ "Frequency should be 8000, 16000, 32000, or 48000 (Hz)");
return false;
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698