|
|
Chromium Code Reviews
Descriptioncc: Make VideoResourceUpdater use CopyToResource instead of SetPixels.
This makes video stop relying on the TextureUploader class. I've ported
the stride-handling code from TextureUploader to the
VideoResourceUpdater class, since it is the only place that will make
use for it for now.
R=enne
BUG=454575
Committed: https://crrev.com/e3f994390b28d440bacfa88031077761a29f1854
Cr-Commit-Position: refs/heads/master@{#317171}
Patch Set 1 #
Total comments: 3
Patch Set 2 : video: comment #Patch Set 3 : video: vector #
Total comments: 3
Messages
Total messages: 28 (13 generated)
The CQ bit was checked by enne@chromium.org
lgtm https://codereview.chromium.org/935383004/diff/1/cc/resources/video_resource_... File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/935383004/diff/1/cc/resources/video_resource_... cc/resources/video_resource_updater.cc:322: // TODO(reveman): Can use of GpuMemoryBuffers here to improve performance. s/of//
The CQ bit was unchecked by enne@chromium.org
New patchsets have been uploaded after l-g-t-m from enne@chromium.org
The CQ bit was checked by danakj@chromium.org
The CQ bit was unchecked by danakj@chromium.org
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/935383004/20001
ericrk@chromium.org changed reviewers: + ericrk@chromium.org
lgtm as well. https://codereview.chromium.org/935383004/diff/1/cc/resources/video_resource_... File cc/resources/video_resource_updater.h (right): https://codereview.chromium.org/935383004/diff/1/cc/resources/video_resource_... cc/resources/video_resource_updater.h:134: // TODO(danakj): Use std::array when we can. std::array is compile-time fixed size. Maybe std::vector once C++11 std::vector::data() is available?
https://codereview.chromium.org/935383004/diff/1/cc/resources/video_resource_... File cc/resources/video_resource_updater.h (right): https://codereview.chromium.org/935383004/diff/1/cc/resources/video_resource_... cc/resources/video_resource_updater.h:134: // TODO(danakj): Use std::array when we can. On 2015/02/19 19:57:41, ericrk wrote: > std::array is compile-time fixed size. > > Maybe std::vector once C++11 std::vector::data() is available? Oh! Hrm. I could just use vector now with some casts then..
The CQ bit was unchecked by danakj@chromium.org
Switched it to a vector.
New patchsets have been uploaded after l-g-t-m from ericrk@chromium.org
The CQ bit was checked by danakj@chromium.org
Patchset #3 (id:40001) has been deleted
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/935383004/60001
Message was sent while issue was closed.
Committed patchset #3 (id:60001)
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/e3f994390b28d440bacfa88031077761a29f1854 Cr-Commit-Position: refs/heads/master@{#317171}
Message was sent while issue was closed.
dalecurtis@chromium.org changed reviewers: + dalecurtis@chromium.org
Message was sent while issue was closed.
https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... cc/resources/video_resource_updater.cc:349: memcpy(dst, src, resource_size_pixels.width() * bytes_per_pixel); Does this mean we're doing a memcpy for every frame within system memory and then another copy from the system memory into the gpu?
Message was sent while issue was closed.
https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... cc/resources/video_resource_updater.cc:349: memcpy(dst, src, resource_size_pixels.width() * bytes_per_pixel); On 2015/02/20 03:21:28, DaleCurtis wrote: > Does this mean we're doing a memcpy for every frame within system memory and > then another copy from the system memory into the gpu? When there's a stride, yes. It's matching the current behaviour, so I don't expect any regressions, but yah. If we can use GpuMemoryBuffers (the TODO above) we can win a lot.
Message was sent while issue was closed.
https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... cc/resources/video_resource_updater.cc:349: memcpy(dst, src, resource_size_pixels.width() * bytes_per_pixel); On 2015/02/20 03:34:03, danakj wrote: > On 2015/02/20 03:21:28, DaleCurtis wrote: > > Does this mean we're doing a memcpy for every frame within system memory and > > then another copy from the system memory into the gpu? > > When there's a stride, yes. It's matching the current behaviour, so I don't > expect any regressions, but yah. If we can use GpuMemoryBuffers (the TODO above) > we can win a lot. Thanks for the explanation. There's always a stride w/ software decoding :) Looking at the GpuMemoryBufferTypes it seems to only support unpacked 8bpp r,g,b,a; so seemingly we'd have to do YUV conversion into that format which might lose some of the benefits. Is there a bug with more information on how a GpuMemoryBuffer might be used here?
Message was sent while issue was closed.
On 2015/02/20 at 18:03:39, dalecurtis wrote: > https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... > File cc/resources/video_resource_updater.cc (right): > > https://codereview.chromium.org/935383004/diff/60001/cc/resources/video_resou... > cc/resources/video_resource_updater.cc:349: memcpy(dst, src, resource_size_pixels.width() * bytes_per_pixel); > On 2015/02/20 03:34:03, danakj wrote: > > On 2015/02/20 03:21:28, DaleCurtis wrote: > > > Does this mean we're doing a memcpy for every frame within system memory and > > > then another copy from the system memory into the gpu? > > > > When there's a stride, yes. It's matching the current behaviour, so I don't > > expect any regressions, but yah. If we can use GpuMemoryBuffers (the TODO above) > > we can win a lot. > > Thanks for the explanation. There's always a stride w/ software decoding :) Looking at the GpuMemoryBufferTypes it seems to only support unpacked 8bpp r,g,b,a; so seemingly we'd have to do YUV conversion into that format which might lose some of the benefits. > > Is there a bug with more information on how a GpuMemoryBuffer might be used here? There are two possible solutions here. In both cases we'd create a GpuMemoryBuffer for each YUV plane and that gives us 0-copy transfer of the planes to the graphics hardware when supported (it will perform an implicit texture upload when not supported). In some cases the driver allows us to create a RGB texture from these planes directly and the color space conversion is handled automatically. That's solution 1. Solution 2 is binding each GpuMemoryBuffer to a separate texture and doing the color space conversion using a shader. Solution 1 would be as efficient as gets. Solution 2 would work with all drivers/hardware but be a bit less efficient.
Message was sent while issue was closed.
Awesome, thanks again for the discussion. Let me know if you need some bandwidth to help get that done. My OKR this quarter is smooth video playback, reducing texture upload cost for hi-res HFR software playback would definitely make it more likely that we can deliver a frame on time.
Message was sent while issue was closed.
On 2015/02/20 at 18:17:27, dalecurtis wrote: > Awesome, thanks again for the discussion. Let me know if you need some bandwidth to help get that done. My OKR this quarter is smooth video playback, reducing texture upload cost for hi-res HFR software playback would definitely make it more likely that we can deliver a frame on time. crbug.com/439520 is about adding YUV support to the GpuMemoryBuffer framework. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
