New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 712311 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Using DXVA HW decoder for WebRTC fails

Project Member Reported by emir...@chromium.org, Apr 17 2017

Issue description

I came accross to this while trying an AppRTC loopback on windows, https://apprtc.appspot.com/?debug=loopback&vsc=h264. HW decode fails and falls back to SW with the below output. It points to a mismatch in textures per picture buffer. Note that, I pushed all logs to ERROR channel to get the output in release mode.

[6000:9556:0417/132153.480:ERROR:dxva_video_decode_accelerator_win.cc(1799)] Received output format change from the decoder. Recursively invoking DoDecode
[3384:6652:0417/132153.480:ERROR:rtc_video_decoder.cc(319)] ProvidePictureBuffers. texture_target=36197
[3384:6652:0417/132153.480:ERROR:rtc_video_decoder.cc(481)] NotifyEndOfBitstreamBuffer. id=0
[6000:5640:0417/132153.481:ERROR:gpu_video_decode_accelerator.cc(430)] Requested 2 textures per picture buffer, got 1
[3384:6652:0417/132153.481:ERROR:rtc_video_decoder.cc(527)] VDA Error:2
[3384:6652:0417/132153.481:ERROR:rtc_video_decoder.cc(782)] DestroyVDA
[3384:4868:0417/132153.511:ERROR:rtc_video_decoder.cc(173)] Decode
[3384:4868:0417/132153.511:ERROR:rtc_video_decoder.cc(183)] Decoding error occurred.

sandersd@ can you help with the triage?
 
Cc: -emir...@chromium.org jbau...@chromium.org sande...@chromium.org
Owner: emir...@chromium.org
This would be the responsibility of the RTC video decoder host implementation to satisfy the VideoDecodeAccelerator interface contract.

The change to allow multiple textures per buffer was commit 673b14862f1fc0ffc2eac7c92ee2604f168a479e. Adding jbauman@ for advice.
The DXVA decoder will try to use NV12 (with 2 textures per buffer) unless config.supported_output_formats is non-empty and does not contain PIXEL_FORMAT_NV12. Looks like we might need to initialize that.
Cc: wuchengli@chromium.org posciak@chromium.org
Labels: M-59
Re #2, it looks like there is a client-V4L2- which can have NV12 with 1 texture per buffer, see links below. We can set config.supported_output_formats for Win only to non-NV12 formats, but would there be a performance penalty? Should we try to change RTCVideoDecoder to handle multiple textures per buffer instead?

Adding wuchengli@ and posciak@ as well.

https://cs.chromium.org/chromium/src/media/gpu/v4l2_video_decode_accelerator.cc?rcl=ee52d446e0aaea1ac7375ab3e7a916230688d4b8&l=2312
https://cs.chromium.org/chromium/src/media/gpu/v4l2_video_decode_accelerator.cc?rcl=ee52d446e0aaea1ac7375ab3e7a916230688d4b8&l=2461
Yeah, ideally you'd change RTCVideoDecoder to support NV12, as it can prevent an unnecessary NV12->RGBA conversion that uses power. I don't know what all can consume the frames from that. The compositor,SkCanvasVideoRenderer, and WebGL support reading from NV12 video frames, but other consumers may not.
SkCanvasVideoRenderer::Copy() is used in some sinks(WebMediaPlayerMS, VideoTrackRecorder) to actually copy the pixel data. We should be good as long as that works.
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f1d77853394a703fc603f0ef0fae3cf6de9a1364

commit f1d77853394a703fc603f0ef0fae3cf6de9a1364
Author: emircan <emircan@chromium.org>
Date: Tue Apr 18 20:33:40 2017

Handle multiple textures per buffer in RTCVideoDecoder

This CL adds checks on RTCVideoDecoder so that it can handle formats with
multiple textures per buffer, i.e. NV12 on Windows.

BUG= 712311 
TEST=Tested AppRTC loopback with H264 on Windows. Added unittests.

Review-Url: https://codereview.chromium.org/2823273003
Cr-Commit-Position: refs/heads/master@{#465352}

[modify] https://crrev.com/f1d77853394a703fc603f0ef0fae3cf6de9a1364/content/renderer/media/gpu/rtc_video_decoder.cc
[modify] https://crrev.com/f1d77853394a703fc603f0ef0fae3cf6de9a1364/content/renderer/media/gpu/rtc_video_decoder.h
[modify] https://crrev.com/f1d77853394a703fc603f0ef0fae3cf6de9a1364/content/renderer/media/gpu/rtc_video_decoder_unittest.cc

Labels: Merge-Request-59
Status: Fixed (was: Assigned)
Project Member

Comment 8 by sheriffbot@chromium.org, Apr 19 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 20 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/987d2433e5921ba7c736a1c6081b87a1eb2050e7

commit 987d2433e5921ba7c736a1c6081b87a1eb2050e7
Author: emircan <emircan@chromium.org>
Date: Thu Apr 20 17:23:49 2017

Merge 59: Handle multiple textures per buffer in RTCVideoDecoder

This CL adds checks on RTCVideoDecoder so that it can handle formats with
multiple textures per buffer, i.e. NV12 on Windows.

BUG= 712311 
TEST=Tested AppRTC loopback with H264 on Windows. Added unittests.

Review-Url: https://codereview.chromium.org/2823273003
Cr-Commit-Position: refs/heads/master@{#465352}
(cherry picked from commit f1d77853394a703fc603f0ef0fae3cf6de9a1364)
NOTRY=true
NOPRESUBMIT=true
TBR=jbauman@chromium.org

Review-Url: https://codereview.chromium.org/2832863002
Cr-Commit-Position: refs/branch-heads/3071@{#87}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/987d2433e5921ba7c736a1c6081b87a1eb2050e7/content/renderer/media/gpu/rtc_video_decoder.cc
[modify] https://crrev.com/987d2433e5921ba7c736a1c6081b87a1eb2050e7/content/renderer/media/gpu/rtc_video_decoder.h
[modify] https://crrev.com/987d2433e5921ba7c736a1c6081b87a1eb2050e7/content/renderer/media/gpu/rtc_video_decoder_unittest.cc

Sign in to add a comment