/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #ifndef ACSDKAPPLICATIONAUDIOPIPELINEFACTORY_GSTREAMERAPPLICATIONAUDIOPIPELINEFACTORY_H_ #define ACSDKAPPLICATIONAUDIOPIPELINEFACTORY_GSTREAMERAPPLICATIONAUDIOPIPELINEFACTORY_H_ #include #include #include #include #include #include #include #include #include #include #include #include namespace alexaClientSDK { namespace acsdkApplicationAudioPipelineFactory { /** * Factory to create media players and related interfaces for Gstreamer. */ class GstreamerApplicationAudioPipelineFactory : public acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface { public: /** * Creates a new instance of @c ApplicationAudioPipelineFactoryInterface. * * @param channelVolumeFactory The @c ChannelVolumeFactoryInterface to use for creating channel volume interfaces. * @param speakerManagerInterface The @c SpeakerManagerInterface with which to register speakers. * @param equalizerRuntimeSetup The @c EqualizerRuntimeSetupInterface with which to register equalizers. * @param httpContentFetcherFactory The @c HTTPContentFetcherInterfaceFactoryInterface to fetch remote http content. * @param shutdownNotifier The @c ShutdownNotifierInterface to notify created media players of shutdown. * @param captionManager The @c CaptionManagerInterface to add captionable media sources. * @return A new @c ApplicationAudioPipelineFactoryInterface for Gstreamer media players. */ static std::shared_ptr createApplicationAudioPipelineFactoryInterface( const std::shared_ptr& channelVolumeFactory, const std::shared_ptr& speakerManager, const std::shared_ptr& equalizerRuntimeSetup, const std::shared_ptr& httpContentFetcherFactory, const std::shared_ptr& shutdownNotifier, const std::shared_ptr& captionManager); /// @name ApplicationAudioPipelineFactoryInterface /// @{ std::shared_ptr createApplicationMediaInterfaces( const std::string& name, bool equalizerAvailable, bool enableLiveMode, bool isCaptionable, avsCommon::sdkInterfaces::ChannelVolumeInterface::Type channelVolumeType, std::function volumeCurve) override; std::shared_ptr createPooledApplicationMediaInterfaces( const std::string& name, int numMediaPlayers, bool equalizerAvailable, bool enableLiveMode, bool isCaptionable, avsCommon::sdkInterfaces::ChannelVolumeInterface::Type channelVolumeType, std::function volumeCurve) override; /// @} private: /** * Constructor. * * @param channelVolumeFactory The @c ChannelVolumeFactoryInterface to use for creating channel volume interfaces. * @param speakerManagerInterface The @c SpeakerManagerInterface with which to register speakers. * @param equalizerRuntimeSetup The @c EqualizerRuntimeSetupInterface with which to register equalizers. * @param httpContentFetcherFactory The @c HTTPContentFetcherInterfaceFactoryInterface to fetch remote http content. * @param shutdownNotifier The @c ShutdownNotifierInterface to notify created media players of shutdown. * @param captionManager The @c CaptionManagerInterface to add captionable media sources. */ GstreamerApplicationAudioPipelineFactory( const std::shared_ptr& channelVolumeFactory, const std::shared_ptr& speakerManager, const std::shared_ptr& equalizerRuntimeSetup, const std::shared_ptr& httpContentFetcherFactory, const std::shared_ptr& shutdownNotifier, const std::shared_ptr& captionManager); /// The @c SpeakerManagerInterface with which to register speakers. std::shared_ptr m_speakerManager; /// The @c ChannelVolumeFactoryInterface to use for creating channel volume interfaces. std::shared_ptr m_channelVolumeFactory; /// The @c HTTPContentFetcherInterfaceFactoryInterface to use when creating a media player. std::shared_ptr m_httpContentFetcherFactory; /// The @c ShutdownNotifierInterface to notify media players of shutdown. std::shared_ptr m_shutdownNotifier; /// The @c EqualizerRuntimeSetupInterface with which to register equalizers. std::shared_ptr m_equalizerRuntimeSetup; /// The @c CaptionManagerInterface with which to register captionable media sources. std::shared_ptr m_captionManager; }; } // namespace acsdkApplicationAudioPipelineFactory } // namespace alexaClientSDK #endif // ACSDKAPPLICATIONAUDIOPIPELINEFACTORY_GSTREAMERAPPLICATIONAUDIOPIPELINEFACTORY_H_