Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SERVICES_MEDIA_FRAMEWORK_LPCM_UTIL_H_ | |
| 6 #define SERVICES_MEDIA_FRAMEWORK_LPCM_UTIL_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "services/media/framework/stream_type.h" | |
| 11 | |
| 12 namespace mojo { | |
| 13 namespace media { | |
| 14 | |
| 15 // Helper class that performs various LPCM processing functions. | |
| 16 class LpcmUtil { | |
|
jeffbrown
2016/02/02 05:35:46
Avoid "Util" or "Helper" types. Perhaps call this
| |
| 17 public: | |
| 18 static std::unique_ptr<LpcmUtil> Create(const LpcmStreamType& stream_type); | |
|
jeffbrown
2016/02/02 05:35:46
Can instances be shared? Consider GetInstance per
| |
| 19 | |
| 20 virtual ~LpcmUtil() {} | |
| 21 | |
| 22 // Fills the buffer with silence. | |
| 23 virtual void Silence(void* buffer, uint64_t frame_count) const = 0; | |
| 24 | |
| 25 // Copies samples. | |
| 26 virtual void Copy(const void* in, void* out, uint64_t frame_count) const = 0; | |
| 27 | |
| 28 // Mixes samples. | |
|
jeffbrown
2016/02/02 05:35:46
The description is a bit unclear. Is this summing
| |
| 29 virtual void Mix(const void* in, void* out, uint64_t frame_count) const = 0; | |
| 30 | |
| 31 // Interleaves non-interleaved samples. This assumes ffmpeg non-interleaved | |
| 32 // ("planar") layout, in which the buffer (in) is divided evenly into a | |
| 33 // channel buffer per channel. The samples for each channel are contiguous | |
| 34 // in the respective channel buffer with possible empty space at the end | |
| 35 // (hence the in_type_count and the frame_count). | |
| 36 virtual void Interleave( | |
| 37 const void* in, | |
| 38 uint64_t in_byte_count, | |
|
jeffbrown
2016/02/02 05:35:46
Mixing bytes and frames could be error prone.
| |
| 39 void* out, | |
| 40 uint64_t frame_count) const = 0; | |
| 41 }; | |
| 42 | |
| 43 } // namespace media | |
| 44 } // namespace mojo | |
| 45 | |
| 46 #endif // SERVICES_MEDIA_FRAMEWORK_LPCM_UTIL_H_ | |
| OLD | NEW |