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

Side by Side Diff: content/renderer/media/audio_decoder.cc

Issue 195043002: Remove unnecassary parameter "sampleRate" for loadAudioResource(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/audio_decoder.h" 5 #include "content/renderer/media/audio_decoder.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "media/base/audio_bus.h" 12 #include "media/base/audio_bus.h"
13 #include "media/base/limits.h" 13 #include "media/base/limits.h"
14 #include "media/filters/audio_file_reader.h" 14 #include "media/filters/audio_file_reader.h"
15 #include "media/filters/in_memory_url_protocol.h" 15 #include "media/filters/in_memory_url_protocol.h"
16 #include "third_party/WebKit/public/platform/WebAudioBus.h" 16 #include "third_party/WebKit/public/platform/WebAudioBus.h"
17 17
18 using media::AudioBus; 18 using media::AudioBus;
19 using media::AudioFileReader; 19 using media::AudioFileReader;
20 using media::InMemoryUrlProtocol; 20 using media::InMemoryUrlProtocol;
21 using std::vector; 21 using std::vector;
22 using blink::WebAudioBus; 22 using blink::WebAudioBus;
23 23
24 namespace content { 24 namespace content {
25 25
26 // Decode in-memory audio file data. 26 // Decode in-memory audio file data.
27 bool DecodeAudioFileData( 27 bool DecodeAudioFileData(
28 blink::WebAudioBus* destination_bus, 28 blink::WebAudioBus* destination_bus,
29 const char* data, size_t data_size, double sample_rate) { 29 const char* data, size_t data_size) {
30 DCHECK(destination_bus); 30 DCHECK(destination_bus);
31 if (!destination_bus) 31 if (!destination_bus)
32 return false; 32 return false;
33 33
34 // Uses the FFmpeg library for audio file reading. 34 // Uses the FFmpeg library for audio file reading.
35 InMemoryUrlProtocol url_protocol(reinterpret_cast<const uint8*>(data), 35 InMemoryUrlProtocol url_protocol(reinterpret_cast<const uint8*>(data),
36 data_size, false); 36 data_size, false);
37 AudioFileReader reader(&url_protocol); 37 AudioFileReader reader(&url_protocol);
38 38
39 if (!reader.Open()) 39 if (!reader.Open())
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 << " data size: " << data_size 85 << " data size: " << data_size
86 << " duration: " << duration 86 << " duration: " << duration
87 << " number of frames: " << actual_frames 87 << " number of frames: " << actual_frames
88 << " sample rate: " << file_sample_rate 88 << " sample rate: " << file_sample_rate
89 << " number of channels: " << number_of_channels; 89 << " number of channels: " << number_of_channels;
90 90
91 return actual_frames > 0; 91 return actual_frames > 0;
92 } 92 }
93 93
94 } // namespace content 94 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_decoder.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698