#ifndef CHROMECAST_MEDIA_AUDIO_INTERLEAVED_CHANNEL_MIXER_H_
#define CHROMECAST_MEDIA_AUDIO_INTERLEAVED_CHANNEL_MIXER_H_
#include <vector>
#include "media/base/channel_layout.h"
namespace chromecast {
namespace media {
class InterleavedChannelMixer {
public:
InterleavedChannelMixer(::media::ChannelLayout input_layout,
int input_channel_count,
::media::ChannelLayout output_layout,
int output_channel_count,
int max_frames);
InterleavedChannelMixer(const InterleavedChannelMixer&) = delete;
InterleavedChannelMixer& operator=(const InterleavedChannelMixer&) = delete;
~InterleavedChannelMixer();
int input_channel_count() const { return input_channel_count_; }
int output_channel_count() const { return output_channel_count_; }
float* Transform(const float* input, int num_frames);
private:
const ::media::ChannelLayout input_layout_;
const int input_channel_count_;
const ::media::ChannelLayout output_layout_;
const int output_channel_count_;
const int max_frames_;
std::vector<float> transform_;
std::vector<float> buffer_;
};
}
}
#endif