OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 CHROMECAST_MEDIA_CMA_BACKEND_ALSA_POST_PROCESSING_PIPELINE_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_POST_PROCESSING_PIPELINE_H_ |
| 7 |
| 8 #include <cstdint> |
| 9 #include <memory> |
| 10 #include <string> |
| 11 #include <vector> |
| 12 |
| 13 #include "base/macros.h" |
| 14 |
| 15 namespace base { |
| 16 class ListValue; |
| 17 class ScopedNativeLibrary; |
| 18 } // namespace base |
| 19 |
| 20 namespace chromecast { |
| 21 namespace media { |
| 22 |
| 23 class AudioPostProcessor; |
| 24 |
| 25 // Creates and contains multiple AudioPostProcessors, as specified in ctor. |
| 26 // Provides convenience methods to access and use the AudioPostProcessors. |
| 27 class PostProcessingPipeline { |
| 28 public: |
| 29 PostProcessingPipeline(const base::ListValue* filter_description_list, |
| 30 int channels); |
| 31 ~PostProcessingPipeline(); |
| 32 |
| 33 // TODO(bshaya): Switch to float* |
| 34 int ProcessFrames(uint8_t* data, |
| 35 int num_frames, |
| 36 float current_volume, |
| 37 bool is_silence); |
| 38 bool SetSampleRate(int sample_rate); |
| 39 bool IsRinging(); |
| 40 |
| 41 private: |
| 42 int GetRingingTimeInFrames(); |
| 43 |
| 44 int sample_rate_; |
| 45 int ringing_time_in_frames_ = 0; |
| 46 int silence_frames_processed_ = 0; |
| 47 int total_delay_frames_ = 0; |
| 48 std::vector<std::unique_ptr<AudioPostProcessor>> processors_; |
| 49 |
| 50 // Contains all libraries in use; |
| 51 // Functions in shared objects cannot be used once library is closed. |
| 52 std::vector<std::unique_ptr<base::ScopedNativeLibrary>> libraries_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(PostProcessingPipeline); |
| 55 }; |
| 56 |
| 57 } // namespace media |
| 58 } // namespace chromecast |
| 59 |
| 60 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_POST_PROCESSING_PIPELINE_H_ |
OLD | NEW |