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