Add MF AAC Encoder. [chromium/src : main]

99 views
Skip to first unread message

Austin Orion (Gerrit)

unread,
Jan 3, 2022, 8:19:30 PM1/3/22
to Eugene Zemtsov, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org

Attention is currently required from: Eugene Zemtsov.

Austin Orion would like Eugene Zemtsov to review this change.

View Change

Add MF AAC Encoder.

This CL introduces MFAudioEncoder which uses the Windows Media
Foundation's AAC encoder.
https://docs.microsoft.com/en-us/windows/win32/medfound/aac-encoder

The MF AAC encoder was designed to encode files, where all the data
is available at the start, and so the API is not perfectly suited
for stream encoding. Specifically, there is no callback or event
to let us know when output data is ready, or when it is ready for more
input.

We make this work with the EncodeAsync function that runs whenever we get
input data, the function is basically:
1. Give the input data to the encoder, if it will accept it.
2. Process any output data that is ready.
3. If we were unable to give the input data in step 1, go back to step 1.

This loop may spin for some time, as the encoder won't accept new input
until it has finished processing enough of the previous input that there
is room for more. This loop is loosely based on the MFT Processing model:
https://docs.microsoft.com/en-us/windows/win32/medfound/basic-mft-processing-model#process-data

This design assumes that consumers of MFAudioEncoder will regularly
provide more input data, as we don't check for output unless we have
received new input. We could easily add a timer that will check for
output, and resets whenever we get new input, if this is a concern.

This will be used by MojoAudioEncoder to enable encoding to be done
in the GPU process when using WebCodecs and other consumers. See these
other related CLs:
3243816: webcodecs: Mojo interface, service and client for AudioEncoder | https://chromium-review.googlesource.com/c/chromium/src/+/3243816
3308655: webcodecs: Binding for Mojo Audio Encoder | https://chromium-review.googlesource.com/c/chromium/src/+/3308655

Bug: 1072056
Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
---
A media/gpu/windows/mf_audio_encoder.h
M media/gpu/BUILD.gn
A media/gpu/windows/mf_audio_encoder.cc
M media/base/audio_parameters.cc
M media/base/audio_parameters.h
M content/browser/media/media_internals.cc
6 files changed, 649 insertions(+), 0 deletions(-)


To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 3
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-MessageType: newchange

Austin Orion (Gerrit)

unread,
Jan 3, 2022, 8:19:37 PM1/3/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov.

View Change

1 comment:

  • Patchset:

    • Patch Set #3:

      Hey Eugene and edgecapabilitiesdev,

      The MF AAC encoder is ready for a preliminary review. I still have some work to do, such as adding tests, loading the .dlls (for N SKUs), and implementing PrepareExtraData, but PTAL at what is here so far.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 3
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Comment-Date: Tue, 04 Jan 2022 01:19:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Rahul Singh (Gerrit)

unread,
Jan 3, 2022, 9:55:17 PM1/3/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Austin Orion.

View Change

9 comments:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 3
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Comment-Date: Tue, 04 Jan 2022 02:55:03 +0000

Austin Orion (Gerrit)

unread,
Jan 6, 2022, 7:01:40 PM1/6/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Rahul Singh.

View Change

8 comments:

  • File media/gpu/windows/mf_audio_encoder.h:

    • 2022. Here and in the . […]

      Done

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #3, Line 31: #include <winerror.h>

      nit: Should this be integrated with the second group of headers above?

    • This is a duplicate anyways and needs to be removed, along with several other includes. Thanks for reminding me!

    • super nit: To denote anonymous namespace, I've usually seen "// namespace" which matches the "namesp […]

      Done

    • Instead of reusing StatusCodes, would it be helpful to add new and more descriptive entries to Encod […]

      I think we can add detail by providing messages, but it would be useful to have a more detailed enum so we can log it to UMA. I'll look into this.

    • Patch Set #3, Line 241: AUDIO_PCM_LOW_LATENCY

      Can we add a comment explaining why this particular format was picked?

    • We can actually just remove this, the only value we need to store is the number of channels.

      But to your question, there is only one valid input type and that is PCM audio samples. I used PCM_LOW_LATENCY because that indicates that we'd like to receive the samples with low latency, but like I said it affects nothing because we don't use it.

    • Per this comment in the same directory as this file, we want to avoid calling CoCreateInstance as it […]

      We are on the GPU main thread, I'll look into this.

    • Should we include a link to this remark that states that setting input and output stream id to 0 is […]

      Done

    • Patch Set #3, Line 294:

        // Each output sample should contain a complete, unbroken frame of audio
      // data.
      DCHECK(output_stream_info.dwFlags | MFT_OUTPUT_STREAM_WHOLE_SAMPLES);
      // Each output sample should contain exactly one frame of audio data.
      DCHECK(output_stream_info.dwFlags |
      MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER);
      // All output samples are the same size.
      DCHECK(output_stream_info.dwFlags | MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE);
      // We are required to process the output for this stream (so that our
      // inputs aren't discarded).
      DCHECK(!output_stream_info.dwFlags | MFT_OUTPUT_STREAM_LAZY_READ);
      // This stream should not be removable.
      DCHECK(!output_stream_info.dwFlags | MFT_OUTPUT_STREAM_REMOVABLE);
      // The encoder should not discard any output data.
      DCHECK(!output_stream_info.dwFlags | MFT_OUTPUT_STREAM_DISCARDABLE);
      // This output stream is required.
      DCHECK(!output_stream_info.dwFlags | MFT_OUTPUT_STREAM_OPTIONAL);
      // We should be responsible for allocating the output samples.
      DCHECK(!output_stream_info.dwFlags | MFT_OUTPUT_STREAM_PROVIDES_SAMPLES);
      DCHECK(!output_stream_info.dwFlags | MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES);

      To reduce the length of this method, could we move these asserts into a helper?

    • Done

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 3
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 07 Jan 2022 00:01:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Rahul Singh <rah...@microsoft.com>
Gerrit-MessageType: comment

Eugene Zemtsov (Gerrit)

unread,
Jan 6, 2022, 7:28:38 PM1/6/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Austin Orion, Rahul Singh.

View Change

2 comments:

  • File media/base/audio_parameters.h:

    • Patch Set #3, Line 134: AUDIO_BITSTREAM_AAC

      We don't need to add each compression format here. This is only for audio formats that are sent to playback devices.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #3, Line 244: AUDIO_BITSTREAM_AAC

      Please use AUDIO_PCM_LOW_LATENCY, this describes parameters of audio segment when the buffer is decoded. If encoder doesn't change channel layout or sample rate, there is not reason to have separate output_params_.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 3
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 07 Jan 2022 00:28:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Steve Becker (Gerrit)

unread,
Jan 10, 2022, 3:26:33 PM1/10/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Austin Orion, Rahul Singh.

View Change

21 comments:

  • File media/gpu/BUILD.gn:

    • Patch Set #4, Line 239: "wmcodecdspuuid.lib",

      Should we also delay load the corresponding DLL for this lib, wmvdspa.dll?

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #3, Line 22:

      #include "base/task/task_traits.h"
      #include "base/task/thread_pool.h"
      #include "base/timer/timer.h"

      Please remove unused headers and forward declare when possible.

    • Patch Set #3, Line 34: class MEDIA_GPU_EXPORT MFAudioEncoder : public AudioEncoder {

      Please consider adding a comment banner to explain this class. The change description had a lot of great information that we could add in a comment.

    • Patch Set #3, Line 56: = nullptr;

      nit: ComPtr has a default constructor that initializes to nullptr.

  • File media/gpu/windows/mf_audio_encoder.cc:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 4
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Mon, 10 Jan 2022 20:26:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Austin Orion <auo...@microsoft.com>

Dale Curtis (Gerrit)

unread,
Jan 10, 2022, 4:23:31 PM1/10/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker, Austin Orion, Rahul Singh.

View Change

13 comments:

  • File media/base/audio_parameters.cc:

    • Patch Set #4, Line 23: case AudioParameters::AUDIO_BITSTREAM_AAC:

      Shouldn't be necessary to add this unless you plan to add bitstream AAC output. Just use PCM linear.

  • File media/gpu/BUILD.gn:

    • Should we also delay load the corresponding DLL for this lib, wmvdspa. […]

      Yes please do. Please ensure this gracefully fails on Windows N too.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Need to use ComPtr to prevent memory leaks.

    • nit: it's a little strange that if verification fails, we do not handle an error. […]

      Since that function only DCHECKs it's probably more legible as

      DCHECK(VerifyOutputStremFlags(...)) and having that function return a boolean instead of N dchecks.

    • Patch Set #4, Line 420: hr = MFCreateMemoryBuffer(output_stream_info.cbSize, &encoded_buffer);

      Similar to above, do we need to recreate a new buffer everytime?

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 4
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Mon, 10 Jan 2022 21:23:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Steve Becker <ste...@microsoft.com>
Gerrit-MessageType: comment

Austin Orion (Gerrit)

unread,
Jan 14, 2022, 12:20:20 AM1/14/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Dale Curtis, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Austin Orion.

View Change

22 comments:

  • Patchset:

    • Patch Set #5:

      Still working on the more complex comments, but I've addressed the simpler ones.

  • File media/base/audio_parameters.h:

    • We don't need to add each compression format here. […]

      Done

  • File media/base/audio_parameters.cc:

    • Patch Set #4, Line 23: case AudioParameters::AUDIO_BITSTREAM_AAC:

      Shouldn't be necessary to add this unless you plan to add bitstream AAC output. Just use PCM linear.

    • Done

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #3, Line 22:

      #include "base/task/task_traits.h"
      #include "base/task/thread_pool.h"
      #include "base/timer/timer.h"

      Please remove unused headers and forward declare when possible.

    • Done

    • Please consider adding a comment banner to explain this class. […]

      Done. Let me know if there is any other information you think may be helpful to include here.

    • Should we add a comment that explains how we chose this value?

    • Done

    • Also, nullptr is the style these days, here and elsewhere.

      Done and done.

    • Same as above, we need to use a ComPtr to prevent memory leaks.

      Done

    • Done

    • Please use AUDIO_PCM_LOW_LATENCY, this describes parameters of audio segment when the buffer is deco […]

      Done

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Should we give this function a more descriptive name? Can we describe what "Prepare" involves? May […]

      Done

    • Patch Set #4, Line 133: std::unique_ptr<AudioBus> audio_bus,

      nit: Should |audio_bus| be const reference to make it clear that it's an input parameter?

    • Done

    • Done

    • Done

    • raw ptr seems a bit concerning here. […]

      Done

    • Done

    • Done

    • Since that function only DCHECKs it's probably more legible as […]

      Good suggestion! Done.

    • Done

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 5
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Comment-Date: Fri, 14 Jan 2022 05:20:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>

Austin Orion (Gerrit)

unread,
Jan 14, 2022, 2:28:59 PM1/14/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Dale Curtis, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker.

View Change

1 comment:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #4, Line 363: weak_factory_.GetWeakPtr(),

      weak_ptr is not thread safe. […]

      I see the problem. What if we make EncodeAsync and ProcessOutput anonymous functions, and passed in encoder_ and output_cb_? Then they can run on another thread and not care if MFAudioEncoder is alive or not.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 5
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Comment-Date: Fri, 14 Jan 2022 19:28:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Sunggook Chue (Gerrit)

unread,
Jan 14, 2022, 9:48:49 PM1/14/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Dale Curtis, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker, Austin Orion.

View Change

14 comments:

  • Patchset:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #5, Line 248:

      ChannelLayout channel_layout;
      switch (options.channels) {
      case 1:
      channel_layout = CHANNEL_LAYOUT_MONO;
      break;
      case 2:
      channel_layout = CHANNEL_LAYOUT_STEREO;
      break;
      case 6:
      if (::base::win::GetVersion() >= ::base::win::Version::WIN10) {
      channel_layout = CHANNEL_LAYOUT_5_1;
      break;
      }
      [[fallthrough]];
      default:
      std::move(done_cb).Run(EncoderStatus::Codes::kEncoderUnsupportedConfig);
      return;
      }

      minor: we can move this one to right above channel_layout is referenced (line 285 or 286).

    • Patch Set #5, Line 267: 44100 && options.sample_rate != 48000

      Are these numbers (44100, 48000) generic knowledge? otherwise, we can replace it use concrete named macro?

    • Patch Set #5, Line 284:

      timestamp_tracker_ =
      std::make_unique<AudioTimestampHelper>(options.sample_rate);

      minor: can it also move to before setting initialized_ = true?

    • Patch Set #5, Line 298:

      if (FAILED(hr)) {
      std::move(done_cb).Run(EncoderStatus::Codes::kEncoderInitializationError);
      return;
      }

      This pattern repeate quite a lot,

      How about creating macro that (mf_audio_decoder.cc uses macro as well).

      CALL_CALLBACK__ON_HR_FAILURE(CoCreateInstance(CLSID_AACMFTEncoder, ..), EncoderStatus::Codes::kEncoderInitializationError);

      or

      CALL_CALLBACK__ON_HR_FAILURE(hr, EncoderStatus::Codes::kEncoderInitializationError, "log error message"); It is following pattern of mf_audio_decoder.cc).

      such as CALL_CALLBACK_ON_HR_FAILURE(hr, EncoderStatus::Codes::kEncoderInitializationError).

      btw, why we swallow the system error of hr and instead custom's?

    • Patch Set #5, Line 320: output_media_type

      any reason not using SUCCEEDED(hr)?

    • Patch Set #5, Line 366:

        if (!initialized_) {
      std::move(done_cb).Run(
      EncoderStatus::Codes::kEncoderInitializeNeverCompleted);
      return;
      }

      this should be before above DCHECK because these variables (channel_count_, etc) must be false if initialized_ is false.

    • Patch Set #5, Line 410: not_accepting = true;

      How about output processing doesn't handle data, then doesn't ProcessInput return MF_E_NOTACCEPTING all the time?

      I'm not much familiar with these API usage, so my question might not be relevant.

    • Patch Set #5, Line 448: = nullptr

      no need, same for every ComPtr init in this file.

    • Patch Set #5, Line 468: = 0;

      no need to set for out parameters when its return value have success/failure like HRESULT.

    • Patch Set #5, Line 471:

        if (FAILED(hr))
      return hr;

      it looks like we can use LOG_HR_ON_FAILURE like mf_audio_decoder.cc?

    • Patch Set #5, Line 480: return E_FAIL;

      E_FAIL is very useful, but at the same time it is very annoying from the caller perspective; can't figure out why it failed.

      Can we have any more specific error? (you can search ULONG based win32 error (winerror.h) and use HRESULT_FROM_WIN32) if it is okay in this file.

    • Patch Set #5, Line 528: if (!initialized_) {

      same here, we need to check initialized_ before accessing member variables (DCHECK above).

    • Patch Set #5, Line 539: MF_E_TRANSFORM_NEED_MORE_INPUT

      "It will stop calling ProcessOutput() once it returns MF_E_TRANSFORM_NEED_MORE_INPUT." from "%SDXROOT%\avcore\codecdsp\audio\AC3Enc\Current\MFT\DDEncMFT.cpp". not sure if it is about CLSID_AACMFTEncoder.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 5
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Comment-Date: Sat, 15 Jan 2022 02:48:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Rahul Singh (Gerrit)

unread,
Jan 18, 2022, 4:17:48 PM1/18/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Dale Curtis, Steve Becker, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Austin Orion.

View Change

9 comments:

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #4, Line 47: encoder_

      Should we rename this to mf_encoder_ which would convey it'll be used to call Windows MediaFoundation APIs?

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #3, Line 137: backing_input_buffer

      Could we name this `input_media_buffer_pointer` or something similar to convey that it's derived from the `input_media_buffer`?

    • Patch Set #5, Line 298:

      if (FAILED(hr)) {
      std::move(done_cb).Run(EncoderStatus::Codes::kEncoderInitializationError);
      return;
      }

    • This pattern repeate quite a lot, […]

      Good idea to pull out the repeating code. Per the style guide, we should prefer a helper function instead of a macro for this.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 5
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Comment-Date: Tue, 18 Jan 2022 21:17:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Steve Becker <ste...@microsoft.com>
Comment-In-Reply-To: Austin Orion <auo...@microsoft.com>
Comment-In-Reply-To: Sunggook Chue <sun...@microsoft.com>

Austin Orion (Gerrit)

unread,
Feb 8, 2022, 9:31:11 PM2/8/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Dale Curtis, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Eugene Zemtsov, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

32 comments:

  • Patchset:

    • Patch Set #7:

      Sorry for the delay, a new iteration has been pushed. This was a significant refactor, and I am still working on updating the CL description, as well as adding some tests.

  • File media/gpu/BUILD.gn:

    • Yes please do. Please ensure this gracefully fails on Windows N too.

      We can remove the dependency on wmcodecdspuuid.lib by using IID_PPV_ARGS instead, so this was removed. I did add a delay load for mfaacenc.dll and a PreSandboxInitialization function, as well as a class factory to create the encoder so that we can gracefullly fail when it is not available.

  • File media/gpu/windows/mf_audio_encoder.h:

    • Should we rename this to mf_encoder_ which would convey it'll be used to call Windows MediaFoundatio […]

      Done

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Could we name this `input_media_buffer_pointer` or something similar to convey that it's derived fro […]

      Done

    • Turns out COM is initialized on GPU process start up with MTA. […]

      Ended up using a ClassFactory here to initialize the encoder.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #4, Line 148: // Fill `input_media_buffer` with data from `audio_bus`.

      Allocate a temp buffer at the class level instead of reallocating this every sample.

    • Good idea. It's convenient this is a vector so we can resize it if the input data is too large. Done.

    • It's preferable to have the task runner passed in instead so tests can manage the thread on their ow […]

      I've updated this to use a SequencedTaskRunner, and I've provided a constructor overload that accepts a task_runner.

    • Patch Set #4, Line 225: if (base::win::GetVersion() >= base::win::Version::WIN10) {

      Document why.

      Done

    • Patch Set #4, Line 235: if (options.sample_rate != 44100 && options.sample_rate != 48000) {

    • Document why. 96khZ AAC is a thing.

    • These are the only supported sample rates for the MF AAC encoder. I put these into a constexpr at the top, just below a link to the docs.

    • I see the problem. […]

      This is done. And to answer your question about what keeps MFAudioEncoder alive, see Eugene's CL:
      https://chromium-review.googlesource.com/c/chromium/src/+/3308655

      Specifically, web codecs holds a
      std::unique_ptr<MediaEncoderType> media_encoder_;
      declared in
      third_party/blink/renderer/modules/webcodecs/encoder_base.h

      and initialized via this stack:
      GpuMojoMediaClient::CreateAudioEncoder (gpu_mojo_media_client.cc)
      InterfaceFactoryImpl::CreateAudioEncoder (mojo_media_client.cc)
      CreatePlatformAudioEncoder (web_codecs/audio_encoder.cc)
      AudioEncoder::CreateMediaAudioEncoder (web_codecs/audio_encoder.cc)

    • Do we need a yield or a sleep to prevent this loop from spinning and consuming 100% of the CPU when […]

      This has been redesigned to post another task to the task_runner_, if necessary, instead of looping.

    • Not sure I understand outer while termination here. […]

      This should be clearer with the new design.

    • Patch Set #4, Line 420: hr = MFCreateMemoryBuffer(output_stream_info.cbSize, &encoded_buffer);

      Similar to above, do we need to recreate a new buffer everytime?

    • No, we can reuse this buffer. This is done.

    • Done

    • Is the addition operation helping us convert to base::TimeTicks() here? If so, should we add a comme […]

      Done

    • Per this documentation: […]

      Flush is not a required part of the processing flow, but chromium's AudioEncoder interface requires that we implement it.

      And yes, the encoder can require more input while still holding on to some, if it has fewer than `kSamplesPerFrame` (1024) samples. We must flush these before the encoder will accept input again.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • ChannelLayout channel_layout;
      switch (options.channels) {
      case 1:
      channel_layout = CHANNEL_LAYOUT_MONO;
      break;
      case 2:
      channel_layout = CHANNEL_LAYOUT_STEREO;
      break;
      case 6:
      if (::base::win::GetVersion() >= ::base::win::Version::WIN10) {
      channel_layout = CHANNEL_LAYOUT_5_1;
      break;
      }
      [[fallthrough]];
      default:
      std::move(done_cb).Run(EncoderStatus::Codes::kEncoderUnsupportedConfig);
      return;
      }

      minor: we can move this one to right above channel_layout is referenced (line 285 or 286).

    • I did some refactoring and this ended up in a helper function.

    • Good catch Sunggook. […]

      I put these into a std::array kSupportedSampleRates, I also did the same for bitrate.

    • Patch Set #5, Line 284:

      timestamp_tracker_ =
      std::make_unique<AudioTimestampHelper>(options.sample_rate);

      minor: can it also move to before setting initialized_ = true?

    • Done

    • Patch Set #5, Line 298:

      if (FAILED(hr)) {
      std::move(done_cb).Run(EncoderStatus::Codes::kEncoderInitializationError);
      return;
      }

    • Good idea to pull out the repeating code. […]

      I do not think we can do this because it would require moving the callback into the function.

    • We should be checking the hr here, fixed.

    • Patch Set #5, Line 366:

        if (!initialized_) {
      std::move(done_cb).Run(
      EncoderStatus::Codes::kEncoderInitializeNeverCompleted);
      return;
      }

    • this should be before above DCHECK because these variables (channel_count_, etc) must be false if in […]

      Done

    • How about output processing doesn't handle data, then doesn't ProcessInput return MF_E_NOTACCEPTING […]

      I don't think I understand your question. Are you saying that if we don't process the output data, then ProcessInput will always return MF_E_NOTACCEPTING? If so, that's correct, but we do process the output data below, as part of this loop.

      Hopefully the new design is clearer, let me know if you still have questions.

    • Done

    • Patch Set #5, Line 468: = 0;

      no need to set for out parameters when its return value have success/failure like HRESULT.

    • Done

    • it looks like we can use LOG_HR_ON_FAILURE like mf_audio_decoder. […]

      Done

    • E_FAIL is very useful, but at the same time it is very annoying from the caller perspective; can't f […]

      We can actually remove this, since status will only be set if ProcessOutput returns MF_E_TRANSFORM_STREAM_CHANGE. Instead let's DCHECK this after the if (FAILED(hr)) above, since we don't expect any stream changes or have any way to handle them.

    • Patch Set #5, Line 528: if (!initialized_) {

      same here, we need to check initialized_ before accessing member variables (DCHECK above).

    • Done

    • "It will stop calling ProcessOutput() once it returns MF_E_TRANSFORM_NEED_MORE_INPUT. […]

      Right, this is also what we do here. If we get MF_E_NEED_MORE_INPUT, we won't run the error callback, and we also stop looping. Hopefully this is clearer in the new design.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 7
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Wed, 09 Feb 2022 02:31:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>

Austin Orion (Gerrit)

unread,
Feb 8, 2022, 9:33:44 PM2/8/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Dale Curtis, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

1 comment:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #7, Line 732: kSamplesPerFrame * 4

      Need to find out how much data the `mf_encoder_` keeps buffered, so that we know when we should keep checking for output. Experimentally it seems it keeps 2048 samples buffered, but need to confirm this.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 7
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Wed, 09 Feb 2022 02:33:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Austin Orion (Gerrit)

unread,
Feb 8, 2022, 10:23:12 PM2/8/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org

Attention is currently required from: Dale Curtis, Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

Austin Orion uploaded patch set #8 to this change.

View Change

Add MF AAC Encoder.

This CL introduces MFAudioEncoder which uses the Windows Media
Foundation's AAC encoder.
https://docs.microsoft.com/en-us/windows/win32/medfound/aac-encoder

The MF AAC encoder was designed to encode files, where all the data
is available at the start, and so the API is not perfectly suited
for stream encoding. Specifically, there is no callback or event
to let us know when output data is ready, or when it is ready for more
input.

We make this work with a state machine that is described by this
diagram:
https://mermaid.live/view/#pako:eNqFVNtu2kAQ_ZXpPkRGCn7gkbZIaXGkqJWSBt66lbXYA1jYa3cvrZDNv3cv1Dcc5Ynd2Tkz55wZXJOkTJEsyUGw6gjbNeUA3_GAPP1JiT8sP-3Eal0qhSnkGUcJTCC8lFJtmTxJSn5Z0FeW5yhgPl_BY67lcRSLuG300UbdM8zD-aqRiimEz3BysYwfGtiK84soE5TyWatKK4vwYAcx598aNT7x9q27206Nu8ZhZQo2sLEN6pqSbA_XZqbbU5ojJZeLxbsMB9yzXGIDr6i04EFASQe4MjIEwZoBwV90JrBcIEvPIDTn5nFGyWzWK2olKqGxr6olPgo5Cq0fXcMGHpIEK2WOdf3hKg6LSp3h7s6zQWePiMM201X0-tpYX2PES304ftH7PQpM61qyospRxhmPr8VgBUXGp0p4QWM1N1I28fO3HvfJnEiIUhg29icIWvHu7o0cEp12tL8nw-xOsJ14r4O9-gbjMm5Z_fHhD8tytsvN_rQOj168P6Ngv-8PO6_ITquu-7N7Gziwt5N2Q3Jg3mLavVuQnYpfmtIF42QXh6-aN2MuFt6R7zEberx4b3f6NcLOl4n_w6jweHqLyfHdgN5eEHJPChQFy1LzuastmBJ1xMJ8CZbmmDJxooTyi8nTVWo6RWmmSkGWttw9YVqVmzNP_t99zjpj5stZ-ODlH1c0454

Basically the process is as follows:
1. If we have input in our queue, give it to the encoder until we run
out or the encoder rejects it (because it is full)
2. Check the encoder for output until it stops producing
3. If, by our count, the encoder could produce more data, check again
4. If we have more input in the queue, by now, go back to 1

Each transition (e.g. from step 1 to step 2) is accomplished by
posting a task to a SequencedTaskRunner. This ensures that we can
safely access our mutable members (like the queue) without issue,
and we yield the thread frequently so we don't block for extended
periods of time.

This class will be used by MojoAudioEncoder to enable encoding to be

done in the GPU process when using WebCodecs and other consumers. See
these other related CLs:
3243816: webcodecs: Mojo interface, service and client for AudioEncoder | https://chromium-review.googlesource.com/c/chromium/src/+/3243816
3308655: webcodecs: Binding for Mojo Audio Encoder | https://chromium-review.googlesource.com/c/chromium/src/+/3308655

Bug: 1072056
Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
---
M content/gpu/gpu_main.cc
M media/gpu/BUILD.gn
A media/gpu/windows/mf_audio_encoder.cc
A media/gpu/windows/mf_audio_encoder.h
4 files changed, 1,027 insertions(+), 0 deletions(-)

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 8
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-MessageType: newpatchset

Dale Curtis (Gerrit)

unread,
Feb 9, 2022, 3:21:38 PM2/9/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

22 comments:

  • Patchset:

    • Patch Set #8:

      Seems you could add a simple unit test for this code that uses the encoder directly (it doesn't take a lot of deps). Can you do that?

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #8, Line 32: // Encodes PCM audio samples into AAC samples with ADTS headers on Win8 and raw

      I'm surprised to see this talk about Win7/8 vs 10/11 :) Can you add some clarity for what happens on more modern OS here?

    • Patch Set #8, Line 64: // `Initialize` is synchronous and will call `done_cb` before returning.

      Generally our style is |done_cb| and just Initialize() in comments. There's no formal rule for this though, so up to you. (Change rest of file if you do change)

    • Patch Set #8, Line 117: ::base::TimeTicks capture_time,

      No leading ::, here and everywhere else.

    • Patch Set #8, Line 158: std::deque<InputData> input_queue_;

      base::circular_deque

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Need to find out how much data the `mf_encoder_` keeps buffered, so that we know when we should keep […]

      Is there no callback based interface to let us know when data is ready?

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #8, Line 105:

      I think we have this same function in dxva decoder. Maybe should go in a common MF utility class?

    • Patch Set #8, Line 113: using GetClassObject =

      GetClassObjectFn ?

    • Patch Set #8, Line 117: GetClassObject get_class_object = reinterpret_cast<GetClassObject>(

      good use for auto

    • Patch Set #8, Line 235: DCHECK_GE(*min_input_buffer_size,

      Since this is using a result from a system call, I think you want a CHECK() instead of DCHECK to catch any bad drivers. If it actually starts crashing we can change it to a conditional.

    • Patch Set #8, Line 282: // The caller supplies a `source_buffer` so we don't have to allocate a new

      Why do we need this? Can't you just call ToInterleaved() directly into the dest_buffer?

    • Patch Set #8, Line 290: audio_bus->ToInterleaved<media::SignedInt16SampleTypeTraits>(

      Does MFAudioFormat_Float not work?

    • Patch Set #8, Line 304: memcpy(source_buffer.data(), dest_buffer_ptr, source_data_size);

      This copies dest_buffer_ptr data into source_buffer. I think that's backwards?

    • Patch Set #8, Line 382: DCHECK_EQ(status, 0u);

      Since this is a system api call, you should probably handle this or CHECK() since we see lots of bad drivers and interceptors in the field.

    • Patch Set #8, Line 384: if (output_data_container.pEvents != nullptr) {

      Drop != nullptr

    • Patch Set #8, Line 439: : samples_in_encoder_(0),

      initialize these inline in the header file where possible. Less error prone.

    • Patch Set #8, Line 453: DCHECK(!done_cb.is_null());

      Just DCHECK(done_cb) here and everywhere else drop is_null

    • Patch Set #8, Line 572: DCHECK_EQ(audio_bus->channels(), channel_count_);

      Probably worth a hard error. I'm not confident in our encoding paths here yet.

    • Patch Set #8, Line 577: ::base::BindOnce(&MFAudioEncoder::EnqueueInput, base::Unretained(this),

      Unretained doesn't seem safe in this class. Can you explain why it is? I think you need a WeakPtrFactory.

    • Patch Set #8, Line 666: break;

      If this happens, what triggers work later?

    • Patch Set #8, Line 691: state_ == EncoderState::kFlushing);

      Helpful to add a << state_ here for debugging.

    • Patch Set #8, Line 782: DCHECK(state_ == EncoderState::kFlushing);

      DCHECK_EQ

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 8
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Wed, 09 Feb 2022 20:21:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Austin Orion <auo...@microsoft.com>
Gerrit-MessageType: comment

Austin Orion (Gerrit)

unread,
Feb 9, 2022, 9:30:54 PM2/9/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Dale Curtis, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Eugene Zemtsov, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

21 comments:

  • Patchset:

    • Patch Set #8:

      Seems you could add a simple unit test for this code that uses the encoder directly (it doesn't take […]

      Definitely, I've hacked together a unit test for inner loop testing, and I'm working on polishing it up and posting. Thanks for adding a tracking comment so we don't miss this.

  • Patchset:

    • Patch Set #9:

      Thanks for taking such a quick look, Dale, I'll get to the rest of your comments tomorrow.

  • File media/gpu/windows/mf_audio_encoder.h:

    • I'm surprised to see this talk about Win7/8 vs 10/11 :) Can you add some clarity for what happens on […]

      Whoops, this should say Win8+. Fixed.

    • Done

    • It seems we can't use base::circular_deque because it requires a copy constructor which we can't provide for this struct since it contains a base::OnceCallback. Let me know if I'm missing something.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Is there no callback based interface to let us know when data is ready?

      Unfortunately no. The MF AAC encoder is a synchronous MF Transform so it has no notification mechanism. We must call GetOutputStatus to find out, but even then it could have enough data to eventually have output, it's just not ready yet. This helps us ensure that we don't leave samples in the encoder.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • I think we have this same function in dxva decoder. […]

      Good idea, I added this to the media/base/win/mf_helpers.cc. I'll look into either moving some more of these functions into there, or making use of the ones already there (e.g. for creating MFSamples).

    • done, and added _func to get_class_object_func

    • Done

    • Since this is using a result from a system call, I think you want a CHECK() instead of DCHECK to cat […]

      Done

    • Patch Set #8, Line 282: // The caller supplies a `source_buffer` so we don't have to allocate a new

      Why do we need this? Can't you just call ToInterleaved() directly into the dest_buffer?

    • Would you look at that, we can! This is fixed.

    • Patch Set #8, Line 290: audio_bus->ToInterleaved<media::SignedInt16SampleTypeTraits>(

      Does MFAudioFormat_Float not work?

    • This copies dest_buffer_ptr data into source_buffer. […]

      This has been removed.

    • Since this is a system api call, you should probably handle this or CHECK() since we see lots of bad […]

      Done

    • Done

    • Patch Set #8, Line 439: : samples_in_encoder_(0),

      initialize these inline in the header file where possible. Less error prone.

    • Done

    • Done

    • Patch Set #8, Line 572: DCHECK_EQ(audio_bus->channels(), channel_count_);

      Probably worth a hard error. I'm not confident in our encoding paths here yet.

    • Updated this to CHECK_EQ.

    • If the encoder is not accepting, it's because its internal input buffers are full, which means that `samples_in_encoder_` will be large enough that we will call TryProcessOutput. From there we will see that `input_queue_` has data remaining in it, and we'll end up back here.

    • Done

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 9
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 10 Feb 2022 02:30:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>

Dale Curtis (Gerrit)

unread,
Feb 10, 2022, 2:07:38 PM2/10/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

3 comments:

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #8, Line 64: // `Initialize` is synchronous and will call `done_cb` before returning.

      I thought backticks were the new thing: […]

      Huh, TIL, thanks for the reference!

    • It seems we can't use base::circular_deque because it requires a copy constructor which we can't pro […]

      If you give the struct a move constructor I think it'll do the right thing?

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Unfortunately no. […]

      Ah, that's unfortunate. The MFT interface is a bit painful to use 😞

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 9
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 10 Feb 2022 19:07:30 +0000

Austin Orion (Gerrit)

unread,
Feb 10, 2022, 8:37:08 PM2/10/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Dale Curtis, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Eugene Zemtsov, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

4 comments:

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #8, Line 158: std::deque<InputData> input_queue_;

      If you give the struct a move constructor I think it'll do the right thing?

      Oh right. This is done.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Ah, that's unfortunate. […]

      Asynchronous MFTs are better for sure, but yeah this one is pretty old and not very well suited for stream encoding.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #8, Line 577: ::base::BindOnce(&MFAudioEncoder::EnqueueInput, base::Unretained(this),

      Unretained doesn't seem safe in this class. […]

      Oh I thought the object just had to outlive the task runner, yeah these should be WeakPtrs. Fixed.

    • Is there a better way to do this for enum classes? I had to cast it to an int for logging, I had some trouble implementing the << operator (I guess because the enum is a private member of MFAudioEncoder).

      Let me know, or if casting is the way to go then this is done.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 10
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 11 Feb 2022 01:36:57 +0000

Dale Curtis (Gerrit)

unread,
Feb 14, 2022, 2:22:26 PM2/14/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

Patch set 10:Code-Review +1

View Change

11 comments:

  • File media/base/win/mf_helpers.cc:

    • Patch Set #10, Line 29: HRESULT CreateCOMObjectFromDll(const HMODULE dll,

      FWIW, I thought this was the old way of activating MFTs. Do we not want to use MFTEnumEx?

  • File media/gpu/windows/mf_audio_encoder.cc:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 10
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Mon, 14 Feb 2022 19:22:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Dale Curtis (Gerrit)

unread,
Feb 14, 2022, 2:29:47 PM2/14/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

1 comment:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 10
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Mon, 14 Feb 2022 19:29:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Gerrit-MessageType: comment

Eugene Zemtsov (Gerrit)

unread,
Feb 16, 2022, 11:25:07 PM2/16/22
to Zhenyao Mo, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Austin Orion, Dale Curtis, Eugene Zemtsov

Attention is currently required from: Zhenyao Mo, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

Eugene Zemtsov would like Zhenyao Mo to review this change authored by Austin Orion.

View Change

M media/base/win/mf_helpers.cc
M media/base/win/mf_helpers.h
M media/gpu/BUILD.gn
M media/gpu/windows/dxva_video_decode_accelerator_win.cc
A media/gpu/windows/mf_audio_encoder.cc
A media/gpu/windows/mf_audio_encoder.h
7 files changed, 1,038 insertions(+), 27 deletions(-)


To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 10
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Zhenyao Mo <z...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-MessageType: newchange

Eugene Zemtsov (Gerrit)

unread,
Feb 16, 2022, 11:25:15 PM2/16/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Zhenyao Mo, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

1 comment:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 10
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Zhenyao Mo <z...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 17 Feb 2022 04:25:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 5:26:12 PM2/17/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Zhenyao Mo, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

9 comments:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #8, Line 691: state_ == EncoderState::kFlushing);

      If you give the enum class a value type I think it might auto convert. I.e., […]

      I forgot to mention that I tried that as well. The only thing that worked was making it an enum instead of an enum class, but I'd rather cast it than do that. I'll just leave it how it is, I was just wondering if there was something I was missing.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #10, Line 241: HRESULT CreateMFSampleFromAudioBus(const std::unique_ptr<AudioBus>& audio_bus,

      Usually we pass const T& instead of unique_ptr<T>& if the function will never get a null value. […]

      Done for AudioBus. I left the ComPtr<T> because the functions we're calling on them aren't marked const.

    • Do you know why we can't just reuse the same output_sample over and over? I'm pretty sure we can't s […]

      Seems to be working for me, maybe it is an issue specifically with the decoder? I see our implementation downstream also does not reuse output buffers. What was the error specifically? Maybe I am overlooking something.

    • (Note they might not be worth the pain, but perhaps we should contribute some useful ones to base/ti […]

      Good suggestion! I think MFTIME would be a better candidate though. It works great for us because it's a typedef for LONGLONG rather than a struct like FILETIME. And it avoids confusion like what's described in this bug, since MFTIME is just a unit and not an absolute time:
      https://bugs.chromium.org/p/chromium/issues/detail?id=989694

      I don't think I understand TimeTicks well enough to add a conversion for that class and maintain its guarantees, so I've just added TimeDelta helpers for this.

    • Patch Set #10, Line 438: std::move(done_cb).Run(EncoderStatus::Codes::kEncoderInitializationError);

      Should this be not supported error?

    • I could see it either way, but I'll go ahead and update this to kEncoderUnsupportedCodec.

    • Sorry, I don't understand, what are you suggestion we compare state_ to?

    • Patch Set #10, Line 591: LONGLONG duration = timestamp_tracker_->GetFrameDuration(audio_bus->frames())

      Ditto on TS helpers.

    • Done

    • I was trying to make the public functions callable from any sequence, and then post tasks to our internal functions onto our SequencedTaskRunner, but that had some issues.

      Now I've updated this class so it must be called on a SequencedTaskRunner (which works fine since we expect to be wrapped in an OffloadingAudioEncoder) and so now we can call these functions immediately instead of posting tasks.

    • I thought about it, but I couldn't decided on a reasonable delay amount. This also breaks the test that I have because RunUntilIdle exits before running delayed tasks. If it's not a deal breaker for you, I'll leave this.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 11
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Zhenyao Mo <z...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 17 Feb 2022 22:26:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 5:31:37 PM2/17/22
to Peter Kasting, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Zhenyao Mo, Dale Curtis, Eugene Zemtsov

Attention is currently required from: Dale Curtis, Zhenyao Mo, Peter Kasting, Steve Becker, Sunggook Chue, Rahul Singh.

Austin Orion would like Peter Kasting to review this change.

View Change

M base/time/time.h
M base/time/time_win.cc
M base/win/windows_types.h

M content/gpu/gpu_main.cc
M media/base/win/mf_helpers.cc
M media/base/win/mf_helpers.h
M media/gpu/BUILD.gn
M media/gpu/windows/dxva_video_decode_accelerator_win.cc
A media/gpu/windows/mf_audio_encoder.cc
A media/gpu/windows/mf_audio_encoder.h
M media/renderers/win/media_foundation_stream_wrapper.cc
11 files changed, 1,140 insertions(+), 34 deletions(-)


To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 12
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Zhenyao Mo <z...@chromium.org>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-MessageType: newchange

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 5:31:43 PM2/17/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Zhenyao Mo, Peter Kasting, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

1 comment:

  • Patchset:

    • Patch Set #12:

      Hi pkasting@, PTAL at some MFTIME helpers that I added to time.h

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 12
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Zhenyao Mo <z...@chromium.org>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 17 Feb 2022 22:31:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 5:33:11 PM2/17/22
to David Bienvenu, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, Zhenyao Mo, Dale Curtis, Eugene Zemtsov

Attention is currently required from: Dale Curtis, Zhenyao Mo, Peter Kasting, Steve Becker, David Bienvenu, Sunggook Chue, Rahul Singh.

Austin Orion would like David Bienvenu to review this change.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 12
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Zhenyao Mo <z...@chromium.org>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-MessageType: newchange

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 5:33:19 PM2/17/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, David Bienvenu, Peter Kasting, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Zhenyao Mo, Peter Kasting, Steve Becker, David Bienvenu, Sunggook Chue, Rahul Singh.

View Change

1 comment:

  • Patchset:

    • Patch Set #12:

      Hi davidbienvenu@, PTAL at the addition of MFTIME to base/win/windows_types.h

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 12
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Zhenyao Mo <z...@chromium.org>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 17 Feb 2022 22:33:08 +0000

Zhenyao Mo (Gerrit)

unread,
Feb 17, 2022, 6:00:35 PM2/17/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, David Bienvenu, Peter Kasting, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Peter Kasting, Steve Becker, David Bienvenu, Austin Orion, Sunggook Chue, Rahul Singh.

Patch set 12:Code-Review +1

View Change

1 comment:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 12
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 17 Feb 2022 23:00:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Dale Curtis (Gerrit)

unread,
Feb 17, 2022, 6:01:05 PM2/17/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Zhenyao Mo, David Bienvenu, Peter Kasting, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Peter Kasting, Steve Becker, David Bienvenu, Austin Orion, Sunggook Chue, Rahul Singh.

Patch set 12:Code-Review +1

View Change

9 comments:

  • File base/time/time.h:

    • Patch Set #12, Line 122: static TimeDelta FromMfTime(MFTIME mf_time);

      I'd probably land these in another CL instead for cleanliness. base/ team is sure to want some tests added for this.

  • File media/base/win/mf_helpers.cc:

    • FWIW, I thought this was the old way of activating MFTs. […]

      Bump on this Q.

  • File media/gpu/windows/mf_audio_encoder.h:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Done for AudioBus. […]

      Usually that means you want T* instead.

    • Seems to be working for me, maybe it is an issue specifically with the decoder? I see our implementa […]

      Hmm, I don't recall, it's certainly possible it was user error.

    • Sorry, I don't understand, what are you suggestion we compare state_ to?

      I just meant add the string "state_ == " so that the text isn't

      "Check failed! 5" but "Check failed! state_ == 5"

  • File media/gpu/windows/mf_audio_encoder.cc:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 12
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 17 Feb 2022 23:00:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

David Bienvenu (Gerrit)

unread,
Feb 17, 2022, 6:44:38 PM2/17/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Zhenyao Mo, Peter Kasting, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Peter Kasting, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

2 comments:

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #12, Line 89:

      Doing so will cause an error, if I'm reading the code correctly, so you might want to incorporate that into your comment.

  • File media/gpu/windows/mf_audio_encoder.cc:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 12
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 17 Feb 2022 23:44:27 +0000

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 8:17:37 PM2/17/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Eugene Zemtsov

Attention is currently required from: Steve Becker, Sunggook Chue, Rahul Singh.

Austin Orion has uploaded this change for review.

View Change

M content/gpu/gpu_main.cc
M media/base/win/mf_helpers.cc
M media/base/win/mf_helpers.h
M media/gpu/BUILD.gn
M media/gpu/windows/dxva_video_decode_accelerator_win.cc
A media/gpu/windows/mf_audio_encoder.cc
A media/gpu/windows/mf_audio_encoder.h
7 files changed, 1,131 insertions(+), 27 deletions(-)


To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 13
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-MessageType: newchange

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 8:17:42 PM2/17/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker, Sunggook Chue, Rahul Singh.

View Change

2 comments:

  • Patchset:

    • Patch Set #13:

      Undid the changes to time.h and media_types.h so moving pkasting@ and davidbienvenu@ to CC.

  • File base/time/time.h:

    • I'd probably land these in another CL instead for cleanliness. […]

      Done.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 13
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 18 Feb 2022 01:17:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Austin Orion (Gerrit)

unread,
Feb 17, 2022, 9:06:33 PM2/17/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker, Sunggook Chue, Rahul Singh.

View Change

7 comments:

  • File media/base/win/mf_helpers.cc:

    • Patch Set #12, Line 57: MFAudioEncoder();

      Do we need both constructors? The one with which takes a task runner should be sufficient.

    • Just for convenience, I'll remove it. It makes it more explicit that it needs to be run on a sequence.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Hmm, I don't recall, it's certainly possible it was user error.

    • I will run my tests with a sanitizer and check tomorrow.

    • I just meant add the string "state_ == " so that the text isn't […]

      Good idea! Done.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • 0 sized AudioBus is impossible.

    • Oh I see the DCHECK in there now, I'll remove this.

    • Done

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 14
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 18 Feb 2022 02:06:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>

Eugene Zemtsov (Gerrit)

unread,
Feb 17, 2022, 10:15:13 PM2/17/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

2 comments:

  • File media/gpu/windows/mf_audio_encoder.h:

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 14
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 18 Feb 2022 03:14:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Austin Orion (Gerrit)

unread,
Feb 18, 2022, 5:10:30 PM2/18/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

4 comments:

  • File media/gpu/windows/mf_audio_encoder.h:

    • Does it have to be MTA? I'd like to run it on a runner created by ThreadPool::CreateCOMSTATaskRunner […]

      No, it can be STA too. I've updated this comment and the ASSERT in Initialize.

    • Whoops, removed.

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #12, Line 89:

      Doing so will cause an error, if I'm reading the code correctly, so you might want to incorporate th […]

      I was looking at other encoders and it seems this is unique to us, so I think I'll instead add another queue to store input received while flushing. Then we can start work on that input once the flush completes.

      I've removed this sentence from the comment since it no longer applies.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • like above, add << "state_ == " << static_cast<int>(state_);

    • Done

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 15
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 18 Feb 2022 22:10:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>
Comment-In-Reply-To: David Bienvenu <davidb...@chromium.org>
Gerrit-MessageType: comment

Dale Curtis (Gerrit)

unread,
Feb 24, 2022, 2:54:03 PM2/24/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

Patch set 17:Code-Review +1

View Change

1 comment:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #17, Line 72: constexpr const wchar_t kAacDllName[] = L"mfaacenc.dll";

      Do we even need the DLL preloads anymore now that you're using MFTEnumEx?

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 17
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 24 Feb 2022 19:53:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Austin Orion (Gerrit)

unread,
Feb 24, 2022, 6:53:57 PM2/24/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

2 comments:

  • Patchset:

    • Patch Set #8:

      Definitely, I've hacked together a unit test for inner loop testing, and I'm working on polishing it […]

      This is done.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Patch Set #17, Line 72: constexpr const wchar_t kAacDllName[] = L"mfaacenc.dll";

      Do we even need the DLL preloads anymore now that you're using MFTEnumEx?

    • Yes, the call to ActivateObject on line 129 will cause mfaacenc.dll to be loaded if it isn't already. And we need mfplat.dll in order to call MFTEnumEx.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 18
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Thu, 24 Feb 2022 23:53:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Dale Curtis (Gerrit)

unread,
Feb 24, 2022, 7:11:44 PM2/24/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

Patch set 18:Code-Review +1

View Change

1 comment:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Yes, the call to ActivateObject on line 129 will cause mfaacenc. […]

      Interesting, did you verify this? We were able to get away with no preloading the av1 MFT for some reason when loading this way, so I thought it might be similar.

      MFPlat is already preloaded by the video decoders, so that one is fine, but the less we have to preload the better.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 18
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 25 Feb 2022 00:11:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Austin Orion (Gerrit)

unread,
Feb 24, 2022, 8:18:40 PM2/24/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Eugene Zemtsov, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

1 comment:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Interesting, did you verify this? We were able to get away with no preloading the av1 MFT for some r […]

      I haven't run this in a sandbox to see if it fails, but when I run media_unittests under WinDbg and set a breakpoint with `sxe ld mfaacenc` I see the breakpoint hit on the call to ActivateObject. I've also debugged a few things and have stepped into mfaacenc, so we're definitely running code from there. IIUC, the sandbox would prevent us from loading the .dll after it's initialized, so I'm pretty sure we have to preload it.

      I'm not sure why the av1 MFT works without preloading, maybe when MF is loaded it loads these codec .dlls by default? I can ask around and try to find out.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 18
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 25 Feb 2022 01:18:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Dale Curtis (Gerrit)

unread,
Feb 24, 2022, 8:21:50 PM2/24/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

1 comment:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • I haven't run this in a sandbox to see if it fails, but when I run media_unittests under WinDbg and […]

      Okay, it might be worth leaving out the sandbox initialization stuff until we can confirm that then since it's not necessary for this patch (only the one which wires this up)

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 18
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 25 Feb 2022 01:21:39 +0000

Eugene Zemtsov (Gerrit)

unread,
Feb 24, 2022, 11:07:47 PM2/24/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

1 comment:

  • Patchset:

    • Patch Set #18:

      I ran media_unittests on my workstation. One of them failed:

      AAC/AudioEncodersTest.Timestamps/2, where GetParam() = 12-byte object <01-00 00-00 01-00 00-00 80-BB 00-00>

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 18
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 25 Feb 2022 04:07:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Eugene Zemtsov (Gerrit)

unread,
Feb 25, 2022, 12:06:31 AM2/25/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Steve Becker, Austin Orion, Sunggook Chue, Rahul Singh.

View Change

1 comment:

  • File media/gpu/windows/mf_audio_encoder.h:

    • Patch Set #18, Line 185: task_runner_

      I've noticed that |task_runner_| is only used for calling TryProcessInput() and TryProcessOutput() and these functions assert that the sequence |sequence_checker_| as all regular public methods.

      Do we even need this runner then? Can't we just synchronously call TryProcessInput() and TryProcessOutput()?

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 18
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 25 Feb 2022 05:06:20 +0000

Austin Orion (Gerrit)

unread,
Feb 25, 2022, 6:18:38 PM2/25/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov, Steve Becker, Sunggook Chue, Rahul Singh.

View Change

3 comments:

  • Patchset:

    • Patch Set #18:

      I ran media_unittests on my workstation. One of them failed: […]

      Yes, I am still investigating this failure. I'm not sure why it's failing when both are using an AudioTimestampHelper, but I'll continue debugging it.

  • File media/gpu/windows/mf_audio_encoder.h:

    • I've noticed that |task_runner_| is only used for calling TryProcessInput() and TryProcessOutput() a […]

      We PostTasks to yield the thread, otherwise we would block while waiting for the encoder to produce output. The encoder won't accept input while its buffer is full, and calls to GetOutputStatus will return false if the input data isn't finished encoding. During this period, we will spin if the calls were synchronous. If the input queue were to fill up faster than we could process it, we could block for a very long time.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Okay, it might be worth leaving out the sandbox initialization stuff until we can confirm that then […]

      Sure, I've removed the call from gpu_main.cc

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 19
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Steve Becker <ste...@microsoft.com>
Gerrit-Attention: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
Gerrit-Comment-Date: Fri, 25 Feb 2022 23:18:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>

Eugene Zemtsov (Gerrit)

unread,
Feb 25, 2022, 7:34:17 PM2/25/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Austin Orion.

View Change

3 comments:

  • Patchset:

    • Patch Set #19:

      I have a webcodecs integration CL pending, but unfortunately when I try to do full cycle encode/decode test in using webcodecs API I get this error from ffmpeg decoder:

      ERROR:ffmpeg_decoding_loop.cc(31)] Failed to send packet for decoding: -1094995529 msg: Invalid data found when processing input

      I don't think it's showstopper though, we can figure out what's the matter after this CL is submitted.

  • File content/gpu/gpu_main.cc:

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Sure, I've removed the call from gpu_main. […]

      Yeah, I have a pending integration CL. And the encoder seems to work fine without this call.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 19
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Austin Orion <auo...@microsoft.com>
Gerrit-Comment-Date: Sat, 26 Feb 2022 00:34:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>

Austin Orion (Gerrit)

unread,
Mar 2, 2022, 3:08:19 PM3/2/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov.

View Change

4 comments:

  • Patchset:

    • Patch Set #18:

      Yes, I am still investigating this failure. […]

      This test is fixed. The issue was that we were using the timestamp provided by the encoder, which (when the inputs are large) undercounts due to summing the (truncated) durations. The solution was to add an output_timestamp_tracker_ and use that instead.

  • File content/gpu/gpu_main.cc:

    • Done

  • File media/gpu/windows/mf_audio_encoder.cc:

    • I will run my tests with a sanitizer and check tomorrow.

      Passes fine with under ASAN. Having troubles running UBSAN and MSAN though, but I think we're fine here.

  • File media/gpu/windows/mf_audio_encoder.cc:

    • Yeah, I have a pending integration CL. And the encoder seems to work fine without this call.

      I asked around and the answer is complicated, but it's not unexpected that loading this .dll would succeed since it is relatively small and self contained. Happy to share more details if you'd like, but you're correct that we don't need to explicitly load mfaacenc.dll. So, I've removed it.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 20
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Comment-Date: Wed, 02 Mar 2022 20:08:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>

Austin Orion (Gerrit)

unread,
Mar 3, 2022, 2:06:32 PM3/3/22
to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Chromium LUCI CQ, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Eugene Zemtsov, Tricium, chromium...@chromium.org

Attention is currently required from: Eugene Zemtsov.

View Change

1 comment:

  • Patchset:

    • Patch Set #19:

      I have a webcodecs integration CL pending, but unfortunately when I try to do full cycle encode/deco […]

      I think this was because I was reusing the encoder's input options for the decoder, which it didn't like. I've reverted the test back to using constants specifically for the decoder, which fixed the test failures.

To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
Gerrit-Change-Number: 3293969
Gerrit-PatchSet: 24
Gerrit-Owner: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Austin Orion <auo...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
Gerrit-CC: David Bienvenu <davidb...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rahul Singh <rah...@microsoft.com>
Gerrit-CC: Steve Becker <ste...@microsoft.com>
Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Comment-Date: Thu, 03 Mar 2022 19:06:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>
Gerrit-MessageType: comment

Eugene Zemtsov (Gerrit)

unread,
Mar 7, 2022, 4:40:20 PM3/7/22
to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Eugene Zemtsov, Chromium LUCI CQ, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Tricium, chromium...@chromium.org

Attention is currently required from: Austin Orion.

Patch set 25:Code-Review +1Commit-Queue +2

View Change

    To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
    Gerrit-Change-Number: 3293969
    Gerrit-PatchSet: 25
    Gerrit-Owner: Austin Orion <auo...@microsoft.com>
    Gerrit-Reviewer: Austin Orion <auo...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
    Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
    Gerrit-CC: David Bienvenu <davidb...@chromium.org>
    Gerrit-CC: Peter Kasting <pkas...@chromium.org>
    Gerrit-CC: Rahul Singh <rah...@microsoft.com>
    Gerrit-CC: Steve Becker <ste...@microsoft.com>
    Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
    Gerrit-Attention: Austin Orion <auo...@microsoft.com>
    Gerrit-Comment-Date: Mon, 07 Mar 2022 21:40:12 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Austin Orion (Gerrit)

    unread,
    Mar 7, 2022, 4:42:21 PM3/7/22
    to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Eugene Zemtsov, Chromium LUCI CQ, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Tricium, chromium...@chromium.org

    Attention is currently required from: Rahul Singh.

    View Change

    1 comment:

    • File media/gpu/windows/mf_audio_encoder.cc:

      • Patch Set #3, Line 234: kEncoderUnsupportedConfig

        I think we can add detail by providing messages, but it would be useful to have a more detailed enum […]

        I'm going to address this in a follow up CL.

    To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
    Gerrit-Change-Number: 3293969
    Gerrit-PatchSet: 25
    Gerrit-Owner: Austin Orion <auo...@microsoft.com>
    Gerrit-Reviewer: Austin Orion <auo...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
    Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
    Gerrit-CC: David Bienvenu <davidb...@chromium.org>
    Gerrit-CC: Peter Kasting <pkas...@chromium.org>
    Gerrit-CC: Rahul Singh <rah...@microsoft.com>
    Gerrit-CC: Steve Becker <ste...@microsoft.com>
    Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
    Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
    Gerrit-Comment-Date: Mon, 07 Mar 2022 21:42:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Orion <auo...@microsoft.com>
    Comment-In-Reply-To: Rahul Singh <rah...@microsoft.com>
    Gerrit-MessageType: comment

    Austin Orion (Gerrit)

    unread,
    Mar 7, 2022, 7:21:40 PM3/7/22
    to edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Eugene Zemtsov, Chromium LUCI CQ, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Tricium, chromium...@chromium.org

    Attention is currently required from: Eugene Zemtsov, Austin Orion, Rahul Singh.

    Patch set 25:Commit-Queue +2

    View Change

      To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
      Gerrit-Change-Number: 3293969
      Gerrit-PatchSet: 25
      Gerrit-Owner: Austin Orion <auo...@microsoft.com>
      Gerrit-Reviewer: Austin Orion <auo...@microsoft.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
      Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
      Gerrit-CC: David Bienvenu <davidb...@chromium.org>
      Gerrit-CC: Peter Kasting <pkas...@chromium.org>
      Gerrit-CC: Rahul Singh <rah...@microsoft.com>
      Gerrit-CC: Steve Becker <ste...@microsoft.com>
      Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
      Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
      Gerrit-Attention: Austin Orion <auo...@microsoft.com>
      Gerrit-Attention: Rahul Singh <rah...@microsoft.com>
      Gerrit-Comment-Date: Tue, 08 Mar 2022 00:21:28 +0000

      Eugene Zemtsov (Gerrit)

      unread,
      Mar 7, 2022, 9:06:56 PM3/7/22
      to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Eugene Zemtsov, Chromium LUCI CQ, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Tricium, chromium...@chromium.org
      Gerrit-Comment-Date: Tue, 08 Mar 2022 02:06:46 +0000

      Chromium LUCI CQ (Gerrit)

      unread,
      Mar 7, 2022, 10:51:25 PM3/7/22
      to Austin Orion, edgecapab...@microsoft.com, feature-me...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, poscia...@chromium.org, Eugene Zemtsov, Peter Kasting, David Bienvenu, Zhenyao Mo, Dale Curtis, Sunggook Chue, Steve Becker, Rahul Singh, Tricium, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change


      Approvals: Dale Curtis: Looks good to me Zhenyao Mo: Looks good to me Eugene Zemtsov: Looks good to me; Commit
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3293969
      Reviewed-by: Zhenyao Mo <z...@chromium.org>
      Reviewed-by: Dale Curtis <dalec...@chromium.org>
      Reviewed-by: Eugene Zemtsov <eug...@chromium.org>
      Commit-Queue: Eugene Zemtsov <eug...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#978595}
      ---
      M media/audio/BUILD.gn
      M media/audio/audio_encoders_unittest.cc
      M media/audio/audio_opus_encoder.cc
      M media/gpu/BUILD.gn
      A media/gpu/windows/mf_audio_encoder.cc
      A media/gpu/windows/mf_audio_encoder.h
      6 files changed, 1,724 insertions(+), 151 deletions(-)


      To view, visit change 3293969. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I89b6a21407e5d7ff24a09569b34ffbdd8073ad67
      Gerrit-Change-Number: 3293969
      Gerrit-PatchSet: 26
      Gerrit-Owner: Austin Orion <auo...@microsoft.com>
      Gerrit-Reviewer: Austin Orion <auo...@microsoft.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
      Gerrit-Reviewer: Zhenyao Mo <z...@chromium.org>
      Gerrit-CC: David Bienvenu <davidb...@chromium.org>
      Gerrit-CC: Peter Kasting <pkas...@chromium.org>
      Gerrit-CC: Rahul Singh <rah...@microsoft.com>
      Gerrit-CC: Steve Becker <ste...@microsoft.com>
      Gerrit-CC: Sunggook Chue <sun...@microsoft.com>
      Gerrit-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages