AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MediaDescription.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_MEDIADESCRIPTION_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_MEDIADESCRIPTION_H_
18 
19 #include <unordered_map>
20 #include <vector>
21 
26 #include <Captions/CaptionData.h>
27 
28 namespace alexaClientSDK {
29 namespace avsCommon {
30 namespace utils {
31 namespace mediaPlayer {
32 
34 static std::string PLAY_BEHAVIOR = "playBehavior";
35 
36 /*
37  * An object that contains all playback related information needed from the media CA.
38  */
42 
44  std::string focusChannel; // "Dialog", "Communications", "Alert", "Content", "Visual"
45 
48 
51 
54 
56  std::unordered_map<std::string, std::string> additionalData;
57 
59  bool enabled;
60 };
61 
68  "",
69  "",
71  Optional<std::vector<audioAnalyzer::AudioAnalyzerState>>(),
72  std::unordered_map<std::string, std::string>(),
73  false};
74 }
75 
83 inline std::ostream& operator<<(std::ostream& stream, const MediaDescription& mediaDescription) {
84  stream << "MixingBehavior:";
85  switch (mediaDescription.mixingBehavior) {
87  stream << "BEHAVIOR_PAUSE";
88  break;
90  stream << "BEHAVIOR_DUCK";
91  break;
92  }
93  stream << ", Channel:" << mediaDescription.focusChannel << ", ";
94  stream << ", TrackId:" << mediaDescription.trackId;
95  if (mediaDescription.caption.hasValue()) {
96  stream << ", CaptionData:{format:" << (mediaDescription.caption.value()).format;
97  stream << ", content:" << (mediaDescription.caption.value()).content << "}";
98  }
99  if (mediaDescription.analyzers.hasValue()) {
100  stream << ", Analyzers:{";
101  const auto analyzersCopy = mediaDescription.analyzers.value();
102  for (auto iter = analyzersCopy.begin(); iter != analyzersCopy.end(); iter++) {
103  stream << "{name:" << (*iter).name;
104  stream << ", enableState:" << (*iter).enableState << "}";
105  }
106  stream << "}";
107  }
108  stream << ", AdditionalData:{";
109  const auto additionalDataCopy = mediaDescription.additionalData;
110  for (auto iter = additionalDataCopy.begin(); iter != additionalDataCopy.end(); iter++) {
111  stream << "{" << (*iter).first;
112  stream << ":" << (*iter).second << "}";
113  }
114  stream << "}, enabled: " << (mediaDescription.enabled ? "true" : "false") << " }";
115  return stream;
116 }
117 
118 } // namespace mediaPlayer
119 } // namespace utils
120 } // namespace avsCommon
121 } // namespace alexaClientSDK
122 
123 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_MEDIADESCRIPTION_H_
sdkInterfaces::audio::MixingBehavior mixingBehavior
Mixing behavior of the stream.
Definition: MediaDescription.h:41
::std::string string
Definition: gtest-port.h:1097
std::string trackId
String identifier of the source.
Definition: MediaDescription.h:47
Optional< std::vector< audioAnalyzer::AudioAnalyzerState > > analyzers
Audio analyzers used to process provided audio content.
Definition: MediaDescription.h:53
MixingBehavior
Definition: MixingBehavior.h:27
bool enabled
Are all of the required values in the Media Description struct set.
Definition: MediaDescription.h:59
MediaDescription emptyMediaDescription()
Definition: MediaDescription.h:66
Optional< captions::CaptionData > caption
Object that contains CaptionData with unprocessed caption content and metadata of a particular format...
Definition: MediaDescription.h:50
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string focusChannel
Focus channel identifies the content type acquiring focus following FocusManger naming convention...
Definition: MediaDescription.h:44
static std::string PLAY_BEHAVIOR
Play behavior key to be included in the additional data.
Definition: MediaDescription.h:34
std::ostream & operator<<(std::ostream &stream, const ErrorType &errorType)
Definition: ErrorTypes.h:158
std::unordered_map< std::string, std::string > additionalData
All additional information to be provided, including PlayBehavior.
Definition: MediaDescription.h:56

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