Media Foundation Frame Server Mode: Part 2: Feature Flag [chromium/src : main]

320 views
Skip to first unread message

William Carr (Gerrit)

unread,
Oct 26, 2021, 12:49:18 AM10/26/21
to Dale Curtis, Xiaohan Wang, Frank Li, David Springgay, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org

Attention is currently required from: Dale Curtis, Xiaohan Wang, Frank Li, David Springgay.

William Carr would like Dale Curtis, Xiaohan Wang, Frank Li and David Springgay to review this change.

View Change

Media Foundation Frame Server Mode: Part 2: Feature Flag

Add feature flag for Media Foundation for Clear & allow Media Factory to register Media Foundation Renderer as the default web media player when the flag is enabled on supported systems.

Bug: 1258887
Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
---
M chrome/browser/flag_descriptions.cc
M media/base/media_switches.cc
M chrome/browser/about_flags.cc
A media/renderers/win/media_foundation_helpers.h
M chrome/browser/flag_descriptions.h
M chrome/browser/flag-metadata.json
M tools/metrics/histograms/enums.xml
M content/renderer/media/media_factory.cc
A media/renderers/win/media_foundation_helpers.cc
M media/renderers/BUILD.gn
M content/browser/media/media_interface_proxy.cc
M media/base/media_switches.h
12 files changed, 111 insertions(+), 3 deletions(-)


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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
Gerrit-Change-Number: 3241732
Gerrit-PatchSet: 1
Gerrit-Owner: William Carr <wic...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
Gerrit-Reviewer: William Carr <wic...@microsoft.com>
Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
Gerrit-Attention: Frank Li <fra...@microsoft.com>
Gerrit-Attention: David Springgay <dasp...@microsoft.com>
Gerrit-MessageType: newchange

William Carr (Gerrit)

unread,
Oct 26, 2021, 12:49:22 AM10/26/21
to asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Dale Curtis, Xiaohan Wang, Frank Li, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

Attention is currently required from: Dale Curtis, Xiaohan Wang, Frank Li, David Springgay.

View Change

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 1
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Tue, 26 Oct 2021 04:49:15 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Frank Li (Gerrit)

    unread,
    Oct 26, 2021, 4:20:41 PM10/26/21
    to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Rafael Cintron, Dale Curtis, Xiaohan Wang, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: Dale Curtis, Xiaohan Wang, William Carr, David Springgay.

    View Change

    2 comments:

    • File content/browser/media/media_interface_proxy.cc:

      • Patch Set #1, Line 60: media/renderers/win/media_foundation_helpers.h

        I wonder we should move the code of it into media\base\win\mf_helpers.{h, cc}

    • File content/renderer/media/media_factory.cc:

      • Patch Set #1, Line 770: RendererType::kMediaPlayer

        At the moment, this is enum value is used in Android platform only. It seems we should add another enum such as RendererType::kMediaFoundationClear to make it clear for the intention.

        BTW, web_media_player_impl.cc!UsesAudioService() needs an update with the enum value.

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 1
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: William Carr <wic...@microsoft.com>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Tue, 26 Oct 2021 20:20:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Dale Curtis (Gerrit)

    unread,
    Oct 26, 2021, 5:30:12 PM10/26/21
    to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Rafael Cintron, Xiaohan Wang, Frank Li, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: Xiaohan Wang, William Carr, Frank Li, David Springgay.

    View Change

    3 comments:

    • Patchset:

    • File content/renderer/media/media_factory.cc:

      • At the moment, this is enum value is used in Android platform only. […]

        Yeah this is the wrong type, can we not just use the same kMediaFoundation type above? Why do we need a second media foundataion entry?

    • File media/renderers/win/media_foundation_helpers.cc:

      • Patch Set #1, Line 13: bool MediaFoundationHelpers::SupportClearContent() {

        media/base/win/mf_helpers seems like a better place.

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 1
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: William Carr <wic...@microsoft.com>
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Tue, 26 Oct 2021 21:29:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Frank Li <fra...@microsoft.com>
    Gerrit-MessageType: comment

    William Carr (Gerrit)

    unread,
    Oct 27, 2021, 4:37:01 PM10/27/21
    to asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Rafael Cintron, Dale Curtis, Xiaohan Wang, Frank Li, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: Dale Curtis, Xiaohan Wang, Frank Li, David Springgay.

    View Change

    4 comments:

    • Patchset:

      • Patch Set #1:

        I realized that with MF for Clear enabled Widevine content would be broken so I've added in a measure to address this in addition to the patchset 1 feedback changes.

    • File content/browser/media/media_interface_proxy.cc:

      • I wonder we should move the code of it into media\base\win\mf_helpers. […]

        I can do this. Note I'll need to refactor a little to remove the feature check due to a dep cycle, so callers have been updated to perform the feature check themselves:

        c:\chromium\src\out\release_x64>autoninja chrome
        call C:\chromium\depot_tools\ninja.bat chrome -j 560
        [0/1] Regenerating ninja files
        ERROR Dependency cycle:
        //ui/gl:gl ->
        //media/base/win:media_foundation_util ->
        //media/base:base ->
        //gpu/ipc/common:common ->
        //gpu/ipc/common:ipc_common_sources ->
        //ui/gl:gl
    • File content/renderer/media/media_factory.cc:

      • Yeah this is the wrong type, can we not just use the same kMediaFoundation type above? Why do we nee […]

        Yeah no problem - this was a hold-over from when we first started experimenting with this a few years back so I don't recall the reasoning for using the MediaPlayer type.

    • File media/renderers/win/media_foundation_helpers.cc:

      • Patch Set #1, Line 13: bool MediaFoundationHelpers::SupportClearContent() {

        media/base/win/mf_helpers seems like a better place.

      • Ack

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 1
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Wed, 27 Oct 2021 20:36:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>

    Frank Li (Gerrit)

    unread,
    Oct 28, 2021, 4:07:45 PM10/28/21
    to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Rafael Cintron, Dale Curtis, Xiaohan Wang, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: Xiaohan Wang, William Carr, David Springgay.

    Patch set 2:Code-Review +1

    View Change

    2 comments:

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 2
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: William Carr <wic...@microsoft.com>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Thu, 28 Oct 2021 20:07:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    William Carr (Gerrit)

    unread,
    Oct 29, 2021, 4:19:42 PM10/29/21
    to Olga Sharonova, mark a. foltz, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Frank Li, Dale Curtis, Xiaohan Wang, David Springgay

    Attention is currently required from: Xiaohan Wang, Olga Sharonova, mark a. foltz, David Springgay.

    William Carr would like Olga Sharonova and mark a. foltz to review this change.

    View Change

    Media Foundation Frame Server Mode: Part 2: Feature Flag

    Add feature flag for Media Foundation for Clear & allow Media Factory to register Media Foundation Renderer as the default web media player when the flag is enabled on supported systems.

    Bug: 1258887
    Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    ---
    M chrome/browser/flag_descriptions.cc
    M media/base/media_switches.cc
    M chrome/browser/about_flags.cc
    M chrome/browser/flag_descriptions.h
    M chrome/browser/flag-metadata.json
    M media/base/win/mf_helpers.h
    M tools/metrics/histograms/enums.xml
    M content/renderer/media/media_factory.cc
    M media/base/pipeline_impl.cc
    M media/base/win/mf_helpers.cc
    M content/browser/media/media_interface_proxy.cc
    M media/base/media_switches.h
    12 files changed, 97 insertions(+), 7 deletions(-)


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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 3
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Reviewer: mark a. foltz <mfo...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: mark a. foltz <mfo...@chromium.org>

    William Carr (Gerrit)

    unread,
    Oct 29, 2021, 4:19:48 PM10/29/21
    to asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Olga Sharonova, mark a. foltz, Frank Li, Rafael Cintron, Dale Curtis, Xiaohan Wang, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: Xiaohan Wang, Olga Sharonova, mark a. foltz, David Springgay.

    View Change

    2 comments:

    • Patchset:

      • Patch Set #2:

        Olga & Mark - could you suggest an appropriate reviewer for the content/browser/media files modified?

        Thanks,

        Bill

    • File media/base/pipeline_impl.cc:

      • nit. […]

        Ack

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 2
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Reviewer: mark a. foltz <mfo...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: mark a. foltz <mfo...@chromium.org>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Fri, 29 Oct 2021 20:19:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    mark a. foltz (Gerrit)

    unread,
    Oct 29, 2021, 4:51:18 PM10/29/21
    to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Olga Sharonova, Frank Li, Rafael Cintron, Dale Curtis, Xiaohan Wang, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: Xiaohan Wang, William Carr, Olga Sharonova, David Springgay.

    View Change

    1 comment:

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 3
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: William Carr <wic...@microsoft.com>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Fri, 29 Oct 2021 20:51:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Xiaohan Wang (Gerrit)

    unread,
    Oct 29, 2021, 11:03:06 PM10/29/21
    to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Olga Sharonova, Frank Li, Rafael Cintron, Dale Curtis, Xiaohan Wang, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: William Carr, Olga Sharonova, David Springgay.

    View Change

    6 comments:

    • Patchset:

      • Patch Set #5:

        Thanks for the change and sorry about the delay. I just have a few comments for discussion.

    • File chrome/browser/flag-metadata.json:

    • File content/browser/media/media_interface_proxy.cc:

      • Patch Set #5, Line 181:

        base::FeatureList::IsEnabled(media::kMediaFoundationClear) &&
        media::MediaFoundationHelpers::SupportClearContent())

        This combination shows up in so many places that I feel we should have a help function for it. Or maybe check the feature in MediaFoundationHelpers::SupportClearContent()?

      • Patch Set #5, Line 461: DLOG(ERROR) << "Hardware secure decryption disabled!";

        This comment needs to be updated now

    • File media/base/media_switches.cc:

      • Patch Set #5, Line 771: kMediaFoundationClear

        nit: Typically the feature name matches the string, otherwise people can get confused, e.g. needs to use the string in commandline but uses a different feature name in the code. I'd suggest we use kMediaFoundationClearPlayback, which is more readable to me. That name is longer, but it's fine since we probably want to add a helper function, see above.

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

      • Patch Set #5, Line 98: static bool SupportClearContent();

        nit: Do you plan to add more functions here in the future? If not just use a function without a class?

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 5
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: William Carr <wic...@microsoft.com>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Sat, 30 Oct 2021 03:02:58 +0000

    Olga Sharonova (Gerrit)

    unread,
    Nov 1, 2021, 5:43:16 AM11/1/21
    to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Frank Li, Rafael Cintron, Dale Curtis, Xiaohan Wang, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: William Carr, David Springgay.

    View Change

    1 comment:

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 5
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: William Carr <wic...@microsoft.com>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Mon, 01 Nov 2021 09:43:05 +0000

    William Carr (Gerrit)

    unread,
    Nov 1, 2021, 7:09:06 PM11/1/21
    to asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Frank Li, Rafael Cintron, Dale Curtis, Xiaohan Wang, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: Xiaohan Wang, David Springgay.

    View Change

    5 comments:

    • File chrome/browser/flag-metadata.json:

      • I am not sure about this one, but typically the default is @chromium.org. […]

        Done

    • File content/browser/media/media_interface_proxy.cc:

      • Patch Set #5, Line 181:

        base::FeatureList::IsEnabled(media::kMediaFoundationClear) &&
        media::MediaFoundationHelpers::SupportClearContent())

      • This combination shows up in so many places that I feel we should have a help function for it. […]

        That was actually how I originally implemented but it was pointed out that there was an existing file for media foundation helpers.

        The existing mf_helpers function cannot include media/base deps as that introduces a circular dependency.

        What I'll do is make a new file that lives in the same path as mf_helpers but that is built into media/base so that it can do the feature check.

      • Done

    • File media/base/media_switches.cc:

      • nit: Typically the feature name matches the string, otherwise people can get confused, e.g. […]

        Done

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

      • nit: Do you plan to add more functions here in the future? If not just use a function without a clas […]

        No planned functions at the moment - will move to a function.

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 5
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Mon, 01 Nov 2021 23:08:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-MessageType: comment

    Xiaohan Wang (Gerrit)

    unread,
    Nov 2, 2021, 1:00:05 AM11/2/21
    to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Xiaohan Wang, Frank Li, Rafael Cintron, Dale Curtis, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: William Carr, David Springgay.

    Patch set 6:Code-Review +1

    View Change

    2 comments:

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
    Gerrit-Change-Number: 3241732
    Gerrit-PatchSet: 6
    Gerrit-Owner: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: William Carr <wic...@microsoft.com>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: William Carr <wic...@microsoft.com>
    Gerrit-Attention: David Springgay <dasp...@microsoft.com>
    Gerrit-Comment-Date: Tue, 02 Nov 2021 04:59:56 +0000

    William Carr (Gerrit)

    unread,
    Nov 7, 2021, 4:01:25 PM11/7/21
    to asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Xiaohan Wang, Frank Li, Rafael Cintron, Dale Curtis, David Springgay, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

    Attention is currently required from: William Carr, David Springgay.

    Patch set 7:Commit-Queue +2

    View Change

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
      Gerrit-Change-Number: 3241732
      Gerrit-PatchSet: 7
      Gerrit-Owner: William Carr <wic...@microsoft.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
      Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
      Gerrit-Reviewer: William Carr <wic...@microsoft.com>
      Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
      Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
      Gerrit-Attention: William Carr <wic...@microsoft.com>
      Gerrit-Attention: David Springgay <dasp...@microsoft.com>
      Gerrit-Comment-Date: Sun, 07 Nov 2021 21:01:11 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      Chromium LUCI CQ (Gerrit)

      unread,
      Nov 7, 2021, 5:03:14 PM11/7/21
      to William Carr, asvitki...@chromium.org, asvitkine...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jmedle...@chromium.org, poscia...@chromium.org, Xiaohan Wang, Frank Li, Rafael Cintron, Dale Curtis, David Springgay, Chromium Metrics Reviews, chromium...@chromium.org, Rijubrata Bhaumik

      Chromium LUCI CQ submitted this change.

      View Change



      6 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: media/base/win/mf_feature_checks.h
      Insertions: 1, Deletions: 1.

      @@ -8,7 +8,7 @@
      #include "media/base/media_export.h"

      namespace media {
      -MEDIA_EXPORT bool SupportMediaFoundationClearContent();
      +MEDIA_EXPORT bool SupportMediaFoundationClearPlayback();
      } // namespace media

      #endif // MEDIA_BASE_WIN_MF_FEATURE_CHECKS_H_
      ```
      ```
      The name of the file: content/renderer/media/media_factory.cc
      Insertions: 1, Deletions: 1.

      @@ -737,7 +737,7 @@
      #endif

      #if BUILDFLAG(IS_WIN)
      - bool use_mf_for_clear = media::SupportMediaFoundationClearContent();
      + bool use_mf_for_clear = media::SupportMediaFoundationClearPlayback();
      // Only use MediaFoundationRenderer when MediaFoundationCdm is available or
      // MediaFoundation for Clear is supported.
      if (media::MediaFoundationCdm::IsAvailable() || use_mf_for_clear) {
      ```
      ```
      The name of the file: media/base/pipeline_impl.cc
      Insertions: 1, Deletions: 1.

      @@ -593,7 +593,7 @@
      if (cdm_context_) {
      if (cdm_context_->RequiresMediaFoundationRenderer()) {
      renderer_type = RendererType::kMediaFoundation;
      - } else if (media::SupportMediaFoundationClearContent()) {
      + } else if (media::SupportMediaFoundationClearPlayback()) {
      // When MediaFoundation for Clear is enabled, the base renderer
      // type is set to MediaFoundation. In order to ensure DRM systems
      // built on non-Media Foundation pipelines continue to work we
      ```
      ```
      The name of the file: media/base/win/mf_feature_checks.cc
      Insertions: 1, Deletions: 1.

      @@ -9,7 +9,7 @@

      namespace media {

      -bool SupportMediaFoundationClearContent() {
      +bool SupportMediaFoundationClearPlayback() {
      return base::win::GetVersion() >= base::win::Version::WIN10_RS3 &&
      base::FeatureList::IsEnabled(media::kMediaFoundationClearPlayback);
      }
      ```
      ```
      The name of the file: content/browser/media/media_interface_proxy.cc
      Insertions: 2, Deletions: 2.

      @@ -178,7 +178,7 @@
      void CreateDCOMPSurfaceRegistry(
      mojo::PendingReceiver<media::mojom::DCOMPSurfaceRegistry> receiver)
      override {
      - if (media::SupportMediaFoundationClearContent() ||
      + if (media::SupportMediaFoundationClearPlayback() ||
      (base::FeatureList::IsEnabled(media::kHardwareSecureDecryption) &&
      media::MediaFoundationCdm::IsAvailable())) {
      // TODO(crbug.com/1233379): Pass IO task runner and remove the PostTask()
      @@ -454,7 +454,7 @@
      DCHECK(thread_checker_.CalledOnValidThread());

      // TODO(xhwang): Also check protected media identifier content setting.
      - if (!media::SupportMediaFoundationClearContent() &&
      + if (!media::SupportMediaFoundationClearPlayback() &&
      !base::FeatureList::IsEnabled(media::kHardwareSecureDecryption)) {
      DLOG(ERROR) << "Both hardware secure decryption & media foundation for "
      "clear are disabled!";
      ```

      Approvals: Xiaohan Wang: Looks good to me Frank Li: Looks good to me William Carr: Commit
      Media Foundation Frame Server Mode: Part 2: Feature Flag

      Add feature flag for Media Foundation for Clear & allow Media Factory to register Media Foundation Renderer as the default web media player when the flag is enabled on supported systems.

      Bug: 1258887
      Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3241732
      Commit-Queue: William Carr <wic...@microsoft.com>
      Reviewed-by: Xiaohan Wang <xhw...@chromium.org>
      Reviewed-by: Frank Li <fra...@microsoft.com>
      Cr-Commit-Position: refs/heads/main@{#939188}

      ---
      M chrome/browser/flag_descriptions.cc
      M media/base/media_switches.cc
      M chrome/browser/about_flags.cc
      M chrome/browser/flag_descriptions.h
      A media/base/win/mf_feature_checks.h
      M chrome/browser/flag-metadata.json
      M media/base/win/BUILD.gn

      M tools/metrics/histograms/enums.xml
      M content/renderer/media/media_factory.cc
      M media/base/pipeline_impl.cc
      A media/base/win/mf_feature_checks.cc

      M media/base/win/mf_helpers.cc
      M content/browser/media/media_interface_proxy.cc
      M media/base/media_switches.h
      M media/base/BUILD.gn
      15 files changed, 123 insertions(+), 11 deletions(-)


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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I08d95f868bc6cb308ae27ffafbf97f5f162dacbd
      Gerrit-Change-Number: 3241732
      Gerrit-PatchSet: 8
      Gerrit-Owner: William Carr <wic...@microsoft.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: David Springgay <dasp...@microsoft.com>
      Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
      Gerrit-Reviewer: William Carr <wic...@microsoft.com>
      Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
      Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
      Gerrit-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages