diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-08-03 14:54:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 14:54:36 -0400 |
commit | 1100710e66c3acc73a6311a86a479f8830a881f5 (patch) | |
tree | c89d21df4fdbfb82012c704aff9b9d7382b38925 | |
parent | bcded2da89ad7a5e9780f47b0b4b516a44237e2e (diff) | |
parent | 48099b25ed665d15b5c6830915b6e8a6fae9ba8f (diff) | |
download | sdl_ios-1100710e66c3acc73a6311a86a479f8830a881f5.tar.gz |
Merge pull request #668 from smartdevicelink/feature/SDL-0058-video-streaming-capabilities
Implement SDL 0058 video streaming capabilities
24 files changed, 963 insertions, 3 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 6b8e0a680..813d8687b 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -903,6 +903,18 @@ 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 */; }; + 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 */; }; + 8BD729B51F2A711D0029AC93 /* SDLVideoStreamingCodecSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD729B41F2A711D0029AC93 /* SDLVideoStreamingCodecSpec.m */; }; + 8BD729B71F2A75FD0029AC93 /* SDLVideoStreamingProtocolSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD729B61F2A75FD0029AC93 /* SDLVideoStreamingProtocolSpec.m */; }; + 8BF9DE071F2BAEEE004FFCBB /* SDLVideoStreamingFormatSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BF9DE061F2BAEEE004FFCBB /* SDLVideoStreamingFormatSpec.m */; }; + 8BF9DE091F2BAF0C004FFCBB /* SDLVideoStreamingCapabilitySpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BF9DE081F2BAF0C004FFCBB /* SDLVideoStreamingCapabilitySpec.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 +1975,18 @@ 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>"; }; + 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>"; }; + 8BD729B41F2A711D0029AC93 /* SDLVideoStreamingCodecSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingCodecSpec.m; sourceTree = "<group>"; }; + 8BD729B61F2A75FD0029AC93 /* SDLVideoStreamingProtocolSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingProtocolSpec.m; sourceTree = "<group>"; }; + 8BF9DE061F2BAEEE004FFCBB /* SDLVideoStreamingFormatSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingFormatSpec.m; sourceTree = "<group>"; }; + 8BF9DE081F2BAF0C004FFCBB /* SDLVideoStreamingCapabilitySpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingCapabilitySpec.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>"; }; @@ -2174,6 +2198,8 @@ 162E82241A9BDE8A00906325 /* SDLWarningLightStatusSpec.m */, DA9F7E9D1DCC05B900ACAE48 /* SDLWaypointTypeSpec.m */, 162E82251A9BDE8A00906325 /* SDLWiperStatusSpec.m */, + 8BD729B41F2A711D0029AC93 /* SDLVideoStreamingCodecSpec.m */, + 8BD729B61F2A75FD0029AC93 /* SDLVideoStreamingProtocolSpec.m */, ); path = EnumSpecs; sourceTree = "<group>"; @@ -2377,6 +2403,8 @@ 162E82B41A9BDE8A00906325 /* SDLVehicleDataResultSpec.m */, 162E82B51A9BDE8A00906325 /* SDLVehicleTypeSpec.m */, 162E82B61A9BDE8A00906325 /* SDLVrHelpItemSpec.m */, + 8BF9DE061F2BAEEE004FFCBB /* SDLVideoStreamingFormatSpec.m */, + 8BF9DE081F2BAF0C004FFCBB /* SDLVideoStreamingCapabilitySpec.m */, ); path = StructSpecs; sourceTree = "<group>"; @@ -2981,6 +3009,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>"; @@ -3129,6 +3161,10 @@ DA9F7E821DCC047200ACAE48 /* SDLWaypointType.m */, 5D61FC261A84238C00846EE7 /* SDLWiperStatus.h */, 5D61FC271A84238C00846EE7 /* SDLWiperStatus.m */, + 8BD729A41F2A2CF30029AC93 /* SDLVideoStreamingCodec.h */, + 8BD729A51F2A2CF30029AC93 /* SDLVideoStreamingCodec.m */, + 8BD729A81F2A41F40029AC93 /* SDLVideoStreamingProtocol.h */, + 8BD729A91F2A41F40029AC93 /* SDLVideoStreamingProtocol.m */, ); name = Enums; sourceTree = "<group>"; @@ -4153,6 +4189,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 */, @@ -4215,6 +4252,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 */, @@ -4233,6 +4271,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 */, @@ -4286,6 +4325,7 @@ 5D61FD6F1A84238C00846EE7 /* SDLRPCPayload.h in Headers */, 5D61FCF01A84238C00846EE7 /* SDLLockScreenStatusManager.h in Headers */, 5D61FD311A84238C00846EE7 /* SDLPolicyDataParser.h in Headers */, + 8BD729B21F2A61DF0029AC93 /* SDLVideoStreamingCapability.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4479,6 +4519,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 */, @@ -4647,6 +4688,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 */, @@ -4664,6 +4706,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 */, @@ -4678,6 +4721,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 */, @@ -4822,6 +4866,7 @@ 5DCF76FE1ACDDB5A00BB647B /* SDLSendLocationResponseSpec.m in Sources */, 162E837D1A9BDE8B00906325 /* SDLEmergencyEventSpec.m in Sources */, 162E82D31A9BDE8A00906325 /* SDLCarModeStatusSpec.m in Sources */, + 8BD729B71F2A75FD0029AC93 /* SDLVideoStreamingProtocolSpec.m in Sources */, 162E82EA1A9BDE8B00906325 /* SDLLanguageSpec.m in Sources */, 5D76E3291D3D0A8800647CFA /* SDLFakeViewControllerPresenter.m in Sources */, 162E83331A9BDE8B00906325 /* SDLPerformInteractionSpec.m in Sources */, @@ -4990,6 +5035,7 @@ 162E83031A9BDE8B00906325 /* SDLTriggerSource.m in Sources */, 162E82D61A9BDE8A00906325 /* SDLComponentVolumeStatusSpec.m in Sources */, 162E835C1A9BDE8B00906325 /* SDLPutFileResponseSpec.m in Sources */, + 8BD729B51F2A711D0029AC93 /* SDLVideoStreamingCodecSpec.m in Sources */, DA9F7EAA1DCC061A00ACAE48 /* SDLSubscribeWaypointsResponseSpec.m in Sources */, 162E835F1A9BDE8B00906325 /* SDLResetGlobalPropertiesResponseSpec.m in Sources */, 162E835E1A9BDE8B00906325 /* SDLRegisterAppInterfaceResponseSpec.m in Sources */, @@ -5015,6 +5061,7 @@ 162E83311A9BDE8B00906325 /* SDLListFilesSpec.m in Sources */, DA9F7EB01DCC063400ACAE48 /* SDLLocationDetailsSpec.m in Sources */, 5DC978261B7A38640012C2F1 /* SDLGlobalsSpec.m in Sources */, + 8BF9DE071F2BAEEE004FFCBB /* SDLVideoStreamingFormatSpec.m in Sources */, 162E82FF1A9BDE8B00906325 /* SDLTextAlignmentSpec.m in Sources */, 162E831F1A9BDE8B00906325 /* SDLOnTouchEventSpec.m in Sources */, 162E83921A9BDE8B00906325 /* SDLTouchEventCapabilitiesSpec.m in Sources */, @@ -5027,6 +5074,7 @@ 162E831D1A9BDE8B00906325 /* SDLOnSystemRequestSpec.m in Sources */, 162E835D1A9BDE8B00906325 /* SDLReadDIDResponseSpec.m in Sources */, 162E82D41A9BDE8A00906325 /* SDLCharacterSetSpec.m in Sources */, + 8BF9DE091F2BAF0C004FFCBB /* SDLVideoStreamingCapabilitySpec.m in Sources */, 162E830F1A9BDE8B00906325 /* SDLOnAppInterfaceUnregisteredSpec.m in Sources */, 162E83971A9BDE8B00906325 /* SDLVehicleTypeSpec.m in Sources */, 1680B1131A9CD7AD00DBD79E /* SDLProtocolHeaderSpec.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..effb5855d 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,10 @@ #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_videoStreamingCapability @"videoStreamingCapability" #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..09f68f2cf 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 @@ -51,6 +52,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 +117,21 @@ } } +- (void)setVideoStreamingCapability:(SDLVideoStreamingCapability *)videoStreamingCapability { + if (videoStreamingCapability != nil) { + store[NAMES_videoStreamingCapability] = videoStreamingCapability; + } else { + [store removeObjectForKey:NAMES_videoStreamingCapability]; + } +} + +- (SDLVideoStreamingCapability *)videoStreamingCapability { + NSObject *obj = store[NAMES_videoStreamingCapability]; + if (obj == nil || [obj isKindOfClass:SDLVideoStreamingCapability.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..b17fa5155 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/SDLVideoStreamingCapability.h b/SmartDeviceLink/SDLVideoStreamingCapability.h new file mode 100644 index 000000000..b14d49946 --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCapability.h @@ -0,0 +1,45 @@ +// +// 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; + +- (instancetype)initWithVideoStreaming:(SDLImageResolution *)preferredResolution maxBitrate:(NSNumber *)maxBitrate supportedFormats:(NSArray<SDLVideoStreamingFormat *> *)supportedFormats; +/** + * @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<SDLVideoStreamingFormat *> *supportedFormats; + +@end diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.m b/SmartDeviceLink/SDLVideoStreamingCapability.m new file mode 100644 index 000000000..112d0c42a --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingCapability.m @@ -0,0 +1,93 @@ +// +// SDLVideoStreamingCapability.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLImageResolution.h" +#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; +} + +- (instancetype)initWithVideoStreaming:(SDLImageResolution *)preferredResolution maxBitrate:(NSNumber *)maxBitrate supportedFormats:(NSArray<SDLVideoStreamingFormat *> *)supportedFormats { + self = [self init]; + if (!self) { + return self; + } + + self.maxBitrate = maxBitrate; + self.preferredResolution = preferredResolution; + self.supportedFormats = [supportedFormats mutableCopy]; + + return self; +} + +- (void)setPreferredResolution:(SDLImageResolution *)preferredResolution { + if (preferredResolution != nil) { + [store setObject:preferredResolution forKey:NAMES_preferredResolution]; + } else { + [store removeObjectForKey:NAMES_preferredResolution]; + } +} + +- (SDLImageResolution *)preferredResolution { + NSObject *obj = [store objectForKey:NAMES_preferredResolution]; + if (obj == nil || [obj isKindOfClass:SDLImageResolution.class]) { + return (SDLImageResolution *)obj; + } else { + return [[SDLImageResolution alloc] initWithDictionary:(NSMutableDictionary *)obj]; + } +} + +- (void)setMaxBitrate:(NSNumber *)maxBitrate { + if (maxBitrate != nil) { + [store setObject:maxBitrate forKey:NAMES_maxBitrate]; + } else { + [store removeObjectForKey:NAMES_maxBitrate]; + } +} + +- (NSNumber *)maxBitrate { + return [store objectForKey: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/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 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..49f7a650c --- /dev/null +++ b/SmartDeviceLink/SDLVideoStreamingFormat.m @@ -0,0 +1,62 @@ +// +// SDLVideoStreamingFormat.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLNames.h" +#import "SDLVideoStreamingCodec.h" +#import "SDLVideoStreamingFormat.h" +#import "SDLVideoStreamingProtocol.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 { + NSObject *obj = [store objectForKey:NAMES_videoProtocol]; + if (obj == nil || [obj isKindOfClass:SDLVideoStreamingProtocol.class]) { + return (SDLVideoStreamingProtocol *)obj; + } else { + return [SDLVideoStreamingProtocol valueOf:(NSString *)obj]; + } +} + +- (void)setVideoStreamingCodec:(SDLVideoStreamingCodec *)codec { + if (codec != nil) { + [store setObject:codec forKey:NAMES_videoCodec]; + } else { + [store removeObjectForKey:NAMES_videoCodec]; + } +} + +- (SDLVideoStreamingCodec *)codec { + NSObject *obj = [store objectForKey:NAMES_videoCodec]; + if (obj == nil || [obj isKindOfClass:SDLVideoStreamingCodec.class]) { + return (SDLVideoStreamingCodec *)obj; + } else { + return [SDLVideoStreamingCodec valueOf:(NSString *)obj]; + } +} + +@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 diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m index f979b28aa..1fee82b62 100644 --- a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m @@ -12,12 +12,14 @@ describe(@"Individual Enum Value Tests", ^ { it(@"Should match internal values", ^ { expect([SDLSystemCapabilityType NAVIGATION].value).to(equal(@"NAVIGATION")); expect([SDLSystemCapabilityType PHONE_CALL].value).to(equal(@"PHONE_CALL")); + expect([SDLSystemCapabilityType VIDEO_STREAMING].value).to(equal(@"VIDEO_STREAMING")); }); }); describe(@"ValueOf Tests", ^ { it(@"Should return correct values when valid", ^ { expect([SDLSystemCapabilityType valueOf:@"NAVIGATION"]).to(equal([SDLSystemCapabilityType NAVIGATION])); expect([SDLSystemCapabilityType valueOf:@"PHONE_CALL"]).to(equal([SDLSystemCapabilityType PHONE_CALL])); + expect([SDLSystemCapabilityType valueOf:@"VIDEO_STREAMING"]).to(equal([SDLSystemCapabilityType VIDEO_STREAMING])); }); it(@"Should return nil when invalid", ^ { @@ -30,7 +32,8 @@ describe(@"Value List Tests", ^ { __block NSArray* definedValues; beforeSuite(^ { definedValues = [@[[SDLSystemCapabilityType NAVIGATION], - [SDLSystemCapabilityType PHONE_CALL]] copy]; + [SDLSystemCapabilityType PHONE_CALL], + [SDLSystemCapabilityType VIDEO_STREAMING]] copy]; }); it(@"Should contain all defined enum values", ^ { diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVideoStreamingCodecSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVideoStreamingCodecSpec.m new file mode 100644 index 000000000..023133bd3 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVideoStreamingCodecSpec.m @@ -0,0 +1,67 @@ +// +// SDLVideoStreamingCodecSpec.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLVideoStreamingCodec.h" + +QuickSpecBegin(SDLVideoStreamingCodecSpec) + +describe(@"Individual Enum Value Tests", ^ { + it(@"Should match internal values", ^ { + expect([SDLVideoStreamingCodec H264].value).to(equal(@"H264")); + expect([SDLVideoStreamingCodec H265].value).to(equal(@"H265")); + expect([SDLVideoStreamingCodec THEORA].value).to(equal(@"THEORA")); + expect([SDLVideoStreamingCodec VP8].value).to(equal(@"VP8")); + expect([SDLVideoStreamingCodec VP9].value).to(equal(@"VP9")); + }); +}); + +describe(@"ValueOf Tests", ^ { + it(@"Should return correct values when valid", ^ { + expect([SDLVideoStreamingCodec valueOf:@"H264"]).to(equal([SDLVideoStreamingCodec H264])); + expect([SDLVideoStreamingCodec valueOf:@"H265"]).to(equal([SDLVideoStreamingCodec H265])); + expect([SDLVideoStreamingCodec valueOf:@"THEORA"]).to(equal([SDLVideoStreamingCodec THEORA])); + expect([SDLVideoStreamingCodec valueOf:@"VP8"]).to(equal([SDLVideoStreamingCodec VP8])); + expect([SDLVideoStreamingCodec valueOf:@"VP9"]).to(equal([SDLVideoStreamingCodec VP9])); + }); + + it(@"Should return nil when invalid", ^ { + expect([SDLVideoStreamingCodec valueOf:nil]).to(beNil()); + expect([SDLVideoStreamingCodec valueOf:@"JKUYTFHYTHJGFRFGYTR"]).to(beNil()); + }); +}); + +describe(@"Value List Tests", ^ { + NSArray* storedValues = [SDLVideoStreamingCodec values]; + __block NSArray* definedValues; + beforeSuite(^ { + definedValues = [@[[SDLVideoStreamingCodec H264], + [SDLVideoStreamingCodec H265], + [SDLVideoStreamingCodec THEORA], + [SDLVideoStreamingCodec VP8], + [SDLVideoStreamingCodec VP9]] copy]; + }); + + it(@"Should contain all defined enum values", ^ { + for (int i = 0; i < definedValues.count; i++) { + expect(storedValues).to(contain(definedValues[i])); + } + }); + + it(@"Should contain only defined enum values", ^ { + for (int i = 0; i < storedValues.count; i++) { + expect(definedValues).to(contain(storedValues[i])); + } + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVideoStreamingProtocolSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVideoStreamingProtocolSpec.m new file mode 100644 index 000000000..d3503786b --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVideoStreamingProtocolSpec.m @@ -0,0 +1,67 @@ +// +// SDLVideoStreamingProtocolSpec.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/27/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLVideoStreamingProtocol.h" + +QuickSpecBegin(SDLVideoStreamingProtocolSpec) + +describe(@"Individual Enum Value Tests", ^ { + it(@"Should match internal values", ^ { + expect([SDLVideoStreamingProtocol RAW].value).to(equal(@"RAW")); + expect([SDLVideoStreamingProtocol RTP].value).to(equal(@"RTP")); + expect([SDLVideoStreamingProtocol RTSP].value).to(equal(@"RTSP")); + expect([SDLVideoStreamingProtocol RTMP].value).to(equal(@"RTMP")); + expect([SDLVideoStreamingProtocol WEBM].value).to(equal(@"WEBM")); + }); +}); + +describe(@"ValueOf Tests", ^ { + it(@"Should return correct values when valid", ^ { + expect([SDLVideoStreamingProtocol valueOf:@"RAW"]).to(equal([SDLVideoStreamingProtocol RAW])); + expect([SDLVideoStreamingProtocol valueOf:@"RTP"]).to(equal([SDLVideoStreamingProtocol RTP])); + expect([SDLVideoStreamingProtocol valueOf:@"RTSP"]).to(equal([SDLVideoStreamingProtocol RTSP])); + expect([SDLVideoStreamingProtocol valueOf:@"RTMP"]).to(equal([SDLVideoStreamingProtocol RTMP])); + expect([SDLVideoStreamingProtocol valueOf:@"WEBM"]).to(equal([SDLVideoStreamingProtocol WEBM])); + }); + + it(@"Should return nil when invalid", ^ { + expect([SDLVideoStreamingProtocol valueOf:nil]).to(beNil()); + expect([SDLVideoStreamingProtocol valueOf:@"JKUYTFHYTHJGFRFGYTR"]).to(beNil()); + }); +}); + +describe(@"Value List Tests", ^ { + NSArray* storedValues = [SDLVideoStreamingProtocol values]; + __block NSArray* definedValues; + beforeSuite(^ { + definedValues = [@[[SDLVideoStreamingProtocol RAW], + [SDLVideoStreamingProtocol RTP], + [SDLVideoStreamingProtocol RTSP], + [SDLVideoStreamingProtocol RTMP], + [SDLVideoStreamingProtocol WEBM]] copy]; + }); + + it(@"Should contain all defined enum values", ^ { + for (int i = 0; i < definedValues.count; i++) { + expect(storedValues).to(contain(definedValues[i])); + } + }); + + it(@"Should contain only defined enum values", ^ { + for (int i = 0; i < storedValues.count; i++) { + expect(definedValues).to(contain(storedValues[i])); + } + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m index e9935bedf..ba452bb7e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m @@ -16,12 +16,14 @@ describe(@"SDLHMICapabilities struct", ^{ __block SDLHMICapabilities *testStruct = nil; __block NSNumber *somePhoneCallState = @NO; __block NSNumber *someNavigationState = @YES; + __block NSNumber *someVideoStreamState = @NO; context(@"When initialized with properties", ^{ beforeEach(^{ testStruct = [[SDLHMICapabilities alloc] init]; testStruct.phoneCall = somePhoneCallState; testStruct.navigation = someNavigationState; + testStruct.videoStreaming = someVideoStreamState; }); it(@"should properly set phone call", ^{ @@ -31,13 +33,18 @@ describe(@"SDLHMICapabilities struct", ^{ it(@"should properly set navigation", ^{ expect(testStruct.navigation).to(equal(someNavigationState)); }); + + it(@"should properly set video streaming", ^{ + expect(testStruct.videoStreaming).to(equal(someVideoStreamState)); + }); }); context(@"When initialized with a dictionary", ^{ beforeEach(^{ NSDictionary *structInitDict = @{ NAMES_navigation: someNavigationState, - NAMES_phoneCall: somePhoneCallState + NAMES_phoneCall: somePhoneCallState, + NAMES_videoStreaming: someVideoStreamState }; testStruct = [[SDLHMICapabilities alloc] initWithDictionary:[structInitDict mutableCopy]]; }); @@ -49,6 +56,10 @@ describe(@"SDLHMICapabilities struct", ^{ it(@"should properly set navigation", ^{ expect(testStruct.navigation).to(equal(someNavigationState)); }); + + it(@"should properly set video streaming", ^{ + expect(testStruct.videoStreaming).to(equal(someVideoStreamState)); + }); }); context(@"When not initialized", ^{ @@ -63,6 +74,10 @@ describe(@"SDLHMICapabilities struct", ^{ it(@"navigation should be nil", ^{ expect(testStruct.navigation).to(beNil()); }); + + it(@"video streaming should be nil", ^{ + expect(testStruct.videoStreaming).to(beNil()); + }); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m index 9a2909128..a081cc366 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m @@ -5,9 +5,15 @@ #import "SDLSystemCapability.h" +#import "SDLImageResolution.h" #import "SDLNavigationCapability.h" #import "SDLPhoneCapability.h" #import "SDLSystemCapabilityType.h" +#import "SDLVideoStreamingCapability.h" +#import "SDLVideoStreamingCodec.h" +#import "SDLVideoStreamingFormat.h" +#import "SDLVideoStreamingProtocol.h" + #import "SDLNames.h" QuickSpecBegin(SDLSystemCapabilitySpec) @@ -24,6 +30,11 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.navigationCapability.sendLocationEnabled).to(equal(YES)); expect(testStruct.navigationCapability.getWayPointsEnabled).to(equal(NO)); expect(testStruct.phoneCapability.dialNumberEnabled).to(equal(YES)); + + testStruct.systemCapabilityType = [SDLSystemCapabilityType VIDEO_STREAMING]; + + expect(testStruct.systemCapabilityType).to(equal([SDLSystemCapabilityType VIDEO_STREAMING])); + }); }); @@ -47,6 +58,7 @@ describe(@"Initialization tests", ^{ expect(testStruct.systemCapabilityType).to(beNil()); expect(testStruct.navigationCapability).to(beNil()); expect(testStruct.phoneCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(beNil()); }); it(@"should initialize correctly with initWithPhoneCapability:", ^{ @@ -56,6 +68,7 @@ describe(@"Initialization tests", ^{ expect(testStruct.systemCapabilityType).to(equal([SDLSystemCapabilityType PHONE_CALL])); expect(testStruct.phoneCapability.dialNumberEnabled).to(equal(YES)); expect(testStruct.navigationCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(beNil()); }); it(@"should initialize correctly with initWithNavigationCapability:", ^{ @@ -66,6 +79,35 @@ describe(@"Initialization tests", ^{ expect(testStruct.navigationCapability.sendLocationEnabled).to(equal(YES)); expect(testStruct.navigationCapability.getWayPointsEnabled).to(equal(YES)); expect(testStruct.phoneCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(beNil()); + }); + + it(@"should initialize correctly with initWithVideoStreamingCapability:", ^{ + + SDLImageResolution* resolution = [[SDLImageResolution alloc] init]; + resolution.resolutionWidth = @600; + resolution.resolutionHeight = @500; + + NSNumber *maxBitrate = @100; + + SDLVideoStreamingFormat *format1 = [[SDLVideoStreamingFormat alloc] init]; + format1.codec = [SDLVideoStreamingCodec H264]; + format1.protocol = [SDLVideoStreamingProtocol RTP]; + + SDLVideoStreamingFormat *format2 = [[SDLVideoStreamingFormat alloc] init]; + format2.codec = [SDLVideoStreamingCodec H265]; + format2.protocol = [SDLVideoStreamingProtocol RTSP]; + + NSArray<SDLVideoStreamingFormat *> *formatArray = @[format1, format2]; + + SDLVideoStreamingCapability *testVidStruct = [[SDLVideoStreamingCapability alloc] initWithVideoStreaming:resolution maxBitrate:maxBitrate supportedFormats:formatArray]; + SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithVideoStreamingCapability:testVidStruct]; + + expect(testStruct.systemCapabilityType).to(equal([SDLSystemCapabilityType VIDEO_STREAMING])); + expect(testStruct.navigationCapability.sendLocationEnabled).to(beNil()); + expect(testStruct.navigationCapability.getWayPointsEnabled).to(beNil()); + expect(testStruct.phoneCapability).to(beNil()); + }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m new file mode 100644 index 000000000..b4aecf238 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m @@ -0,0 +1,88 @@ +// +// SDLVideoStreamingCapabilitySpec.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/28/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNames.h" +#import "SDLImageResolution.h" +#import "SDLVideoStreamingCapability.h" +#import "SDLVideoStreamingCodec.h" +#import "SDLVideoStreamingFormat.h" +#import "SDLVideoStreamingProtocol.h" + +QuickSpecBegin(SDLVideoStreamingCapabilitySpec) + +describe(@"Initialization tests", ^{ + it(@"Should get correctly when initialized with a dictionary", ^ { + + SDLImageResolution* resolution = [[SDLImageResolution alloc] init]; + resolution.resolutionWidth = @600; + resolution.resolutionHeight = @500; + + NSNumber *maxBitrate = @100; + + SDLVideoStreamingFormat *format1 = [[SDLVideoStreamingFormat alloc] init]; + format1.codec = [SDLVideoStreamingCodec H264]; + format1.protocol = [SDLVideoStreamingProtocol RTP]; + + SDLVideoStreamingFormat *format2 = [[SDLVideoStreamingFormat alloc] init]; + format2.codec = [SDLVideoStreamingCodec H265]; + format2.protocol = [SDLVideoStreamingProtocol RTSP]; + + NSArray<SDLVideoStreamingFormat *> *formatArray = @[format1, format2]; + + NSMutableDictionary* dict = [@{NAMES_preferredResolution: resolution, + NAMES_maxBitrate: maxBitrate, + NAMES_supportedFormats: formatArray} mutableCopy]; + + SDLVideoStreamingCapability* testStruct = [[SDLVideoStreamingCapability alloc] initWithDictionary:dict]; + + expect(testStruct.preferredResolution).to(equal(resolution)); + expect(testStruct.maxBitrate).to(equal(maxBitrate)); + expect(testStruct.supportedFormats).to(equal(formatArray)); + }); + + it(@"Should return nil if not set", ^ { + SDLVideoStreamingCapability* testStruct = [[SDLVideoStreamingCapability alloc] init]; + + expect(testStruct.preferredResolution).to(beNil()); + expect(testStruct.maxBitrate).to(beNil()); + expect(testStruct.supportedFormats).to(beNil()); + }); + + it(@"Should initialize correctly with initWithVideoStreaming:(SDLImageResolution *)preferredResolution (NSNumber *)maxBitrate (NSArray<SDLVideoStreamingFormat *> *)suportedFormats", ^ { + + SDLImageResolution* resolution = [[SDLImageResolution alloc] init]; + resolution.resolutionWidth = @600; + resolution.resolutionHeight = @500; + + NSNumber *maxBitrate = @100; + + SDLVideoStreamingFormat *format1 = [[SDLVideoStreamingFormat alloc] init]; + format1.codec = [SDLVideoStreamingCodec H264]; + format1.protocol = [SDLVideoStreamingProtocol RTP]; + + SDLVideoStreamingFormat *format2 = [[SDLVideoStreamingFormat alloc] init]; + format2.codec = [SDLVideoStreamingCodec H265]; + format2.protocol = [SDLVideoStreamingProtocol RTSP]; + + NSArray<SDLVideoStreamingFormat *> *formatArray = @[format1, format2]; + + SDLVideoStreamingCapability *testStruct = [[SDLVideoStreamingCapability alloc] initWithVideoStreaming:resolution maxBitrate:maxBitrate supportedFormats:formatArray]; + + expect(testStruct.preferredResolution).to(equal(resolution)); + expect(testStruct.maxBitrate).to(equal(maxBitrate)); + expect(testStruct.supportedFormats).to(equal(formatArray)); + }); + +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m new file mode 100644 index 000000000..b1f0a4e16 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m @@ -0,0 +1,39 @@ +// +// SDLVideoStreamingFormatSpec.m +// SmartDeviceLink-iOS +// +// Created by Brett McIsaac on 7/28/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNames.h" +#import "SDLVideoStreamingCodec.h" +#import "SDLVideoStreamingFormat.h" +#import "SDLVideoStreamingProtocol.h" + +QuickSpecBegin(SDLVideoStreamingFormatSpec) + +describe(@"Initialization tests", ^{ + it(@"Should get correctly when initialized with a dictionary", ^ { + NSMutableDictionary* dict = [@{NAMES_videoProtocol: [SDLVideoStreamingProtocol RAW], + NAMES_videoCodec: [SDLVideoStreamingCodec H264]} mutableCopy]; + SDLVideoStreamingFormat* testStruct = [[SDLVideoStreamingFormat alloc] initWithDictionary:dict]; + + expect(testStruct.protocol).to(equal([SDLVideoStreamingProtocol RAW])); + expect(testStruct.codec).to(equal([SDLVideoStreamingCodec H264])); + }); + + it(@"Should return nil if not set", ^ { + SDLVideoStreamingFormat* testStruct = [[SDLVideoStreamingFormat alloc] init]; + + expect(testStruct.protocol).to(beNil()); + expect(testStruct.codec).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLink_Example/Classes/ProxyManager.m b/SmartDeviceLink_Example/Classes/ProxyManager.m index b4ddacea9..ada8d9e7b 100644 --- a/SmartDeviceLink_Example/Classes/ProxyManager.m +++ b/SmartDeviceLink_Example/Classes/ProxyManager.m @@ -143,6 +143,13 @@ NS_ASSUME_NONNULL_BEGIN "Response: %@" "Error: %@", request, response, error); }]; + SDLGetSystemCapability *getVideoStreamingCapability = [[SDLGetSystemCapability alloc] initWithType:[SDLSystemCapabilityType VIDEO_STREAMING]]; + [self.sdlManager sendRequest:getVideoStreamingCapability withResponseHandler:^(__kindof SDLRPCRequest * _Nullable request, __kindof SDLRPCResponse * _Nullable response, NSError * _Nullable error) { + NSLog(@"Video Streaming Capability:\n" + "Request: %@" + "Response: %@" + "Error: %@", request, response, error); + }]; SDLSetDisplayLayout *displayLayout = [[SDLSetDisplayLayout alloc] initWithLayout:[[SDLPredefinedLayout NON_MEDIA] value]]; [self.sdlManager sendRequest:displayLayout]; |