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

Fix auto restart video stream to ensure hmi level is streamable #1808

Merged
merged 6 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ public void shutDown() {
inputSurface.release();
inputSurface = null;
}
if (mEglCore != null) {
mEglCore.release();
mEglCore = null;
}
} catch (Exception ex) {
DebugTool.logError(TAG, "shutDown() failed");
}
Expand All @@ -262,6 +266,9 @@ public void shutDown() {
* @param Height
*/
private void setupGLES(int Width, int Height) {
if (mEglCore != null) {
mEglCore.release();
}
mEglCore = new EglCore(null, 0);

// This 1x1 offscreen is created just to get the texture name (mTextureId).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,15 @@ public void onServiceStarted(SdlSession session, SessionType type, boolean isEnc
public void onServiceEnded(SdlSession session, SessionType type) {
if (SessionType.NAV.equals(type)) {
if (remoteDisplay != null) {
stopStreaming(withPendingRestart);
if (withPendingRestart && isHMIStateVideoStreamCapable(currentOnHMIStatus)) {
stopStreaming(withPendingRestart);
} else {
stopStreaming();
}
}
stateMachine.transitionToState(StreamingStateMachine.NONE);
transitionToState(SETTING_UP);

if (withPendingRestart) {
if (withPendingRestart && isHMIStateVideoStreamCapable(currentOnHMIStatus)) {
VideoStreamManager manager = VideoStreamManager.this;
manager.internalInterface.startVideoService(manager.getLastCachedStreamingParameters(), manager.isEncrypted, withPendingRestart);
}
Expand Down Expand Up @@ -198,6 +201,10 @@ public void onNotified(RPCNotification notification) {
if (hasStarted && (isHMIStateVideoStreamCapable(prevOnHMIStatus)) && (!isHMIStateVideoStreamCapable(currentOnHMIStatus))) {
stopVideoStream();
}
if (withPendingRestart && hasStarted && (!isHMIStateVideoStreamCapable(prevOnHMIStatus)) && (isHMIStateVideoStreamCapable(currentOnHMIStatus))) {
VideoStreamManager manager = VideoStreamManager.this;
manager.internalInterface.startVideoService(manager.getLastCachedStreamingParameters(), manager.isEncrypted, withPendingRestart);
}
}
}
};
Expand Down