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

Side by Side Diff: webkit/media/audio_decoder.cc

Issue 8570010: Moving media-related files from webkit/glue/ to webkit/media/. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: minor fixes Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/media/audio_decoder.h ('k') | webkit/media/buffered_data_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/glue/media/audio_decoder.h" 5 #include "webkit/media/audio_decoder.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "media/base/limits.h" 11 #include "media/base/limits.h"
12 #include "media/filters/audio_file_reader.h" 12 #include "media/filters/audio_file_reader.h"
13 #include "media/filters/in_memory_url_protocol.h" 13 #include "media/filters/in_memory_url_protocol.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioBus.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioBus.h"
15 15
16 using media::AudioFileReader; 16 using media::AudioFileReader;
17 using media::InMemoryUrlProtocol; 17 using media::InMemoryUrlProtocol;
18 using std::vector; 18 using std::vector;
19 using WebKit::WebAudioBus; 19 using WebKit::WebAudioBus;
20 20
21 namespace webkit_glue { 21 namespace webkit_media {
22 22
23 // Decode in-memory audio file data. 23 // Decode in-memory audio file data.
24 bool DecodeAudioFileData( 24 bool DecodeAudioFileData(
25 WebKit::WebAudioBus* destination_bus, 25 WebKit::WebAudioBus* destination_bus,
26 const char* data, size_t data_size, double sample_rate) { 26 const char* data, size_t data_size, double sample_rate) {
27 DCHECK(destination_bus); 27 DCHECK(destination_bus);
28 if (!destination_bus) 28 if (!destination_bus)
29 return false; 29 return false;
30 30
31 // Uses the FFmpeg library for audio file reading. 31 // Uses the FFmpeg library for audio file reading.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 vector<float*> audio_data; 77 vector<float*> audio_data;
78 audio_data.reserve(number_of_channels); 78 audio_data.reserve(number_of_channels);
79 for (size_t i = 0; i < number_of_channels; ++i) { 79 for (size_t i = 0; i < number_of_channels; ++i) {
80 audio_data.push_back(destination_bus->channelData(i)); 80 audio_data.push_back(destination_bus->channelData(i));
81 } 81 }
82 82
83 // Decode the audio file data. 83 // Decode the audio file data.
84 return reader.Read(audio_data, number_of_frames); 84 return reader.Read(audio_data, number_of_frames);
85 } 85 }
86 86
87 } // namespace webkit_glue 87 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/audio_decoder.h ('k') | webkit/media/buffered_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698