AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
PooledMediaResourceProvider.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_POOLEDMEDIARESOURCEPROVIDER_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_POOLEDMEDIARESOURCEPROVIDER_H_
18 
19 #include <vector>
20 
25 
26 namespace alexaClientSDK {
27 namespace avsCommon {
28 namespace utils {
29 namespace mediaPlayer {
30 
38 public:
48  static std::shared_ptr<avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface>
50  std::unique_ptr<avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface> mediaPlayerFactory,
51  std::vector<std::shared_ptr<avsCommon::sdkInterfaces::ChannelVolumeInterface>> speakers);
52 
62  static std::shared_ptr<avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface>
64  std::vector<std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface>> mediaPlayers,
65  std::vector<std::shared_ptr<avsCommon::sdkInterfaces::ChannelVolumeInterface>> speakers,
66  const avsCommon::utils::mediaPlayer::Fingerprint& fingerprint = {});
67 
69 
73  std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> acquireMediaPlayer() override;
74  bool releaseMediaPlayer(std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> mediaPlayer) override;
75  bool isMediaPlayerAvailable() override;
76  void addObserver(
77  std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerFactoryObserverInterface> observer) override;
78  void removeObserver(
79  std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerFactoryObserverInterface> observer) override;
80  std::vector<std::shared_ptr<avsCommon::sdkInterfaces::ChannelVolumeInterface>> getSpeakers() const override;
82 
83 private:
93  std::unique_ptr<avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface> mediaPlayerFactory,
94  std::vector<std::shared_ptr<avsCommon::sdkInterfaces::ChannelVolumeInterface>> speakers);
95 
97  std::unique_ptr<avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface> m_factory;
98 
100  std::vector<std::shared_ptr<avsCommon::sdkInterfaces::ChannelVolumeInterface>> m_speakers;
101 };
102 
103 } // namespace mediaPlayer
104 } // namespace utils
105 } // namespace avsCommon
106 } // namespace alexaClientSDK
107 
108 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_POOLEDMEDIARESOURCEPROVIDER_H_
static std::shared_ptr< avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface > adaptMediaPlayerFactoryInterface(std::unique_ptr< avsCommon::utils::mediaPlayer::MediaPlayerFactoryInterface > mediaPlayerFactory, std::vector< std::shared_ptr< avsCommon::sdkInterfaces::ChannelVolumeInterface >> speakers)
bool releaseMediaPlayer(std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > mediaPlayer) override
void addObserver(std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerFactoryObserverInterface > observer) override
void removeObserver(std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerFactoryObserverInterface > observer) override
std::vector< std::shared_ptr< avsCommon::sdkInterfaces::ChannelVolumeInterface > > getSpeakers() const override
static std::shared_ptr< avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface > createPooledMediaResourceProviderInterface(std::vector< std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface >> mediaPlayers, std::vector< std::shared_ptr< avsCommon::sdkInterfaces::ChannelVolumeInterface >> speakers, const avsCommon::utils::mediaPlayer::Fingerprint &fingerprint={})
Definition: MediaPlayerFactoryInterface.h:38
std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > acquireMediaPlayer() override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
avsCommon::utils::mediaPlayer::Fingerprint getFingerprint() override

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0