| Index: chromecast/media/cma/backend/alsa/post_processing_pipeline.h
|
| diff --git a/chromecast/media/cma/backend/alsa/post_processing_pipeline.h b/chromecast/media/cma/backend/alsa/post_processing_pipeline.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..773a6b55581d0e0a1b4d217fe2b347a8b5e42c6f
|
| --- /dev/null
|
| +++ b/chromecast/media/cma/backend/alsa/post_processing_pipeline.h
|
| @@ -0,0 +1,60 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROMECAST_MEDIA_CMA_BACKEND_ALSA_POST_PROCESSING_PIPELINE_H_
|
| +#define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_POST_PROCESSING_PIPELINE_H_
|
| +
|
| +#include <cstdint>
|
| +#include <memory>
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| +#include "base/macros.h"
|
| +
|
| +namespace base {
|
| +class ListValue;
|
| +class ScopedNativeLibrary;
|
| +} // namespace base
|
| +
|
| +namespace chromecast {
|
| +namespace media {
|
| +
|
| +class AudioPostProcessor;
|
| +
|
| +// Creates and contains multiple AudioPostProcessors, as specified in ctor.
|
| +// Provides convenience methods to access and use the AudioPostProcessors.
|
| +class PostProcessingPipeline {
|
| + public:
|
| + PostProcessingPipeline(const base::ListValue* filter_description_list,
|
| + int channels);
|
| + ~PostProcessingPipeline();
|
| +
|
| + // TODO(bshaya): Switch to float*
|
| + int ProcessFrames(uint8_t* data,
|
| + int num_frames,
|
| + float current_volume,
|
| + bool is_silence);
|
| + bool SetSampleRate(int sample_rate);
|
| + bool IsRinging();
|
| +
|
| + private:
|
| + int GetRingingTimeInFrames();
|
| +
|
| + int sample_rate_;
|
| + int ringing_time_in_frames_ = 0;
|
| + int silence_frames_processed_ = 0;
|
| + int total_delay_frames_ = 0;
|
| + std::vector<std::unique_ptr<AudioPostProcessor>> processors_;
|
| +
|
| + // Contains all libraries in use;
|
| + // Functions in shared objects cannot be used once library is closed.
|
| + std::vector<std::unique_ptr<base::ScopedNativeLibrary>> libraries_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PostProcessingPipeline);
|
| +};
|
| +
|
| +} // namespace media
|
| +} // namespace chromecast
|
| +
|
| +#endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_POST_PROCESSING_PIPELINE_H_
|
|
|