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

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature

Blocked on: View detail
issue 910590
issue 921921

Blocking:
issue 917798
issue 921931



Sign in to add a comment
link

Issue 907767: media/gpu Make ImageProcessor support only import mode.

Reported by deanliao@chromium.org, Nov 22 Project Member

Issue description

Right now ImageProcessor, specifically v4l2 IP, supports both import and allocated mode for output frame. If we move the responsibility of allocating buffer from image processor to its users, VEA and VDA, ImageProcessor.Process() interface can be simplified as:
Process(scoped_refptr<VideoFrame> input, scoped_refptr<VideoFrame> output, callback).
 

Comment 1 by bugdroid1@chromium.org, Nov 26

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b79c9a2523662dc6f383a2ef45b8edd30a2f265

commit 9b79c9a2523662dc6f383a2ef45b8edd30a2f265
Author: Dean Liao <deanliao@chromium.org>
Date: Mon Nov 26 04:48:55 2018

media/gpu: Use StorageType instead of v4l2_memory to create image processor.

V4L2ImageProcessor::Create() has input_memory_type and output_memory_type
parameters of type v4l2_memory. In order to have a generic ImageProcessor
factory method, we use StorageType to replace v4l2_memory.

Also, since V4L2ImageProcessor supports both allocate and import output mode,
and for a storage type (e.g. STORAGE_OWNED_MEMORY), its v4l2_memory mapping
is V4L2_MEMORY_MMAP for allocate mode and V4L2_MEMORY_USERPTR for import mode.
We have to pass output_mode to v4l2 IP factory till all its users move to
use import mode.

BUG=b:73752373, chromium:907767
TEST=TEST=Run VEA VDA unittest on devices (peach_pit and elm)
VEA:
video_encode_accelerator_unittest \
--test_stream_data=bear-320x180.yuv:320:180:1:bear.mp4:100000:30 \
--disable_flush --single-process-tests -v=0

VDA:
video_decode_accelerator_unittest \
--test_stream_data=/usr/local/video/test-25fps.h264:320:240:250:258:\
35:150:1 -v=0 --disable_flush --single-process-tests --ozone-platform=gbm

Change-Id: I60f8eeea937dc6566cf844a8a74069711c29f5a0
Reviewed-on: https://chromium-review.googlesource.com/c/1341739
Commit-Queue: Shuo-Peng Liao <deanliao@google.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610764}
[modify] https://crrev.com/9b79c9a2523662dc6f383a2ef45b8edd30a2f265/media/gpu/image_processor.h
[modify] https://crrev.com/9b79c9a2523662dc6f383a2ef45b8edd30a2f265/media/gpu/v4l2/v4l2_image_processor.cc
[modify] https://crrev.com/9b79c9a2523662dc6f383a2ef45b8edd30a2f265/media/gpu/v4l2/v4l2_image_processor.h
[modify] https://crrev.com/9b79c9a2523662dc6f383a2ef45b8edd30a2f265/media/gpu/v4l2/v4l2_video_decode_accelerator.cc
[modify] https://crrev.com/9b79c9a2523662dc6f383a2ef45b8edd30a2f265/media/gpu/v4l2/v4l2_video_encode_accelerator.cc

Comment 2 by deanliao@google.com, Nov 30

Blockedon: 910590

Comment 3 by bugdroid1@chromium.org, Dec 4

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/14226ae66313291949ff7b581cfb3807cddc39e4

commit 14226ae66313291949ff7b581cfb3807cddc39e4
Author: Dean Liao <deanliao@chromium.org>
Date: Tue Dec 04 19:17:37 2018

media/gpu: Always Initialize Ozone in VEA unittest not only if --native_input.

Chrome OS Chrome VEA may create Dmabuf-backed VideoFrame using Ozone.
Therefore, VEA unittest needs to perform Ozone setup on Chrome OS.

BUG=chromium:907767
TEST=Run VEA unittest on devices (peach_pit and elm)
video_encode_accelerator_unittest \
--test_stream_data=bear-320x180.yuv:320:180:1:bear.mp4:100000:30 \
--disable_flush --single-process-tests -v=0

Change-Id: Iaf13646b3c665246862c0de7fee4487679904552
Reviewed-on: https://chromium-review.googlesource.com/c/1356444
Commit-Queue: Shuo-Peng Liao <deanliao@google.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613630}
[modify] https://crrev.com/14226ae66313291949ff7b581cfb3807cddc39e4/media/gpu/video_encode_accelerator_unittest.cc

Comment 4 by bugdroid1@chromium.org, Dec 14

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/78b2ef02daff55860c6c6ff70c880a6095f02e46

commit 78b2ef02daff55860c6c6ff70c880a6095f02e46
Author: Alexandre Courbot <acourbot@chromium.org>
Date: Fri Dec 14 11:04:48 2018

media/gpu/veaunittest: Initialize Ozone in global environment

The Ozone initialization and creation of the rendering thread was
performed before running each individual tests. This triggers a
CalledOnValidSequence() DCHECK in Debug builds when
AfterSandboxEntry() tries to start the DRM thread for the second time,
and Thread::Start() is called from a different thread that with the
first test.

Fix this by moving all Ozone initialization and the rendering thread to
the global test environment.

BUG=907767
TEST=Checked that VEA was passing on Cheza with --single-process-tests.

Change-Id: Ic9b52a31310b40c99368620ea78cf861d084032d
Reviewed-on: https://chromium-review.googlesource.com/c/1369755
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616633}
[modify] https://crrev.com/78b2ef02daff55860c6c6ff70c880a6095f02e46/media/gpu/video_encode_accelerator_unittest.cc

Comment 5 by bugdroid1@chromium.org, Dec 27

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

commit f48666208d6eb854768ee0923bc9abb3f93eeb5e
Author: Dean Liao <deanliao@chromium.org>
Date: Thu Dec 27 01:58:41 2018

media/gpu: Add LibYUVImageProcessor and extend ImageProcessor interface

LibYUVImageProcessor is a software image processor to convert video
stream format for video encoder / decoder to consume.

Adds ImageProcessorFactory to encapsulate image processor creation
for video decode/encode accelerators.

Adds Process(VF, VF, cb) in ImageProcessor because it is platform
agnostics, i.e. no ScopedFD, which is POXIS only. Also, it aligns with
our goal to make ImageProcessor support only import mode for output
VideoFrame (input is already import mode only). When we reach the goal,
i.e. all IP's users use Process(VF, VF, cb), we can simplify the logic
of both ImageProcessors and their callers.

We take V4L2 VEA as its first user of this overloaded function.
When V4L2 VEA needs IP and VEA knows how to create VideoFrame for IP
as output, we can use the new interface.
On the contrary, as far as we know, V4L2 VEA is unable to create
DMAbuf-backed VideoFrame for V4L2 IP's output, we keep using the
original interface until the issue is solved.

BUG=b:73752373, chromium:907767, b:110815424
TEST=TEST=Run VEA VDA unittest on devices (peach_pit and elm)
VEA:
video_encode_accelerator_unittest \
--test_stream_data=bear-320x180.yuv:320:180:1:bear.mp4:100000:30 \
--disable_flush --single-process-tests -v=0

Change-Id: I8bfabda30a569030e8e0831efafc502f48cfabf2
Reviewed-on: https://chromium-review.googlesource.com/c/1348150
Commit-Queue: Shuo-Peng Liao <deanliao@google.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618991}
[modify] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/BUILD.gn
[add] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/image_processor.cc
[modify] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/image_processor.h
[add] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/image_processor_factory.cc
[add] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/image_processor_factory.h
[add] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/libyuv_image_processor.cc
[add] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/libyuv_image_processor.h
[modify] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/v4l2/v4l2_image_processor.cc
[modify] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/v4l2/v4l2_image_processor.h
[modify] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/v4l2/v4l2_video_decode_accelerator.cc
[modify] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/v4l2/v4l2_video_encode_accelerator.cc
[modify] https://crrev.com/f48666208d6eb854768ee0923bc9abb3f93eeb5e/media/gpu/v4l2/v4l2_video_encode_accelerator.h

Comment 6 by hiroh@chromium.org, Dec 28

Blocking: 917798

Comment 7 by deanliao@chromium.org, Jan 15

Blockedon: 921921

Comment 8 by deanliao@chromium.org, Jan 15

Blocking: 921931

Comment 9 by deanliao@chromium.org, Jan 16

Cc: deanliao@chromium.org wuchengli@chromium.org
 Issue 895701  has been merged into this issue.

Sign in to add a comment