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

Issue 104713014: VDA: Restructure EVDA (Closed)

Created:
7 years ago by vpagar
Modified:
6 years, 6 months ago
Reviewers:
shivdasp, Pawel Osciak
CC:
chromium-reviews, fischman+watch_chromium.org, jam, mcasas+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

VDA: Restructure EVDA This CL restructures EVDA implementation to facilitate easy addition of other V4L2 based implementations. BUG=

Patch Set 1 #

Total comments: 26
Unified diffs Side-by-side diffs Delta from patch set Stats (+236 lines, -176 lines) Patch
M content/common/gpu/media/exynos_video_decode_accelerator.h View 8 chunks +37 lines, -11 lines 15 comments Download
M content/common/gpu/media/exynos_video_decode_accelerator.cc View 76 chunks +174 lines, -141 lines 10 comments Download
M content/common/gpu/media/gpu_video_decode_accelerator.cc View 8 chunks +25 lines, -24 lines 1 comment Download

Messages

Total messages: 7 (0 generated)
vpagar
This CL restructures EVDA implementation to facilitate easy addition of other V4L2 based implementations.
7 years ago (2013-12-23 13:57:15 UTC) #1
Pawel Osciak
https://codereview.chromium.org/104713014/diff/1/content/common/gpu/media/exynos_video_decode_accelerator.cc File content/common/gpu/media/exynos_video_decode_accelerator.cc (right): https://codereview.chromium.org/104713014/diff/1/content/common/gpu/media/exynos_video_decode_accelerator.cc#newcode36 content/common/gpu/media/exynos_video_decode_accelerator.cc:36: if (HANDLE_EINTR(device->dev_ioctl(fd, type, arg) != 0)) { \ Please ...
6 years, 12 months ago (2013-12-24 03:45:24 UTC) #2
vpagar
6 years, 12 months ago (2013-12-24 08:11:06 UTC) #3
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
6 years, 12 months ago (2013-12-26 06:12:28 UTC) #4
shivdasp
-----------Copying the email conversation with Pawel regarding this here for reference------------ On Tue, Dec 24, ...
6 years, 12 months ago (2013-12-26 06:14:33 UTC) #5
shivdasp
On 2013/12/26 06:14:33, shivdasp wrote: > -----------Copying the email conversation with Pawel regarding this here ...
6 years, 12 months ago (2013-12-26 07:03:01 UTC) #6
Pawel Osciak
6 years, 12 months ago (2013-12-26 07:46:36 UTC) #7
On 2013/12/26 07:03:01, shivdasp wrote:
> > >   // I guess there should be a good way to name below two and are more of
> how
> > exynos’s polling interrupt mechanism is implemented. On tegra > these are
> no-ops
> > but since they are called on the “fd” we have to abstract it out here.
> > >   V4l2_setdevicepollinterrupt() = 0;
> > 
> > How do you wake up the polling thread in your case if you need to abort it? 
> > 
> 
> Since we do not have a real polling fd, we use "StopPoll" api which the
library
> exposes to abort the poll thread.

The poll() call is blocking and these methods are used by EVDA to interrupt it
when something requires us to abort polling the device (like a seek, or
destroy). We need to be able to interrupt a blocking poll() so that we can stop
the polling thread (device_poll_thread_ in EVDA).

I would assume that in your case SetDevicePollInterrupt() should internally call
StopPoll() from your library and signal the sleeping poll() to early return via
some synchronization primitive in your library. But you said those methods are
no-ops in your case?

> Would it be a good idea to rename these set[clear]devicepollinterrupt to
rather
> more generic to fit into the v4l2_video_device interface ?

Could we do away with ClearDevicePollInterrupt() and instead clear it
immediately after being interrupted in poll? I'll let John weigh in on this. So
the interface would be:

Poll()
StopPoll()


> > Also, please drop the V4l2_ prefixes from methods and please follow the
> Chromium
> > coding style. 
> >
> System call names will collide with keeping the method names as open(),
close()
> etc.
> What prefix would be better ?

The simple answer is that once this interface is updated to the Chromium Coding
Style, the method names will have to start with a capital letter.
   

> > >5.       In GpuVideoDecodeAccelerator::Initialize() before creating the
> > v4l2_video_decode_accelerator object, we would create a >v4l2_video_device
and
> > pass it as an argument to it. The question is how we instantiate an
> appropriate
> > one ?
> > > Can we keep the video device names different on tegra vs exynos ? So if
> > opening of /dev/mfc-dec fails we instantiate the >tegra_v4l2_video_device.
Any
> > other ideas ?
> > > That's fine. You could also use VIDIOC_QUERYCAP to get driver name. I
think
> > the simplest way is probably to have the factory method try >each of the
> classes
> > until one of them succeeds in opening their device. I'm actually flirting
with
> > an idea of making Open static as well and > returning an object of its class
> if
> > it succeeds in opening the device to the factory method. What do you think?
> > > Is the above class hierarchy okay with you ?
> >
> The real problem is that open() on Tegra will not succeed since we provide a
> library api instead of a system call.

I meant above that TVDA::Open() should not succeed if it fails to open the
library.

> I think making static open could be good idea or maybe use open()'s
> success/failure to determine this.
> If open() succeeds we create the Exynos object else Tegra object.
> 

It should not matter which class' method we call, both TVDA and EVDA should be
capable of failing to initialize on a system that doesn't support them and
succeeding on one that does. Also because we may add another implementation in
the future that may need to distinguish between TVDA and itself.

Powered by Google App Engine
This is Rietveld 408576698