Skip to content

Conversation

@ym
Copy link
Contributor

@ym ym commented Nov 21, 2025

No description provided.

@ym ym requested review from adamshiervani and Copilot November 21, 2025 10:07
Copilot finished reviewing on behalf of ym November 21, 2025 10:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where entering sleep mode could occur while the video stream is still active, which could cause system instability. The fix ensures that the video stream is properly stopped before enabling sleep mode.

Key changes:

  • Added VideoIsStreaming() function to check if video streaming is active or stopping
  • Modified setSleepMode() to stop video streaming before enabling sleep mode
  • Implemented underlying C function video_is_streaming() that returns streaming status (active, stopping, or stopped)

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/native/video.go Added logic to check and stop video streaming before enabling sleep mode, with a grace period
internal/native/cgo_linux.go Implemented Go wrapper for the new video streaming status check function
internal/native/cgo_notlinux.go Added stub implementation for non-Linux platforms
internal/native/cgo/video.h Added function declaration and documentation for video_is_streaming()
internal/native/cgo/video.c Implemented video_is_streaming() to return streaming state (1=active, 2=stopping, 0=stopped) and added sleep mode check on select timeout
internal/native/cgo/ctrl.h Added wrapper function declaration for jetkvm_is_video_streaming()
internal/native/cgo/ctrl.c Implemented wrapper function that calls video_is_streaming()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return fmt.Errorf("video stop failed, won't enable sleep mode: %w", err)
}

// wait few seconds to ensure the video stream is stopped
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar: "wait few seconds" should be "wait a few seconds"

Suggested change
// wait few seconds to ensure the video stream is stopped
// wait a few seconds to ensure the video stream is stopped

Copilot uses AI. Check for mistakes.
@ym ym requested a review from Copilot November 21, 2025 10:19
Copilot finished reviewing on behalf of ym November 21, 2025 10:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot finished reviewing on behalf of ym November 21, 2025 12:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (should_restart) {
log_info("restarting video streaming due to format change");
video_restart_streaming();
video_restart_streaming(false);
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function video_restart_streaming() is defined without parameters at line 770, but it's being called with a false argument here. This will cause a compilation error. Remove the false argument from this call.

Suggested change
video_restart_streaming(false);
video_restart_streaming();

Copilot uses AI. Check for mistakes.
@ym ym requested a review from Copilot November 21, 2025 12:13
Copilot finished reviewing on behalf of ym November 21, 2025 12:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamshiervani adamshiervani merged commit d24ce1c into dev Nov 21, 2025
5 checks passed
@adamshiervani adamshiervani deleted the fix/sleep-mode-video-stop branch November 21, 2025 13:37
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.

3 participants