Skip to content

Compositor: add blur-glass effect - #89

Merged
neodesys merged 1 commit into
masterfrom
compositor-add-blur-glass-effect
Sep 18, 2026
Merged

neodesys merged 1 commit into
masterfrom
compositor-add-blur-glass-effect

Conversation

@neodesys

Copy link
Copy Markdown
Contributor

No description provided.

@neodesys
neodesys requested review from ArmorDarks and a lite review from Copilot September 18, 2026 15:28
@neodesys neodesys self-assigned this Sep 18, 2026
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 03696e1c-dd77-4656-b1cd-54b3c61cddeb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The blur-glass implementation has three unresolved moderate issues affecting correctness and documentation.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a compositor blur-glass sink-pad effect alongside GStreamer RTMP cleanup and WebRTC logging patches.

Changes:

  • Adds blur-glass properties and rendering logic.
  • Fixes RTMP connection cleanup.
  • Reduces WebRTC FEC logging verbosity.
  • Applies patches during the GStreamer build.
File summaries
File Summary
docker/build-gstreamer/patch/gstreamer/0003-compositor-add-blur-glass-effect-property-to-sinkpad.patch Adds blur-glass functionality; requires fixes for documentation wording, the first-pad fast path, and SOURCE blend handling.
docker/build-gstreamer/patch/gstreamer/0004-Reduce-logs-verbosity-in-webrtcbin-when-a-FEC-decode.patch Reduces WebRTC FEC decoder log severity.
docker/build-gstreamer/patch/gstreamer/0005-rtmp2-rtmpclient-Close-the-connection-when-the-conne.patch Cleans up failed RTMP client connections.
docker/build-gstreamer/patch/gstreamer/0006-rtmp2src-Close-the-connection-when-starting-playback.patch Cleans up failed playback connections.
docker/build-gstreamer/patch/gstreamer/0007-rtmp2sink-Close-the-connection-when-starting-publish.patch Cleans up failed publishing connections.
docker/build-gstreamer/compile Applies the patches in sequence.
Review details

Suppressed comments (5)

docker/build-gstreamer/patch/gstreamer/0003-compositor-add-blur-glass-effect-property-to-sinkpad.patch:226

  • This loop only averages pixels from the current scanline, so the implementation is a horizontal 1-D filter rather than the documented 2-D box blur. Vertical edges and changes in the background across adjacent rows are left unblurred; use a vertical pass (or an equivalent 2-D/separable implementation) before writing the output.
+      for (gint i = start; i <= end; ++i) {
+        guint8 *pixel = (guint8 *) (row_copy + i);
+        sum[0] += pixel[0];
+        sum[1] += pixel[1];
+        sum[2] += pixel[2];

docker/build-gstreamer/patch/gstreamer/0003-compositor-add-blur-glass-effect-property-to-sinkpad.patch:226

  • The per-pixel inner loop scans every column in the radius, making this O(width × height × radius) for each blurred pad and frame. With the default radius on 4K video, or a large user-supplied radius, this can dominate compositor CPU; a sliding-window or summed-area/separable blur keeps the work linear in the number of pixels.
+      for (gint i = start; i <= end; ++i) {
+        guint8 *pixel = (guint8 *) (row_copy + i);
+        sum[0] += pixel[0];
+        sum[1] += pixel[1];
+        sum[2] += pixel[2];

docker/build-gstreamer/patch/gstreamer/0003-compositor-add-blur-glass-effect-property-to-sinkpad.patch:219

  • The property accepts values through G_MAXUINT, but this casts the radius to gint before doing the window arithmetic. Values above G_MAXINT therefore wrap (for example G_MAXUINT makes start > end and count underflow), producing incorrect pixels and potentially overflowing the additions; clamp the radius to the frame width before converting it.
+      gint start = MAX (0, (gint) x - (gint) radius);
+      gint end = MIN (frame_width - 1, (gint) x + (gint) radius);
+      guint count = end - start + 1;

docker/build-gstreamer/patch/gstreamer/0003-compositor-add-blur-glass-effect-property-to-sinkpad.patch:137

  • The new blur_glass flag is collected here, but the compositor's first-pad copy fast path (in the preceding box-shadow patch) does not exclude it. If this is the first full-frame pad, aggregation copies prepared_frame directly and never reaches blend_pads(), so blur_glass_background() is skipped entirely. The fast-path condition must also require !compo_info->blur_glass.
+  info->blur_glass = pad->blur_glass;
+  info->blur_glass_radius = pad->blur_glass_radius;
+  info->has_alpha = (pad->alpha != 1.0
+      || GST_VIDEO_INFO_HAS_ALPHA (&GST_VIDEO_AGGREGATOR_PAD (pad)->info));

docker/build-gstreamer/patch/gstreamer/0003-compositor-add-blur-glass-effect-property-to-sinkpad.patch:256

  • The blur runs before the final composite() call, but this code does not change info->blend_mode when it is COMPOSITOR_BLEND_MODE_SOURCE. A source-operator pad replaces the destination region, so it overwrites the blurred background and makes blur-glass ineffective for that valid operator combination. As with rounded corners in the preceding patch, force SOURCE to OVER when the effect is active, while doing so during pad-info extraction rather than in the parallel render loop.
+    // Blur the composited background behind this pad (frosted-glass effect)
+    if (info->blur_glass && info->blur_glass_radius > 0 && info->has_alpha) {
+      if (has_visible_src_rect (&visible_src_rect, &dest_rect, comp)) {
+        visible_src_rect.x += dest_rect.x;
+        visible_src_rect.y += dest_rect.y;
+        blur_glass_background (comp, &visible_src_rect, &dest_rect,
+            info->border_radius, info->blur_glass_radius);
+      }
+    }
  • Files reviewed: 2/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@neodesys
neodesys merged commit 78fe72e into master Sep 18, 2026
6 checks passed
@neodesys
neodesys deleted the compositor-add-blur-glass-effect branch September 18, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants