-
Notifications
You must be signed in to change notification settings - Fork 122
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
Streaming Media Manager 5.0 #56
Merged
theresalech
merged 7 commits into
smartdevicelink:master
from
asm09fsu:nnnn-streaming-media-manager-update
Mar 8, 2017
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
85549ba
Created nnnn-streaming-media-manager-update
asm09fsu 22a3c76
Updated to add a scenario for HMI/Phone state not included.
asm09fsu 473627e
Updating how video data is sent.
asm09fsu fdfa584
Updated to include stream lifecycle charts. Updated isPaused code.
asm09fsu 3f5c208
Updated to add in support for touch manager improvements
asm09fsu df19ce5
Fixed property annotations
asm09fsu 66577a1
Updated to talk about incorporating a new class, SDLStreamingMediaLif…
asm09fsu File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,23 +63,23 @@ There will need to be multiple state machines that need to work together to deal | |
- Streaming sessions and encoder are ready. This state is only active so long as HMI is **Limited or greater** and Phone State is **Regaining Active** or **Active**. If at this state, and Phone State changes to **Resigning Active**, send ~30 frames. If at this state, and HMI changes to **Background or less**, move to **Stopped**. | ||
|
||
##### Sending Video Data | ||
There will be a handler, `videoDataHandler`, that will be within SMM that will expect a return of a `CVImageBufferRef` for video. | ||
This handler will be called on a thread that will periodically call it based on CADisplayLayer’s scheduling, which is going to be once per screen draw. The developer will be given a `BOOL` `isEncrypted` to let them know if the stream is encrypted, a `CGSize` `screenSize` to let them know the current Head Unit screen size, and a `CVPixelBufferPoolRef` for using the encoder’s pixel buffer pool. | ||
There will also be a parameter `paused` (and getter `isPaused`) that allows a developer to pause/resume the calling of `videoDataHandler`, based on circumstances where there’s not a need to pull frames (i.e. no new frames available because map is not moving). This will be `NO` by default. If video streaming moves to a state where streaming cannot occur (i.e. HMI state changes to Limited, or Phone state move to Resigning Active), `paused` will be set to `YES` automatically, and if `NO` when regaining state, will resume when possible. | ||
The way in which video frames are sent over will not change from the current implementation. This function will require input of a `CVImageBufferRef` for video. It will be up to the developer to decide how to frequently to call this function. The developer will be able to know if the currently connected stream is encrypted with a `BOOL` `isEncrypted`, a `CGSize` `screenSize` to let them know the current Head Unit screen size, and a `CVPixelBufferPoolRef` for using the encoder’s pixel buffer pool, as is currently available in SMM. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
There will also be getter `isPaused` that informs a developer to if sending of video data is not occurring based on circumstances where there’s not a need to send frames. If video streaming moves to a state where streaming cannot occur (i.e. HMI state changes to Limited, or Phone state move to Resigning Active), `isPaused` will be set to `YES`, and will resume when possible. | ||
|
||
The thought for implementation is as follows: | ||
```objc | ||
// Adding handler for getting video data. This will be called every 1 per screen draw. | ||
streamingMediaManager.videoDataHandler = ^(BOOL isEncrypted, CGSize screenSize, CVPixelBufferPoolRef pixelBufferPool) { | ||
CVPixelBufferRef pixelBufferRef = <# create pixel buffer ref #>; | ||
return pixelBufferRef; | ||
}; | ||
|
||
// Pause the calling of videoDataHandler | ||
streamingMediaManager.paused = YES; | ||
// Checking if SMM is paused | ||
if (streamingMediaManager.isPaused) { | ||
// PAUSED! | ||
<#pause pulling of frames if running#> | ||
return; | ||
} | ||
|
||
// Sending Video Data | ||
CVPixelBufferPoolRef pixelBufferPool = streamingMediaManager.pixelBufferPool; | ||
CGSize screenSize = streamingMediaManager.screenSize; | ||
|
||
CVImageBufferRef frame = <#acquire video frame#> | ||
[streamingMediaManager sendVideoFrame:frame]; | ||
``` | ||
|
||
##### Sending video data when iPhone is moving to background | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@kshala-ford How does this look? Since we are only assuming the developer is using OpenGL, I have changed how we get the video frames from a developer.
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.
lgtm