Skip to content
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

Closed
wants to merge 12 commits into from
Closed

Custom video encoder settings and dynamic screen sizes #406

wants to merge 12 commits into from

Conversation

asm09fsu
Copy link
Contributor

@asm09fsu asm09fsu commented May 26, 2016

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 new videoEncoderSettings 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
  • Added ability for developer-specified VTCompressionSession properties.
  • Added support for providing SDLStreamingMediaManager with display capabilities returned from a successful RegisterAppInterface.
Bug Fixes
  • Fixed an issue relating to setting the return error when configuring the video encoder.

@asm09fsu asm09fsu added enhancement proposal Accepted SDL Evolution Proposal labels May 26, 2016
@asm09fsu asm09fsu added this to the 4.2 milestone May 26, 2016

return NO;

if (self.videoEncoderSettings == nil) {
Copy link
Contributor

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.

Copy link
Contributor Author

@asm09fsu asm09fsu May 27, 2016

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.

Copy link
Contributor

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.

@asm09fsu asm09fsu changed the title [WIP] Update video encoder settings & allow for custom settings [WIP] Allow for custom video encoder settings May 26, 2016
@asm09fsu asm09fsu changed the title [WIP] Allow for custom video encoder settings Allow for custom video encoder settings Jun 14, 2016
@joeljfischer joeljfischer modified the milestones: 4.X, 4.2 Jul 27, 2016
…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.
@asm09fsu asm09fsu changed the title Allow for custom video encoder settings Allow for custom video encoder settings including dynamic screen size support. Jul 27, 2016
@codecov-io
Copy link

codecov-io commented Jul 27, 2016

Current coverage is 69.04% (diff: 0.00%)

Merging #406 into develop will decrease coverage by 0.35%

@@            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          

Powered by Codecov. Last update 11b0b07...3638430

@asm09fsu
Copy link
Contributor Author

@joeljfischer Issue #400 has been added to this PR as well, with no modification of the API's init methods.

@joeljfischer joeljfischer changed the title Allow for custom video encoder settings including dynamic screen size support. Custom video encoder settings and dynamic screen sizes Jul 28, 2016
@@ -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];
Copy link
Contributor

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) {
Copy link
Contributor

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

@joeljfischer
Copy link
Contributor

LGTM

@joeljfischer joeljfischer removed the proposal Accepted SDL Evolution Proposal label Jul 29, 2016
@joeljfischer
Copy link
Contributor

This was merged

@asm09fsu asm09fsu deleted the feature/issue_401_video_encoder_settings branch November 1, 2016 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants