Skip to content

fix(llc, samples): to run video on windows #1023

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

renefloor
Copy link
Contributor

@renefloor renefloor commented Jul 11, 2025

🎯 Goal

Run dogfooding on windows.

Related PR: GetStream/webrtc-flutter#37

🛠 Implementation details

Mostly automated changes, the only real change is in audio_constraints.dart

{'DtlsSrtpKeyAgreement': true},

☑️Contributor Checklist

General

  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#flutter-team) (required)
  • PR is linked to the GitHub issue it resolves

☑️Reviewer Checklist

  • Sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • All code we touched has new or updated Documentation

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility by updating the audio constraints configuration for secure media connections.
  • Chores

    • Removed the volume controller plugin from Linux and Windows platforms.
    • Added the screen brightness plugin for Windows.
    • Enhanced Windows build configuration to support dynamic platform specification.

@renefloor renefloor requested a review from a team as a code owner July 11, 2025 08:38
Copy link

coderabbitai bot commented Jul 11, 2025

Walkthrough

The updates remove the volume_controller plugin from both Linux and Windows Flutter plugin registries, replacing it with screen_brightness_windows on Windows. The Windows CMake build script now dynamically sets the target platform with a fallback. Additionally, the audio constraints in the WebRTC package are updated to use a boolean for DTLS-SRTP key agreement.

Changes

Files/Paths Change Summary
dogfooding/linux/flutter/generated_plugin_registrant.cc, dogfooding/linux/flutter/generated_plugins.cmake Removed all references to the volume_controller plugin from Linux plugin registration and CMake list.
dogfooding/windows/flutter/generated_plugins.cmake Removed volume_controller and added screen_brightness_windows to the Windows plugin list.
dogfooding/windows/flutter/CMakeLists.txt Made FLUTTER_TARGET_PLATFORM configurable with a default fallback to windows-x64.
packages/stream_video/lib/src/webrtc/media/audio_constraints.dart Changed 'DtlsSrtpKeyAgreement' value from string 'true' to boolean true in audio constraints.

Sequence Diagram(s)

sequenceDiagram
    participant BuildScript as CMakeLists.txt
    participant Env as Environment
    participant FlutterTool as Flutter Backend

    BuildScript->>Env: Check FLUTTER_TARGET_PLATFORM
    alt Variable is set
        BuildScript->>FlutterTool: Use FLUTTER_TARGET_PLATFORM
    else Not set
        BuildScript->>Env: Set FLUTTER_TARGET_PLATFORM to "windows-x64"
        BuildScript->>FlutterTool: Use default "windows-x64"
    end
Loading

Poem

A plugin departs, a new one arrives,
Bright screens for Windows, as volume survives.
Linux grows lighter, the code is now clean,
Audio constraints truer, as rabbits convene.
With platforms more nimble,
Our builds hop and mingle!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2005c0a and 504a16c.

📒 Files selected for processing (1)
  • packages/stream_video/CHANGELOG.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/stream_video/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: analyze
  • GitHub Check: build
  • GitHub Check: stream_video_noise_cancellation
  • GitHub Check: stream_video_screen_sharing
  • GitHub Check: stream_video_push_notification
  • GitHub Check: analyze_legacy_version
  • GitHub Check: stream_video_flutter
  • GitHub Check: stream_video

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@renefloor renefloor changed the title Fixes to run video on windows fix(llc, samples): to run video on windows Jul 11, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 650befb and 2005c0a.

📒 Files selected for processing (5)
  • dogfooding/linux/flutter/generated_plugin_registrant.cc (0 hunks)
  • dogfooding/linux/flutter/generated_plugins.cmake (0 hunks)
  • dogfooding/windows/flutter/CMakeLists.txt (2 hunks)
  • dogfooding/windows/flutter/generated_plugins.cmake (1 hunks)
  • packages/stream_video/lib/src/webrtc/media/audio_constraints.dart (1 hunks)
💤 Files with no reviewable changes (2)
  • dogfooding/linux/flutter/generated_plugins.cmake
  • dogfooding/linux/flutter/generated_plugin_registrant.cc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build
  • GitHub Check: analyze
  • GitHub Check: analyze_legacy_version
  • GitHub Check: stream_video_flutter
  • GitHub Check: stream_video_screen_sharing
  • GitHub Check: stream_video_noise_cancellation
  • GitHub Check: stream_video_push_notification
  • GitHub Check: stream_video
🔇 Additional comments (2)
packages/stream_video/lib/src/webrtc/media/audio_constraints.dart (1)

56-56: LGTM! Type consistency improvement for WebRTC constraints.

The change from string 'true' to boolean true is correct and improves type consistency with WebRTC standards. This aligns with other boolean constraints in the same array and ensures proper WebRTC functionality across platforms.

dogfooding/windows/flutter/CMakeLists.txt (1)

13-16: Excellent defensive programming approach.

The fallback mechanism for FLUTTER_TARGET_PLATFORM is well-implemented and improves the robustness of the Windows build configuration. This allows for dynamic platform specification while providing a sensible default.

@@ -14,11 +14,11 @@ list(APPEND FLUTTER_PLUGIN_LIST
media_kit_video
permission_handler_windows
record_windows
screen_brightness_windows
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify that manual editing of generated file is intentional.

This is a generated file that typically shouldn't be manually edited. The addition of screen_brightness_windows plugin (replacing volume_controller based on the AI summary) appears to be part of Windows platform compatibility improvements.

Please confirm that:

  1. This change is intentional and part of the automated tooling updates
  2. The plugin replacement aligns with Windows platform requirements
  3. The change won't be overwritten by the next generation cycle

🏁 Script executed:

#!/bin/bash
# Description: Verify if volume_controller plugin usage exists elsewhere and check for screen_brightness_windows dependencies

# Check for any remaining volume_controller references
echo "Checking for volume_controller references:"
rg -i "volume_controller" --type cmake --type dart

# Check for screen_brightness_windows usage
echo "Checking for screen_brightness_windows usage:"
rg -i "screen_brightness_windows" --type cmake --type dart --type yaml

# Check pubspec.yaml for plugin dependencies
echo "Checking pubspec.yaml for plugin dependencies:"
fd -e yaml -x grep -l "volume_controller\|screen_brightness_windows" {}

Length of output: 575


🏁 Script executed:

#!/bin/bash
# Search for plugin definitions in all pubspec.yaml files
echo "Searching for screen_brightness and volume_controller in pubspec.yaml files:"
find . -type f -name "pubspec.yaml" -print -exec rg -n "screen_brightness|volume_controller" {} \;

Length of output: 603


🏁 Script executed:

#!/bin/bash
# Display dependencies section of dogfooding/pubspec.yaml for plugin definitions
echo "Dependencies in dogfooding/pubspec.yaml:"
awk '/^dependencies:/,/^[^ ]/' dogfooding/pubspec.yaml

Length of output: 161


🏁 Script executed:

#!/bin/bash
# Verify plugin entries in root and dogfooding pubspec.yaml files

echo "Root pubspec.yaml dependencies block:"
awk '/^dependencies:/,/^[^ ]/' pubspec.yaml || echo "No dependencies section found in root pubspec.yaml"

echo
echo "Search for screen_brightness_windows and volume_controller references in pubspec files:"
for f in pubspec.yaml dogfooding/pubspec.yaml; do
  echo "== $f =="
  rg -n "screen_brightness_windows" "$f" || echo "  screen_brightness_windows: none"
  rg -n "volume_controller" "$f" || echo "  volume_controller: none"
done

Length of output: 1005


Remove or Correct Manual Edits to generated_plugins.cmake

It looks like screen_brightness_windows was added by hand to
dogfooding/windows/flutter/generated_plugins.cmake (line 17), but there’s no corresponding dependency in any pubspec.yaml. Generated plugin registrant files are rebuilt by Flutter and shouldn’t be edited directly. You’ll need to either:

  • Add screen_brightness_windows as a dependency in your pubspec.yaml so Flutter’s tooling can regenerate it correctly, or
  • Revert the manual change in generated_plugins.cmake and manage plugin registration through your Dart/Flutter configuration.

Files needing attention:

  • dogfooding/windows/flutter/generated_plugins.cmake (remove or revert line 17)
  • pubspec.yaml / dogfooding/pubspec.yaml (add screen_brightness_windows: under dependencies: if this plugin is intended)
🤖 Prompt for AI Agents
In dogfooding/windows/flutter/generated_plugins.cmake at line 17, the plugin
'screen_brightness_windows' was manually added but this file is auto-generated
and should not be edited directly. To fix this, either add
'screen_brightness_windows' as a dependency in dogfooding/pubspec.yaml under
dependencies so Flutter can regenerate this file properly, or revert the manual
addition in generated_plugins.cmake and manage plugin registration only through
pubspec.yaml and Flutter tooling.

@@ -92,7 +97,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG>
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify consistent usage of FLUTTER_TARGET_PLATFORM variable.

The usage of ${FLUTTER_TARGET_PLATFORM} in the custom command is correct and consistent with the fallback mechanism defined above.

Please verify that this change doesn't break existing build processes:


🏁 Script executed:

#!/bin/bash
# Description: Verify FLUTTER_TARGET_PLATFORM usage and check for any hardcoded platform references

# Check for any remaining hardcoded "windows-x64" references that might need updating
echo "Checking for hardcoded windows-x64 references:"
rg -i "windows-x64" --type cmake

# Check for FLUTTER_TARGET_PLATFORM usage consistency
echo "Checking FLUTTER_TARGET_PLATFORM variable usage:"
rg "FLUTTER_TARGET_PLATFORM" --type cmake -A 2 -B 2

# Check if there are any other CMakeLists.txt files that might need similar updates
echo "Checking for other CMakeLists.txt files in Windows directories:"
fd -e txt -p "*/windows/*" -x grep -l "FLUTTER_TARGET_PLATFORM\|windows-x64" {}

Length of output: 3640


Ensure all Windows CMakeLists use FLUTTER_TARGET_PLATFORM

The example project under packages/stream_video_flutter still hardcodes “windows-x64”. Replace it to keep platform selection consistent:

  • packages/stream_video_flutter/example/windows/flutter/CMakeLists.txt
  •   windows-x64 $<CONFIG>
    
  •   ${FLUTTER_TARGET_PLATFORM} $<CONFIG>
    
    
    
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
- windows-x64 $<CONFIG>
+ ${FLUTTER_TARGET_PLATFORM} $<CONFIG>
🤖 Prompt for AI Agents
In dogfooding/windows/flutter/CMakeLists.txt at line 100, replace the hardcoded
platform string "windows-x64" with the variable ${FLUTTER_TARGET_PLATFORM} to
ensure consistent platform selection across all Windows CMakeLists files. This
change will make the platform configurable and aligned with other projects.

Copy link

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 4.24%. Comparing base (650befb) to head (504a16c).

Files with missing lines Patch % Lines
..._video/lib/src/webrtc/media/audio_constraints.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1023   +/-   ##
=====================================
  Coverage   4.24%   4.24%           
=====================================
  Files        574     574           
  Lines      38526   38526           
=====================================
  Hits        1634    1634           
  Misses     36892   36892           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -7,6 +7,7 @@
* Fixed an issue where the last reaction was removed too fast when a user sends multiple reactions quickly after each other.
* Fixed an issue where toggling camera enabled quickly could cause AVCaptureMultiCamSession to crash
* Fixed an issue where the default camera selection would occasionally be incorrect even when properly configured.
* Boolean type of `DtlsSrtpKeyAgreement`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Boolean type of `DtlsSrtpKeyAgreement`.
* Fixed `DtlsSrtpKeyAgreement` audio constraint parameter mapping

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.

2 participants