AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
FFmpegUrlInputController.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 #ifndef ALEXA_CLIENT_SDK_MEDIAPLAYER_ANDROIDSLESMEDIAPLAYER_INCLUDE_ANDROIDSLESMEDIAPLAYER_FFMPEGURLINPUTCONTROLLER_H_
16 #define ALEXA_CLIENT_SDK_MEDIAPLAYER_ANDROIDSLESMEDIAPLAYER_INCLUDE_ANDROIDSLESMEDIAPLAYER_FFMPEGURLINPUTCONTROLLER_H_
17 
18 #include <chrono>
19 #include <memory>
20 #include <queue>
21 
24 
26 
27 namespace alexaClientSDK {
28 namespace mediaPlayer {
29 namespace android {
30 
35 public:
45  static std::unique_ptr<FFmpegUrlInputController> create(
46  std::shared_ptr<avsCommon::utils::playlistParser::IterativePlaylistParserInterface> playlistParser,
47  const std::string& url,
48  const std::chrono::milliseconds& offset,
49  bool repeat);
50 
53  std::tuple<Result, std::shared_ptr<AVFormatContext>, std::chrono::milliseconds> getCurrentFormatContext() override;
54  bool hasNext() const override;
55  bool next() override;
57 
58  std::string getCurrentUrl() const;
59 
64 
65 private:
75  std::shared_ptr<avsCommon::utils::playlistParser::IterativePlaylistParserInterface> parser,
76  const std::string& url,
77  const std::chrono::milliseconds& offset,
78  bool repeat);
79 
85  bool findFirstEntry();
86 
88  std::shared_ptr<avsCommon::utils::playlistParser::IterativePlaylistParserInterface> m_parser;
89 
91  std::string m_currentUrl;
92 
94  const std::string m_sourceUrl;
95 
97  std::chrono::milliseconds m_offset;
98 
100  bool m_done;
101 
103  const bool m_repeat;
104 };
105 
106 } // namespace android
107 } // namespace mediaPlayer
108 } // namespace alexaClientSDK
109 
110 #endif // ALEXA_CLIENT_SDK_MEDIAPLAYER_ANDROIDSLESMEDIAPLAYER_INCLUDE_ANDROIDSLESMEDIAPLAYER_FFMPEGURLINPUTCONTROLLER_H_
Definition: FFmpegInputControllerInterface.h:37
::std::string string
Definition: gtest-port.h:1097
static std::unique_ptr< FFmpegUrlInputController > create(std::shared_ptr< avsCommon::utils::playlistParser::IterativePlaylistParserInterface > playlistParser, const std::string &url, const std::chrono::milliseconds &offset, bool repeat)
std::tuple< Result, std::shared_ptr< AVFormatContext >, std::chrono::milliseconds > getCurrentFormatContext() override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
parser
Definition: upload.py:392

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