| Index: chromecast/media/cma/backend/alsa/post_processing_pipeline_impl.cc
|
| diff --git a/chromecast/media/cma/backend/alsa/post_processing_pipeline_impl.cc b/chromecast/media/cma/backend/alsa/post_processing_pipeline_impl.cc
|
| index 61a917720494461b2bf7aace7d781075950a7a76..c465d8d892d20b32daaf17498374b94ea158cab8 100644
|
| --- a/chromecast/media/cma/backend/alsa/post_processing_pipeline_impl.cc
|
| +++ b/chromecast/media/cma/backend/alsa/post_processing_pipeline_impl.cc
|
| @@ -21,13 +21,10 @@ namespace media {
|
| namespace {
|
|
|
| const int kNoSampleRate = -1;
|
| -const char kSoCreateFunction[] = "AudioPostProcessorShlib_Create";
|
| const char kProcessorKey[] = "processor";
|
| const char kNameKey[] = "name";
|
| } // namespace
|
|
|
| -using CreatePostProcessor = AudioPostProcessor* (*)(const std::string&, int);
|
| -
|
| std::unique_ptr<PostProcessingPipeline> PostProcessingPipeline::Create(
|
| const std::string& name,
|
| const base::ListValue* filter_description_list,
|
| @@ -67,22 +64,16 @@ PostProcessingPipelineImpl::PostProcessingPipelineImpl(
|
| const base::Value* processor_config_val;
|
| CHECK(processor_description_dict->Get("config", &processor_config_val));
|
| CHECK(processor_config_val->is_dict() || processor_config_val->is_string());
|
| - auto processor_config_string = SerializeToJson(*processor_config_val);
|
| + std::unique_ptr<std::string> processor_config_string =
|
| + SerializeToJson(*processor_config_val);
|
|
|
| LOG(INFO) << "Creating an instance of " << library_path << "("
|
| << *processor_config_string << ")";
|
| - libraries_.push_back(base::MakeUnique<base::ScopedNativeLibrary>(
|
| - base::FilePath(library_path)));
|
| - CHECK(libraries_.back()->is_valid())
|
| - << "Could not open post processing library " << library_path;
|
| - CreatePostProcessor create = reinterpret_cast<CreatePostProcessor>(
|
| - libraries_.back()->GetFunctionPointer(kSoCreateFunction));
|
| -
|
| - CHECK(create) << "Could not find " << kSoCreateFunction << "() in "
|
| - << library_path;
|
| - processors_.emplace_back(PostProcessorInfo{
|
| - base::WrapUnique(create(*processor_config_string, channels)),
|
| - processor_name});
|
| +
|
| + processors_.emplace_back(
|
| + PostProcessorInfo{factory_.CreatePostProcessor(
|
| + library_path, *processor_config_string, channels),
|
| + processor_name});
|
| }
|
| }
|
|
|
|
|