Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Remove unnecassary parameter "sampleRate" for loadAudioResource().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
[email protected] committed Mar 13, 2014
1 parent 22df2b2 commit 33fcc33
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Kaustubh Atrawalkar <[email protected]>
Kaustubh Atrawalkar <[email protected]>
Keene Pan <[email protected]>
Kenneth Rohde Christiansen <[email protected]>
Keonho Kim <[email protected]>
Kevin Lee Helpingstine <[email protected]>
Kevin M. McCormick <[email protected]>
Kihong Kwon <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion content/renderer/media/android/audio_decoder_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<ThreadSafeSender> sender) {
// Try to decode the data as a WAVE file first. If it can't be
// decoded, use MediaCodec. See crbug.com/259048.
Expand Down
1 change: 0 additions & 1 deletion content/renderer/media/android/audio_decoder_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace content {
bool DecodeAudioFileData(blink::WebAudioBus* destination_bus,
const char* data,
size_t data_size,
double sample_rate,
scoped_refptr<ThreadSafeSender> sender);

} // namespace content
Expand Down
2 changes: 1 addition & 1 deletion content/renderer/media/audio_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion content/renderer/media/audio_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 17 additions & 2 deletions content/renderer/renderer_webkitplatformsupport_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions content/renderer/renderer_webkitplatformsupport_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 33fcc33

Please sign in to comment.