From 33fcc33ec9ef57d98a20911a6cd6f64f91a5d375 Mon Sep 17 00:00:00 2001 From: "keonho07.kim@samsung.com" Date: Thu, 13 Mar 2014 10:56:24 +0000 Subject: [PATCH] Remove unnecassary parameter "sampleRate" for loadAudioResource(). Parameter "sampleRate" is not required for loadAudioResource(). There is FIXME in AudioBus.cpp in blink FIXME: the sampleRate parameter is ignored. It should be removed from the API. It will be consist of 3 steps. 1. Removing "sampleRate" in chrome which is called by blink. (included deprecated method) https://codereview.chromium.org/195043002/ 2. Removing "sampleRate" in blink. https://codereview.chromium.org/194753005/ 3. Removing deprecated method from #1 BUG=351284 Review URL: https://codereview.chromium.org/195043002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256800 0039d316-1c4b-4281-b951-d872f2087c98 --- AUTHORS | 1 + .../media/android/audio_decoder_android.cc | 2 +- .../media/android/audio_decoder_android.h | 1 - content/renderer/media/audio_decoder.cc | 2 +- content/renderer/media/audio_decoder.h | 2 +- .../renderer_webkitplatformsupport_impl.cc | 19 +++++++++++++++++-- .../renderer_webkitplatformsupport_impl.h | 4 ++++ 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/AUTHORS b/AUTHORS index 17ced317e0f39..a4465c762fcc0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -170,6 +170,7 @@ Kaustubh Atrawalkar Kaustubh Atrawalkar Keene Pan Kenneth Rohde Christiansen +Keonho Kim Kevin Lee Helpingstine Kevin M. McCormick Kihong Kwon diff --git a/content/renderer/media/android/audio_decoder_android.cc b/content/renderer/media/android/audio_decoder_android.cc index bb3e7687a1413..21c978ebb8283 100644 --- a/content/renderer/media/android/audio_decoder_android.cc +++ b/content/renderer/media/android/audio_decoder_android.cc @@ -503,7 +503,7 @@ static bool TryWAVEFileDecoder(blink::WebAudioBus* destination_bus, // of a pipe. The MediaCodec class will decode the data from the // shared memory and write the PCM samples back to us over a pipe. bool DecodeAudioFileData(blink::WebAudioBus* destination_bus, const char* data, - size_t data_size, double sample_rate, + size_t data_size, scoped_refptr sender) { // Try to decode the data as a WAVE file first. If it can't be // decoded, use MediaCodec. See crbug.com/259048. diff --git a/content/renderer/media/android/audio_decoder_android.h b/content/renderer/media/android/audio_decoder_android.h index d2cac1575dfca..983e8b428504a 100644 --- a/content/renderer/media/android/audio_decoder_android.h +++ b/content/renderer/media/android/audio_decoder_android.h @@ -16,7 +16,6 @@ namespace content { bool DecodeAudioFileData(blink::WebAudioBus* destination_bus, const char* data, size_t data_size, - double sample_rate, scoped_refptr sender); } // namespace content diff --git a/content/renderer/media/audio_decoder.cc b/content/renderer/media/audio_decoder.cc index e853c24160b00..c413bb08020ae 100644 --- a/content/renderer/media/audio_decoder.cc +++ b/content/renderer/media/audio_decoder.cc @@ -26,7 +26,7 @@ namespace content { // Decode in-memory audio file data. bool DecodeAudioFileData( blink::WebAudioBus* destination_bus, - const char* data, size_t data_size, double sample_rate) { + const char* data, size_t data_size) { DCHECK(destination_bus); if (!destination_bus) return false; diff --git a/content/renderer/media/audio_decoder.h b/content/renderer/media/audio_decoder.h index 9c14ed9f5d559..454a80a1caf80 100644 --- a/content/renderer/media/audio_decoder.h +++ b/content/renderer/media/audio_decoder.h @@ -13,7 +13,7 @@ namespace content { // Decode in-memory audio file data. bool DecodeAudioFileData(blink::WebAudioBus* destination_bus, const char* data, - size_t data_size, double sample_rate); + size_t data_size); } // namespace content diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index 250c76919a840..c4b54dc3634ed 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -774,21 +774,36 @@ RendererWebKitPlatformSupportImpl::createAudioDevice( } #if defined(OS_ANDROID) +bool RendererWebKitPlatformSupportImpl::loadAudioResource( + blink::WebAudioBus* destination_bus, const char* audio_file_data, + size_t data_size) { + return DecodeAudioFileData(destination_bus, + audio_file_data, + data_size, + thread_safe_sender_); +} +// DEPRECATED bool RendererWebKitPlatformSupportImpl::loadAudioResource( blink::WebAudioBus* destination_bus, const char* audio_file_data, size_t data_size, double sample_rate) { return DecodeAudioFileData(destination_bus, audio_file_data, data_size, - sample_rate, thread_safe_sender_); } #else +bool RendererWebKitPlatformSupportImpl::loadAudioResource( + blink::WebAudioBus* destination_bus, const char* audio_file_data, + size_t data_size) { + return DecodeAudioFileData( + destination_bus, audio_file_data, data_size); +} +// DEPRECATED bool RendererWebKitPlatformSupportImpl::loadAudioResource( blink::WebAudioBus* destination_bus, const char* audio_file_data, size_t data_size, double sample_rate) { return DecodeAudioFileData( - destination_bus, audio_file_data, data_size, sample_rate); + destination_bus, audio_file_data, data_size); } #endif // defined(OS_ANDROID) diff --git a/content/renderer/renderer_webkitplatformsupport_impl.h b/content/renderer/renderer_webkitplatformsupport_impl.h index bfaaabcac0e4f..6b79f40f1bc18 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.h +++ b/content/renderer/renderer_webkitplatformsupport_impl.h @@ -116,6 +116,10 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl double sample_rate, blink::WebAudioDevice::RenderCallback* callback, const blink::WebString& input_device_id); + virtual bool loadAudioResource( + blink::WebAudioBus* destination_bus, const char* audio_file_data, + size_t data_size); + // DEPRECATED virtual bool loadAudioResource( blink::WebAudioBus* destination_bus, const char* audio_file_data, size_t data_size, double sample_rate);