diff options
author | BrettyWhite <geekman3454@protonmail.com> | 2017-07-27 11:35:17 -0400 |
---|---|---|
committer | BrettyWhite <geekman3454@protonmail.com> | 2017-07-27 11:35:17 -0400 |
commit | 9ff88809872b23c7f2241af4bca41e7e45717494 (patch) | |
tree | dced4d9a03d008ccdce3f145a1111e74e66cbd38 | |
parent | 8566341224be0748bd30cbffd9285a42cffd13d7 (diff) | |
download | sdl_ios-9ff88809872b23c7f2241af4bca41e7e45717494.tar.gz |
start of implementation
-rw-r--r-- | SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 8 | ||||
-rw-r--r-- | SmartDeviceLink/SDLHMICapabilities.h | 7 | ||||
-rw-r--r-- | SmartDeviceLink/SDLHMICapabilities.m | 12 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNames.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapability.h | 5 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapability.m | 29 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapabilityType.h | 5 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapabilityType.m | 11 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCodec.h | 58 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCodec.m | 78 |
10 files changed, 213 insertions, 1 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 6b8e0a680..195585537 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -903,6 +903,8 @@ 5DEE55C01B8509CB004F0D0F /* SDLURLRequestTaskSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */; }; 5DF2BB9D1B94E38A00CE5994 /* SDLURLSessionSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */; }; 5DFFB9151BD7C89700DB3F04 /* SDLConnectionManagerType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */; }; + 8BD729A61F2A2CF30029AC93 /* SDLVideoStreamingCodec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BD729A41F2A2CF30029AC93 /* SDLVideoStreamingCodec.h */; }; + 8BD729A71F2A2CF30029AC93 /* SDLVideoStreamingCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD729A51F2A2CF30029AC93 /* SDLVideoStreamingCodec.m */; }; 97E26DEC1E807AD70074A3C7 /* SDLMutableDataQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E26DEA1E807AD70074A3C7 /* SDLMutableDataQueue.h */; }; 97E26DED1E807AD70074A3C7 /* SDLMutableDataQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 97E26DEB1E807AD70074A3C7 /* SDLMutableDataQueue.m */; }; DA4353DF1D271FD10099B8C4 /* CGPointUtilSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */; }; @@ -1963,6 +1965,8 @@ 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>"; }; + 8BD729A41F2A2CF30029AC93 /* SDLVideoStreamingCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingCodec.h; sourceTree = "<group>"; }; + 8BD729A51F2A2CF30029AC93 /* SDLVideoStreamingCodec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingCodec.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>"; }; DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CGPointUtilSpec.m; path = UtilitiesSpecs/Touches/CGPointUtilSpec.m; sourceTree = "<group>"; }; @@ -3129,6 +3133,8 @@ DA9F7E821DCC047200ACAE48 /* SDLWaypointType.m */, 5D61FC261A84238C00846EE7 /* SDLWiperStatus.h */, 5D61FC271A84238C00846EE7 /* SDLWiperStatus.m */, + 8BD729A41F2A2CF30029AC93 /* SDLVideoStreamingCodec.h */, + 8BD729A51F2A2CF30029AC93 /* SDLVideoStreamingCodec.m */, ); name = Enums; sourceTree = "<group>"; @@ -4215,6 +4221,7 @@ 5D61FD911A84238C00846EE7 /* SDLShowConstantTBT.h in Headers */, 5D61FC331A84238C00846EE7 /* SDLAddSubMenuResponse.h in Headers */, 5D61FD5D1A84238C00846EE7 /* SDLRegisterAppInterface.h in Headers */, + 8BD729A61F2A2CF30029AC93 /* SDLVideoStreamingCodec.h in Headers */, 5D61FC9A1A84238C00846EE7 /* SDLEmergencyEvent.h in Headers */, 5D61FC651A84238C00846EE7 /* SDLCompassDirection.h in Headers */, 5D61FC8E1A84238C00846EE7 /* SDLDimension.h in Headers */, @@ -4678,6 +4685,7 @@ 5D61FC7F1A84238C00846EE7 /* SDLDeleteSubMenu.m in Sources */, 5D61FCE91A84238C00846EE7 /* SDLLanguage.m in Sources */, 5D61FC3E1A84238C00846EE7 /* SDLAlertResponse.m in Sources */, + 8BD729A71F2A2CF30029AC93 /* SDLVideoStreamingCodec.m in Sources */, 5D61FD8C1A84238C00846EE7 /* SDLSetMediaClockTimer.m in Sources */, 5D2996EA1BFCC0E3006106BF /* (null) in Sources */, 5D61FE121A84238C00846EE7 /* SDLWarningLightStatus.m in Sources */, diff --git a/SmartDeviceLink/SDLHMICapabilities.h b/SmartDeviceLink/SDLHMICapabilities.h index 6a84cec2c..3b3c16ca3 100644 --- a/SmartDeviceLink/SDLHMICapabilities.h +++ b/SmartDeviceLink/SDLHMICapabilities.h @@ -23,4 +23,11 @@ */ @property (copy, nonatomic) NSNumber *phoneCall; +/** + Availability of build in video streaming. True: Available, False: Not Available + + Boolean value. Optional. + */ +@property (copy, nonatomic) NSNumber *videoStreaming; + @end diff --git a/SmartDeviceLink/SDLHMICapabilities.m b/SmartDeviceLink/SDLHMICapabilities.m index 24b35be25..375cfe1d1 100644 --- a/SmartDeviceLink/SDLHMICapabilities.m +++ b/SmartDeviceLink/SDLHMICapabilities.m @@ -51,4 +51,16 @@ return store[NAMES_phoneCall]; } +- (void)setVideoStreaming:(NSNumber *)videoStreaming { + if (videoStreaming != nil) { + store[NAMES_videoStreaming] = videoStreaming; + } else { + [store removeObjectForKey:NAMES_videoStreaming]; + } +} + +- (NSNumber *)videoStreaming { + return store[NAMES_videoStreaming]; +} + @end diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h index 93da8a03a..e6892800a 100644 --- a/SmartDeviceLink/SDLNames.h +++ b/SmartDeviceLink/SDLNames.h @@ -432,6 +432,7 @@ #define NAMES_value @"value" #define NAMES_vdop @"vdop" #define NAMES_vehicleType @"vehicleType" +#define NAMES_videoStreaming @"videoStreaming" #define NAMES_vin @"vin" #define NAMES_voiceRecOn @"voiceRecOn" #define NAMES_vrCapabilities @"vrCapabilities" diff --git a/SmartDeviceLink/SDLSystemCapability.h b/SmartDeviceLink/SDLSystemCapability.h index 0c5b8ed2d..b0232bf00 100644 --- a/SmartDeviceLink/SDLSystemCapability.h +++ b/SmartDeviceLink/SDLSystemCapability.h @@ -13,6 +13,7 @@ @class SDLPhoneCapability; @class SDLNavigationCapability; @class SDLSystemCapabilityType; +@class SDLVideoStreamingCapability; /** The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist. @@ -35,10 +36,14 @@ - (instancetype)initWithPhoneCapability:(SDLPhoneCapability *)capability; +- (instancetype)initWithVideoStreamingCapability:(SDLVideoStreamingCapability *)capability; + @property (strong, nonatomic) SDLSystemCapabilityType *systemCapabilityType; @property (strong, nonatomic) SDLNavigationCapability *navigationCapability; @property (strong, nonatomic) SDLPhoneCapability *phoneCapability; +@property (strong, nonatomic) SDLVideoStreamingCapability *videoStreamingCapability; + @end diff --git a/SmartDeviceLink/SDLSystemCapability.m b/SmartDeviceLink/SDLSystemCapability.m index 45c614320..495e59add 100644 --- a/SmartDeviceLink/SDLSystemCapability.m +++ b/SmartDeviceLink/SDLSystemCapability.m @@ -51,6 +51,18 @@ return self; } +- (instancetype)initWithVideoStreamingCapability:(SDLVideoStreamingCapability *)capability { + self = [self init]; + if (!self) { + return nil; + } + + self.systemCapabilityType = [SDLSystemCapabilityType VIDEO_STREAMING]; + self.videoStreamingCapability = capability; + + return self; +} + - (void)setSystemCapabilityType:(SDLSystemCapabilityType *)type { if (type != nil) { [store setObject:type forKey:NAMES_systemCapabilityType]; @@ -104,4 +116,21 @@ } } +- (void)setVideoStreamingCapability:(SDLVideoStreamingCapability *)videoStreamingCapability { + if (videoStreamingCapability != nil) { + store[NAMES_videoStreaming] = videoStreamingCapability; + } else { + [store removeObjectForKey:NAMES_videoStreaming]; + } +} + +- (SDLVideoStreamingCapability *)videoStreamingCapability { + NSObject *obj = store[NAMES_videoStreaming]; + if (obj == nil || [obj isKindOfClass:SDLPhoneCapability.class]) { + return (SDLVideoStreamingCapability *)obj; + } else { + return [[SDLVideoStreamingCapability alloc] initWithDictionary:(NSMutableDictionary *)obj]; + } +} + @end diff --git a/SmartDeviceLink/SDLSystemCapabilityType.h b/SmartDeviceLink/SDLSystemCapabilityType.h index d79f44180..1f207520f 100644 --- a/SmartDeviceLink/SDLSystemCapabilityType.h +++ b/SmartDeviceLink/SDLSystemCapabilityType.h @@ -38,4 +38,9 @@ */ + (SDLSystemCapabilityType *)PHONE_CALL; +/** + @abstract VIDEO_STREAMING + */ ++ (SDLSystemCapabilityType *)VIDEO_STREAMING; + @end diff --git a/SmartDeviceLink/SDLSystemCapabilityType.m b/SmartDeviceLink/SDLSystemCapabilityType.m index 888701bea..a1a711cde 100644 --- a/SmartDeviceLink/SDLSystemCapabilityType.m +++ b/SmartDeviceLink/SDLSystemCapabilityType.m @@ -10,6 +10,7 @@ SDLSystemCapabilityType *SDLSystemCapabilityType_NAVIGATION = nil; SDLSystemCapabilityType *SDLSystemCapabilityType_PHONE_CALL = nil; +SDLSystemCapabilityType *SDLSystemCapabilityType_VIDEO_STREAMING = nil; NSArray *SDLSystemCapabilityType_values = nil; @@ -28,7 +29,8 @@ NSArray *SDLSystemCapabilityType_values = nil; if (SDLSystemCapabilityType_values == nil) { SDLSystemCapabilityType_values = @[ SDLSystemCapabilityType.NAVIGATION, - SDLSystemCapabilityType.PHONE_CALL + SDLSystemCapabilityType.PHONE_CALL, + SDLSystemCapabilityType_VIDEO_STREAMING ]; } return SDLSystemCapabilityType_values; @@ -48,4 +50,11 @@ NSArray *SDLSystemCapabilityType_values = nil; return SDLSystemCapabilityType_PHONE_CALL; } ++ (SDLSystemCapabilityType *)VIDEO_STREAMING { + if (SDLSystemCapabilityType_VIDEO_STREAMING == nil) { + SDLSystemCapabilityType_VIDEO_STREAMING = [[SDLSystemCapabilityType alloc] initWithValue:@"VIDEO_STREAMING"]; + } + return SDLSystemCapabilityType_VIDEO_STREAMING; +} + @end diff --git a/SmartDeviceLink/SDLVideoStreamingCodec.h b/SmartDeviceLink/SDLVideoStreamingCodec.h new file mode 100644 index 000000000..0bfeb90f0 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCodec.h @@ -0,0 +1,58 @@ +// +// SDLVideoStreamingCodec.h +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLEnum.h" + +/** + * Enum for each type of video streaming codec + * + * @since SDL 4.7 + */ +@interface SDLVideoStreamingCodec : SDLEnum + +/** + * Convert String to SDLVideoStreamingCodec + * + * @param value String value to retrieve the object for + * + * @return SDLVideoStreamingCodec + */ ++ (SDLVideoStreamingCodec *)valueOf:(NSString *)value; + +/** + @abstract Store the enumeration of all possible SDLVideoStreamingCodec + @return an array that store all possible SDLVideoStreamingCodec + */ ++ (NSArray *)values; + +/** + @abstract SDLVideoStreamingCodec : H264 + */ ++ (SDLVideoStreamingCodec *)H264; + +/** + @abstract SDLVideoStreamingCodec : H265 + */ ++ (SDLVideoStreamingCodec *)H265; + +/** + @abstract SDLVideoStreamingCodec : Theora + */ ++ (SDLVideoStreamingCodec *)THEORA; + +/** + @abstract SDLVideoStreamingCodec : VP8 + */ ++ (SDLVideoStreamingCodec *)VP8; + +/** + @abstract SDLVideoStreamingCodec : VP9 + */ ++ (SDLVideoStreamingCodec *)VP9; + +@end diff --git a/SmartDeviceLink/SDLVideoStreamingCodec.m b/SmartDeviceLink/SDLVideoStreamingCodec.m new file mode 100644 index 000000000..e15ecdf54 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCodec.m @@ -0,0 +1,78 @@ +// +// SDLVideoStreamingCodec.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLVideoStreamingCodec.h" + +SDLVideoStreamingCodec *SDLVideoStreamingCodec_H264 = nil; +SDLVideoStreamingCodec *SDLVideoStreamingCodec_H265 = nil; +SDLVideoStreamingCodec *SDLVideoStreamingCodec_THEORA = nil; +SDLVideoStreamingCodec *SDLVideoStreamingCodec_VP8 = nil; +SDLVideoStreamingCodec *SDLVideoStreamingCodec_VP9 = nil; + +NSArray *SDLVideoStreamingCodec_values = nil; + +@implementation SDLVideoStreamingCodec + ++ (SDLVideoStreamingCodec *)valueOf:(NSString *)value { + for (SDLVideoStreamingCodec *item in SDLVideoStreamingCodec.values) { + if ([item.value isEqualToString:value]) { + return item; + } + } + return nil; +} + ++ (NSArray *)values { + if (SDLVideoStreamingCodec_values == nil) { + SDLVideoStreamingCodec_values = @[ + SDLVideoStreamingCodec.H264, + SDLVideoStreamingCodec.H265, + SDLVideoStreamingCodec.THEORA, + SDLVideoStreamingCodec.VP8, + SDLVideoStreamingCodec.VP9 + ]; + } + return SDLVideoStreamingCodec_values; +} + ++ (SDLVideoStreamingCodec *)H264 { + if (SDLVideoStreamingCodec_H264 == nil) { + SDLVideoStreamingCodec_H264 = [[SDLVideoStreamingCodec alloc] initWithValue:@"H264"]; + } + return SDLVideoStreamingCodec_H264; +} + ++ (SDLVideoStreamingCodec *)H265 { + if (SDLVideoStreamingCodec_H265 == nil) { + SDLVideoStreamingCodec_H265 = [[SDLVideoStreamingCodec alloc] initWithValue:@"H265"]; + } + return SDLVideoStreamingCodec_H265; +} + ++ (SDLVideoStreamingCodec *)THEORA { + if (SDLVideoStreamingCodec_THEORA == nil) { + SDLVideoStreamingCodec_THEORA = [[SDLVideoStreamingCodec alloc] initWithValue:@"THEORA"]; + } + return SDLVideoStreamingCodec_THEORA; +} + ++ (SDLVideoStreamingCodec *)VP8 { + if (SDLVideoStreamingCodec_VP8 == nil) { + SDLVideoStreamingCodec_VP8 = [[SDLVideoStreamingCodec alloc] initWithValue:@"VP8"]; + } + return SDLVideoStreamingCodec_VP8; +} + ++ (SDLVideoStreamingCodec *)VP9 { + if (SDLVideoStreamingCodec_VP9 == nil) { + SDLVideoStreamingCodec_VP9 = [[SDLVideoStreamingCodec alloc] initWithValue:@"VP9"]; + } + return SDLVideoStreamingCodec_VP9; +} + +@end |