diff options
author | BrettyWhite <geekman3454@protonmail.com> | 2017-07-31 13:40:55 -0400 |
---|---|---|
committer | BrettyWhite <geekman3454@protonmail.com> | 2017-07-31 13:40:55 -0400 |
commit | ad8a7e85d61cc5897edd5ed262c71e569e64476e (patch) | |
tree | 5e288bf28e569ca4ec94a11fb11837e015605628 | |
parent | 9ab505e86a435d2163b4b67a0bd251c65377fa92 (diff) | |
download | sdl_ios-ad8a7e85d61cc5897edd5ed262c71e569e64476e.tar.gz |
continuing work
-rw-r--r-- | SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 32 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNames.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNames.m | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapability.h | 5 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapability.m | 21 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapabilityType.h | 5 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapabilityType.m | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCapability.h | 50 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCapability.m | 72 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCodec.h | 36 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCodec.m | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingFormat.h | 38 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingFormat.m | 51 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingProtocol.h | 36 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingProtocol.m | 11 |
15 files changed, 374 insertions, 0 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 8b7504af7..b96c607db 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -900,6 +900,14 @@ 5DE5ABB71B0E38C90067BB02 /* SDLSystemRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FBD21A84238B00846EE7 /* SDLSystemRequest.h */; }; 5DE5ABB81B0E38C90067BB02 /* SDLSystemRequestResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FBD41A84238B00846EE7 /* SDLSystemRequestResponse.h */; }; 5DFFB9151BD7C89700DB3F04 /* SDLConnectionManagerType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */; }; + 8B7B319A1F2F7B5700BDC38D /* SDLVideoStreamingCodec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B7B31981F2F7B5700BDC38D /* SDLVideoStreamingCodec.h */; }; + 8B7B319B1F2F7B5700BDC38D /* SDLVideoStreamingCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7B31991F2F7B5700BDC38D /* SDLVideoStreamingCodec.m */; }; + 8B7B319E1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B7B319C1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h */; }; + 8B7B319F1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7B319D1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.m */; }; + 8B7B31A21F2F7FEA00BDC38D /* SDLVideoStreamingFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B7B31A01F2F7FEA00BDC38D /* SDLVideoStreamingFormat.h */; }; + 8B7B31A31F2F7FEA00BDC38D /* SDLVideoStreamingFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7B31A11F2F7FEA00BDC38D /* SDLVideoStreamingFormat.m */; }; + 8B7B31A61F2F875200BDC38D /* SDLVideoStreamingCapability.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B7B31A41F2F875200BDC38D /* SDLVideoStreamingCapability.h */; }; + 8B7B31A71F2F875200BDC38D /* SDLVideoStreamingCapability.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7B31A51F2F875200BDC38D /* SDLVideoStreamingCapability.m */; }; 97E26DEC1E807AD70074A3C7 /* SDLMutableDataQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E26DEA1E807AD70074A3C7 /* SDLMutableDataQueue.h */; }; 97E26DED1E807AD70074A3C7 /* SDLMutableDataQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 97E26DEB1E807AD70074A3C7 /* SDLMutableDataQueue.m */; }; DA0C46AD1DCD35080001F2A8 /* SDLNames.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0C46AC1DCD35080001F2A8 /* SDLNames.m */; }; @@ -1957,6 +1965,14 @@ 5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLRequestTaskSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m"; sourceTree = "<group>"; }; 5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLSessionSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m"; sourceTree = "<group>"; }; 5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLConnectionManagerType.h; sourceTree = "<group>"; }; + 8B7B31981F2F7B5700BDC38D /* SDLVideoStreamingCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingCodec.h; sourceTree = "<group>"; }; + 8B7B31991F2F7B5700BDC38D /* SDLVideoStreamingCodec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingCodec.m; sourceTree = "<group>"; }; + 8B7B319C1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingProtocol.h; sourceTree = "<group>"; }; + 8B7B319D1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingProtocol.m; sourceTree = "<group>"; }; + 8B7B31A01F2F7FEA00BDC38D /* SDLVideoStreamingFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingFormat.h; sourceTree = "<group>"; }; + 8B7B31A11F2F7FEA00BDC38D /* SDLVideoStreamingFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingFormat.m; sourceTree = "<group>"; }; + 8B7B31A41F2F875200BDC38D /* SDLVideoStreamingCapability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingCapability.h; sourceTree = "<group>"; }; + 8B7B31A51F2F875200BDC38D /* SDLVideoStreamingCapability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingCapability.m; sourceTree = "<group>"; }; 97E26DEA1E807AD70074A3C7 /* SDLMutableDataQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLMutableDataQueue.h; sourceTree = "<group>"; }; 97E26DEB1E807AD70074A3C7 /* SDLMutableDataQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLMutableDataQueue.m; sourceTree = "<group>"; }; DA0C46AC1DCD35080001F2A8 /* SDLNames.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLNames.m; sourceTree = "<group>"; }; @@ -2989,6 +3005,10 @@ 5D61FC1F1A84238C00846EE7 /* SDLVehicleType.m */, 5D61FC221A84238C00846EE7 /* SDLVrHelpItem.h */, 5D61FC231A84238C00846EE7 /* SDLVrHelpItem.m */, + 8B7B31A01F2F7FEA00BDC38D /* SDLVideoStreamingFormat.h */, + 8B7B31A11F2F7FEA00BDC38D /* SDLVideoStreamingFormat.m */, + 8B7B31A41F2F875200BDC38D /* SDLVideoStreamingCapability.h */, + 8B7B31A51F2F875200BDC38D /* SDLVideoStreamingCapability.m */, ); name = Structs; sourceTree = "<group>"; @@ -3137,6 +3157,10 @@ DA9F7E821DCC047200ACAE48 /* SDLWaypointType.m */, 5D61FC261A84238C00846EE7 /* SDLWiperStatus.h */, 5D61FC271A84238C00846EE7 /* SDLWiperStatus.m */, + 8B7B31981F2F7B5700BDC38D /* SDLVideoStreamingCodec.h */, + 8B7B31991F2F7B5700BDC38D /* SDLVideoStreamingCodec.m */, + 8B7B319C1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h */, + 8B7B319D1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.m */, ); name = Enums; sourceTree = "<group>"; @@ -3877,6 +3901,7 @@ 5D3E48CB1D7722FE0000BFEF /* NSBundle+SDLBundle.h in Headers */, 5D61FD851A84238C00846EE7 /* SDLSetDisplayLayoutResponse.h in Headers */, 5D61FD751A84238C00846EE7 /* SDLRPCResponse.h in Headers */, + 8B7B31A21F2F7FEA00BDC38D /* SDLVideoStreamingFormat.h in Headers */, 5D61FC901A84238C00846EE7 /* SDLDisplayCapabilities.h in Headers */, 5D61FCE81A84238C00846EE7 /* SDLLanguage.h in Headers */, 5D61FC841A84238C00846EE7 /* SDLDeviceLevelStatus.h in Headers */, @@ -3965,6 +3990,7 @@ 5D61FDC71A84238C00846EE7 /* SDLTextAlignment.h in Headers */, 5D61FD051A84238C00846EE7 /* SDLOnButtonPress.h in Headers */, 5D61FCC51A84238C00846EE7 /* SDLHMIZoneCapabilities.h in Headers */, + 8B7B319A1F2F7B5700BDC38D /* SDLVideoStreamingCodec.h in Headers */, 5D61FCAF1A84238C00846EE7 /* SDLGenericResponse.h in Headers */, 5D61FC4F1A84238C00846EE7 /* SDLBodyInformation.h in Headers */, 5D61FDAB1A84238C00846EE7 /* SDLStartTime.h in Headers */, @@ -4024,6 +4050,7 @@ 5D61FDD31A84238C00846EE7 /* SDLTouchEvent.h in Headers */, 5D61FD451A84238C00846EE7 /* SDLProtocolHeader.h in Headers */, 5D61FCFA1A84238C00846EE7 /* SDLMyKey.h in Headers */, + 8B7B31A61F2F875200BDC38D /* SDLVideoStreamingCapability.h in Headers */, 5D61FC981A84238C00846EE7 /* SDLECallInfo.h in Headers */, 5D61FD7B1A84238C00846EE7 /* SDLScrollableMessage.h in Headers */, DA9F7E931DCC04E400ACAE48 /* SDLUnsubscribeWaypoints.h in Headers */, @@ -4065,6 +4092,7 @@ 5D61FCF21A84238C00846EE7 /* SDLLockScreenStatus.h in Headers */, 5D00AC771F15283E004000D9 /* SDLNavigationCapability.h in Headers */, 5D61FCD31A84238C00846EE7 /* SDLImageResolution.h in Headers */, + 8B7B319E1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h in Headers */, 5D61FD541A84238C00846EE7 /* SDLProxyListener.h in Headers */, 5D61FC5D1A84238C00846EE7 /* SDLChangeRegistrationResponse.h in Headers */, 5D61FDCD1A84238C00846EE7 /* SDLTimerMode.h in Headers */, @@ -4431,9 +4459,11 @@ 5D61FD941A84238C00846EE7 /* SDLShowConstantTBTResponse.m in Sources */, 5D61FE0A1A84238C00846EE7 /* SDLVehicleDataType.m in Sources */, 5D61FD1A1A84238C00846EE7 /* SDLOnSyncPData.m in Sources */, + 8B7B319F1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.m in Sources */, 5D61FC461A84238C00846EE7 /* SDLAudioPassThruCapabilities.m in Sources */, 5D61FD301A84238C00846EE7 /* SDLPermissionStatus.m in Sources */, 5D61FDEE1A84238C00846EE7 /* SDLUnsubscribeVehicleDataResponse.m in Sources */, + 8B7B319B1F2F7B5700BDC38D /* SDLVideoStreamingCodec.m in Sources */, 5D535DC61B72473800CF7760 /* SDLGlobals.m in Sources */, 5DBF06321E64A9C600A5CF03 /* SDLLogModel.m in Sources */, 5D61FCAE1A84238C00846EE7 /* SDLFunctionID.m in Sources */, @@ -4485,6 +4515,7 @@ 5D61FD2E1A84238C00846EE7 /* SDLPermissionItem.m in Sources */, 5D61FD041A84238C00846EE7 /* SDLOnButtonEvent.m in Sources */, 5D61FD201A84238C00846EE7 /* SDLOnTouchEvent.m in Sources */, + 8B7B31A71F2F875200BDC38D /* SDLVideoStreamingCapability.m in Sources */, 5DA3F35B1BC448480026F2D0 /* SDLError.m in Sources */, 5D61FD781A84238C00846EE7 /* SDLSamplingRate.m in Sources */, 5D61FC681A84238C00846EE7 /* SDLComponentVolumeStatus.m in Sources */, @@ -4668,6 +4699,7 @@ E9C32B9F1AB20C5900F283AF /* EAAccessoryManager+SDLProtocols.m in Sources */, 5D61FDA81A84238C00846EE7 /* SDLSpeakResponse.m in Sources */, 5DB92D331AC9C8BA00C15BB0 /* SDLRPCStruct.m in Sources */, + 8B7B31A31F2F7FEA00BDC38D /* SDLVideoStreamingFormat.m in Sources */, DA0C46AD1DCD35080001F2A8 /* SDLNames.m in Sources */, 5DA3F3551BC448060026F2D0 /* NSMapTable+Subscripting.m in Sources */, 5D61FCD61A84238C00846EE7 /* SDLImageType.m in Sources */, diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h index ff18de450..c1f69f9ce 100644 --- a/SmartDeviceLink/SDLNames.h +++ b/SmartDeviceLink/SDLNames.h @@ -206,6 +206,7 @@ extern SDLName const SDLNameMajorVersion; extern SDLName const SDLNameMake; extern SDLName const SDLNameManeuverComplete; extern SDLName const SDLNameManualTextEntry; +extern SDLName const SDLNameMaxBitrate; extern SDLName const SDLNameMaxDuration; extern SDLName const SDLNameMaximumChangeVelocity; extern SDLName const SDLNameMaxNumberRFCOMMPorts; @@ -446,6 +447,7 @@ extern SDLName const SDLNameVehicleType; extern SDLName const SDLNameVideoCodec; extern SDLName const SDLNameVideoProtocol; extern SDLName const SDLNameVideoStreaming; +extern SDLName const SDLNameVideoStreamingCapability; extern SDLName const SDLNameVIN; extern SDLName const SDLNameVoiceRecognitionOn; extern SDLName const SDLNameVRCapabilities; diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m index 8d7d22a71..1962fd4d6 100644 --- a/SmartDeviceLink/SDLNames.m +++ b/SmartDeviceLink/SDLNames.m @@ -446,6 +446,7 @@ SDLName const SDLNameVehicleType = @"vehicleType"; SDLName const SDLNameVideoCodec = @"videoCodec"; SDLName const SDLNameVideoProtocol = @"videoProtocol"; SDLName const SDLNameVideoStreaming = @"videoStreaming"; +SDLName const SDLNameVideoStreamingCapability = @"videoStreamingCapability"; SDLName const SDLNameVIN = @"vin"; SDLName const SDLNameVoiceRecognitionOn = @"voiceRecOn"; SDLName const SDLNameVRCapabilities = @"vrCapabilities"; diff --git a/SmartDeviceLink/SDLSystemCapability.h b/SmartDeviceLink/SDLSystemCapability.h index 87a968670..8d1f8483f 100644 --- a/SmartDeviceLink/SDLSystemCapability.h +++ b/SmartDeviceLink/SDLSystemCapability.h @@ -13,6 +13,7 @@ @class SDLPhoneCapability; @class SDLNavigationCapability; +@class SDLVideoStreamingCapability; NS_ASSUME_NONNULL_BEGIN @@ -26,12 +27,16 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithPhoneCapability:(SDLPhoneCapability *)capability; +- (instancetype)initWithVideoStreamingCapability:(SDLVideoStreamingCapability *)capability; + @property (strong, nonatomic) SDLSystemCapabilityType systemCapabilityType; @property (nullable, strong, nonatomic) SDLNavigationCapability *navigationCapability; @property (nullable, strong, nonatomic) SDLPhoneCapability *phoneCapability; +@property (nullable, strong, nonatomic) SDLVideoStreamingCapability *videoStreamingCapability; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSystemCapability.m b/SmartDeviceLink/SDLSystemCapability.m index 2a3ba2f90..25f638912 100644 --- a/SmartDeviceLink/SDLSystemCapability.m +++ b/SmartDeviceLink/SDLSystemCapability.m @@ -13,6 +13,7 @@ #import "SDLNavigationCapability.h" #import "SDLPhoneCapability.h" #import "SDLSystemCapabilityType.h" +#import "SDLVideoStreamingCapability.h" NS_ASSUME_NONNULL_BEGIN @@ -42,6 +43,18 @@ NS_ASSUME_NONNULL_BEGIN return self; } +- (instancetype)initWithVideoStreamingCapability:(SDLVideoStreamingCapability *)capability { + self = [self init]; + if (!self) { + return nil; + } + + self.systemCapabilityType = SDLSystemCapabilityTypeVideoStreaming; + self.videoStreamingCapability = capability; + + return self; +} + - (void)setSystemCapabilityType:(SDLSystemCapabilityType)type { [store sdl_setObject:type forName:SDLNameSystemCapabilityType]; } @@ -68,6 +81,14 @@ NS_ASSUME_NONNULL_BEGIN return [store sdl_objectForName:SDLNamePhoneCapability ofClass:SDLPhoneCapability.class]; } +- (void)setVideoStreamingCapability:(nullable SDLVideoStreamingCapability *)videoStreamingCapability { + [store sdl_setObject:videoStreamingCapability forName:SDLNameVideoStreamingCapability]; +} + +- (nullable SDLVideoStreamingCapability *)videoStreamingCapability { + return [store sdl_objectForName:SDLNameVideoStreamingCapability ofClass:SDLVideoStreamingCapability.class]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSystemCapabilityType.h b/SmartDeviceLink/SDLSystemCapabilityType.h index 66924d780..e8a177a41 100644 --- a/SmartDeviceLink/SDLSystemCapabilityType.h +++ b/SmartDeviceLink/SDLSystemCapabilityType.h @@ -22,3 +22,8 @@ extern SDLSystemCapabilityType const SDLSystemCapabilityTypeNavigation; @abstract PHONE_CALL */ extern SDLSystemCapabilityType const SDLSystemCapabilityTypePhoneCall; + +/** + @abstract VIDEO_STREAMING + */ +extern SDLSystemCapabilityType const SDLSystemCapabilityTypeVideoStreaming; diff --git a/SmartDeviceLink/SDLSystemCapabilityType.m b/SmartDeviceLink/SDLSystemCapabilityType.m index ca97a2196..47a425c53 100644 --- a/SmartDeviceLink/SDLSystemCapabilityType.m +++ b/SmartDeviceLink/SDLSystemCapabilityType.m @@ -11,3 +11,4 @@ SDLSystemCapabilityType const SDLSystemCapabilityTypeNavigation = @"NAVIGATION"; SDLSystemCapabilityType const SDLSystemCapabilityTypePhoneCall = @"PHONE_CALL"; +SDLSystemCapabilityType const SDLSystemCapabilityTypeVideoStreaming = @"VIDEO_STREAMING"; diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.h b/SmartDeviceLink/SDLVideoStreamingCapability.h new file mode 100644 index 000000000..4bda4940d --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCapability.h @@ -0,0 +1,50 @@ +// +// SDLVideoStreamingCapability.h +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/31/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLRPCMessage.h" + +@class SDLImageResolution; +@class SDLVideoStreamingFormat; + +NS_ASSUME_NONNULL_BEGIN + +@interface SDLVideoStreamingCapability : SDLRPCStruct + +/** + * @abstract Constructs a newly allocated SDLVideoStreamingCapability object + */ +- (instancetype)init; + +/** + * @abstract Constructs a newly allocated SDLVideoStreamingCapability object indicated by the dictionary parameter + * @param dict The dictionary to use + */ +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict; + +- (instancetype)initWithVideoStreaming:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats; +/** + * @abstract The preferred resolution of a video stream for decoding and rendering on HMI, optional + */ +@property (nullable, strong, nonatomic) SDLImageResolution *preferredResolution; + +/** + * @abstract The maximum bitrate of video stream that is supported, in kbps, optional + * minvalue= 0 + * maxvalue= 2147483647 + */ +@property (nullable, strong, nonatomic) NSNumber *maxBitrate; + +/** + * @abstract Detailed information on each format supported by this system, in its preferred order, optional + */ +@property (nullable, strong, nonatomic) NSMutableArray<SDLVideoStreamingFormat *> *supportedFormats; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.m b/SmartDeviceLink/SDLVideoStreamingCapability.m new file mode 100644 index 000000000..22a9525bc --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCapability.m @@ -0,0 +1,72 @@ +// +// SDLVideoStreamingCapability.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/31/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLImageResolution.h" +#import "SDLVideoStreamingCapability.h" +#import "SDLVideoStreamingFormat.h" + +#import "NSMutableDictionary+Store.h" +#import "SDLNames.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SDLVideoStreamingCapability + +- (instancetype)init { + if (self = [super init]) { + } + return self; +} + +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict { + if (self = [super initWithDictionary:dict]) { + } + return self; +} + +- (instancetype)initWithVideoStreaming:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats { + + self = [self init]; + if (!self) { + return self; + } + + self.maxBitrate = maxBitrate; + self.preferredResolution = preferredResolution; + self.supportedFormats = [supportedFormats mutableCopy]; + + return self; +} + +- (void)setPreferredResolution:(nullable SDLImageResolution *)preferredResolution { + [store sdl_setObject:preferredResolution forName:SDLNamePreferredResolution]; +} + +- (nullable SDLImageResolution *)preferredResolution { + return [store sdl_objectForName:SDLNamePreferredResolution]; +} + +- (void)setMaxBitrate:(nullable NSNumber *)maxBitrate { + [store sdl_setObject:maxBitrate forName:SDLNameMaxBitrate]; +} + +- (nullable NSNumber *)maxBitrate { + return [store sdl_objectForName:SDLNameMaxBitrate]; +} + +- (void)setSupportedFormats:(nullable NSMutableArray *)supportedFormats { + [store sdl_setObject:supportedFormats forName:SDLNameSupportedFormats]; +} + +- (nullable NSMutableArray *)supportedFormats { + return [store sdl_objectForName:SDLNameSupportedFormats]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLVideoStreamingCodec.h b/SmartDeviceLink/SDLVideoStreamingCodec.h new file mode 100644 index 000000000..e884eb210 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCodec.h @@ -0,0 +1,36 @@ +// +// SDLVideoStreamingCodec.h +// SmartDeviceLink-iOS +// + +#import "SDLEnum.h" + +/** + * Enum for each type of video streaming codec + */ +typedef SDLEnum SDLVideoStreamingCodec SDL_SWIFT_ENUM; + +/** + * @abstract SDLVideoStreamingCodec : H264 + */ +extern SDLVideoStreamingCodec const H264; + +/** + * @abstract SDLVideoStreamingCodec : H265 + */ +extern SDLVideoStreamingCodec const H265; + +/** + * @abstract SDLVideoStreamingCodec : THEORA + */ +extern SDLVideoStreamingCodec const THEORA; + +/** + * @abstract SDLVideoStreamingCodec : VP8 + */ +extern SDLVideoStreamingCodec const VP8; + +/** + * @abstract SDLVideoStreamingCodec : VP9 + */ +extern SDLVideoStreamingCodec const VP9; diff --git a/SmartDeviceLink/SDLVideoStreamingCodec.m b/SmartDeviceLink/SDLVideoStreamingCodec.m new file mode 100644 index 000000000..b4a8d3f7a --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCodec.m @@ -0,0 +1,13 @@ +// +// SDLVideoStreamingCodec.m +// SmartDeviceLink-iOS +// + + +#import "SDLVideoStreamingCodec.h" + +SDLVideoStreamingCodec const H264 = @"H264"; +SDLVideoStreamingCodec const H265 = @"H265"; +SDLVideoStreamingCodec const THEORA = @"THEORA"; +SDLVideoStreamingCodec const VP8 = @"VP8"; +SDLVideoStreamingCodec const VP9 = @"VP9"; diff --git a/SmartDeviceLink/SDLVideoStreamingFormat.h b/SmartDeviceLink/SDLVideoStreamingFormat.h new file mode 100644 index 000000000..e3c202216 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingFormat.h @@ -0,0 +1,38 @@ +// +// SDLVideoStreamingFormat.h +// SmartDeviceLink-iOS +// + +#import "SDLRPCMessage.h" + +@class SDLVideoStreamingCodec; +@class SDLVideoStreamingProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@interface SDLVideoStreamingFormat : SDLRPCStruct + +/** + * @abstract Constructs a newly allocated SDLVideoStreamingFormat object + */ +- (instancetype)init; + +/** + * @abstract Constructs a newly allocated SDLVideoStreamingFormat object indicated by the dictionary parameter + * @param dict The dictionary to use + */ +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict; + +/** + * @abstract Protocol type, see VideoStreamingProtocol, mandatory + */ +@property (strong, nonatomic) SDLVideoStreamingProtocol *protocol; + +/** + * @abstract Codec type, see VideoStreamingCodec, mandatory + */ +@property (strong, nonatomic) SDLVideoStreamingCodec *codec; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLVideoStreamingFormat.m b/SmartDeviceLink/SDLVideoStreamingFormat.m new file mode 100644 index 000000000..0831e45f8 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingFormat.m @@ -0,0 +1,51 @@ +// +// SDLVideoStreamingFormat.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/31/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLVideoStreamingFormat.h" +#import "NSMutableDictionary+Store.h" +#import "SDLNames.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SDLVideoStreamingFormat + +- (instancetype)init { + self = [self init]; + if (!self) { + return nil; + } + return self; +} + +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict { + self = [super initWithDictionary:dict]; + if (!self) { + return nil; + } + return self; +} + +- (SDLVideoStreamingProtocol *)protocol { + return [store sdl_objectForName:SDLNameVideoProtocol]; +} + +- (void)setVideoStreamingProtocol:(SDLVideoStreamingProtocol *)protocol { + [store sdl_setObject:protocol forName:SDLNameVideoProtocol]; +} + +- (SDLVideoStreamingCodec *)codec { + return [store sdl_objectForName:SDLNameVideoCodec]; +} + +- (void)setVideoStreamingCodec:(SDLVideoStreamingCodec *)codec { + [store sdl_setObject:codec forName:SDLNameVideoCodec]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLVideoStreamingProtocol.h b/SmartDeviceLink/SDLVideoStreamingProtocol.h new file mode 100644 index 000000000..6a0a7d461 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingProtocol.h @@ -0,0 +1,36 @@ +// +// SDLVideoStreamingProtocol.h +// SmartDeviceLink-iOS +// + +#import "SDLEnum.h" + +/** + * Enum for each type of video streaming protocol + */ +typedef SDLEnum SDLVideoStreamingProtocol SDL_SWIFT_ENUM; + +/** + * @abstract SDLVideoStreamingProtocol : RAW + */ +extern SDLVideoStreamingProtocol const RAW; + +/** + * @abstract SDLVideoStreamingProtocol : RTP + */ +extern SDLVideoStreamingProtocol const RTP; + +/** + * @abstract SDLVideoStreamingProtocol : RTSP + */ +extern SDLVideoStreamingProtocol const RTSP; + +/** + * @abstract SDLVideoStreamingProtocol : RTMP + */ +extern SDLVideoStreamingProtocol const RTMP; + +/** + * @abstract SDLVideoStreamingProtocol : WEBM + */ +extern SDLVideoStreamingProtocol const WEBM; diff --git a/SmartDeviceLink/SDLVideoStreamingProtocol.m b/SmartDeviceLink/SDLVideoStreamingProtocol.m new file mode 100644 index 000000000..8e54590d7 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingProtocol.m @@ -0,0 +1,11 @@ +// +// SDLVideoStreamingProtocol.m +// SmartDeviceLink-iOS + +#import "SDLVideoStreamingProtocol.h" + +SDLVideoStreamingProtocol const RAW = @"RAW"; +SDLVideoStreamingProtocol const RTP = @"RTP"; +SDLVideoStreamingProtocol const RTSP = @"RTSP"; +SDLVideoStreamingProtocol const RTMP = @"RTMP"; +SDLVideoStreamingProtocol const WEBM = @"WEBM"; |