AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
FFmpegInputControllerInterface.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_FFMPEGINPUTCONTROLLERINTERFACE_H_
16 #define ALEXA_CLIENT_SDK_MEDIAPLAYER_ANDROIDSLESMEDIAPLAYER_INCLUDE_ANDROIDSLESMEDIAPLAYER_FFMPEGINPUTCONTROLLERINTERFACE_H_
17 
18 #include <chrono>
19 #include <ostream>
20 #include <tuple>
21 
22 struct AVFormatContext;
23 
24 namespace alexaClientSDK {
25 namespace mediaPlayer {
26 namespace android {
27 
38 public:
40  enum class Result {
42  OK,
44  OK_EMPTY,
46  TRY_AGAIN,
48  ERROR
49  };
50 
56  virtual bool hasNext() const = 0;
57 
63  virtual bool next() = 0;
64 
70  virtual std::tuple<Result, std::shared_ptr<AVFormatContext>, std::chrono::milliseconds>
72 
76  virtual ~FFmpegInputControllerInterface() = default;
77 };
78 
86 inline std::ostream& operator<<(std::ostream& stream, const FFmpegInputControllerInterface::Result& result) {
87  switch (result) {
89  stream << "OK";
90  break;
92  stream << "OK_EMPTY";
93  break;
95  stream << "TRY_AGAIN";
96  break;
98  stream << "ERROR";
99  break;
100  }
101  return stream;
102 }
103 
104 } // namespace android
105 } // namespace mediaPlayer
106 } // namespace alexaClientSDK
107 
108 #endif // ALEXA_CLIENT_SDK_MEDIAPLAYER_ANDROIDSLESMEDIAPLAYER_INCLUDE_ANDROIDSLESMEDIAPLAYER_FFMPEGINPUTCONTROLLERINTERFACE_H_
Definition: FFmpegInputControllerInterface.h:37
std::ostream & operator<<(std::ostream &stream, const FFmpegInputControllerInterface::Result &result)
Definition: FFmpegInputControllerInterface.h:86
Get context succeeded. The returned AVFormatContext shall be valid.
Result
Enumeration class that represents the possible return values for getContext.
Definition: FFmpegInputControllerInterface.h:40
virtual std::tuple< Result, std::shared_ptr< AVFormatContext >, std::chrono::milliseconds > getCurrentFormatContext()=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Get context succeeded. The returned AVFormatContext is null because there is no input to read...
There is not enough input data available to generate the context. Decoder should try again later...
A unrecoverable error was found while trying to create the AVFormatContext.

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