// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MEDIA_BASE_RENDERER_FACTORY_SELECTOR_H_ #define MEDIA_BASE_RENDERER_FACTORY_SELECTOR_H_ #include <map> #include <optional> #include "base/functional/callback.h" #include "build/build_config.h" #include "media/base/media_export.h" #include "media/base/media_status.h" #include "media/base/renderer.h" #include "media/base/renderer_factory.h" namespace media { // RendererFactorySelector owns RendererFactory instances used within WMPI. // Its purpose is to aggregate the signals and centralize the logic behind // choosing which RendererFactory should be used when creating a new Renderer. // // There are 3 categories of factories: base, conditional and other, which can // be added by AddBaseFactory(), AddConditionalFactory() and AddFactory() // respectively. // // The current factory is selected as: // - If a conditional factory exists and the condition is met, use the // conditional factory. // - Else use the base factory. // // Notes: // - One and at most one base factory must be set. // - The base factory can be changed by calling SetBaseRendererType(). // - Multiple conditional factories are supported but there should be at most // one conditional factory for any factory type. If multiple conditions are // met, it's up to the implementation detail which factory will be returned. class MEDIA_EXPORT RendererFactorySelector { … }; } // namespace media #endif // MEDIA_BASE_RENDERER_FACTORY_SELECTOR_H_