Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chromecast/media/cma/backend/alsa/post_processing_pipeline.h

Issue 2771143002: Implement runtime audio post-processing pipeline. See go/cast_audio.json (Closed)
Patch Set: Fix stray keystroke Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 <unordered_map>
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, int num_frames, float current_volume);
35 bool SetSampleRate(int sample_rate);
36 int GetRingingTimeInFrames();
37
38 private:
39 int sample_rate_;
40 std::vector<std::unique_ptr<AudioPostProcessor>> processors_;
41
42 // Contains all libraries in use;
43 // Functions in shared objects cannot be used once library is closed.
44 std::unordered_map<std::string, std::unique_ptr<base::ScopedNativeLibrary>>
45 libraries_;
46
47 DISALLOW_COPY_AND_ASSIGN(PostProcessingPipeline);
48 };
49
50 } // namespace media
51 } // namespace chromecast
52
53 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_POST_PROCESSING_PIPELINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698