OLD | NEW |
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 "webkit/renderer/media/audio_decoder.h" | 5 #include "content/renderer/media/audio_decoder.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
| 8 |
8 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
10 #include "base/time.h" | 11 #include "base/time.h" |
11 #include "media/base/audio_bus.h" | 12 #include "media/base/audio_bus.h" |
12 #include "media/base/limits.h" | 13 #include "media/base/limits.h" |
13 #include "media/filters/audio_file_reader.h" | 14 #include "media/filters/audio_file_reader.h" |
14 #include "media/filters/in_memory_url_protocol.h" | 15 #include "media/filters/in_memory_url_protocol.h" |
15 #include "third_party/WebKit/public/platform/WebAudioBus.h" | 16 #include "third_party/WebKit/public/platform/WebAudioBus.h" |
16 | 17 |
17 using media::AudioBus; | 18 using media::AudioBus; |
18 using media::AudioFileReader; | 19 using media::AudioFileReader; |
19 using media::InMemoryUrlProtocol; | 20 using media::InMemoryUrlProtocol; |
20 using std::vector; | 21 using std::vector; |
21 using WebKit::WebAudioBus; | 22 using WebKit::WebAudioBus; |
22 | 23 |
23 namespace webkit_media { | 24 namespace content { |
24 | 25 |
25 // Decode in-memory audio file data. | 26 // Decode in-memory audio file data. |
26 bool DecodeAudioFileData( | 27 bool DecodeAudioFileData( |
27 WebKit::WebAudioBus* destination_bus, | 28 WebKit::WebAudioBus* destination_bus, |
28 const char* data, size_t data_size, double sample_rate) { | 29 const char* data, size_t data_size, double sample_rate) { |
29 DCHECK(destination_bus); | 30 DCHECK(destination_bus); |
30 if (!destination_bus) | 31 if (!destination_bus) |
31 return false; | 32 return false; |
32 | 33 |
33 // Uses the FFmpeg library for audio file reading. | 34 // Uses the FFmpeg library for audio file reading. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 << " data: " << data | 84 << " data: " << data |
84 << " data size: " << data_size | 85 << " data size: " << data_size |
85 << " duration: " << duration | 86 << " duration: " << duration |
86 << " number of frames: " << actual_frames | 87 << " number of frames: " << actual_frames |
87 << " sample rate: " << file_sample_rate | 88 << " sample rate: " << file_sample_rate |
88 << " number of channels: " << number_of_channels; | 89 << " number of channels: " << number_of_channels; |
89 | 90 |
90 return actual_frames > 0; | 91 return actual_frames > 0; |
91 } | 92 } |
92 | 93 |
93 } // namespace webkit_media | 94 } // namespace content |
OLD | NEW |