New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom video encoder settings and dynamic screen sizes #406
Conversation
|
||
return NO; | ||
|
||
if (self.videoEncoderSettings == nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is how it's being done, then the video encoder settings dict should be null_resettable, not nullable, and the api should be redesigned so that it's initialized on init
, maybe an initWithEncoderSettings
if possible. For testability, as many dependencies as possible should be injected at init time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initWithEncoderSettings:
would collide with other fixes coming down the pipeline (such as dynamic encoder dimensions). The thought here is that so long as the stream isn't open, we can modify the existing SDLStreamingMediaManager
object, instead of having to specify it via the proxy (since the developer never calls the init). We can definitely add it in the init.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide how this init will work with #400 also making a change / addition to init.
…video_encoder_settings * origin/develop: (26 commits) add id attribute to section headers for linking Add link to smartdevicelink.com to README Update for v4.1.4 Fix not handling the TCP disconnect case Update README.md Update README.md Add documentation coverage badge to README Fix `.xctool-args` path to project Fix another codecov.yml issue Fix branch issue for codecov comments Basically just a bump to re-run tests Update for v4.1.3 Add clean switch to generate-documentation.sh Update gen documentation script Add Jazzy theme, scripts, initial documentation, and an updated gitignore Update codecov yaml file comment and status settings Fix mis-spaced README file causing header issues Fix test script Add carthage before_deploy generating of archive Fix a badge in the README ... # Conflicts: # SmartDeviceLink/SDLStreamingMediaManager.m
…e, because that is essentially what we are doing.
Current coverage is 69.04% (diff: 0.00%)@@ develop #406 diff @@
==========================================
Files 281 281
Lines 9376 9424 +48
Methods 2585 2592 +7
Messages 0 0
Branches 603 612 +9
==========================================
Hits 6507 6507
- Misses 2581 2629 +48
Partials 288 288
|
… when destructing the proxy.
…ster app interface for use in the video encoder.
@joeljfischer Issue #400 has been added to this PR as well, with no modification of the API's init methods. |
@@ -166,7 +169,11 @@ - (NSString *)proxyVersion { | |||
|
|||
- (SDLStreamingMediaManager *)streamingMediaManager { | |||
if (_streamingMediaManager == nil) { | |||
if (self.displayCapabilities == nil) { | |||
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"SDLStreamingMediaManager must be accessed only after a successful RegisterAppInterfaceResponse" userInfo:nil]; | |||
} | |||
_streamingMediaManager = [[SDLStreamingMediaManager alloc] initWithProtocol:self.protocol]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we deprecate initWithProtocol:
and add initWithProtocol:displayCapabilities:
? The displayCapabilities property on SMM will have to stay nullable for now, but that would clarify the actual dependencies.
|
||
if (status != noErr) { | ||
// TODO: Log the error | ||
if (*error != nil) { | ||
if (*error == nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were correct originally. They're checking that the passed NSError address can be dereferenced, and later retrieved by the developer. See "Generating your own errors" at https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/ErrorHandling/ErrorHandling.html
LGTM |
This was merged |
Fixes #399 and #401
This PR is ready for review.
Risk
This PR makes minor API changes.
Testing Plan
For #399
We can test by starting a video session and validating that the encoder is in fact using the screen dimensions returned back from a register app interface response.
For #401
A valid testing plan would make sure that we cannot change the video encoder's settings while a video stream is connected, as well as validating that settings
SDLStreamingMediaManager
's newvideoEncoderSettings
property to nil results in using the default settings.Summary
For #399
Added support for SDLStreamingMediaManager's initializer to use the screen dimensions returned from a successful RegisterAppInterface.
For #401
This PR allows a developer to specify custom video encoder settings if they believe they have found a better means of streaming with their current environment.
Changelog
Enhancements
VTCompressionSession
properties.Bug Fixes