diff options
author | BrettyWhite <geekman3454@protonmail.com> | 2017-07-27 14:49:34 -0400 |
---|---|---|
committer | BrettyWhite <geekman3454@protonmail.com> | 2017-07-27 14:49:34 -0400 |
commit | 6f625f2b252e0e70efc22791fe60e0da71b5a012 (patch) | |
tree | e6658607ac201e1cd8747e7fa00934bfb396ce8b | |
parent | 9ff88809872b23c7f2241af4bca41e7e45717494 (diff) | |
download | sdl_ios-6f625f2b252e0e70efc22791fe60e0da71b5a012.tar.gz |
added final two structs
-rw-r--r-- | SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 24 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNames.h | 5 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSystemCapability.m | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCapability.h | 44 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCapability.m | 75 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingFormat.h | 37 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingFormat.m | 50 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingProtocol.h | 58 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingProtocol.m | 78 |
9 files changed, 372 insertions, 0 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 195585537..d260a99ac 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -905,6 +905,12 @@ 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 */; }; + 8BD729AA1F2A41F40029AC93 /* SDLVideoStreamingProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BD729A81F2A41F40029AC93 /* SDLVideoStreamingProtocol.h */; }; + 8BD729AB1F2A41F40029AC93 /* SDLVideoStreamingProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD729A91F2A41F40029AC93 /* SDLVideoStreamingProtocol.m */; }; + 8BD729AE1F2A5AA10029AC93 /* SDLVideoStreamingFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BD729AC1F2A5AA10029AC93 /* SDLVideoStreamingFormat.h */; }; + 8BD729AF1F2A5AA10029AC93 /* SDLVideoStreamingFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD729AD1F2A5AA10029AC93 /* SDLVideoStreamingFormat.m */; }; + 8BD729B21F2A61DF0029AC93 /* SDLVideoStreamingCapability.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BD729B01F2A61DF0029AC93 /* SDLVideoStreamingCapability.h */; }; + 8BD729B31F2A61DF0029AC93 /* SDLVideoStreamingCapability.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD729B11F2A61DF0029AC93 /* SDLVideoStreamingCapability.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 */; }; @@ -1967,6 +1973,12 @@ 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>"; }; + 8BD729A81F2A41F40029AC93 /* SDLVideoStreamingProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingProtocol.h; sourceTree = "<group>"; }; + 8BD729A91F2A41F40029AC93 /* SDLVideoStreamingProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingProtocol.m; sourceTree = "<group>"; }; + 8BD729AC1F2A5AA10029AC93 /* SDLVideoStreamingFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingFormat.h; sourceTree = "<group>"; }; + 8BD729AD1F2A5AA10029AC93 /* SDLVideoStreamingFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingFormat.m; sourceTree = "<group>"; }; + 8BD729B01F2A61DF0029AC93 /* SDLVideoStreamingCapability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingCapability.h; sourceTree = "<group>"; }; + 8BD729B11F2A61DF0029AC93 /* 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>"; }; DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CGPointUtilSpec.m; path = UtilitiesSpecs/Touches/CGPointUtilSpec.m; sourceTree = "<group>"; }; @@ -2985,6 +2997,10 @@ 5D61FC1F1A84238C00846EE7 /* SDLVehicleType.m */, 5D61FC221A84238C00846EE7 /* SDLVrHelpItem.h */, 5D61FC231A84238C00846EE7 /* SDLVrHelpItem.m */, + 8BD729AC1F2A5AA10029AC93 /* SDLVideoStreamingFormat.h */, + 8BD729AD1F2A5AA10029AC93 /* SDLVideoStreamingFormat.m */, + 8BD729B01F2A61DF0029AC93 /* SDLVideoStreamingCapability.h */, + 8BD729B11F2A61DF0029AC93 /* SDLVideoStreamingCapability.m */, ); name = Structs; sourceTree = "<group>"; @@ -3135,6 +3151,8 @@ 5D61FC271A84238C00846EE7 /* SDLWiperStatus.m */, 8BD729A41F2A2CF30029AC93 /* SDLVideoStreamingCodec.h */, 8BD729A51F2A2CF30029AC93 /* SDLVideoStreamingCodec.m */, + 8BD729A81F2A41F40029AC93 /* SDLVideoStreamingProtocol.h */, + 8BD729A91F2A41F40029AC93 /* SDLVideoStreamingProtocol.m */, ); name = Enums; sourceTree = "<group>"; @@ -4159,6 +4177,7 @@ 5D4D67B01D2FE2F900468B4A /* SDLResponseDispatcher.h in Headers */, 5D61FCF21A84238C00846EE7 /* SDLLockScreenStatus.h in Headers */, 5D00AC771F15283E004000D9 /* SDLNavigationCapability.h in Headers */, + 8BD729AE1F2A5AA10029AC93 /* SDLVideoStreamingFormat.h in Headers */, 5D61FCD31A84238C00846EE7 /* SDLImageResolution.h in Headers */, 5D61FD541A84238C00846EE7 /* SDLProxyListener.h in Headers */, 5D61FD731A84238C00846EE7 /* SDLRPCRequestFactory.h in Headers */, @@ -4240,6 +4259,7 @@ 5D61FCA31A84238C00846EE7 /* SDLEndAudioPassThru.h in Headers */, 5D61FCB11A84238C00846EE7 /* SDLGetDTCs.h in Headers */, 5D61FDFF1A84238C00846EE7 /* SDLVehicleDataEventStatus.h in Headers */, + 8BD729AA1F2A41F40029AC93 /* SDLVideoStreamingProtocol.h in Headers */, 5D61FC5B1A84238C00846EE7 /* SDLChangeRegistration.h in Headers */, 5D61FD5B1A84238C00846EE7 /* SDLReadDIDResponse.h in Headers */, 5D61FDEF1A84238C00846EE7 /* SDLUpdateMode.h in Headers */, @@ -4293,6 +4313,7 @@ 5D61FD6F1A84238C00846EE7 /* SDLRPCPayload.h in Headers */, 5D61FCF01A84238C00846EE7 /* SDLLockScreenStatusManager.h in Headers */, 5D61FD311A84238C00846EE7 /* SDLPolicyDataParser.h in Headers */, + 8BD729B21F2A61DF0029AC93 /* SDLVideoStreamingCapability.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4486,6 +4507,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8BD729AB1F2A41F40029AC93 /* SDLVideoStreamingProtocol.m in Sources */, 332A914F1CED9CC60043824C /* SDLAppInfo.m in Sources */, 5DCC19A51B822804004FFAD9 /* SDLURLRequestTask.m in Sources */, DA9F7E841DCC047200ACAE48 /* SDLWaypointType.m in Sources */, @@ -4654,6 +4676,7 @@ 5D61FCC61A84238C00846EE7 /* SDLHMIZoneCapabilities.m in Sources */, 5D61FD161A84238C00846EE7 /* SDLOnLockScreenStatus.m in Sources */, 5D61FDAE1A84238C00846EE7 /* SDLSubscribeButton.m in Sources */, + 8BD729AF1F2A5AA10029AC93 /* SDLVideoStreamingFormat.m in Sources */, DA9F7E6C1DCBFB0700ACAE48 /* SDLDeliveryMode.m in Sources */, 5D61FC581A84238C00846EE7 /* SDLButtonPressMode.m in Sources */, 5D00AC781F15283E004000D9 /* SDLNavigationCapability.m in Sources */, @@ -4671,6 +4694,7 @@ 5D61FDD01A84238C00846EE7 /* SDLTireStatus.m in Sources */, 5D61FC321A84238C00846EE7 /* SDLAddSubMenu.m in Sources */, 5D61FDF61A84238C00846EE7 /* SDLV1ProtocolHeader.m in Sources */, + 8BD729B31F2A61DF0029AC93 /* SDLVideoStreamingCapability.m in Sources */, 5D61FDAA1A84238C00846EE7 /* SDLSpeechCapabilities.m in Sources */, 5D61FDB41A84238C00846EE7 /* SDLSubscribeVehicleDataResponse.m in Sources */, 5D61FD121A84238C00846EE7 /* SDLOnKeyboardInput.m in Sources */, diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h index e6892800a..324dab99d 100644 --- a/SmartDeviceLink/SDLNames.h +++ b/SmartDeviceLink/SDLNames.h @@ -197,6 +197,7 @@ #define NAMES_make @"make" #define NAMES_maneuverComplete @"maneuverComplete" #define NAMES_manualTextEntry @"manualTextEntry" +#define NAMES_maxBitrate @"maxBitrate" #define NAMES_maxDuration @"maxDuration" #define NAMES_maximumChangeVelocity @"maximumChangeVelocity" #define NAMES_maxNumberRFCOMMPorts @"maxNumberRFCOMMPorts" @@ -291,6 +292,7 @@ #define NAMES_powerModeActive @"powerModeActive" #define NAMES_powerModeQualificationStatus @"powerModeQualificationStatus" #define NAMES_powerModeStatus @"powerModeStatus" +#define NAMES_preferredResolution @"preferredResolution" #define NAMES_prerecordedSpeech @"prerecordedSpeech" #define NAMES_presetBankCapabilities @"presetBankCapabilities" #define NAMES_pressAvailable @"pressAvailable" @@ -375,6 +377,7 @@ #define NAMES_subThoroughfare @"subThoroughfare" #define NAMES_success @"success" #define NAMES_supportedDiagModes @"supportedDiagModes" +#define NAMES_supportedFormats @"supportedFormats" #define NAMES_syncFileName @"syncFileName" #define NAMES_syncMsgVersion @"syncMsgVersion" #define NAMES_SyncPData @"SyncPData" @@ -432,6 +435,8 @@ #define NAMES_value @"value" #define NAMES_vdop @"vdop" #define NAMES_vehicleType @"vehicleType" +#define NAMES_videoCodec @"videoCodec" +#define NAMES_videoProtocol @"videoProtocol" #define NAMES_videoStreaming @"videoStreaming" #define NAMES_vin @"vin" #define NAMES_voiceRecOn @"voiceRecOn" diff --git a/SmartDeviceLink/SDLSystemCapability.m b/SmartDeviceLink/SDLSystemCapability.m index 495e59add..6901abf42 100644 --- a/SmartDeviceLink/SDLSystemCapability.m +++ b/SmartDeviceLink/SDLSystemCapability.m @@ -12,6 +12,7 @@ #import "SDLNavigationCapability.h" #import "SDLPhoneCapability.h" #import "SDLSystemCapabilityType.h" +#import "SDLVideoStreamingCapability.h" @implementation SDLSystemCapability diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.h b/SmartDeviceLink/SDLVideoStreamingCapability.h new file mode 100644 index 000000000..b8d6692ec --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCapability.h @@ -0,0 +1,44 @@ +// +// SDLVideoStreamingCapability.h +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLRPCMessage.h" + +@class SDLImageResolution; +@class SDLVideoStreamingFormat; + +@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; + +/** + * @abstract The preferred resolution of a video stream for decoding and rendering on HMI, optional + */ +@property (strong, nonatomic) SDLImageResolution *preferredResolution; + +/** + * @abstract The maximum bitrate of video stream that is supported, in kbps, optional + * minvalue= 0 + * maxvalue= 2147483647 + */ +@property (strong, nonatomic) NSNumber *maxBitrate; + +/** + * @abstract Detailed information on each format supported by this system, in its preferred order, optional + */ +@property (strong, nonatomic) NSMutableArray *supportedFormats; + +@end diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.m b/SmartDeviceLink/SDLVideoStreamingCapability.m new file mode 100644 index 000000000..9ddc4cf32 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCapability.m @@ -0,0 +1,75 @@ +// +// SDLVideoStreamingCapability.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLNames.h" +#import "SDLVideoStreamingFormat.h" +#import "SDLVideoStreamingCapability.h" + +@implementation SDLVideoStreamingCapability + +- (instancetype)init { + if (self = [super init]) { + } + return self; +} + +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict { + if (self = [super initWithDictionary:dict]) { + } + return self; +} + +- (void)setPreferredResolution:(SDLImageResolution *)preferredResolution { + if (preferredResolution != nil) { + [store setObject:preferredResolution forKey:NAMES_preferredResolution]; + } else { + [store removeObjectForKey:NAMES_preferredResolution]; + } +} + +- (SDLImageResolution *)preferredResolution { + return store[NAMES_preferredResolution]; +} + +- (void)setMaxBitrate:(NSNumber *)maxBitrate { + if (maxBitrate != nil) { + [store setObject:maxBitrate forKey:NAMES_maxBitrate]; + } else { + [store removeObjectForKey:NAMES_maxBitrate]; + } +} + +- (NSNumber *)maxBitrate { + return store[NAMES_maxBitrate]; +} + +- (void)setSupportedFormats:(NSMutableArray *)supportedFormats { + if (supportedFormats != nil) { + [store setObject:supportedFormats forKey:NAMES_supportedFormats]; + } else { + [store removeObjectForKey:NAMES_supportedFormats]; + } +} + +- (NSMutableArray *)supportedFormats { + NSMutableArray *array = [store objectForKey:NAMES_supportedFormats]; + if ([array isEqual:[NSNull null]]) { + return [NSMutableArray array]; + } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLVideoStreamingFormat.class]) { + return array; + } else { + NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]]; + for (NSDictionary *dict in array) { + [newList addObject:[[SDLVideoStreamingFormat alloc] initWithDictionary:(NSMutableDictionary *)dict]]; + } + return newList; + } +} + + +@end diff --git a/SmartDeviceLink/SDLVideoStreamingFormat.h b/SmartDeviceLink/SDLVideoStreamingFormat.h new file mode 100644 index 000000000..3f1b5829f --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingFormat.h @@ -0,0 +1,37 @@ +// +// SDLVideoStreamingFormat.h +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLRPCMessage.h" + +@class SDLVideoStreamingCodec; +@class SDLVideoStreamingProtocol; + +@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 diff --git a/SmartDeviceLink/SDLVideoStreamingFormat.m b/SmartDeviceLink/SDLVideoStreamingFormat.m new file mode 100644 index 000000000..4cc4a7341 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingFormat.m @@ -0,0 +1,50 @@ +// +// SDLVideoStreamingFormat.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLNames.h" +#import "SDLVideoStreamingFormat.h" + +@implementation SDLVideoStreamingFormat + +- (instancetype)init { + if (self = [super init]) { + } + return self; +} + +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict { + if (self = [super initWithDictionary:dict]) { + } + return self; +} + +- (void)setVideoStreamingProtocol:(SDLVideoStreamingProtocol *)protocol { + if (protocol != nil) { + [store setObject:protocol forKey:NAMES_videoProtocol]; + } else { + [store removeObjectForKey:NAMES_videoProtocol]; + } +} + +- (SDLVideoStreamingProtocol *)protocol { + return store[NAMES_videoProtocol]; +} + +- (void)setVideoStreamingCodec:(SDLVideoStreamingCodec *)codec { + if (codec != nil) { + [store setObject:codec forKey:NAMES_videoCodec]; + } else { + [store removeObjectForKey:NAMES_videoCodec]; + } +} + +- (SDLVideoStreamingCodec *)codec { + return store[NAMES_videoCodec]; +} + +@end diff --git a/SmartDeviceLink/SDLVideoStreamingProtocol.h b/SmartDeviceLink/SDLVideoStreamingProtocol.h new file mode 100644 index 000000000..d36f969ec --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingProtocol.h @@ -0,0 +1,58 @@ +// +// SDLVideoStreamingProtocol.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 protocol + * + * @since SDL 4.7 + */ +@interface SDLVideoStreamingProtocol : SDLEnum + +/** + * Convert String to SDLVideoStreamingProtocol + * + * @param value String value to retrieve the object for + * + * @return SDLVideoStreamingProtocol + */ ++ (SDLVideoStreamingProtocol *)valueOf:(NSString *)value; + +/** + @abstract Store the enumeration of all possible SDLVideoStreamingProtocol + @return an array that store all possible SDLVideoStreamingProtocol + */ ++ (NSArray *)values; + +/** + @abstract SDLVideoStreamingProtocol : RAW + */ ++ (SDLVideoStreamingProtocol *)RAW; + +/** + @abstract SDLVideoStreamingProtocol : RTP + */ ++ (SDLVideoStreamingProtocol *)RTP; + +/** + @abstract SDLVideoStreamingProtocol : RTSP + */ ++ (SDLVideoStreamingProtocol *)RTSP; + +/** + @abstract SDLVideoStreamingProtocol : RTMP + */ ++ (SDLVideoStreamingProtocol *)RTMP; + +/** + @abstract SDLVideoStreamingProtocol : WEBM + */ ++ (SDLVideoStreamingProtocol *)WEBM; + +@end diff --git a/SmartDeviceLink/SDLVideoStreamingProtocol.m b/SmartDeviceLink/SDLVideoStreamingProtocol.m new file mode 100644 index 000000000..0509be0cc --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingProtocol.m @@ -0,0 +1,78 @@ +// +// SDLVideoStreamingProtocol.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLVideoStreamingProtocol.h" + +SDLVideoStreamingProtocol *SDLVideoStreamingProtocol_RAW = nil; +SDLVideoStreamingProtocol *SDLVideoStreamingProtocol_RTP = nil; +SDLVideoStreamingProtocol *SDLVideoStreamingProtocol_RTSP = nil; +SDLVideoStreamingProtocol *SDLVideoStreamingProtocol_RTMP = nil; +SDLVideoStreamingProtocol *SDLVideoStreamingProtocol_WEBM = nil; + +NSArray *SDLVideoStreamingProtocol_values = nil; + +@implementation SDLVideoStreamingProtocol + ++ (SDLVideoStreamingProtocol *)valueOf:(NSString *)value { + for (SDLVideoStreamingProtocol *item in SDLVideoStreamingProtocol.values) { + if ([item.value isEqualToString:value]) { + return item; + } + } + return nil; +} + ++ (NSArray *)values { + if (SDLVideoStreamingProtocol_values == nil) { + SDLVideoStreamingProtocol_values = @[ + SDLVideoStreamingProtocol.RAW, + SDLVideoStreamingProtocol.RTP, + SDLVideoStreamingProtocol.RTSP, + SDLVideoStreamingProtocol.RTMP, + SDLVideoStreamingProtocol.WEBM + ]; + } + return SDLVideoStreamingProtocol_values; +} + ++ (SDLVideoStreamingProtocol *)RAW { + if (SDLVideoStreamingProtocol_RAW == nil) { + SDLVideoStreamingProtocol_RAW = [[SDLVideoStreamingProtocol alloc] initWithValue:@"RAW"]; + } + return SDLVideoStreamingProtocol_RAW; +} + ++ (SDLVideoStreamingProtocol *)RTP { + if (SDLVideoStreamingProtocol_RTP == nil) { + SDLVideoStreamingProtocol_RTP = [[SDLVideoStreamingProtocol alloc] initWithValue:@"RTP"]; + } + return SDLVideoStreamingProtocol_RTP; +} + ++ (SDLVideoStreamingProtocol *)RTSP { + if (SDLVideoStreamingProtocol_RTSP == nil) { + SDLVideoStreamingProtocol_RTSP = [[SDLVideoStreamingProtocol alloc] initWithValue:@"RTSP"]; + } + return SDLVideoStreamingProtocol_RTSP; +} + ++ (SDLVideoStreamingProtocol *)RTMP { + if (SDLVideoStreamingProtocol_RTMP == nil) { + SDLVideoStreamingProtocol_RTMP = [[SDLVideoStreamingProtocol alloc] initWithValue:@"RTMP"]; + } + return SDLVideoStreamingProtocol_RTMP; +} + ++ (SDLVideoStreamingProtocol *)WEBM { + if (SDLVideoStreamingProtocol_WEBM == nil) { + SDLVideoStreamingProtocol_WEBM = [[SDLVideoStreamingProtocol alloc] initWithValue:@"WEBM"]; + } + return SDLVideoStreamingProtocol_WEBM; +} + +@end |