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

Related to the issue in openwebrtc-ios-sdk #27 #535

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

xelven
Copy link

@xelven xelven commented Dec 8, 2015

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

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

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.

@stefanalund
Copy link
Contributor

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.
@stefanalund
Copy link
Contributor

Thanks for fixing the style stuff, looks good now.

@stefanalund
Copy link
Contributor

I think we can merge this. @superdump?

@superdump
Copy link
Contributor

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?

@xelven
Copy link
Author

xelven commented Dec 12, 2015

@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 after the app active will call the stare do Playing with renderer from openwebrtc-iOS-sdk.

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.

@stefanalund
Copy link
Contributor

@superdump @sdroege thoughts?

return;

switch (state) {
case OWR_MEIDA_RENDER_STOP:
Copy link
Contributor

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

@stefanalund
Copy link
Contributor

@superdump comments addressed.

@stefanalund
Copy link
Contributor

Looks 👍 to me, what do you say @superdump?

@ystreet
Copy link
Contributor

ystreet commented Feb 1, 2016

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.

@superdump
Copy link
Contributor

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.

@xelven
Copy link
Author

xelven commented Feb 1, 2016

@ystreet thank u comment.
@superdump I have to say, if can able automatically handle that whitout iOS API layer, that will be awesome!!
and actually I already implemented the common approach RTC applications in my locally, enter background stop video but audio continue, (even I fixed that after you hangup the audio still running.)
I was plan after you commit this, then I can handle all of other in webrtc-ios-sdk layer, because I think the handle enter background event is specific iOS Layer API.

@alessandrod
Copy link
Contributor

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.

@stefanalund
Copy link
Contributor

@alessandrod has this been fixed now?

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.

5 participants