Skip to content

Conversation

@EnricoSchw
Copy link
Contributor

@EnricoSchw EnricoSchw commented Dec 19, 2025

BugWPB-22425 [Web] - Camera Decoding Issue

Pull Request

Summary

This change improves camera stability on HP devices by disabling hardware acceleration early during application startup.

We identified a known issue affecting HP laptops/desktops when using Electron (Chromium) together with MJPEG camera streams. In these cases, GPU-accelerated video decoding can lead to partially gray or corrupted video frames and unstable frame rates.

To mitigate this, hardware acceleration is now disabled before Chromium initialization on HP devices only. The detection is based on the system manufacturer and runs synchronously during startup, ensuring the correct media pipeline is selected.

This approach prioritizes stability over GPU acceleration and avoids known Intel/Chromium MJPEG decode issues while keeping the change limited in scope.

Key points

  • Hardware acceleration is disabled before Electron/Chromium initialization
  • The change is limited to HP devices
  • Prevents partially gray frames and MJPEG decode instability
  • No impact on application logic or camera APIs

Security Checklist (required)

  • External inputs are validated & sanitized on client and/or server where applicable.
  • API responses are validated; unexpected shapes are handled safely (fallbacks or errors).
  • No unsafe HTML is rendered; if unavoidable, sanitization is applied and documented where it happens.
  • Injection risks (XSS/SQL/command) are prevented via safe APIs and/or escaping.

Standards Acknowledgement (required)


Screenshots or demo (if the user interface changed)

Notes for reviewers

  • Trade-offs:
  • Follow-ups (linked issues):
  • Linked PRs (e.g. web-packages):

  The previous implementation attempted to enable/disable hardware acceleration based on runtime GPU detection, which is ineffective and occurs too late in Electron’s startup lifecycle.
  Introduced logic to disable GPU-based hardware acceleration for affected HP EliteBook 840 G7 models during app startup to address known issues.
@EnricoSchw EnricoSchw changed the title Fix/camera decoding issue wpb 22425 Fix/camera decoding issue [WPB-22425] Dec 19, 2025
  Adjusted `wmic` command path to explicitly use the `SystemRoot` environment variable, ensuring compatibility across Windows systems.
  Included detailed comments explaining the rationale behind using a fixed `wmic` command with absolute path, mitigating risks related to command injection or privilege escalation.
@EnricoSchw
Copy link
Contributor Author

@emil-wire Could you, please review this line

const output = execSync(`"${systemRoot}\\System32\\wbem\\wmic.exe" computersystem get model`, {
      encoding: 'utf8',
      timeout: 1000,
    });

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 22, 2025

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants