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

Side by Side Diff: services/media/audio/platform/generic/mixer.h

Issue 1471813002: Mix to an intermediate buffer. (Closed) Base URL: https://github.com/domokit/mojo.git@change7
Patch Set: Final rebase before landing Created 4 years, 10 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
« no previous file with comments | « services/media/audio/BUILD.gn ('k') | services/media/audio/platform/generic/mixer.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_MIXER_H_ 5 #ifndef SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_MIXER_H_
6 #define SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_MIXER_H_ 6 #define SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_MIXER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "mojo/services/media/common/interfaces/media_types.mojom.h" 10 #include "mojo/services/media/common/interfaces/media_types.mojom.h"
(...skipping 17 matching lines...) Expand all
28 // Select 28 // Select
29 // 29 //
30 // Select an appropriate instance of a mixer based on the properties of the 30 // Select an appropriate instance of a mixer based on the properties of the
31 // source and destination formats. 31 // source and destination formats.
32 // 32 //
33 // TODO(johngro): Come back here and add a way to indicate user preference 33 // TODO(johngro): Come back here and add a way to indicate user preference
34 // where appropriate. For example, where we might chose a linear 34 // where appropriate. For example, where we might chose a linear
35 // interpolation sampler, the user may actually prefer cubic interpolation, or 35 // interpolation sampler, the user may actually prefer cubic interpolation, or
36 // perhaps just a point sampler. 36 // perhaps just a point sampler.
37 static MixerPtr Select(const LpcmMediaTypeDetailsPtr& src_format, 37 static MixerPtr Select(const LpcmMediaTypeDetailsPtr& src_format,
38 const LpcmMediaTypeDetailsPtr& dst_format); 38 const LpcmMediaTypeDetailsPtr* dst_format);
39 39
40 // Mix 40 // Mix
41 // 41 //
42 // Perform a mixing operation from the source buffer into the destination 42 // Perform a mixing operation from the source buffer into the destination
43 // buffer. 43 // buffer.
44 // 44 //
45 // @param dst 45 // @param dst
46 // The pointer to the destination buffer into which frames will be mixed. 46 // The pointer to the destination buffer into which frames will be mixed.
47 // 47 //
48 // @param dst_frames 48 // @param dst_frames
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // output samples, then frac_step_size+1 for M samples, etc... 81 // output samples, then frac_step_size+1 for M samples, etc...
82 // 82 //
83 // @param accumulate 83 // @param accumulate
84 // When true, the mixer will accumulate into the destination buffer (read, 84 // When true, the mixer will accumulate into the destination buffer (read,
85 // sum, clip, write-back). When false, the mixer will simply replace the 85 // sum, clip, write-back). When false, the mixer will simply replace the
86 // destination buffer with its output. 86 // destination buffer with its output.
87 // 87 //
88 // @return True if the mixer is finished with this source data and will not 88 // @return True if the mixer is finished with this source data and will not
89 // need it in the future. False if the mixer has not consumed the entire 89 // need it in the future. False if the mixer has not consumed the entire
90 // source buffer and will need more of it in the future. 90 // source buffer and will need more of it in the future.
91 virtual bool Mix(void* dst, 91 virtual bool Mix(int32_t* dst,
92 uint32_t dst_frames, 92 uint32_t dst_frames,
93 uint32_t* dst_offset, 93 uint32_t* dst_offset,
94 const void* src, 94 const void* src,
95 uint32_t frac_src_frames, 95 uint32_t frac_src_frames,
96 int32_t* frac_src_offset, 96 int32_t* frac_src_offset,
97 uint32_t frac_step_size, 97 uint32_t frac_step_size,
98 bool accumulate) = 0; 98 bool accumulate) = 0;
99 99
100 // Reset 100 // Reset
101 // 101 //
(...skipping 23 matching lines...) Expand all
125 private: 125 private:
126 uint32_t pos_filter_width_; 126 uint32_t pos_filter_width_;
127 uint32_t neg_filter_width_; 127 uint32_t neg_filter_width_;
128 }; 128 };
129 129
130 } // namespace audio 130 } // namespace audio
131 } // namespace media 131 } // namespace media
132 } // namespace mojo 132 } // namespace mojo
133 133
134 #endif // SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_MIXER_H_ 134 #endif // SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_MIXER_H_
OLDNEW
« no previous file with comments | « services/media/audio/BUILD.gn ('k') | services/media/audio/platform/generic/mixer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698