video: Enable VP9 kSVC HW decoding with D3D11 on Windows. [chromium/src : main]

627 views
Skip to first unread message

Shuhai Peng (Gerrit)

unread,
Sep 27, 2021, 6:33:01 AM9/27/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

Shuhai Peng uploaded patch set #7 to this change.

View Change

video: Enable VP9 kSVC HW decoding with D3D11 on Windows.

The Google Meets application, when running with VP9 as the codec,
is encoding at kSVC mode. On the receiving side, HW decoder must
be able to decode the super-frame(key-frame) sent by WebRTC,
otherwise WebRTC will fallback to SW decoding.

Currently this HW decoding is completely blocked in
rtc_video_decoder_adapter if more than 1 spatial layer is detected
on Windows. This CL aims to enable HW kSVC decoding through D3D11VA.

By the way, another CL needs to be done to support kSVC DXVA decoding
through Microsoft VP9 decoder extension.

Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
---
M media/base/media_switches.cc
M media/base/media_switches.h
M media/gpu/vp9_decoder.cc
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.h
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.h
8 files changed, 60 insertions(+), 19 deletions(-)

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 7
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-MessageType: newpatchset

Shuhai Peng (Gerrit)

unread,
Oct 17, 2021, 11:06:44 PM10/17/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Frank Liberato, Ted Meyer.

View Change

13 comments:

  • Commit Message:

    • Patch Set #6, Line 7: video: Enable VP9 kSVC HW decoding on Windows.

      please provide some background on what this is and why it is needed

      Done

  • Patchset:

  • File media/base/media_switches.h:

  • File media/base/media_switches.cc:

  • File media/gpu/vp9_decoder.cc:

    • Patch Set #6, Line 49: return {};

      keep the same DLOG message as above, since it shouldn't be talking directly about the switch like th […]

      Done

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

    • Patch Set #6, Line 657: video_decoder_type == media::VideoDecoderType::kD3D11;

      is DXVAVideoDecodeAccelerator not capable of handling this too?
      Yes, DXVA don't support it currently. For this bug referenced by Frank, DXVA would expect superframe from WebRTC with show_frame flag for each sub-frame correctly set and super_frame_idx properly configured. This is currently not implemented and would need another CL to enable the DXVA path.

       I wonder why the decoder type is really needed.
      Faking the decoder_type_ is not a good choice, I have reverted it. See #282 for more detail.
  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc:

    • Patch Set #6, Line 278: D3D11

      DecoderStream's support for this should also depend on kExposeSwDecodersToWebRTC [1], since that wil […]

      Good catch! I will add the check in the patch for enabling DXVA path.

    • Patch Set #6, Line 282: VideoDecoderType

      i think this is used for media capabilities. […]

      In fact, the Media Capability can't get the decoder type , because decoder has not been created yet. Faking the decoder type is not a good idea, it may trigger unnecessary creation process then fallback.

      At runtime, we can get the decoder type is D3D11/DXVA, it can work properly. Check the decoder_type_ in RTCVideoDecoderAdapter::Decode, allow the D3D11 decoder to decode and DXVA fallback to software decoding.

      For D3D11VA path, as mentioned above, is verified to work. We would expect it not to be blacklisted by rtc_video_decoder_adapter when kSVC is enabled.

      Currently, we first land D3D11 path. When the DXVA path can work properly[1], I will refind the code(win7 check is worth, and return the corret result to Media Capability). But now, I think we can still return false to Media Capability, and keep the origin code. What's your suggestion?

      [1]https://chromium-review.googlesource.com/c/chromium/src/+/3222682

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc:

    • Patch Set #6, Line 394: // TODO(chromium:1187565): Update

      why was this formatting changed?

      Done

    • Patch Set #6, Line 399: base::AutoLock auto_lock(lock_

      rather than acquire and drop the lock multiple times, can this be merged with the autolock scope @37 […]

      Done

    • Patch Set #6, Line 861: video_decoder_type_

      i don't know if this matters for your use-case, but this may get called only after one or more calls […]

      Have reverted it.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 13
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Mon, 18 Oct 2021 03:06:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>
Comment-In-Reply-To: Ted Meyer <tmath...@chromium.org>
Gerrit-MessageType: comment

Ted Meyer (Gerrit)

unread,
Oct 18, 2021, 1:20:29 AM10/18/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Frank Liberato.

Patch set 13:Code-Review +1

View Change

1 comment:

  • Patchset:

    • Patch Set #13:

      How will you be testing this? We can probably do an experiment unless you've got something ready to go.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 13
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Comment-Date: Mon, 18 Oct 2021 05:20:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Shuhai Peng (Gerrit)

unread,
Oct 18, 2021, 4:59:15 AM10/18/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Frank Liberato, Ted Meyer.

View Change

2 comments:

  • Patchset:

    • Patch Set #13:

      How will you be testing this? I have verified that this CL works properly in Google Meet. Process is as follows:

      • Need two accounts, and join Google Meet room.
      • Open chrome://webrtc-internals/
      • For the sender, ensure the 'googCodecName' is VP9. We can see while data 'googFrameRateSent' is n, the data 'framesEncoded' will increase 3*n(maybe 2*n, it depends on the number of layers), it means that currently it is kSVC stream.
      • For the receiver, we can see 'codecImplementationName' is ExternalDecoder and 'googCodecName' is VP9. It means we decode VP9 kSVC stream properly. The code log also shows that the decoded stream is kSVC stream.

      Please let me know if you have any concerns/suggestions, thanks. 😊

    • Patch Set #13:

      Hi Ted, PTAL.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 13
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Mon, 18 Oct 2021 08:59:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Frank Liberato (Gerrit)

unread,
Oct 18, 2021, 2:02:46 PM10/18/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

View Change

1 comment:

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

    • Patch Set #13, Line 293: defined(OS_WIN)

      i want to make sure that i understand your plan.

      dxva will support this before too long, so Vp9HwSupportForSpatialLayers() will return true for windows (maybe excluding win7). the code from 292-303 will revert to what it is in ToT today.

      do i understand correctly?

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 13
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Mon, 18 Oct 2021 18:02:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Ted Meyer (Gerrit)

unread,
Oct 18, 2021, 7:58:00 PM10/18/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Shuhai Peng.

View Change

1 comment:

  • Patchset:

    • Patch Set #13:

      > How will you be testing this? […]

      Ah, ok so google meet is doing this already in the wild. I had been talking about an in-the-wild experiment anyway, since I'd like to avoid launching something with only a "works on my machine!" test backing it up.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 13
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Comment-Date: Mon, 18 Oct 2021 23:57:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shuhai Peng <shuha...@intel.com>

Shuhai Peng (Gerrit)

unread,
Oct 18, 2021, 10:37:18 PM10/18/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Frank Liberato, Ted Meyer.

View Change

3 comments:

  • Patchset:

    • Patch Set #13:

      Ah, ok so google meet is doing this already in the wild. […]

      Ah, I see. Agree with you, can you help me run it with the in-the-wild experiment?

    • Patch Set #13:

      Thanks for the comments, PT-Another-L.

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

    • i want to make sure that i understand your plan. […]

      Yes, but there is one thing needs to be explained. When the DXVA supports decoding the VP9 kSVC stream, the code from 287-303 should be removed. Currently I am focusing on implementing DXVA path.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 13
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Tue, 19 Oct 2021 02:37:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shuhai Peng <shuha...@intel.com>
Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>

Frank Liberato (Gerrit)

unread,
Oct 19, 2021, 2:05:49 PM10/19/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

View Change

2 comments:

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

    • the code from 287-303 should be removed

      287-303 is needed for non-windows platforms. i'm not sure that it should be removed. wouldn't one remove the #if win parts only?

    • When the DXVA supports decoding the VP9 kSVC stream

    • if that's not going to take too long to get DXVA working, would it be easier to wait on these changes until then? it seems like most of this CL is working around the fact that DXVA support isn't landed yet, and Vp9HwSupport...() must give the wrong answer sometimes as a result.

    • Patch Set #13, Line 294: if (video_decoder_->GetDecoderType() == media::VideoDecoderType::kD3D11 &&

      does the equivalent of this check need to show up in RTCVideoDecoderStreamAdapter too? else it'll fall back when it doesn't need to. that, in turn, will skew the results of the DecoderStream experiment that's running right now.

      alternatively, once DXVA supports svc, neither DecoderAdapter nor DecoderStreamAdapter will need any changes since Vp9HwSupport...() will give the right answer.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 13
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Tue, 19 Oct 2021 18:05:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shuhai Peng <shuha...@intel.com>
Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>
Gerrit-MessageType: comment

Shuhai Peng (Gerrit)

unread,
Oct 27, 2021, 7:55:04 AM10/27/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

Shuhai Peng uploaded patch set #14 to this change.

View Change

video: Enable VP9 kSVC HW decoding with D3D11 on Windows.

The Google Meets application, when running with VP9 as the codec,
is encoding at kSVC mode. On the receiving side, HW decoder must
be able to decode the super-frame(key-frame) sent by WebRTC,
otherwise WebRTC will fallback to SW decoding.

This CL aims to enable HW kSVC decoding through D3D11VA.

Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
---
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc
M media/base/media_switches.cc
M media/gpu/vp9_decoder.cc
M media/base/media_switches.h
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc
5 files changed, 54 insertions(+), 9 deletions(-)

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 14
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-MessageType: newpatchset

Shuhai Peng (Gerrit)

unread,
Oct 27, 2021, 9:54:17 PM10/27/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Frank Liberato, Ted Meyer.

View Change

3 comments:

  • Patchset:

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

    • wouldn't one remove the #if win parts only?
      Ah, I see. You are right!

    • if that's not going to take too long to get DXVA working, would it be easier to wait on these changes until then?

    • The plan temporarily fell through. I tried to implement DXVA path to support VP9 kSVC stream with VP9 Spec, but the decoder can't decode successfully. So we contacted the Microsoft media team, and they told us that currently Media Foundation Transform doesn't support decoding VP9 kSVC stream. It shows that only when the MFT support decoding the VP9 stream that change resolution dynamically without key-frame, we can implement the corresponding dxva's path with the Spec.

      Do you think it is a good idea to keep the original code unitl MFT support it?

    • does the equivalent of this check need to show up in RTCVideoDecoderStreamAdapter too?

    • It makes sense. The decoder may be changed between hardware and software.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 16
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Thu, 28 Oct 2021 01:54:10 +0000

Frank Liberato (Gerrit)

unread,
Oct 30, 2021, 6:00:20 PM10/30/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

View Change

5 comments:

  • Patchset:

    • Patch Set #16:

      overall looks good. just a few questions. sorry for the delay.

      thanks
      -fl

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

    • > wouldn't one remove the #if win parts only? […]

      yeah, if there's going to be a delay in adding dxva support, then this makes sense. please be sure to add a comment about it, and what the goal is. if the DXVA changes fall through for some reason permanently, then we might need to come up with something else here.

      but as a reasonably temporary measure, this seems fine.

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc:

    • Patch Set #6, Line 282: VideoDecoderType

      In fact, the Media Capability can't get the decoder type , because decoder has not been created yet. […]

      if i understand correctly, returning false is the only safe option. we don't know if the hw decoder will support or not support kSVC at the point when MediaCap asks. so we have to say no.

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc:

    • Patch Set #16, Line 273: video_decoder_type_ = media::VideoDecoderType::kUnknown;

      nit: please move this into the .h -- most of the other init that doesn't depend on ctor params happens there.

      i don't know why i put `decoder_info_` here -- maybe {} didn't work with GUARDED_BY or something. don't remember.

    • Patch Set #16, Line 402: if (video_decoder_type_ == media::VideoDecoderType::kD3D11 &&

      i don't remember if the decoder type is set by the first decode. if you haven't already done so, i'd suggest verifying that.

      i'm worried that it defers picking a decoder until the first successful decode.

      right now, if that turns out to be the case, then that decode will fail. however, if the switch kExposeSwDecodersToWebRTC is enabled, then it will try a chrome (not webrtc) sw decoder instead of failing. if chrome's sw decoders support kSVC then maybe no action is needed here at all if kExposeSw... is enabled.

      i don't know if anything has to be configured specially in libvpx to kSVC support.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 16
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Sat, 30 Oct 2021 22:00:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shuhai Peng <shuha...@intel.com>
Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>

Shuhai Peng (Gerrit)

unread,
Nov 3, 2021, 3:28:06 AM11/3/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Frank Liberato, Ted Meyer.

View Change

6 comments:

  • Patchset:

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

    • yeah, if there's going to be a delay in adding dxva support, then this makes sense. […]

      Agree. We will continue to pay attention to the changes in DXVA features and keep in touch with Microsoft. Once dxva supports decoding vp9 kSVC stream, i will try to implement the path.

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc:

    • if i understand correctly, returning false is the only safe option. […]

      Yes, you are right!

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc:

    • nit: please move this into the . […]

      I moved them all to .h file. Work properly.

    • i don't remember if the decoder type is set by the first decode.

    • Yes, it defers picking a decoder due to decode and decoder initialiazation work in two different thread. I add the boolean |decoder_configured_| as one of the VP9 kSVC check condition in RTCVideoDecoderStreamAdapter::Decode, the check will be executed only when the decoder is valid.

    • if chrome's sw decoders support kSVC then maybe no action is needed here at all if kExposeSw... is enabled

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc:

    • Patch Set #20, Line 423: decoder_info_.is_hardware_accelerated

      Only hardware decoder need to check, currently all sw decoder(webrtc sw decoder, chrome sw decoder) can decode VP9 kSVC stream. It will avoid fallback to webrtc sw decoder when it should use chrome sw decoder(enable kExposeSwDecodersToWebRTC). It's different from RTCVideoDecoderAdapter.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 21
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Nov 2021 07:27:56 +0000

Frank Liberato (Gerrit)

unread,
Nov 3, 2021, 3:08:50 PM11/3/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

View Change

1 comment:

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc:

    • Patch Set #16, Line 402: if (video_decoder_type_ == media::VideoDecoderType::kD3D11 &&

      > i don't remember if the decoder type is set by the first decode. […]

      i don't know enough about SVC -- does it result in a config change when resolution switches? if so, the DecoderStream can re-choose the decoder at that point.

      if not, then we probably need to do something smarter in DecoderSelector.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 21
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Nov 2021 19:08:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shuhai Peng <shuha...@intel.com>
Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>
Gerrit-MessageType: comment

Shuhai Peng (Gerrit)

unread,
Nov 4, 2021, 12:06:37 AM11/4/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Frank Liberato, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Frank Liberato, Ted Meyer.

View Change

2 comments:

  • Patchset:

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc:

    • i don't know enough about SVC -- does it result in a config change when resolution switches? if so, […]

      kSVC means changing resolution dynamically without key-frame required. It doesn't change the config when resolution changed.

      if i understand correctly, we should not allow decoder switch for dynamic resolution change. Reason for that is, if you've decoded a 180p picture with SW decoder and recontructed it, there's no way HW decoder can reference the same 180p reconstructed picture, for decoding subsequent 360p or 720p frame. i think we need another patch to consider the impact of dynamic resolution, it needs some work.

      Now, based on this CL, VP9 kSVC decoding can work properly in all cases, except when kExposeSwDecodersToWebRTC is enabled, it would use VpxVideoDecoder(yeah... it can decode kSVC as above mentioned), it's not bad.

      could we submit this patch first? what's your suggestion?

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 21
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Nov 2021 04:06:27 +0000

Frank Liberato (Gerrit)

unread,
Nov 4, 2021, 12:22:51 AM11/4/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Ted Meyer, Chunbo Hua, Jianlin Qiu, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

Patch set 21:Code-Review +1

View Change

3 comments:

  • Patchset:

    • Patch Set #13:

      Ah, I see. […]

      there is a canary DecoderStreamAdapter experiment that i'm running now. it has three arms: control (uses DecoderAdapter), "DecoderStreamAdapter but enable hardware decoders only", and "DecoderStreamAdapter with both hw and sw enabled".

      the experiment is off at this moment, because of a bug that showed up today. as soon as the fix hits canary, i'll re-enable it.

      i suggest that we get some results from that experiment. if everything looks good, then the "DecoderStream + hw only" branch will go away -- it's just an intermediate step away from DecoderAdapter. the real goal is to enable DecoderStream+hw/sw decoders. i plan to push a DecoderAdapter (control) and DecoderStreamAdapter+hw/sw to a 50% beta experiment as soon as it's stable in canary (hopefully very soon!), because the data in canary is low volume for rtc.

      once we do that, we could do a 50/50 SVC experiment on canary and see what happens. else we're changing too many things at once, given the low volume of canary rtc. we likely don't need DecoderAdapter at all -- could be 50/50 on DecoderStream+hw/sw.

      WDYT?

  • Patchset:

  • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc:

    • kSVC means changing resolution dynamically without key-frame required. […]

      if there's not an explicit config change, then DecoderStream won't change decoders. config change => key frame, so at least it won't break as-is.

      submitting this patch as is sgtm.

      as a follow-up, we can teach DecoderSelector to change its behavior if SVC is enabled. maybe pick hw decoders over sw even for low-res configs. alternatively, we could start with SW for low res using the existing DecoderSelector heuristic. if the stream later adapts to a resolution that's high enough, we could ask rtc for a keyframe and swap decoders at that point. that could be done by DecoderStreamAdapter, without any changes in DecoderStream or DecoderSelector. it knows if it has a hw or sw decoder, and it knows the decoded frame size.

      i'm not sure what the right behavior is, maybe it's neither of those.

      but, all of that is future work.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 21
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Nov 2021 04:22:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Shuhai Peng <shuha...@intel.com>
Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>

Jianlin Qiu (Gerrit)

unread,
Nov 4, 2021, 12:52:43 AM11/4/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Chromium LUCI CQ, Frank Liberato, Ted Meyer, Chunbo Hua, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer.

View Change

1 comment:

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 21
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Jianlin Qiu <jianl...@intel.com>
Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Chunbo Hua <chunb...@intel.com>
Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Nov 2021 04:52:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Shuhai Peng (Gerrit)

unread,
Nov 4, 2021, 1:23:09 AM11/4/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Frank Liberato, Ted Meyer

Attention is currently required from: Ted Meyer.

Shuhai Peng has uploaded this change for review.

View Change

video: Enable VP9 kSVC HW decoding with D3D11 on Windows.

The Google Meets application, when running with VP9 as the codec,
is encoding at kSVC mode. On the receiving side, HW decoder must
be able to decode the super-frame(key-frame) sent by WebRTC,
otherwise WebRTC will fallback to SW decoding.

This CL aims to enable HW kSVC decoding through D3D11VA.

Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
---
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc
M media/base/media_switches.cc
M media/gpu/vp9_decoder.cc
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.h
M media/base/media_switches.h
M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc
7 files changed, 108 insertions(+), 30 deletions(-)


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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 21
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-MessageType: newchange

Shuhai Peng (Gerrit)

unread,
Nov 4, 2021, 1:23:14 AM11/4/21
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

Attention is currently required from: Ted Meyer.

View Change

2 comments:

  • Patchset:

    • Patch Set #13:

      there is a canary DecoderStreamAdapter experiment that i'm running now. […]

      Agree with you, thanks!

  • Patchset:

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
Gerrit-Change-Number: 3169330
Gerrit-PatchSet: 21
Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Nov 2021 05:23:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Chunbo Hua (Gerrit)

unread,
Nov 4, 2021, 2:31:15 AM11/4/21
to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

Attention is currently required from: Shuhai Peng, Ted Meyer, Chunbo Hua.

Patch set 21:Commit-Queue +2

View Change

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 21
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
    Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
    Gerrit-Attention: Chunbo Hua <chunb...@intel.com>
    Gerrit-Comment-Date: Thu, 04 Nov 2021 06:30:58 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Shuhai Peng (Gerrit)

    unread,
    Nov 4, 2021, 2:54:49 AM11/4/21
    to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Shuhai Peng, Ted Meyer, Chunbo Hua.

    Shuhai Peng removed a vote from this change.

    View Change

    Removed Commit-Queue+2 by Chunbo Hua <chunb...@intel.com>

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 21
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
    Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
    Gerrit-Attention: Chunbo Hua <chunb...@intel.com>
    Gerrit-MessageType: deleteVote

    Shuhai Peng (Gerrit)

    unread,
    Nov 4, 2021, 3:12:17 AM11/4/21
    to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Ted Meyer, Chunbo Hua.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #13:

        Agree with you, thanks!

        sorry, i misunderstood what you meant at first... but i understand what you mean now! OK, hold this patch until you finish the experiment. thanks!

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 21
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
    Gerrit-Attention: Chunbo Hua <chunb...@intel.com>
    Gerrit-Comment-Date: Thu, 04 Nov 2021 07:12:08 +0000

    Frank Liberato (Gerrit)

    unread,
    Nov 4, 2021, 12:32:22 PM11/4/21
    to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Shuhai Peng, Ted Meyer, Chunbo Hua.

    View Change

    4 comments:

    • Patchset:

      • Patch Set #13:

        sorry, i misunderstood what you meant at first... […]

        sorry for the confusion -- i only meant to delay the experiment. this patch's changes are behind a default-off flag in media_switches, so landing it won't change any behavior.

        however, when i took another look at PS21, i noticed one or two unrelated things that i missed before. nothing serious.

    • Patchset:

      • Patch Set #21:

        still lgtm, but with two new comments that i missed before.

        thanks
        -fl

    • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

      • Patch Set #21, Line 300: kD3D11Vp9kSVCHWDecoding

        i just thought of something -- don't you need to enable kVp9kSVCHWDecoding in addition to kD3D11Vp9... in order to make svc decoding work? vp9_decoder.cc [1] checks kVp9kSVCHWDecoding, anad d3d11 uses VP9Decoder [2].

        if i understand correctly, then i think the MediaCapabilities check in the factory will return true, which wasn't our goal.

        i guess one could make VP9Decoder check both flags, but that seems ugly.

        instead, maybe the kD3D11Vp9kSVC switch could just be removed, and make kVp9 the only switch. it's just used for chromeos now, and is off everywhere else. so if you merged them, then you could get rid of the IsEnabled @300 (keep the rest of the #if win block, of course).

        that doesn't fix the MediaCap issue, but that issue is the same issue either way (assuming, of course, that i'm right that you need to enable both switches anyway).

        it's okay to land this with both switches if you like - we can always revisit that part if it's necessary.

        if i'm wrong about both switches, then none of the above applies. :)

        [1] https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/vp9_decoder.cc;drc=e3a85bb84de97dfe6941ea22f0595b7421fee480;l=30

        [2] https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/windows/d3d11_video_decoder.cc;l=175

    • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.h:

      • Patch Set #21, Line 49: constexpr const char* kExternalDecoderName = "ExternalDecoder";

        sorry, i missed this. i didn't mean to move the decoder_info_ init here. i just meant to move the init of the new `decoder_configurd_` to the .h .

        in particular, @49 needs to be in the .cc file, which is why `decoder_info_` is initialized in the ctor.

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 21
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
    Gerrit-Attention: Ted Meyer <tmath...@chromium.org>
    Gerrit-Attention: Chunbo Hua <chunb...@intel.com>
    Gerrit-Comment-Date: Thu, 04 Nov 2021 16:32:13 +0000

    Shuhai Peng (Gerrit)

    unread,
    Nov 4, 2021, 1:36:26 PM11/4/21
    to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Frank Liberato.

    View Change

    4 comments:

    • Patchset:

      • Patch Set #13:

        sorry for the confusion -- i only meant to delay the experiment. […]

        Thanks.

    • Patchset:

      • Patch Set #24:

        Thanks for your review. Comments addressed/replied, PT-Another-L.

    • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

      • sorry, i missed this. i didn't mean to move the decoder_info_ init here. […]

        Done. BTW, is it not recommended to add anonymous space in .h?

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 24
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Frank Liberato <libe...@chromium.org>
    Gerrit-Comment-Date: Thu, 04 Nov 2021 17:36:18 +0000

    Shuhai Peng (Gerrit)

    unread,
    Nov 4, 2021, 1:52:58 PM11/4/21
    to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Frank Liberato.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.h:

      • Done. BTW, is it not recommended to add anonymous space in . […]

        'Use of internal linkage in .cc files is encouraged for all code that does not need to be referenced elsewhere. Do not use internal linkage in .h files.'[1]

        This should be the reason why init decoder_info_ in ctor instead of .h file!

        [1]https://google.github.io/styleguide/cppguide.html#Internal_Linkage

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 24
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Frank Liberato <libe...@chromium.org>
    Gerrit-Comment-Date: Thu, 04 Nov 2021 17:52:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Shuhai Peng <shuha...@intel.com>
    Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>
    Gerrit-MessageType: comment

    Shuhai Peng (Gerrit)

    unread,
    Nov 10, 2021, 3:29:14 AM11/10/21
    to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Frank Liberato.

    View Change

    1 comment:

    • Patchset:

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 24
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Frank Liberato <libe...@chromium.org>
    Gerrit-Comment-Date: Wed, 10 Nov 2021 08:28:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Frank Liberato (Gerrit)

    unread,
    Nov 10, 2021, 12:08:19 PM11/10/21
    to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chunbo Hua, Chromium LUCI CQ, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Shuhai Peng.

    Patch set 24:Code-Review +1

    View Change

    2 comments:

    • Patchset:

      • Patch Set #24:

        still lgtm -- please feel free to land this as is. the remaining discussion on mediacap and the flags doesn't need to block it.

        sorry for the delay.

        -fl

    • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

      • > don't you need to enable kVp9kSVCHWDecoding in addition to kD3D11Vp9... […]

        i don't see how that changes the MediaCap results. for vp9_decoder.cc to support svc on windows, it still requires both the d3d11 and Vp9SVC flags to be set [1] or d3d11 won't decode svc. so, when testing this on d3d11 (even in the current, two-flag situation), MediaCap will return true for svc support. that seems to happen regardless of whether we have one flag or two; if we have two, both must be set or the vp9 decoder will still fail on svc. i think -- please let me know if i've traced through this incorrectly.

        maybe the answer is to make rtc_decoder_factory check for OS_WIN and return false unconditionally for svc? as in, there is no case in windows where we want to advertise svc via mediacap, so ignore the flags and say no.

        [1] https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/vp9_decoder.cc;drc=fb2681cfd505c49806d1d2198e183f42024e5ad6;l=30

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
    Gerrit-Change-Number: 3169330
    Gerrit-PatchSet: 24
    Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
    Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
    Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
    Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
    Gerrit-Comment-Date: Wed, 10 Nov 2021 17:08:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes

    Chunbo Hua (Gerrit)

    unread,
    Nov 10, 2021, 8:53:54 PM11/10/21
    to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Jianlin Qiu, Chromium LUCI CQ, Frank Liberato, Ted Meyer, chromium...@chromium.org

    Attention is currently required from: Shuhai Peng.

    Patch set 24:Commit-Queue +2

    View Change

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
      Gerrit-Change-Number: 3169330
      Gerrit-PatchSet: 24
      Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
      Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
      Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
      Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
      Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
      Gerrit-Attention: Shuhai Peng <shuha...@intel.com>
      Gerrit-Comment-Date: Thu, 11 Nov 2021 01:53:39 +0000

      Chromium LUCI CQ (Gerrit)

      unread,
      Nov 10, 2021, 10:21:14 PM11/10/21
      to Shuhai Peng, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Chunbo Hua, Jianlin Qiu, Frank Liberato, Ted Meyer, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change


      Approvals: Frank Liberato: Looks good to me Ted Meyer: Looks good to me Chunbo Hua: Commit
      video: Enable VP9 kSVC HW decoding with D3D11 on Windows.

      The Google Meets application, when running with VP9 as the codec,
      is encoding at kSVC mode. On the receiving side, HW decoder must
      be able to decode the super-frame(key-frame) sent by WebRTC,
      otherwise WebRTC will fallback to SW decoding.

      This CL aims to enable HW kSVC decoding through D3D11VA.

      Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3169330
      Reviewed-by: Frank Liberato <libe...@chromium.org>
      Reviewed-by: Ted Meyer <tmath...@chromium.org>
      Commit-Queue: Chunbo Hua <chunb...@intel.com>
      Cr-Commit-Position: refs/heads/main@{#940643}

      ---
      M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc
      M media/base/media_switches.cc
      M media/gpu/vp9_decoder.cc
      M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc
      M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.h
      M media/base/media_switches.h
      M third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc
      7 files changed, 106 insertions(+), 21 deletions(-)


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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
      Gerrit-Change-Number: 3169330
      Gerrit-PatchSet: 25
      Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
      Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
      Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
      Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
      Gerrit-MessageType: merged

      Shuhai Peng (Gerrit)

      unread,
      Nov 10, 2021, 10:51:40 PM11/10/21
      to Chromium LUCI CQ, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, Chunbo Hua, Jianlin Qiu, Frank Liberato, Ted Meyer, chromium...@chromium.org

      View Change

      2 comments:

      • Patchset:

      • File third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc:

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Id3c1063f45a2cb48cd26c559fa6190c7b7a35809
      Gerrit-Change-Number: 3169330
      Gerrit-PatchSet: 25
      Gerrit-Owner: Shuhai Peng <shuha...@intel.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Chunbo Hua <chunb...@intel.com>
      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
      Gerrit-Reviewer: Shuhai Peng <shuha...@intel.com>
      Gerrit-Reviewer: Ted Meyer <tmath...@chromium.org>
      Gerrit-CC: Jianlin Qiu <jianl...@intel.com>
      Gerrit-Comment-Date: Thu, 11 Nov 2021 03:51:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Reply all
      Reply to author
      Forward
      0 new messages