Reland "[gDM] Window audio capture WASAPI implementation" [chromium/src : main]

0 views
Skip to first unread message

Gabriel Brito (Gerrit)

unread,
May 16, 2025, 9:35:08 PMMay 16
to Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Henrik Andreasson, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima
Attention needed from Fredrik Hernqvist, Greg Thompson, Henrik Andreasson, Olga Sharonova and Zequan Wu

Gabriel Brito has uploaded the change for review

Gabriel Brito would like Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova and Henrik Andreasson to review this change.

Commit message

Reland "[gDM] Window audio capture WASAPI implementation"

This is a reland of commit 42f725b8b8d20758e49c0b9cbcaded7bc6fdfe95

Original change's description:
> [gDM] Window audio capture WASAPI implementation
>
> Adds the process-based audio capture logic that will power
> getDisplayMedia window capture on Windows devices. This CL also adds
> tests and testing mocks for the Windows WASAPI interfaces. This CL
> builds on the work in
> https://chromium-review.googlesource.com/c/chromium/src/+/5092148.
>
> Bug: 40947205
> Change-Id: I971b5b6a9c715b45ddcdbcc40466b5da8f2f816e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6442207
> Reviewed-by: Henrik Andreasson <hen...@chromium.org>
> Reviewed-by: Olga Sharonova <ol...@chromium.org>
> Reviewed-by: Zequan Wu <zequ...@google.com>
> Commit-Queue: Gabriel Brito <gabrie...@microsoft.com>
> Reviewed-by: Greg Thompson <g...@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1461128}
Bug: 40947205
Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2

Change diff


Change information

Files:
  • M build/config/win/BUILD.gn
  • M media/audio/BUILD.gn
  • M media/audio/audio_input_stream_data_interceptor.h
  • M media/audio/win/audio_low_latency_input_win.cc
  • M media/audio/win/audio_low_latency_input_win.h
  • M media/audio/win/audio_low_latency_input_win_unittest.cc
  • M media/audio/win/core_audio_util_win.cc
  • M media/audio/win/core_audio_util_win_unittest.cc
  • A media/audio/win/test_support/fake_iactivate_audio_interface_async_operation.cc
  • A media/audio/win/test_support/fake_iactivate_audio_interface_async_operation.h
  • A media/audio/win/test_support/fake_iaudio_capture_client.cc
  • A media/audio/win/test_support/fake_iaudio_capture_client.h
  • A media/audio/win/test_support/fake_iaudio_client.cc
  • A media/audio/win/test_support/fake_iaudio_client.h
  • A media/audio/win/test_support/fake_win_wasapi_environment.cc
  • A media/audio/win/test_support/fake_win_wasapi_environment.h
  • A media/audio/win/test_support/wasapi_test_error_code.h
Change size: XL
Delta: 17 files changed, 1007 insertions(+), 95 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Hernqvist
  • Greg Thompson
  • Henrik Andreasson
  • Olga Sharonova
  • Zequan Wu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
Gerrit-Change-Number: 6557667
Gerrit-PatchSet: 1
Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
Gerrit-CC: Evan Stade <evan...@microsoft.com>
Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
Gerrit-CC: Rekinek <rekin...@gmail.com>
Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Attention: Greg Thompson <g...@chromium.org>
Gerrit-Attention: Zequan Wu <zequ...@google.com>
Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
Gerrit-Attention: Henrik Andreasson <hen...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Gabriel Brito (Gerrit)

unread,
May 16, 2025, 9:45:26 PMMay 16
to Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Henrik Andreasson, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
Attention needed from Fredrik Hernqvist, Greg Thompson, Henrik Andreasson, Olga Sharonova and Zequan Wu

Gabriel Brito voted and added 1 comment

Votes added by Gabriel Brito

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Gabriel Brito . resolved

Hi! PTAL when convenient.

@g...@chromium.org I am removing you from the reviewer set just because your approval is not strictly required for this change and I don't want to take your time unnecessarily. But, please, feel free to review it if you'd like.

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Hernqvist
  • Greg Thompson
  • Henrik Andreasson
  • Olga Sharonova
  • Zequan Wu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
Gerrit-Change-Number: 6557667
Gerrit-PatchSet: 3
Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
Gerrit-CC: Evan Stade <evan...@microsoft.com>
Gerrit-CC: Greg Thompson <g...@chromium.org>
Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
Gerrit-CC: Rekinek <rekin...@gmail.com>
Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Attention: Greg Thompson <g...@chromium.org>
Gerrit-Attention: Zequan Wu <zequ...@google.com>
Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
Gerrit-Attention: Henrik Andreasson <hen...@chromium.org>
Gerrit-Comment-Date: Sat, 17 May 2025 01:45:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Henrik Andreasson (Gerrit)

unread,
May 17, 2025, 4:27:12 AMMay 17
to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

Henrik Andreasson added 1 comment

Patchset-level comments
Henrik Andreasson . resolved

I created an ASan build and verified that all tests now work as intended.

To be clear: the changes here are on the fake client only: No other functional changes are made afaik.

Correct?

Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Hernqvist
  • Gabriel Brito
  • Greg Thompson
  • Olga Sharonova
  • Zequan Wu
Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
Gerrit-Comment-Date: Sat, 17 May 2025 08:26:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Henrik Andreasson (Gerrit)

unread,
May 17, 2025, 4:27:17 AMMay 17
to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

Henrik Andreasson voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Hernqvist
  • Gabriel Brito
  • Greg Thompson
  • Olga Sharonova
  • Zequan Wu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Review
Gerrit-Comment-Date: Sat, 17 May 2025 08:27:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Henrik Andreasson (Gerrit)

unread,
May 17, 2025, 9:37:54 AMMay 17
to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

Henrik Andreasson added 1 comment

Patchset-level comments
Henrik Andreasson . resolved

I created an ASan build and verified that all tests now work as intended.

To be clear: the changes here are on the fake client only: No other functional changes are made afaik.

Correct?

Henrik Andreasson

I could see the diff in https://chromium-review.googlesource.com/c/chromium/src/+/6557667/1..2 and the change is on the fake clients only. Hence Resolved.

Gerrit-Comment-Date: Sat, 17 May 2025 13:37:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Henrik Andreasson <hen...@chromium.org>
satisfied_requirement
open
diffy

Henrik Andreasson (Gerrit)

unread,
May 17, 2025, 10:04:08 AMMay 17
to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

Henrik Andreasson added 1 comment

File media/audio/win/test_support/fake_iaudio_client.cc
Line 34, Patchset 3 (Latest): *buffer_size = kBufferSizeFrames;
Henrik Andreasson . unresolved

Just FYI, my experience from real devices is that this size is often a multiple of 10ms and should depend on the sample rate. It should work with any size I but given that we also have access to the sample rate it might be more clean to do the same for the fake class. Today, the FIFO will have to adapt more in the fake client than in a real client.

Not needed now but just wanted to leave a comment.

Example:
```
[20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1022] CreateFifoIfNeeded
[20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1052] endpoint_buffer_size_frames=4800
[20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1053] frame_size_bytes_=4
[20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1054] packet_size_bytes_=1920
[20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1055] buffers_required=20
```

In the example above, the fake client will use 256 and a real client will use 4800.

Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Hernqvist
  • Gabriel Brito
  • Greg Thompson
  • Olga Sharonova
  • Zequan Wu
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Gerrit-Comment-Date: Sat, 17 May 2025 14:03:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gabriel Brito (Gerrit)

    unread,
    May 17, 2025, 1:42:32 PMMay 17
    to Henrik Andreasson, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
    Attention needed from Fredrik Hernqvist, Greg Thompson, Henrik Andreasson, Olga Sharonova and Zequan Wu

    Gabriel Brito added 2 comments

    Patchset-level comments
    Henrik Andreasson . resolved

    I created an ASan build and verified that all tests now work as intended.

    To be clear: the changes here are on the fake client only: No other functional changes are made afaik.

    Correct?

    Henrik Andreasson

    I could see the diff in https://chromium-review.googlesource.com/c/chromium/src/+/6557667/1..2 and the change is on the fake clients only. Hence Resolved.

    Gabriel Brito

    Yep. thanks for double checking!

    File media/audio/win/test_support/fake_iaudio_client.cc
    Line 34, Patchset 3: *buffer_size = kBufferSizeFrames;
    Henrik Andreasson . resolved

    Just FYI, my experience from real devices is that this size is often a multiple of 10ms and should depend on the sample rate. It should work with any size I but given that we also have access to the sample rate it might be more clean to do the same for the fake class. Today, the FIFO will have to adapt more in the fake client than in a real client.

    Not needed now but just wanted to leave a comment.

    Example:
    ```
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1022] CreateFifoIfNeeded
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1052] endpoint_buffer_size_frames=4800
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1053] frame_size_bytes_=4
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1054] packet_size_bytes_=1920
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1055] buffers_required=20
    ```

    In the example above, the fake client will use 256 and a real client will use 4800.

    Gabriel Brito

    Fix applied.

    It seems that I don't have access issue 323486298. Is it ok for me to be able to see it?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fredrik Hernqvist
    • Greg Thompson
    • Henrik Andreasson
    • Olga Sharonova
    • Zequan Wu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
    Gerrit-Change-Number: 6557667
    Gerrit-PatchSet: 4
    Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
    Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
    Gerrit-CC: Evan Stade <evan...@microsoft.com>
    Gerrit-CC: Greg Thompson <g...@chromium.org>
    Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
    Gerrit-CC: Rekinek <rekin...@gmail.com>
    Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Greg Thompson <g...@chromium.org>
    Gerrit-Attention: Zequan Wu <zequ...@google.com>
    Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: Henrik Andreasson <hen...@chromium.org>
    Gerrit-Comment-Date: Sat, 17 May 2025 17:42:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Henrik Andreasson <hen...@chromium.org>
    satisfied_requirement
    open
    diffy

    Henrik Andreasson (Gerrit)

    unread,
    May 19, 2025, 2:53:07 AMMay 19
    to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
    Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

    Henrik Andreasson voted and added 1 comment

    Votes added by Henrik Andreasson

    Code-Review+1

    1 comment

    File media/audio/win/test_support/fake_iaudio_client.cc
    Line 34, Patchset 3: *buffer_size = kBufferSizeFrames;
    Henrik Andreasson . resolved

    Just FYI, my experience from real devices is that this size is often a multiple of 10ms and should depend on the sample rate. It should work with any size I but given that we also have access to the sample rate it might be more clean to do the same for the fake class. Today, the FIFO will have to adapt more in the fake client than in a real client.

    Not needed now but just wanted to leave a comment.

    Example:
    ```
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1022] CreateFifoIfNeeded
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1052] endpoint_buffer_size_frames=4800
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1053] frame_size_bytes_=4
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1054] packet_size_bytes_=1920
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1055] buffers_required=20
    ```

    In the example above, the fake client will use 256 and a real client will use 4800.

    Gabriel Brito

    Fix applied.

    It seems that I don't have access issue 323486298. Is it ok for me to be able to see it?

    Henrik Andreasson

    b/323486298 is unrelated to your work and I can't find it as crbug.com/323486298 either. Note sure where you got 323486298 from. Can you create your own/new issue and us it instead.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fredrik Hernqvist
    • Gabriel Brito
    • Greg Thompson
    • Olga Sharonova
    • Zequan Wu
    Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
    Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 May 2025 06:52:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Gabriel Brito <gabrie...@microsoft.com>
    Comment-In-Reply-To: Henrik Andreasson <hen...@chromium.org>
    satisfied_requirement
    open
    diffy

    Greg Thompson (Gerrit)

    unread,
    May 19, 2025, 3:34:24 AMMay 19
    to Gabriel Brito, Henrik Andreasson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
    Attention needed from Fredrik Hernqvist, Gabriel Brito, Olga Sharonova and Zequan Wu

    Greg Thompson added 2 comments

    File media/audio/win/test_support/fake_iaudio_client.cc
    Line 34, Patchset 3: *buffer_size = kBufferSizeFrames;
    Henrik Andreasson . unresolved

    Just FYI, my experience from real devices is that this size is often a multiple of 10ms and should depend on the sample rate. It should work with any size I but given that we also have access to the sample rate it might be more clean to do the same for the fake class. Today, the FIFO will have to adapt more in the fake client than in a real client.

    Not needed now but just wanted to leave a comment.

    Example:
    ```
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1022] CreateFifoIfNeeded
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1052] endpoint_buffer_size_frames=4800
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1053] frame_size_bytes_=4
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1054] packet_size_bytes_=1920
    [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1055] buffers_required=20
    ```

    In the example above, the fake client will use 256 and a real client will use 4800.

    Gabriel Brito

    Fix applied.

    It seems that I don't have access issue 323486298. Is it ok for me to be able to see it?

    Henrik Andreasson

    b/323486298 is unrelated to your work and I can't find it as crbug.com/323486298 either. Note sure where you got 323486298 from. Can you create your own/new issue and us it instead.

    Greg Thompson

    I was just about to write more-or-less the same thing.

    Line 114, Patchset 4 (Latest): should_stop_streaming_ = true;
    Greg Thompson . unresolved

    there's no synchronization around this (accessed by multiple threads), nor do i see anything that ensures that the tasks posted below (which use `Unretained`) will not run after this instance is destroyed. although this is test code, it would be good to fix this so that we don't end up with flaky tests.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fredrik Hernqvist
    • Gabriel Brito
    • Olga Sharonova
    • Zequan Wu
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
      Gerrit-Change-Number: 6557667
      Gerrit-PatchSet: 4
      Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
      Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
      Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
      Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
      Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
      Gerrit-CC: Evan Stade <evan...@microsoft.com>
      Gerrit-CC: Greg Thompson <g...@chromium.org>
      Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
      Gerrit-CC: Rekinek <rekin...@gmail.com>
      Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Zequan Wu <zequ...@google.com>
      Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
      Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
      Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
      Gerrit-Comment-Date: Mon, 19 May 2025 07:34:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Olga Sharonova (Gerrit)

      unread,
      May 19, 2025, 3:58:52 AMMay 19
      to Gabriel Brito, Henrik Andreasson, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
      Attention needed from Fredrik Hernqvist, Gabriel Brito and Zequan Wu

      Olga Sharonova added 4 comments

      File media/audio/win/test_support/fake_iaudio_capture_client.cc
      Line 18, Patchset 4 (Latest): next_packet_size_(buffer_size_frames) {}
      Olga Sharonova . unresolved

      CHECK(frame_size_bytes_);
      (since we are dividing by it later)

      Line 29, Patchset 4 (Latest): static_cast<UINT32>(buffer_data_.size() / frame_size_bytes_);
      Olga Sharonova . unresolved

      This is a known constant value - precalculate and use here and in GetNextPacketSize()?

      File media/audio/win/test_support/fake_iaudio_client.cc
      Line 114, Patchset 4 (Latest): should_stop_streaming_ = true;
      Greg Thompson . unresolved

      there's no synchronization around this (accessed by multiple threads), nor do i see anything that ensures that the tasks posted below (which use `Unretained`) will not run after this instance is destroyed. although this is test code, it would be good to fix this so that we don't end up with flaky tests.

      Olga Sharonova

      +1

      Line 131, Patchset 4 (Latest): if (buffer_ready_event_handle_) {
      SetEvent(buffer_ready_event_handle_);
      }
      Olga Sharonova . unresolved

      Do we expect IAudioClient to stop synchronously? In that case, shouldn't this be called only if `should_stop_streaming_` is true?

      An typical alternative to should_stop_streaming would be: posting from Stop() to base::ThreadPool a task to signal an event, and waiting in Stop() for it to be signaled. (This would mean all the earlier posted tasks have cycled through.)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fredrik Hernqvist
      • Gabriel Brito
      • Zequan Wu
      Gerrit-Comment-Date: Mon, 19 May 2025 07:58:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Henrik Andreasson (Gerrit)

      unread,
      May 19, 2025, 6:03:54 AMMay 19
      to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
      Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

      Henrik Andreasson voted and added 6 comments

      Votes added by Henrik Andreasson

      Code-Review+1

      6 comments

      Patchset-level comments
      File-level comment, Patchset 5 (Latest):
      Henrik Andreasson . resolved

      I took the liberty of fixing the remaining comments to ensure that we can land this essential CL again as soon as possible.

      I have pending work which need the new structure.

      File media/audio/win/test_support/fake_iaudio_capture_client.cc
      Line 18, Patchset 4: next_packet_size_(buffer_size_frames) {}
      Olga Sharonova . resolved

      CHECK(frame_size_bytes_);
      (since we are dividing by it later)

      Henrik Andreasson

      Done

      Line 29, Patchset 4: static_cast<UINT32>(buffer_data_.size() / frame_size_bytes_);
      Olga Sharonova . resolved

      This is a known constant value - precalculate and use here and in GetNextPacketSize()?

      Henrik Andreasson

      Done

      File media/audio/win/test_support/fake_iaudio_client.cc
      Line 34, Patchset 3: *buffer_size = kBufferSizeFrames;
      Henrik Andreasson . resolved

      Just FYI, my experience from real devices is that this size is often a multiple of 10ms and should depend on the sample rate. It should work with any size I but given that we also have access to the sample rate it might be more clean to do the same for the fake class. Today, the FIFO will have to adapt more in the fake client than in a real client.

      Not needed now but just wanted to leave a comment.

      Example:
      ```
      [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1022] CreateFifoIfNeeded
      [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1052] endpoint_buffer_size_frames=4800
      [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1053] frame_size_bytes_=4
      [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1054] packet_size_bytes_=1920
      [20028:24184:VERBOSE1:media\audio\win\audio_low_latency_input_win.cc:1055] buffers_required=20
      ```

      In the example above, the fake client will use 256 and a real client will use 4800.

      Gabriel Brito

      Fix applied.

      It seems that I don't have access issue 323486298. Is it ok for me to be able to see it?

      Henrik Andreasson

      b/323486298 is unrelated to your work and I can't find it as crbug.com/323486298 either. Note sure where you got 323486298 from. Can you create your own/new issue and us it instead.

      Greg Thompson

      I was just about to write more-or-less the same thing.

      Henrik Andreasson

      Done

      Line 114, Patchset 4: should_stop_streaming_ = true;
      Greg Thompson . resolved

      there's no synchronization around this (accessed by multiple threads), nor do i see anything that ensures that the tasks posted below (which use `Unretained`) will not run after this instance is destroyed. although this is test code, it would be good to fix this so that we don't end up with flaky tests.

      Olga Sharonova

      +1

      Henrik Andreasson

      Done

      Line 131, Patchset 4: if (buffer_ready_event_handle_) {
      SetEvent(buffer_ready_event_handle_);
      }
      Olga Sharonova . resolved

      Do we expect IAudioClient to stop synchronously? In that case, shouldn't this be called only if `should_stop_streaming_` is true?

      An typical alternative to should_stop_streaming would be: posting from Stop() to base::ThreadPool a task to signal an event, and waiting in Stop() for it to be signaled. (This would mean all the earlier posted tasks have cycled through.)

      Henrik Andreasson

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fredrik Hernqvist
      • Gabriel Brito
      • Greg Thompson
      • Olga Sharonova
      • Zequan Wu
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
      Gerrit-Change-Number: 6557667
      Gerrit-PatchSet: 5
      Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
      Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
      Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
      Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
      Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
      Gerrit-CC: Evan Stade <evan...@microsoft.com>
      Gerrit-CC: Greg Thompson <g...@chromium.org>
      Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
      Gerrit-CC: Rekinek <rekin...@gmail.com>
      Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Greg Thompson <g...@chromium.org>
      Gerrit-Attention: Zequan Wu <zequ...@google.com>
      Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
      Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
      Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
      Gerrit-Comment-Date: Mon, 19 May 2025 10:03:40 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
      Comment-In-Reply-To: Gabriel Brito <gabrie...@microsoft.com>
      Comment-In-Reply-To: Olga Sharonova <ol...@chromium.org>
      Comment-In-Reply-To: Henrik Andreasson <hen...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Greg Thompson (Gerrit)

      unread,
      May 19, 2025, 6:50:14 AMMay 19
      to Gabriel Brito, Henrik Andreasson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
      Attention needed from Fredrik Hernqvist, Gabriel Brito, Henrik Andreasson, Olga Sharonova and Zequan Wu

      Greg Thompson added 1 comment

      File media/audio/win/test_support/fake_iaudio_client.cc
      Line 117, Patchset 5 (Latest): // Post a task to signal the event after all tasks are flushed.
      Greg Thompson . unresolved

      if the intent here is to have this task run after any existing call to `StreamData`, then all tasks need to be posted to the same `SequencedTaskRunner`. also note that this won't prevent a previously-posted delayed task from running. you could introduce a `WeakPtrFactory` and post tasks w/ a weak ptr to prevent them from running after destruction.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fredrik Hernqvist
      • Gabriel Brito
      • Henrik Andreasson
      • Olga Sharonova
      • Zequan Wu
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Greg Thompson <g...@chromium.org>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
        Gerrit-Attention: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Comment-Date: Mon, 19 May 2025 10:50:00 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Henrik Andreasson (Gerrit)

        unread,
        May 19, 2025, 7:40:13 AMMay 19
        to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

        Henrik Andreasson voted and added 1 comment

        Votes added by Henrik Andreasson

        Code-Review+1

        1 comment

        File media/audio/win/test_support/fake_iaudio_client.cc
        Line 117, Patchset 5: // Post a task to signal the event after all tasks are flushed.
        Greg Thompson . unresolved

        if the intent here is to have this task run after any existing call to `StreamData`, then all tasks need to be posted to the same `SequencedTaskRunner`. also note that this won't prevent a previously-posted delayed task from running. you could introduce a `WeakPtrFactory` and post tasks w/ a weak ptr to prevent them from running after destruction.

        Henrik Andreasson

        Thanks Greg. I hope my last version addresses your comments. PTAL.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Fredrik Hernqvist
        • Gabriel Brito
        • Greg Thompson
        • Olga Sharonova
        • Zequan Wu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 6
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Greg Thompson <g...@chromium.org>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Greg Thompson <g...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
        Gerrit-Comment-Date: Mon, 19 May 2025 11:40:01 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Greg Thompson (Gerrit)

        unread,
        May 19, 2025, 8:15:43 AMMay 19
        to Gabriel Brito, Henrik Andreasson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Fredrik Hernqvist, Gabriel Brito, Henrik Andreasson, Olga Sharonova and Zequan Wu

        Greg Thompson added 1 comment

        File media/audio/win/test_support/fake_iaudio_client.cc
        Line 117, Patchset 5: // Post a task to signal the event after all tasks are flushed.
        Greg Thompson . unresolved

        if the intent here is to have this task run after any existing call to `StreamData`, then all tasks need to be posted to the same `SequencedTaskRunner`. also note that this won't prevent a previously-posted delayed task from running. you could introduce a `WeakPtrFactory` and post tasks w/ a weak ptr to prevent them from running after destruction.

        Henrik Andreasson

        Thanks Greg. I hope my last version addresses your comments. PTAL.

        Greg Thompson

        on second thought, i think i gave you some bad advice with that WeakPtr suggestion. i think it's better to use a SequenceBound to run a timer. something close to this should do the trick:

        ```
        class FakeIAudioClient {
        public:
        ...
        private:
        class DataStreamer {
        public:
        explicit DataStreamer(HANDLE buffer_ready_event_handle);
        DataStreamer(const DataStreamer&) = delete;
        DataStreamer& operator=(const DataStreamer&) = delete;
        ~DataStreamer();
            void Stop(base::WaitableEvent &stop_event);
           private:
        void StreamData();
            const HANDLE buffer_ready_event_handle_;
        base::RepeatingTimer timer_;
        };
          base::SequenceBound<DataStreamer> streamer_;
        };

        FakeIAudioClient::DataStreamer::DataStreamer(HANDLE buffer_ready_event_handle)
        : buffer_ready_event_handle_(buffer_ready_event_handle) {
        // Stream once immediately.
        StreamData();
        // And again every kSamplingPeriodMs milliseconds.
        timer_.Start(FROM_HERE, base::Milliseconds(kSamplingPeriodMs),
        base::BindRepeating(&FakeIAudioClient::DataStreamer::StreamData,
        base::Unretained(this)));
        }

        FakeIAudioClient::DataStreamer::~DataStreamer() = default;

        void FakeIAudioClient::DataStreamer::Stop(base::WaitableEvent &stop_event) {
        timer_.Stop();
        stop_event.Signal();
        }
        void FakeIAudioClient::DataStreamer::StreamData() {
        if (buffer_ready_event_handle_) {
        ::SetEvent(buffer_ready_event_handle_);
        }
        }
        void FakeIAudioClient::Start() {
        if (!streamer_.is_null()) {
        return; // Already running.
        }
        // Start the streamer, giving it the client's event to be signaled.
        streamer_.emplace(base::ThreadPool::CreateSequencedTaskRunner({}),
        buffer_ready_event_handle_);
        }
        void FakeIAudioClient::Stop() {
        if (streamer_.is_null()) {
        return; // Not running.
        }
        // Stop the streamer and wait for it to acknowledge.
        base::WaitableEvent stop_event;
        streamer_.AsyncCall(&DataStreamer::Stop).WithArgs(std::ref(stop_event));
        stop_event.Wait();
          // Destroy the streamer.
        streamer_.Reset();
        }
        ```
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Fredrik Hernqvist
        • Gabriel Brito
        • Henrik Andreasson
        • Olga Sharonova
        • Zequan Wu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 8
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Greg Thompson <g...@chromium.org>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
        Gerrit-Attention: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Comment-Date: Mon, 19 May 2025 12:15:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
        Comment-In-Reply-To: Henrik Andreasson <hen...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Henrik Andreasson (Gerrit)

        unread,
        May 19, 2025, 8:47:59 AMMay 19
        to Gabriel Brito, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Fredrik Hernqvist, Gabriel Brito, Greg Thompson, Olga Sharonova and Zequan Wu

        Henrik Andreasson voted and added 1 comment

        Votes added by Henrik Andreasson

        Code-Review+1

        1 comment

        File media/audio/win/test_support/fake_iaudio_client.cc
        Line 117, Patchset 5: // Post a task to signal the event after all tasks are flushed.
        Greg Thompson . resolved
        Henrik Andreasson

        Now that was a fancy pattern :-)

        Thanks for the detailed feedback Greg.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Fredrik Hernqvist
        • Gabriel Brito
        • Greg Thompson
        • Olga Sharonova
        • Zequan Wu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 8
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Greg Thompson <g...@chromium.org>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Greg Thompson <g...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
        Gerrit-Comment-Date: Mon, 19 May 2025 12:47:45 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Greg Thompson (Gerrit)

        unread,
        May 19, 2025, 8:53:36 AMMay 19
        to Gabriel Brito, Henrik Andreasson, Zequan Wu, Chromium LUCI CQ, Fredrik Hernqvist, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Fredrik Hernqvist, Gabriel Brito, Henrik Andreasson, Olga Sharonova and Zequan Wu

        Greg Thompson voted and added 1 comment

        Votes added by Greg Thompson

        Code-Review+1

        1 comment

        File media/audio/win/test_support/fake_iaudio_client.cc
        Greg Thompson

        does it work. :-)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Fredrik Hernqvist
        • Gabriel Brito
        • Henrik Andreasson
        • Olga Sharonova
        • Zequan Wu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 9
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
        Gerrit-Attention: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Comment-Date: Mon, 19 May 2025 12:53:23 +0000
        satisfied_requirement
        open
        diffy

        Henrik Andreasson (Gerrit)

        unread,
        May 19, 2025, 8:57:05 AMMay 19
        to Gabriel Brito, Fredrik Hernqvist, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Gabriel Brito, Olga Sharonova and Zequan Wu

        Henrik Andreasson voted and added 1 comment

        Votes added by Henrik Andreasson

        Code-Review+1

        1 comment

        File media/audio/win/test_support/fake_iaudio_client.cc
        Henrik Andreasson

        Yes. Also verified ASan. Only required some minor/trivial changes in your proposal. Very impressive!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Gabriel Brito
        • Olga Sharonova
        • Zequan Wu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 9
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
        Gerrit-Comment-Date: Mon, 19 May 2025 12:56:52 +0000
        satisfied_requirement
        open
        diffy

        Henrik Andreasson (Gerrit)

        unread,
        May 19, 2025, 8:59:34 AMMay 19
        to Gabriel Brito, Fredrik Hernqvist, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Olga Sharonova, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Gabriel Brito, Olga Sharonova and Zequan Wu

        Henrik Andreasson added 1 comment

        Patchset-level comments
        File-level comment, Patchset 9 (Latest):
        Henrik Andreasson . resolved

        zequ...@google.com: we need your OK again for `build/config/win/BUILD.gn` in this attempt to reland a previously reverted CL.

        Gerrit-Comment-Date: Mon, 19 May 2025 12:59:22 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Olga Sharonova (Gerrit)

        unread,
        May 19, 2025, 9:52:12 AMMay 19
        to Gabriel Brito, Henrik Andreasson, Fredrik Hernqvist, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Gabriel Brito, Henrik Andreasson and Zequan Wu

        Olga Sharonova voted and added 1 comment

        Votes added by Olga Sharonova

        Code-Review+1

        1 comment

        Patchset-level comments
        Olga Sharonova . resolved

        LGTM

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Gabriel Brito
        • Henrik Andreasson
        • Zequan Wu
        Gerrit-Attention: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Comment-Date: Mon, 19 May 2025 13:52:01 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Henrik Andreasson (Gerrit)

        unread,
        May 19, 2025, 9:59:04 AMMay 19
        to Gabriel Brito, Olga Sharonova, Fredrik Hernqvist, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Gabriel Brito and Zequan Wu

        Henrik Andreasson added 1 comment

        Patchset-level comments
        Henrik Andreasson . resolved

        gabrie...@microsoft.com:

        It is my assumption that you will still be the author in git blame for this CL. Hope I did not mess this up here by uploading some final changes.

        Looks like we still need an OK from zequ...@google.com.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Gabriel Brito
        • Zequan Wu
        Gerrit-Comment-Date: Mon, 19 May 2025 13:58:51 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Henrik Andreasson (Gerrit)

        unread,
        May 19, 2025, 10:21:21 AMMay 19
        to Gabriel Brito, Olga Sharonova, Fredrik Hernqvist, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Gabriel Brito and Zequan Wu

        Henrik Andreasson voted and added 1 comment

        Votes added by Henrik Andreasson

        Code-Review+1
        Commit-Queue+1

        1 comment

        Patchset-level comments
        File-level comment, Patchset 10 (Latest):
        Henrik Andreasson . resolved

        I did try `git commit --amend --author="Gabriel Brito <gabrie...@microsoft.com>" --no-edit` and then `git cl upload` but I am not sure that we are OK yet.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Gabriel Brito
        • Zequan Wu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 10
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Comment-Date: Mon, 19 May 2025 14:21:08 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Gabriel Brito (Gerrit)

        unread,
        May 19, 2025, 2:29:05 PMMay 19
        to Henrik Andreasson, Olga Sharonova, Fredrik Hernqvist, Greg Thompson, Zequan Wu, Chromium LUCI CQ, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Zequan Wu

        Gabriel Brito added 3 comments

        Patchset-level comments
        File-level comment, Patchset 5:
        Henrik Andreasson . resolved

        I took the liberty of fixing the remaining comments to ensure that we can land this essential CL again as soon as possible.

        I have pending work which need the new structure.

        Gabriel Brito

        No problem on my side. Thanks for doing it! It would have taken me days to fix all of it given out time zone differences.

        Henrik Andreasson . resolved

        gabrie...@microsoft.com:

        It is my assumption that you will still be the author in git blame for this CL. Hope I did not mess this up here by uploading some final changes.

        Looks like we still need an OK from zequ...@google.com.

        Gabriel Brito

        I added a simple comment to upload a new patchset. I guess now it looks like how it was before.

        File-level comment, Patchset 11 (Latest):
        Gabriel Brito . resolved

        @hen...@chromium.org thanks for working through the additional comments.

        Also, thanks everyone for the additional feedback. While I did not implement it, I read through everything and understood the idea behind `DataStreamer`. The previous implementation was lacking for using `PostDelayedTask` and `base::Unretained` indiscriminately.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Zequan Wu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 11
        Gerrit-Owner: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
        Gerrit-Reviewer: Henrik Andreasson <hen...@chromium.org>
        Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
        Gerrit-Reviewer: Zequan Wu <zequ...@google.com>
        Gerrit-CC: Evan Stade <evan...@microsoft.com>
        Gerrit-CC: Fredrik Hernqvist <fhern...@google.com>
        Gerrit-CC: Henrique Nakashima <hnaka...@chromium.org>
        Gerrit-CC: Rekinek <rekin...@gmail.com>
        Gerrit-CC: Thomas Guilbert <tgui...@chromium.org>
        Gerrit-Attention: Zequan Wu <zequ...@google.com>
        Gerrit-Comment-Date: Mon, 19 May 2025 18:28:55 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Henrik Andreasson <hen...@chromium.org>
        satisfied_requirement
        open
        diffy

        Zequan Wu (Gerrit)

        unread,
        May 19, 2025, 3:33:37 PMMay 19
        to Gabriel Brito, Henrik Andreasson, Olga Sharonova, Fredrik Hernqvist, Greg Thompson, Chromium LUCI CQ, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org
        Attention needed from Gabriel Brito

        Zequan Wu voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Gabriel Brito
        Gerrit-Attention: Gabriel Brito <gabrie...@microsoft.com>
        Gerrit-Comment-Date: Mon, 19 May 2025 19:33:27 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Gabriel Brito (Gerrit)

        unread,
        May 19, 2025, 3:47:31 PMMay 19
        to Zequan Wu, Henrik Andreasson, Olga Sharonova, Fredrik Hernqvist, Greg Thompson, Chromium LUCI CQ, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org

        Gabriel Brito voted and added 1 comment

        Votes added by Gabriel Brito

        Commit-Queue+2

        1 comment

        Patchset-level comments
        Gabriel Brito . resolved

        Thanks for reviewing!

        Open in Gerrit

        Related details

        Attention set is empty
        Gerrit-Comment-Date: Mon, 19 May 2025 19:47:21 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        May 19, 2025, 4:08:55 PMMay 19
        to Gabriel Brito, Zequan Wu, Henrik Andreasson, Olga Sharonova, Fredrik Hernqvist, Greg Thompson, Thomas Guilbert, chromium...@chromium.org, Evan Stade, AyeAye, Rekinek, Henrique Nakashima, feature-me...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Reland "[gDM] Window audio capture WASAPI implementation"

        This is a reland of commit 42f725b8b8d20758e49c0b9cbcaded7bc6fdfe95

        Whenever the *Size fake functions (GetNextPacketSize, GetBufferSize,
        etc) were called, we were returning the size in "number of bytes"
        instead of "number of frames". For example, a dual channel frame in
        Windows has 4 bytes, which results in the fifo always trying to read off
        bounds in the test data buffer.

        The WAVEFORMATEXT struct has enough information that allows us to
        calculate this information at runtime and simulate it properly. The
        latest patchset adds this. Tested on a local Windows ASAN build and the
        tests executed successfully.


        Original change's description:
        > [gDM] Window audio capture WASAPI implementation
        >
        > Adds the process-based audio capture logic that will power
        > getDisplayMedia window capture on Windows devices. This CL also adds
        > tests and testing mocks for the Windows WASAPI interfaces. This CL
        > builds on the work in
        > https://chromium-review.googlesource.com/c/chromium/src/+/5092148.
        >
        > Bug: 40947205
        > Change-Id: I971b5b6a9c715b45ddcdbcc40466b5da8f2f816e
        > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6442207
        > Reviewed-by: Henrik Andreasson <hen...@chromium.org>
        > Reviewed-by: Olga Sharonova <ol...@chromium.org>
        > Reviewed-by: Zequan Wu <zequ...@google.com>
        > Commit-Queue: Gabriel Brito <gabrie...@microsoft.com>
        > Reviewed-by: Greg Thompson <g...@chromium.org>
        > Cr-Commit-Position: refs/heads/main@{#1461128}
        Bug: 40947205
        Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Reviewed-by: Olga Sharonova <ol...@chromium.org>
        Commit-Queue: Gabriel Brito <gabrie...@microsoft.com>
        Reviewed-by: Henrik Andreasson <hen...@chromium.org>
        Reviewed-by: Zequan Wu <zequ...@google.com>
        Reviewed-by: Greg Thompson <g...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1462398}
        Files:
        • M build/config/win/BUILD.gn
        • M media/audio/BUILD.gn
        • M media/audio/audio_input_stream_data_interceptor.h
        • M media/audio/win/audio_low_latency_input_win.cc
        • M media/audio/win/audio_low_latency_input_win.h
        • M media/audio/win/audio_low_latency_input_win_unittest.cc
        • M media/audio/win/core_audio_util_win.cc
        • M media/audio/win/core_audio_util_win_unittest.cc
        • A media/audio/win/test_support/fake_iactivate_audio_interface_async_operation.cc
        • A media/audio/win/test_support/fake_iactivate_audio_interface_async_operation.h
        • A media/audio/win/test_support/fake_iaudio_capture_client.cc
        • A media/audio/win/test_support/fake_iaudio_capture_client.h
        • A media/audio/win/test_support/fake_iaudio_client.cc
        • A media/audio/win/test_support/fake_iaudio_client.h
        • A media/audio/win/test_support/fake_win_wasapi_environment.cc
        • A media/audio/win/test_support/fake_win_wasapi_environment.h
        • A media/audio/win/test_support/wasapi_test_error_code.h
        Change size: XL
        Delta: 17 files changed, 1051 insertions(+), 95 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Olga Sharonova, +1 by Henrik Andreasson, +1 by Zequan Wu, +1 by Greg Thompson
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I987c210568cc78a10ce21c3967cf68be0b057ce2
        Gerrit-Change-Number: 6557667
        Gerrit-PatchSet: 12
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages