-
Notifications
You must be signed in to change notification settings - Fork 536
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
Related to the issue in openwebrtc-ios-sdk #27 #535
base: master
Are you sure you want to change the base?
Conversation
added this api to call GStream API let it stop render when the app enter background, otherwise it will going crash by GStream lib draw_cb & run_message_sync.
renderer = OWR_MEDIA_RENDERER(_renderer); | ||
priv = renderer->priv; | ||
|
||
switch(state){ |
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.
[Style] This switch statement does not follow the syntax of the rest of the code. Please have a look at other similar statements.
Apart from some comments on stylistic issues, I'll leave the reviewing to @superdump @adam-be or @pererikb. |
follow the code style, added a space between args.
modify follow the other switch statement style, and added a protection logic.
Thanks for fixing the style stuff, looks good now. |
I think we can merge this. @superdump? |
MEIDA needs changing to MEDIA. I'm trying to think whether setting the PAUSED state on the media renderer will be sufficient. All the other pipelines (sources, transport agent) will still be in PLAYING and still processing data unless iOS stops the threads. If it stops the threads I don't know if they will resume properly with some kind of correct behaviour. That is, I don't know if this is sufficient to address the issue properly. @sdroege? |
@superdump My plan is change the video render state Paused when the iOS app going background from openwebrtc-ios-sdk, otherwise it still send message let app render but the windows unavailable. And I will let other render keep Playing because the app should be set background mode, all the transport/source/agent are all fine but the window rendering in iOS. |
@superdump @sdroege thoughts? |
return; | ||
|
||
switch (state) { | ||
case OWR_MEIDA_RENDER_STOP: |
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.
MEDIA
and call this OWR_MEDIA_RENDERER_PAUSE
@superdump comments addressed. |
Looks 👍 to me, what do you say @superdump? |
This will most likely work for the current code however with the push to using GL everywhere on iOS, this kind of thing will need to replicated across the source and possibly the transport pipelines as well. The cause is that iOS does not allow using the GPU if the application is not in the foreground and will unceremoniously kill your application if you do. I believe the ios' camera source also has the same restriction. With #553 GL is being used in more pipelines that also need to be paused/stopped. |
Thanks for the comment @ystreet , I would ideally also be able to handle this automatically. However, one common approach in RTC applications is to continue with audio but stop the video and restart it once you return to the application. We probably need to do something like that. |
@ystreet thank u comment. |
I think we should fix glimagesink to not crash when the app goes in background. Then separately, we should investigate how to make OWR consume less resources when in background. I'm looking at the crash now. |
@alessandrod has this been fixed now? |
added this api to call GStream API let it stop render when the app
enter background, otherwise it will going crash by GStream lib draw_cb
& run_message_sync.
EricssonResearch/openwebrtc-ios-sdk#27