Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Issue 807853005: Refactor Vaapi video decoder/encoder in preparation of Freon support (Closed)

Created:
6 years ago by llandwerlin-old
Modified:
6 years ago
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, piman+watch_chromium.org, posciak+watch_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor Vaapi video decoder/encoder in preparation of Freon support This introduces VaapiPicture which abstracts the output picture for the VaapiVideoDecodeAccelerator. This also splits out the x11 specific functions of LibVA into their own signature file. And finally this adds back GLImageGLX to match the code path that will be used on Freon, using GLImageLinuxDMABuffer. BUG=403058 TEST=video_decode_accelerator_unittest and video_encode_accelerator_unittest Committed: https://crrev.com/289e96375e75be0d9158b86df2bd4faf2d7b2a64 Cr-Commit-Position: refs/heads/master@{#309355}

Patch Set 1 #

Patch Set 2 : Remove video_(de/en)code_accelerator_unittest from Ozone build #

Patch Set 3 : Remove whitespace changes #

Total comments: 12

Patch Set 4 : Update after piman's review #

Patch Set 5 : Fix GN build #

Total comments: 1

Patch Set 6 : Make VaapiWrapper RefCountedThreadSafe #

Patch Set 7 : Fix BUILD.gn #

Unified diffs Side-by-side diffs Delta from patch set Stats (+492 lines, -425 lines) Patch
M content/common/BUILD.gn View 1 2 3 4 5 6 5 chunks +16 lines, -4 lines 0 comments Download
M content/common/gpu/media/gpu_video_decode_accelerator.cc View 1 2 3 4 5 2 chunks +4 lines, -13 lines 0 comments Download
M content/common/gpu/media/gpu_video_encode_accelerator.cc View 2 chunks +5 lines, -6 lines 0 comments Download
M content/common/gpu/media/rendering_helper.h View 1 chunk +4 lines, -1 line 0 comments Download
M content/common/gpu/media/rendering_helper.cc View 1 2 10 chunks +22 lines, -17 lines 0 comments Download
M content/common/gpu/media/va.sigs View 1 chunk +0 lines, -7 lines 0 comments Download
M content/common/gpu/media/va_surface.h View 4 chunks +13 lines, -4 lines 0 comments Download
A content/common/gpu/media/va_x11.sigs View 1 chunk +9 lines, -0 lines 0 comments Download
M content/common/gpu/media/vaapi_h264_decoder_unittest.cc View 3 chunks +7 lines, -23 lines 0 comments Download
A content/common/gpu/media/vaapi_picture.h View 1 chunk +73 lines, -0 lines 0 comments Download
A content/common/gpu/media/vaapi_picture.cc View 1 chunk +40 lines, -0 lines 0 comments Download
A content/common/gpu/media/vaapi_tfp_picture.h View 1 chunk +56 lines, -0 lines 0 comments Download
A content/common/gpu/media/vaapi_tfp_picture.cc View 1 chunk +77 lines, -0 lines 0 comments Download
M content/common/gpu/media/vaapi_video_decode_accelerator.h View 8 chunks +16 lines, -22 lines 0 comments Download
M content/common/gpu/media/vaapi_video_decode_accelerator.cc View 14 chunks +36 lines, -228 lines 0 comments Download
M content/common/gpu/media/vaapi_video_encode_accelerator.h View 3 chunks +2 lines, -4 lines 0 comments Download
M content/common/gpu/media/vaapi_video_encode_accelerator.cc View 4 chunks +7 lines, -10 lines 0 comments Download
M content/common/gpu/media/vaapi_wrapper.h View 1 2 3 4 5 7 chunks +21 lines, -20 lines 0 comments Download
M content/common/gpu/media/vaapi_wrapper.cc View 9 chunks +50 lines, -43 lines 0 comments Download
M content/common/gpu/media/video_decode_accelerator_unittest.cc View 2 chunks +4 lines, -12 lines 0 comments Download
M content/common/gpu/media/video_encode_accelerator_unittest.cc View 2 chunks +3 lines, -7 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 3 chunks +23 lines, -2 lines 0 comments Download
M media/BUILD.gn View 1 chunk +1 line, -1 line 0 comments Download
M media/media.gyp View 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_image_glx.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (5 generated)
llandwerlin-old
This is a split of the https://codereview.chromium.org/490233002/ There is almost no new changes to the ...
6 years ago (2014-12-17 13:11:17 UTC) #2
scherkus (not reviewing)
lgtm
6 years ago (2014-12-17 17:47:56 UTC) #3
piman
a few things... https://codereview.chromium.org/807853005/diff/40001/content/common/BUILD.gn File content/common/BUILD.gn (right): https://codereview.chromium.org/807853005/diff/40001/content/common/BUILD.gn#newcode280 content/common/BUILD.gn:280: if (cpu_arch == "arm" && use_x11) ...
6 years ago (2014-12-17 18:57:06 UTC) #4
llandwerlin-old
https://codereview.chromium.org/807853005/diff/40001/content/common/BUILD.gn File content/common/BUILD.gn (right): https://codereview.chromium.org/807853005/diff/40001/content/common/BUILD.gn#newcode280 content/common/BUILD.gn:280: if (cpu_arch == "arm" && use_x11) { On 2014/12/17 ...
6 years ago (2014-12-17 21:24:59 UTC) #5
piman
https://codereview.chromium.org/807853005/diff/40001/content/common/BUILD.gn File content/common/BUILD.gn (right): https://codereview.chromium.org/807853005/diff/40001/content/common/BUILD.gn#newcode280 content/common/BUILD.gn:280: if (cpu_arch == "arm" && use_x11) { On 2014/12/17 ...
6 years ago (2014-12-17 21:42:02 UTC) #6
llandwerlin-old
On 2014/12/17 21:42:02, piman (Very slow to review) wrote: > https://codereview.chromium.org/807853005/diff/40001/content/common/BUILD.gn > File content/common/BUILD.gn (right): ...
6 years ago (2014-12-18 12:02:11 UTC) #7
piman
LGTM though I would like resolution on the RefCounted vs RefCountedThreadSafe issue. Do we use ...
6 years ago (2014-12-18 19:51:59 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/807853005/80001
6 years ago (2014-12-18 21:54:37 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/31469)
6 years ago (2014-12-18 22:02:30 UTC) #12
piman
https://codereview.chromium.org/807853005/diff/80001/content/common/gpu/media/DEPS File content/common/gpu/media/DEPS (right): https://codereview.chromium.org/807853005/diff/80001/content/common/gpu/media/DEPS#newcode5 content/common/gpu/media/DEPS:5: "+ui", You shouldn't need all of ui, just ui/gl ...
6 years ago (2014-12-18 22:53:38 UTC) #13
llandwerlin-old
On 2014/12/18 22:53:38, piman (Very slow to review) wrote: > https://codereview.chromium.org/807853005/diff/80001/content/common/gpu/media/DEPS > File content/common/gpu/media/DEPS (right): ...
6 years ago (2014-12-19 15:09:16 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/807853005/100001
6 years ago (2014-12-20 15:53:06 UTC) #16
commit-bot: I haz the power
Committed patchset #6 (id:100001)
6 years ago (2014-12-20 17:49:46 UTC) #17
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/289e96375e75be0d9158b86df2bd4faf2d7b2a64 Cr-Commit-Position: refs/heads/master@{#309355}
6 years ago (2014-12-20 17:50:48 UTC) #18
dcheng
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/804353003/ by dcheng@chromium.org. ...
6 years ago (2014-12-20 18:49:43 UTC) #19
dcheng
Link to the failing build: http://build.chromium.org/p/chromium.chromiumos/buildstatus?builder=Linux%20ChromiumOS%20GN&number=4733
6 years ago (2014-12-20 18:50:00 UTC) #21
Pawel Osciak
On 2014/12/18 19:51:59, piman (Very slow to review) wrote: > LGTM though I would like ...
6 years ago (2014-12-20 20:02:34 UTC) #22
Pawel Osciak
On 2014/12/20 20:02:34, Pawel Osciak wrote: > On 2014/12/18 19:51:59, piman (Very slow to review) ...
6 years ago (2014-12-21 00:25:07 UTC) #23
piman
On 2014/12/21 00:25:07, Pawel Osciak wrote: > On 2014/12/20 20:02:34, Pawel Osciak wrote: > > ...
6 years ago (2014-12-22 19:12:57 UTC) #24
Pawel Osciak
6 years ago (2014-12-23 01:23:38 UTC) #25
Message was sent while issue was closed.
On 2014/12/22 19:12:57, piman (Very slow to review) wrote:
> On 2014/12/21 00:25:07, Pawel Osciak wrote:
> > On 2014/12/20 20:02:34, Pawel Osciak wrote:
> > > On 2014/12/18 19:51:59, piman (Very slow to review) wrote:
> > > > LGTM though I would like resolution on the RefCounted vs
> > RefCountedThreadSafe
> > > > issue. Do we use VaapiWrapper on multiple threads or not? If not we
should
> > > > remove the locks. If yes, we should make it RefCountedThreadSafe (though
I
> > > > suspect there would be extra issues wrt e.g. using the X Display from
> > multiple
> > > > threads).
> > > 
> > > VaapiWrapper is accessed from multiple thread, the decoder thread and the
> > > GpuChild tread. Also, if we have multiple decoders running, it can be
> accessed
> > > from multiple decoder threads as well.
> > > Only the functions that do not make X calls are called from decoder
threads,
> > the
> > > ones that require X are called from GpuChild only.
> > 
> > To further clarify, in the case of multiple decoders, what I meant by
> > VaapiWrapper accessed on each decoder's thread was libva itself being
accessed
> > from multiple decoder threads (each decoder has its own instance of
> > VaapiWrapper). In that case however each has a separate libva context for
> > concurrent calls on decoder threads, and is still serialized for X on
> GpuChild.
> 
> Then, with this CL that adds refcounting, what ensures the destructor (which
> implicitly does X calls, I believe, in e.g. vaTerminate) is called on the main
> thread?

VaapiVideoDecodeAccelerator derives from VideoDecodeAccelerator, which has a
specialized deleter that calls VDA::Destroy() to destroy itself first, which
should happen only as a consequence of GpuCommandBufferStub going away via
observer implementation of OnWillDestroyStub in GpuVideoDecodeAccelerator. My
understanding was that this was enough?

Powered by Google App Engine
This is Rietveld 408576698