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

Unified 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: Suffix governor with _1.0 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 side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chromecast/media/cma/backend/alsa/filter_group.cc ('k') | chromecast/media/cma/backend/alsa/post_processing_pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698