AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
PlaybackContext.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_PLAYBACKCONTEXT_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_PLAYBACKCONTEXT_H_
18 
19 #include <map>
20 #include <string>
21 
23 
24 namespace alexaClientSDK {
25 namespace avsCommon {
26 namespace utils {
27 namespace mediaPlayer {
28 
30 typedef std::map<std::string, std::string> HeaderConfig;
31 
32 /*
33  * An object that contains Playback Context for a source media.
34  */
37  static const avscommon_EXPORT std::string HTTP_HEADERS;
38 
40  static const avscommon_EXPORT std::string HTTP_KEY_HEADERS;
41 
43  static const avscommon_EXPORT std::string HTTP_MANIFEST_HEADERS;
44 
46  static const avscommon_EXPORT std::string HTTP_AUDIOSEGMENT_HEADERS;
47 
49  static const avscommon_EXPORT std::string HTTP_ALL_HEADERS;
50 
52  HeaderConfig keyConfig;
53 
55  HeaderConfig manifestConfig;
56 
58  HeaderConfig audioSegmentConfig;
59 
61  HeaderConfig allConfig;
62 };
63 
70 bool validateIfNotMalicious(const std::string& header);
71 
78 std::pair<bool, bool> validatePlaybackContextHeaders(PlaybackContext* playbackContext);
79 
80 } // namespace mediaPlayer
81 } // namespace utils
82 } // namespace avsCommon
83 } // namespace alexaClientSDK
84 
85 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_PLAYBACKCONTEXT_H_
HeaderConfig allConfig
Headers to be sent for all out going requests.
Definition: PlaybackContext.h:61
std::map< std::string, std::string > HeaderConfig
Header Key, Value pairs.
Definition: PlaybackContext.h:30
static const avscommon_EXPORT std::string HTTP_ALL_HEADERS
Key in PlayDirective for the Http Headers that have to be sent with all requests. ...
Definition: PlaybackContext.h:49
static const avscommon_EXPORT std::string HTTP_HEADERS
Http Headers in play directive.
Definition: PlaybackContext.h:37
static const avscommon_EXPORT std::string HTTP_MANIFEST_HEADERS
Key in PlayDirective for the Http Headers that have to be sent with manifest requests.
Definition: PlaybackContext.h:43
bool validateIfNotMalicious(const std::string &header)
Definition: PlaybackContext.cpp:50
HeaderConfig keyConfig
Headers to be sent while fetching license.
Definition: PlaybackContext.h:52
std::pair< bool, bool > validatePlaybackContextHeaders(PlaybackContext *playbackContext)
Definition: PlaybackContext.cpp:102
static const avscommon_EXPORT std::string HTTP_KEY_HEADERS
Key in PlayDirective for the Http Headers that have to be sent with key/license requests.
Definition: PlaybackContext.h:40
static const avscommon_EXPORT std::string HTTP_AUDIOSEGMENT_HEADERS
Key in PlayDirective for the Http Headers that have to be sent with audioSegment requests.
Definition: PlaybackContext.h:46
HeaderConfig audioSegmentConfig
Headers to be sent while fetching data segments.
Definition: PlaybackContext.h:58
HeaderConfig manifestConfig
Headers to be sent while fetching manifest.
Definition: PlaybackContext.h:55
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
#define avscommon_EXPORT
Definition: PlatformDefinitions.h:39

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