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

Unified Diff: chrome/browser/media/webrtc_browsertest_audio.cc

Issue 1453233002: Improve input handling for WaveAudioHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: More comments, more test cases. Created 5 years, 1 month 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
« no previous file with comments | « no previous file | media/audio/BUILD.gn » ('j') | media/audio/simple_sources.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc_browsertest_audio.cc
diff --git a/chrome/browser/media/webrtc_browsertest_audio.cc b/chrome/browser/media/webrtc_browsertest_audio.cc
index 1f7defec05711daa6034e78cbd1967d0ab2bfd3c..670a2b4d90027e9e53a3000dce870808b5a5671f 100644
--- a/chrome/browser/media/webrtc_browsertest_audio.cc
+++ b/chrome/browser/media/webrtc_browsertest_audio.cc
@@ -37,18 +37,6 @@ scoped_ptr<uint8[]> ReadWavFile(const base::FilePath& wav_filename,
*file_length = wav_file_length;
return scoped_ptr<uint8[]>(wav_file_data);
}
-
-scoped_ptr<media::WavAudioHandler> CreateWavAudioHandler(
- const base::FilePath& wav_filename, const uint8* wav_file_data,
- size_t wav_file_length) {
- base::StringPiece wav_data(reinterpret_cast<const char*>(wav_file_data),
- wav_file_length);
- scoped_ptr<media::WavAudioHandler> wav_audio_handler(
- new media::WavAudioHandler(wav_data));
-
- return wav_audio_handler.Pass();
-}
-
} // namespace
namespace test {
@@ -58,8 +46,8 @@ float ComputeAudioEnergyForWavFile(const base::FilePath& wav_filename,
// Read the file, and put its data in a scoped_ptr so it gets deleted later.
size_t file_length = 0;
scoped_ptr<uint8[]> wav_file_data = ReadWavFile(wav_filename, &file_length);
- scoped_ptr<media::WavAudioHandler> wav_audio_handler = CreateWavAudioHandler(
- wav_filename, wav_file_data.get(), file_length);
+ auto wav_audio_handler = media::WavAudioHandler::Create(base::StringPiece(
+ reinterpret_cast<const char*>(wav_file_data), file_length));
scoped_ptr<media::AudioBus> audio_bus = media::AudioBus::Create(
wav_audio_handler->num_channels(), wav_audio_handler->total_frames());
« no previous file with comments | « no previous file | media/audio/BUILD.gn » ('j') | media/audio/simple_sources.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698