Shaka Player Embedded
net_objc.h
Go to the documentation of this file.
1 // Copyright 2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_NET_OBJC_H_
16 #define SHAKA_EMBEDDED_NET_OBJC_H_
17 
18 #import <Foundation/Foundation.h>
19 
20 #include "macros.h"
21 
22 typedef NS_ENUM(NSInteger, ShakaPlayerRequestType) {
23  // These have the same values as shaka.net.NetworkingEngine.RequestType and
24  // shaka::RequestType.
25  ShakaPlayerRequestTypeUnknown = -1,
26  ShakaPlayerRequestTypeManifest = 0,
27  ShakaPlayerRequestTypeSegment = 1,
28  ShakaPlayerRequestTypeLicense = 2,
29  ShakaPlayerRequestTypeApp = 3,
30  ShakaPlayerRequestTypeTiming = 4
31 };
32 
33 NS_ASSUME_NONNULL_BEGIN
34 
43 @interface ShakaPlayerRequest : NSObject
44 
45 - (instancetype)init NS_UNAVAILABLE; // Cannot create external instances.
46 
51 @property(atomic) NSMutableArray<NSString *> *uris;
52 
54 @property(atomic) NSString *method;
55 
57 @property(atomic) NSMutableDictionary<NSString *, NSString *> *headers;
58 
60 @property(atomic, nullable) NSData *body;
61 
62 @end
63 
64 
73 @interface ShakaPlayerResponse : NSObject
74 
75 - (instancetype)init NS_UNAVAILABLE; // Cannot create external instances.
76 
81 @property(atomic) NSString *uri;
82 
87 @property(atomic) NSString *originalUri;
88 
94 @property(atomic) NSMutableDictionary<NSString *, NSString *> *headers;
95 
100 @property(atomic) bool fromCache;
101 
106 @property(atomic, nullable) NSNumber *timeMs;
107 
109 @property(atomic, nullable) NSData *data;
110 
111 @end
112 
113 NS_ASSUME_NONNULL_END
114 
115 #endif // SHAKA_EMBEDDED_NET_OBJC_H_
#define SHAKA_EXPORT
Definition: macros.h:30
typedef NS_ENUM(NSInteger, ShakaPlayerRequestType)
Definition: net_objc.h:22
NSString * uri
Definition: net_objc.h:81
NSString * originalUri
Definition: net_objc.h:87
NSString * method
Definition: net_objc.h:54
instancetype NS_UNAVAILABLE()
NSMutableDictionary< NSString *, NSString * > * headers
Definition: net_objc.h:94
NSData * body
Definition: net_objc.h:60
instancetype NS_UNAVAILABLE()
NSMutableDictionary< NSString *, NSString * > * headers
Definition: net_objc.h:57
NSMutableArray< NSString * > * uris
Definition: net_objc.h:51
NSNumber * timeMs
Definition: net_objc.h:106