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

Side by Side Diff: media/audio/audio_util.h

Issue 5550006: Implement WebKitClientImpl::loadAudioResource() to decode in-memory audio fil... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years 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 | « no previous file | media/audio/audio_util.cc » ('j') | media/filters/audio_file_reader.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
scherkus (not reviewing) 2010/12/11 02:31:12 copyright year
Chris Rogers 2010/12/13 20:25:27 Done.
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 #ifndef MEDIA_AUDIO_AUDIO_UTIL_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_UTIL_H_
6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ 6 #define MEDIA_AUDIO_AUDIO_UTIL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "media/ffmpeg/ffmpeg_common.h"
9 10
10 namespace media { 11 namespace media {
11 12
12 // For all audio functions 3 audio formats are supported: 13 // For all audio functions 3 audio formats are supported:
13 // 8 bits unsigned 0 to 255. 14 // 8 bits unsigned 0 to 255.
14 // 16 bit signed (little endian). 15 // 16 bit signed (little endian).
15 // 32 bit signed (little endian) 16 // 32 bit signed (little endian)
16 17
17 // AdjustVolume() does a software volume adjustment of a sample buffer. 18 // AdjustVolume() does a software volume adjustment of a sample buffer.
18 // The samples are multiplied by the volume, which should range from 19 // The samples are multiplied by the volume, which should range from
(...skipping 23 matching lines...) Expand all
42 // since clamping is performed a value of more than 1 is allowed to increase 43 // since clamping is performed a value of more than 1 is allowed to increase
43 // volume. 44 // volume.
44 // The buffer is modified in-place to avoid memory management, as this 45 // The buffer is modified in-place to avoid memory management, as this
45 // function may be called in performance critical code. 46 // function may be called in performance critical code.
46 bool FoldChannels(void* buf, 47 bool FoldChannels(void* buf,
47 size_t buflen, 48 size_t buflen,
48 int channels, 49 int channels,
49 int bytes_per_sample, 50 int bytes_per_sample,
50 float volume); 51 float volume);
51 52
53 // DeinterleaveAudioChannel() takes interleaved audio buffer |source|
54 // of the given |sample_fmt| and |number_of_channels| and extracts
55 // |number_of_frames| data for the given |channel_index| and
56 // puts it in the floating point |destination|.
57 // It returns |true| on success, or |false| if the |sample_fmt| is
58 // not recognized.
59 bool DeinterleaveAudioChannel(void* source,
60 float* destination,
61 AVSampleFormat sample_fmt,
scherkus (not reviewing) 2010/12/11 02:31:12 similar to the other functions you should remove t
Chris Rogers 2010/12/13 20:25:27 Done.
62 size_t number_of_channels,
scherkus (not reviewing) 2010/12/11 02:31:12 for the sake of API consistency I'd recommend we r
Chris Rogers 2010/12/13 20:25:27 Done.
63 unsigned channel_index,
64 unsigned number_of_frames);
65
52 } // namespace media 66 } // namespace media
53 67
54 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ 68 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_util.cc » ('j') | media/filters/audio_file_reader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698