blob: afc55848a77e52352f29cfb92112e8c7646852e6 [file] [log] [blame]
// 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.
#include <memory>
#include <string>
#include <vector>
#include "base/macros.h"
namespace base {
class FilePath;
class ScopedNativeLibrary;
} // namespace base
namespace chromecast {
namespace media {
class AudioPostProcessor2;
class PostProcessorFactory {
// Checks if a library is a V1 or V2 post processor.
static bool IsPostProcessorLibrary(const base::FilePath& library_path);
// Returns the preferred directory for 1P Post Processors.
static base::FilePath const GetPostProcessorDirectory();
// Returns the preferred directroy for 3P Post Processors.
static base::FilePath const GetOemPostProcessorDirectory();
// Creates an instance of AudioPostProcessor2 or a wrapped AudioPostProcessor.
// By default, will attempt to find the library in
// /system/chrome/lib/processors/|library_name|. Will fall back to
// searching for /oem_cast_shlib/processors/|library_name|, and finally
// searching for |library_name| in LD_LIBRARY_PATH.
std::unique_ptr<AudioPostProcessor2> CreatePostProcessor(
const std::string& library_name,
const std::string& config,
int channels);
// Contains all libraries in use;
// Functions in shared objects cannot be used once library is closed.
std::vector<std::unique_ptr<base::ScopedNativeLibrary>> libraries_;
} // namespace media
} // namespace chromecast