| Index: chromecast/media/cma/backend/alsa/post_processing_pipeline_parser.h
|
| diff --git a/chromecast/media/cma/backend/alsa/post_processing_pipeline_parser.h b/chromecast/media/cma/backend/alsa/post_processing_pipeline_parser.h
|
| index a2da06003c8f3a3bc6c228065963c363f7691879..13c6fa54ce8394f70ab19c7d43f70b6e9642ad63 100644
|
| --- a/chromecast/media/cma/backend/alsa/post_processing_pipeline_parser.h
|
| +++ b/chromecast/media/cma/backend/alsa/post_processing_pipeline_parser.h
|
| @@ -7,6 +7,8 @@
|
|
|
| #include <memory>
|
| #include <string>
|
| +#include <unordered_set>
|
| +#include <vector>
|
|
|
| #include "base/macros.h"
|
|
|
| @@ -18,30 +20,48 @@ class ListValue;
|
| namespace chromecast {
|
| namespace media {
|
|
|
| +// Helper class to hold information about a stream pipeline.
|
| +struct StreamPipelineDescriptor {
|
| + // The format for pipeline is:
|
| + // [ {"processor": "PATH_TO_SHARED_OBJECT",
|
| + // "config": "CONFIGURATION_STRING"},
|
| + // {"processor": "PATH_TO_SHARED_OBJECT",
|
| + // "config": "CONFIGURATION_STRING"},
|
| + // ... ]
|
| + base::ListValue* pipeline;
|
| + std::unordered_set<std::string> stream_types;
|
| +
|
| + StreamPipelineDescriptor(
|
| + base::ListValue* pipeline_in,
|
| + const std::unordered_set<std::string>& stream_types_in);
|
| + ~StreamPipelineDescriptor();
|
| + StreamPipelineDescriptor(const StreamPipelineDescriptor& other);
|
| + StreamPipelineDescriptor operator=(const StreamPipelineDescriptor& other) =
|
| + delete;
|
| +};
|
| +
|
| // Helper class to parse post-processing pipeline descriptor file.
|
| class PostProcessingPipelineParser {
|
| public:
|
| PostProcessingPipelineParser();
|
| +
|
| + // Use json string instead of reading from file. For test only.
|
| + explicit PostProcessingPipelineParser(const std::string& json);
|
| ~PostProcessingPipelineParser();
|
|
|
| - // Reads the pipeline descriptor file and does preliminary parsing.
|
| - // Crashes with fatal log if parsing fails.
|
| - void Initialize();
|
| + std::vector<StreamPipelineDescriptor> GetStreamPipelines();
|
|
|
| - // Gets the list of processors for a given stream type.
|
| - // The format will be:
|
| - // [
|
| - // {"processor": "PATH_TO_SHARED_OBJECT",
|
| - // "config": "CONFIGURATION_STRING"},
|
| - // {"processor": "PATH_TO_SHARED_OBJECT",
|
| - // "config": "CONFIGURATION_STRING"},
|
| - // ...
|
| - // ]
|
| - base::ListValue* GetPipelineByDeviceId(const std::string& device_id);
|
| + // Gets the list of processors for the mix/linearize stages.
|
| + // Same format as StreamPipelineDescriptor.pipeline
|
| + base::ListValue* GetMixPipeline();
|
| + base::ListValue* GetLinearizePipeline();
|
| +
|
| + static std::string GetFilePath();
|
|
|
| private:
|
| + base::ListValue* GetPipelineByKey(const std::string& key);
|
| +
|
| std::unique_ptr<base::DictionaryValue> config_dict_;
|
| - base::DictionaryValue* pipeline_dict_ = nullptr;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PostProcessingPipelineParser);
|
| };
|
|
|