summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2016-07-27 14:47:32 -0700
committerMuller, Alexander (A.) <amulle19@ford.com>2016-07-27 14:47:32 -0700
commit4694398cef6114fd7f38df98ed2b1c870423013e (patch)
tree5002a181714ddfb05c2e814855cdbddd16372ce8
parentf3eb4248f799b396e4bffbe16fc724db968c9c81 (diff)
downloadsdl_ios-4694398cef6114fd7f38df98ed2b1c870423013e.tar.gz
Changed videoEncoderSettings to be null_resettable instead of nullable, because that is essentially what we are doing.
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.h2
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.m21
2 files changed, 16 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.h b/SmartDeviceLink/SDLStreamingMediaManager.h
index 2e3a6dbb1..344ac52f0 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.h
+++ b/SmartDeviceLink/SDLStreamingMediaManager.h
@@ -87,7 +87,7 @@ typedef void (^SDLStreamingStartBlock)(BOOL success, NSError *__nullable error);
*
* @warning Video streaming must not be connected to update the encoder properties. If it is running, issue a stopVideoSession before updating.
*/
-@property (strong, nonatomic, nullable) NSDictionary* videoEncoderSettings;
+@property (strong, nonatomic, null_resettable) NSDictionary* videoEncoderSettings;
@property (assign, nonatomic, readonly) BOOL videoSessionConnected;
@property (assign, nonatomic, readonly) BOOL audioSessionConnected;
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.m b/SmartDeviceLink/SDLStreamingMediaManager.m
index 665917745..ec07f369b 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.m
+++ b/SmartDeviceLink/SDLStreamingMediaManager.m
@@ -39,6 +39,8 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLStreamingMediaManager
+@synthesize videoEncoderSettings = _videoEncoderSettings;
+
#pragma mark - Class Lifecycle
- (instancetype)initWithProtocol:(SDLAbstractProtocol *)protocol {
@@ -129,13 +131,24 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Update video encoder
-- (void)setVideoEncoderSettings:( NSDictionary * _Nullable)videoEncoderSettings {
+- (void)setVideoEncoderSettings:(NSDictionary * _Nullable)videoEncoderSettings {
if (self.videoSessionConnected) {
@throw [NSException exceptionWithName:SDLErrorDomainStreamingMediaVideo reason:@"Cannot update video encoder settings while video session is connected." userInfo:nil];
return;
}
- _videoEncoderSettings = videoEncoderSettings;
+ if (videoEncoderSettings) {
+ _videoEncoderSettings = videoEncoderSettings;
+ } else {
+ _videoEncoderSettings = self.defaultVideoEncoderSettings;
+ }
+}
+
+- (NSDictionary*)videoEncoderSettings {
+ if (!_videoEncoderSettings) {
+ _videoEncoderSettings = self.defaultVideoEncoderSettings;
+ }
+ return _videoEncoderSettings;
}
- (NSDictionary*)defaultVideoEncoderSettings {
@@ -257,10 +270,6 @@ void sdl_videoEncoderOutputCallback(void *outputCallbackRefCon, void *sourceFram
return NO;
}
-
- if (self.videoEncoderSettings == nil) {
- self.videoEncoderSettings = self.defaultVideoEncoderSettings;
- }
// Validate that the video encoder properties are valid.
CFDictionaryRef supportedProperties;