Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Usage of v4l2_wrapper #882

Open
philolt opened this issue Aug 11, 2019 · 5 comments
Open

Usage of v4l2_wrapper #882

philolt opened this issue Aug 11, 2019 · 5 comments

Comments

@philolt
Copy link

philolt commented Aug 11, 2019

Hi,
How can I use the compiled libyami_v4l2.so to expose the hardware codecs via v4l2? The only device which is visible is the integrated Webcam of my intel notebook. I searched the whole repo but didn't find a hint how to setup.
thanks and best regards

@xuguangxin
Copy link
Contributor

Hi @PipOlt ,
thanks for interested on this.
all v4l2 functions exposed by https://github.com/intel/libyami/blob/apache/interface/v4l2_wrapper.h
you can refer to https://github.com/intel/libyami-utils/blob/master/tests/v4l2decode.cpp
for api usage.
here is some high level introduction. https://github.com/intel/libyami/wiki/V4L2-Codec. You can read it with code, but it's little old, not all information is accurate.

@philolt
Copy link
Author

philolt commented Aug 12, 2019

Hi @xuguangxin,
Thank you for your fast response. I thought, the v4l2-wrapper acts as a v4l2-device like a capture card. I found all of the documents you posted earlier. But I don't understand how to load the library in a normal linux environment. I expected an exposed device like /dev/video$X for the v4l2 codec. But therefore I need something like a kernel Module. Can you explain how this is working especially in context of video acceleration under chromium?
best regards!

@xuguangxin
Copy link
Contributor

@PipOlt , No, it's for decoder and encoder. not for capture.
here is the example how to use it https://github.com/intel/libyami-utils/blob/master/tests/V4L2Device.cpp#L219
chrome has similar class https://github.com/chromium/chromium/blob/master/media/gpu/v4l2/v4l2_device.h#L393.
If you write a chrome wrapper and hook it up here https://github.com/chromium/chromium/blob/master/media/gpu/v4l2/v4l2_device.cc#L984. you may plugin it to chrome.

thanks

@philolt
Copy link
Author

philolt commented Aug 12, 2019

@xuguangxin Ok, thank you for the information. I thought it would be possible to load the codec as a device of v4l2 like this https://github.com/torvalds/linux/blob/master/drivers/media/platform/vicodec/vicodec-core.c. It can be loaded as kernel module and then there is a entrypoint at /dev/video* for the codec.
thanks!

@xuguangxin
Copy link
Contributor

no, it's a simulation for v4l2 in user space. nothing related to the kernel module

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants