GithubHelp home page GithubHelp logo

bootlin / libva-v4l2-request Goto Github PK

View Code? Open in Web Editor NEW
76.0 76.0 59.0 355 KB

LibVA implementation for the Linux Video4Linux2 Request API

License: Other

Makefile 1.47% Shell 0.03% M4 0.88% C 92.72% Assembly 1.70% C++ 0.77% Meson 2.42%

libva-v4l2-request's People

Contributors

ezequielgarcia avatar jernejsk avatar mripard avatar ndufresne avatar paulkocialkowski avatar rzerres avatar tpetazzoni avatar wens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libva-v4l2-request's Issues

Compilation under debian

Hi,

I don't know exactly were to post this indications to compile your drivers under debian, but I finally managed to do it. It is a little bit tricky and won't be possible if you don't patch file src/video.c and replace #include <drm_fourcc.h> with #include <drm/drm_fourcc.h> (in any other way it will include local drm_fourcc.h header and won't find DRM_FORMAT_MOD_ALLWINNER_MB32_TILED declaration). Should this be patched it your code?

On top of everything, debian won't compile if you don't use this configuration with autogen.sh:

./autogen.sh --enable-tools=yes --prefix=/usr/local CFLAGS="-I/usr/src/linux-headers-4.18.0-uname -r/include/uapi/ -I/usr/src/linux-headers-uname -r/include/"

Thanks for your help

Cannot make it run on OrangePi PC (sun8i-h3)

I have installed armbian server (console) on my device OrangePI PC (this is allwinner H3 device).
Did "apt install x-window-system" so I can start "xinit &" and my hdmi display shows me xterm.
Then I cloned bootlin/linux-cedrus tags/release-2019.03 and built new kernel and installed it.
Then got https://github.com/intel/libva and built branch v2.4-branch, installed.
Against this libva I got and built this bootlin/libva-v4l2-request (also tags/release-2019.03)
Also I built v4l2-request-test
In armbianEnv.txt added line extraargs="cma=256M"

So v4l2-request-test runs properly and I see on full-screen fragment of bunny movie cycled. That is ok.
My my cedrus devices are:

nick@orangepipc:/opt/libva-v4l2-request/src$ ls /dev/media0 -l
crw-rw-rw- 1 root video 252, 0 May 8 16:05 /dev/media0
nick@orangepipc:/opt/libva-v4l2-request/src$ ls /dev/video0 -l
crw-rw-rw- 1 root video 81, 0 May 8 16:05 /dev/video0

Because v4l2-request-test works properly I expect that I did all right and further should be no problems, but not.

Then I want to run vlc and/or gstreamer.
1st trouble was that VLC even did not want to use HW acceleration. I spent whole day until understood that VLC by default uses multi-threading for ffmpeg and this DISABLES any possibility for HW accel. I need to manually modify VLC config file like ~/.config/vlc/vlcrc and whereever found option thread number set to 1 instead of 0 (auto mean multi-threading)
Then at least VLC begins tries to use HW accel. Would be good to add this tip into docs.

Well. VLC in my case does not work accelerated.
It crashes with log:
vlc -v ./bunny.mp4
VLC media player 3.0.6 Vetinari (revision 3.0.6-0-g5803e85f73)
libEGL warning: DRI2: failed to authenticate
[swscaler @ 0xac5b5260] No accelerated colorspace conversion found from yuv420p to bgra.
[swscaler @ 0xac5b5260] No accelerated colorspace conversion found from yuv420p to bgra.
libva info: VA-API version 1.4.1
libva info: va_getDriverName() returns -1
libva info: User requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
[swscaler @ 0xa8f04530] No accelerated colorspace conversion found from yuv420p to bgra.
Segmentation fault

So sad.
Next I am trying to use gstreamer.
I have installed gstreamer1.0-vaapi package and configured it with

export LIBVA_DRIVERS_PATH=/usr/lib/dri
export LIBVA_DRIVER_NAME=v4l2_request
export DISPLAY=:0
export GST_VAAPI_ALL_DRIVERS=1

recent line seem important because otherwise VAAPI plugins are blacklisted in gstreamer.
gst-inspect gives hope:

gst-inspect-1.0 vaapi
Plugin Details:
Name vaapi
Description VA-API based elements
Filename /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstvaapi.so
Version 1.10.4
License LGPL
Source module gstreamer-vaapi
Source release date 2017-02-23
Binary package gstreamer-vaapi
Origin URL http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

vaapimpeg2dec: VA-API MPEG2 decoder
vaapih264dec: VA-API H264 decoder
vaapih265dec: VA-API H265 decoder
vaapisink: VA-API sink

4 features:
+-- 4 elements

So I see decoding elements present.
I am trying to run any gstreamer pipeline like this:
gst-launch-1.0 filesrc location=[FILENAME] ! qtdemux ! vaapih264dec ! fakesink

My tries are failed here with log:

gst-launch-1.0 filesrc location=/opt/videos/bunny.mp4 ! qtdemux ! vaapih264dec ! fakesink
libva info: VA-API version 1.4.1
libva info: va_getDriverName() returns -1
libva info: User requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
Setting pipeline to PAUSED ...
libva info: VA-API version 1.4.1
libva info: va_getDriverName() returns -1
libva info: User requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
Pipeline is PREROLLING ...
Got context from element 'vaapidecode_h264-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)NULL;
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
v4l2-request: Unable to set format for type 1: Device or resource busy
ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode_h264:vaapidecode_h264-0: Decoding error
Additional debug info:
../../../gst/vaapi/gstvaapidecode.c(689): gst_vaapidecode_handle_frame (): /GstPipeline:pipeline0/GstVaapiDecode_h264:vaapidecode_h264-0:
Decode error -1
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

After so debug I see that error happens in function surface.c RequestCreateSurfaces2(..) which calls v4l2_set_format(..) with parameter capture_type=1

What ever this can be?

Can You please give me some ideas? What is wrong with VLC? And for me would be even more important gstreamer, is it ever chance to make it run?

A23 support

Hi, is it possible to run this on A23?
I applied this patch to kernel:

diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
index 4461d5098..2fadc02d5 100644
--- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
@@ -152,6 +152,17 @@ ve_sram: sram-section@0 {
                        };
                };
 
+                video-codec@1c0e000 {
+                        compatible = "allwinner,sun8i-a33-video-engine";
+                        reg = <0x01c0e000 0x1000>;
+                        clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+                                 <&ccu CLK_DRAM_VE>;
+                        clock-names = "ahb", "mod", "ram";
+                        resets = <&ccu RST_BUS_VE>;
+                        interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+                        allwinner,sram = <&ve_sram 1>;
+                };
+
                dma: dma-controller@1c02000 {
                        compatible = "allwinner,sun8i-a23-dma";
                        reg = <0x01c02000 0x1000>;

and... it's not working! Timeout when waiting for media request!

VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[00575a48] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[004f9b98] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
libva info: VA-API version 1.10.0
libva info: User environment variable requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
[007b2ab8] avcodec decoder: Using v4l2-request for hardware decoding
v4l2-request: Timeout when waiting for media request
[h264 @ 0x7d8300] Failed to end picture decode issue: 1 (operation failed).
[b2b05650] main filter error: Failed to create video converter
[h264 @ 0x7d8300] hardware accelerator failed to decode picture
v4l2-request: Timeout when waiting for media request
[h264 @ 0x81e8a0] Failed to end picture decode issue: 1 (operation failed).
[h264 @ 0x81e8a0] hardware accelerator failed to decode picture
v4l2-request: Timeout when waiting for media request
[h264 @ 0x860380] Failed to end picture decode issue: 1 (operation failed).
[h264 @ 0x860380] hardware accelerator failed to decode picture
v4l2-request: Timeout when waiting for media request
[h264 @ 0x7d8300] Failed to end picture decode issue: 1 (operation failed).
[h264 @ 0x7d8300] hardware accelerator failed to decode picture
^Cv4l2-request: Timeout when waiting for media request
[h264 @ 0x81e8a0] Failed to end picture decode issue: 1 (operation failed).
[h264 @ 0x81e8a0] hardware accelerator failed to decode picture
v4l2-request: Timeout when waiting for media request
[h264 @ 0x860380] Failed to end picture decode issue: 1 (operation failed).
[h264 @ 0x860380] hardware accelerator failed to decode picture
v4l2-request: Unable to queue buffer: Invalid argument

is it possible to fix this?
Thanks.

Would be possible to get cedrus running on v3s?

Hello,

I'm wondering about the possibility to have Cedrus working on v3s.

Although Allwinner market v3s as a video encoder/decoder soc, I'm not sure if it would be practically useful since it only has 64 MB, maybe in a very specific use case.

Would be at least fun to have it 😄

I added this code to arch/arm/boot/dts/sun8i-v3s.dtsi that I copied from a33 dts.

                syscon: syscon@1c00000 {
                       compatible = "allwinner,sun8i-v3s-system-controller",
                                "syscon";
                        reg = <0x01c00000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;

                        sram_c: sram@1d00000 {
                                compatible = "mmio-sram";
                                reg = <0x01d00000 0x80000>;
                                #address-cells = <1>;
                                #size-cells = <1>;
                                ranges = <0 0x01d00000 0x80000>;

                                ve_sram: sram-section@0 {
                                        compatible = "allwinner,sun8i-a23-sram-c1",
                                                        "allwinner,sun4i-a10-sram-c1";
                                        reg = <0x000000 0x80000>;
                                };
                        };
                };

                video-codec@1c0e000 {
                        compatible = "allwinner,sun8i-a33-video-engine";
                        reg = <0x01c0e000 0x1000>;
                        clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
                                <&ccu CLK_DRAM_VE>;
                        clock-names = "ahb", "mod", "ram";
                        resets = <&ccu RST_BUS_VE>;
                        interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
                        allwinner,sram = <&ve_sram 1>;
                        status = "okay";
                };

and loaded the module, but I'm having the following kernel crash:

root@localhost:~# modprobe sunxi_cedrus
[  125.342252] sunxi_cedrus: module is from the staging directory, the quality is unknown, you have be
en warned.
[  125.367169] 8<--- cut here ---
[  125.371563] Unable to handle kernel NULL pointer dereference at virtual address 0000001a
[  125.382247] pgd = 0d0a49fc
[  125.386243] [0000001a] *pgd=00000000
[  125.391070] Internal error: Oops: 5 [#1] SMP ARM
[  125.396900] Modules linked in: sunxi_cedrus(C+) videobuf2_dma_contig v4l2_mem2mem videobuf2_memops 
videobuf2_v4l2 videobuf2_common tca8418_keypad matrix_keymap usb_f_ecm g_ether usb_f_rndis u_ether lib
composite
[  125.419538] CPU: 0 PID: 266 Comm: modprobe Tainted: G         C        5.8.0-rc4-licheepi-zero+ #10
[  125.431192] Hardware name: Allwinner sun8i Family
[  125.437215] PC is at __of_find_property+0xc/0x60
[  125.443117] LR is at of_find_property+0x34/0x50
[  125.448912] pc : [<c05df874>]    lr : [<c05df8fc>]    psr: 200b0093
[  125.456473] sp : c1fd3bc0  ip : 0000326c  fp : 00000000
[  125.462991] r10: 0000000f  r9 : c0978090  r8 : c1fd3be8
[  125.469538] r7 : c0978090  r6 : 00000002  r5 : 400b0013  r4 : c0c85cf8
[  125.477449] r3 : c0c85cf8  r2 : c1fd3be8  r1 : c0978090  r0 : 00000002
[  125.485400] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
[  125.495377] Control: 10c5387d  Table: 41d7406a  DAC: 00000051
[  125.502557] Process modprobe (pid: 266, stack limit = 0xd3991463)
[  125.510076] Stack: (0xc1fd3bc0 to 0xc1fd4000)
[  125.515823] 3bc0: c0c85cf8 400b0013 00000002 c05df8fc 00000000 c1fd3c18 00000000 00000002
[  125.526901] 3be0: 00000000 c05dfd40 c299c840 c0c04ec8 c1fd3c32 00000000 00000000 c1fd3c5c
[  125.538137] 3c00: c34b2800 c34b2810 c299c898 c05e1258 00000000 c029d498 00000000 00000000
[  125.549371] 3c20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c0c04ec8
[  125.560651] 3c40: 00000000 c34b2810 bf0521f0 c05e133c 00000000 c1fd3c5c 0338d000 c0c04ec8
[  125.572063] 3c60: c2bfc240 00000000 c34af400 bf04df38 c34af414 00000016 00000000 c016eb38
[  125.583620] 3c80: 00000000 c1202bc0 bf04df38 00000016 c34b2810 00000000 c1202bc0 00000000
[  125.595288] 3ca0: 00000016 c0c04ec8 c34aeb00 c05e83a4 00000000 c299c840 bf0521f0 c34b2800
[  125.607112] 3cc0: c34b2810 c299c898 0000000f bf04e324 00000000 c34aeb00 c299c840 c34b2810
[  125.619003] 3ce0: c299c840 c34b2810 bf0516d0 bf04d2ec c093c55c c34b2810 00000000 c34b2810
[  125.630949] 3d00: bf053014 c0c83470 00000000 bf053014 0000000f c048adcc c34b2810 c0c83468
[  125.642990] 3d20: 00000000 c0c83470 00000000 c0488ec0 c34b2810 bf053014 bf053014 c0c30d50
[  125.655041] 3d40: bf053188 c2bfc080 bf053140 c0489134 c34b2810 00000000 bf053014 c048932c
[  125.667075] 3d60: 00000000 bf053014 c34b2810 c048938c 00000000 bf053014 c0489334 c0487234
[  125.679110] 3d80: c3408f6c c3408f58 c34a0634 c0c04ec8 bf053014 c1202380 00000000 c0488258
[  125.691163] 3da0: bf0525b4 00000001 bf053014 bf053014 bf056000 ffffe000 00000000 c0489c0c
[  125.703198] 3dc0: c0c4ae80 bf056000 ffffe000 c0101710 c0c45640 00210d00 c0c45380 c2a58300
[  125.715249] 3de0: c3f4bb00 c3401e40 c2a58340 c3f4bb00 c3401e40 8040003e bf053188 c021cd1c
[  125.727300] 3e00: 00000001 c2a58300 c3f4bb00 c3401e40 c01a1ae4 bf053188 bf053140 c0c04ec8
[  125.739351] 3e20: 00000002 bf053140 c2bfc140 00000002 00000002 c019f908 c2bfc040 00000002
[  125.751402] 3e40: c1fd3f40 c2bfc040 00000002 c01a1aec bf05314c 00007fff bf053140 c019ebb4
[  125.763438] 3e60: bf053320 00000000 c0803038 c09188e0 bf05314c bf05aa18 bf053254 c0918838
[  125.775490] 3e80: c0918890 c1fd3f38 00000000 c022720c 00000000 00000000 00000000 ffffe000
[  125.787525] 3ea0: 00000000 00000000 00000000 00000000 00000000 00000000 6e72656b 00006c65
[  125.799560] 3ec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  125.811596] 3ee0: 00000000 00000000 00000000 00000000 00000000 c0c04ec8 7fffffff 00000000
[  125.823633] 3f00: 00000008 004c0afc 0000017b c0100264 c1fd2000 0000017b 00000000 c01a2118
[  125.835670] 3f20: 7fffffff 00000000 00000004 000000c0 00000000 c4062000 0000a064 00000000
[  125.847707] 3f40: c406758f c4067740 c4062000 0000a064 c406ba9c c406b92c c4069230 00007000
[  125.859744] 3f60: 000074c0 0000493c 000079fe 00000000 00000000 00000000 0000492c 00000022
[  125.871779] 3f80: 00000023 00000018 00000000 00000012 00000000 c0c04ec8 004c28b0 00000000
[  125.883831] 3fa0: 1b213700 c0100060 004c28b0 00000000 00000008 004c0afc 00000000 004c2390
[  125.895867] 3fc0: 004c28b0 00000000 1b213700 0000017b 004d51f8 004d4090 004d5190 00000000
[  125.907902] 3fe0: bea908b0 bea908a0 004b85e5 b6ceb9a2 40010030 00000008 00000000 00000000
[  125.919968] [<c05df874>] (__of_find_property) from [<c05df8fc>] (of_find_property+0x34/0x50)
[  125.932276] [<c05df8fc>] (of_find_property) from [<c05dfd40>] (of_phandle_iterator_init+0x5c/0xcc)
[  125.945112] [<c05dfd40>] (of_phandle_iterator_init) from [<c05e1258>] (__of_parse_phandle_with_args
+0x44/0xec)
[  125.959000] [<c05e1258>] (__of_parse_phandle_with_args) from [<c05e133c>] (of_parse_phandle+0x3c/0x
74)
[  125.972195] [<c05e133c>] (of_parse_phandle) from [<c05e83a4>] (of_reserved_mem_device_init_by_idx+0
x34/0x170)
[  125.986033] [<c05e83a4>] (of_reserved_mem_device_init_by_idx) from [<bf04e324>] (cedrus_hw_probe+0x
98/0x284 [sunxi_cedrus])
[  126.001112] [<bf04e324>] (cedrus_hw_probe [sunxi_cedrus]) from [<bf04d2ec>] (cedrus_probe+0xc4/0x2d
0 [sunxi_cedrus])
[  126.015564] [<bf04d2ec>] (cedrus_probe [sunxi_cedrus]) from [<c048adcc>] (platform_drv_probe+0x48/0
x98)
[  126.028867] [<c048adcc>] (platform_drv_probe) from [<c0488ec0>] (really_probe+0x1e0/0x348)
[  126.041024] [<c0488ec0>] (really_probe) from [<c0489134>] (driver_probe_device+0x5c/0xb4)
[  126.053089] [<c0489134>] (driver_probe_device) from [<c048932c>] (device_driver_attach+0x58/0x60)
[  126.065857] [<c048932c>] (device_driver_attach) from [<c048938c>] (__driver_attach+0x58/0xcc)
[  126.078273] [<c048938c>] (__driver_attach) from [<c0487234>] (bus_for_each_dev+0x78/0xc0)
[  126.090338] [<c0487234>] (bus_for_each_dev) from [<c0488258>] (bus_add_driver+0x15c/0x1e0)
[  126.102492] [<c0488258>] (bus_add_driver) from [<c0489c0c>] (driver_register+0x74/0x108)
[  126.114466] [<c0489c0c>] (driver_register) from [<c0101710>] (do_one_initcall+0x58/0x1c4)
[  126.126527] [<c0101710>] (do_one_initcall) from [<c019f908>] (do_init_module+0x5c/0x224)
[  126.138495] [<c019f908>] (do_init_module) from [<c01a1aec>] (load_module+0x1f1c/0x22f8)
[  126.150375] [<c01a1aec>] (load_module) from [<c01a2118>] (sys_finit_module+0xd0/0xe8)
[  126.162076] [<c01a2118>] (sys_finit_module) from [<c0100060>] (ret_fast_syscall+0x0/0x54)
[  126.174124] Exception stack(0xc1fd3fa8 to 0xc1fd3ff0)
[  126.181104] 3fa0:                   004c28b0 00000000 00000008 004c0afc 00000000 004c2390
[  126.193064] 3fc0: 004c28b0 00000000 1b213700 0000017b 004d51f8 004d4090 004d5190 00000000
[  126.204998] 3fe0: bea908b0 bea908a0 004b85e5 b6ceb9a2
[  126.211921] Code: e8bd8070 e3500000 e92d4070 0a000012 (e5904018) 
[  126.219868] ---[ end trace 56a5212a986fddcc ]---
Segmentation fault

and the module doesn't load.
How could I track the source of this problem?

Looking in the memory mapping of the v3s, it seems that the video engine (VE) should be in the same address as the other SOC, bur SRAM C seems to be in a different place, and much smaller. Also, it is not clear that this space can be used by the video engine.

V3S:

image

A10:

image

Fails to build against kernel 5.11.x

It looks like nearly all of the structs defined in include/h264-ctrls.h are defined in /usr/include/linux/v4l2-controls.h already:

$ /usr/bin/meson compile -C aarch64-redhat-linux-gnu --verbose
Found runner: ['/usr/bin/ninja']
ninja: Entering directory `aarch64-redhat-linux-gnu'
[1/4] gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/h264.c.o -MF src/v4l2_request_drv_video.so.p/h264.c.o.d -o src/v4l2_request_drv_video.so.p/h264.c.o -c ../src/h264.c
FAILED: src/v4l2_request_drv_video.so.p/h264.c.o 
gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/h264.c.o -MF src/v4l2_request_drv_video.so.p/h264.c.o.d -o src/v4l2_request_drv_video.so.p/h264.c.o -c ../src/h264.c
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:52:8: error: redefinition of ‘struct v4l2_ctrl_h264_sps’
   52 | struct v4l2_ctrl_h264_sps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1273:8: note: originally defined here
 1273 | struct v4l2_ctrl_h264_sps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:82:8: error: redefinition of ‘struct v4l2_ctrl_h264_pps’
   82 | struct v4l2_ctrl_h264_pps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1329:8: note: originally defined here
 1329 | struct v4l2_ctrl_h264_pps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:96:8: error: redefinition of ‘struct v4l2_ctrl_h264_scaling_matrix’
   96 | struct v4l2_ctrl_h264_scaling_matrix {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1361:8: note: originally defined here
 1361 | struct v4l2_ctrl_h264_scaling_matrix {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:101:8: error: redefinition of ‘struct v4l2_h264_weight_factors’
  101 | struct v4l2_h264_weight_factors {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1366:8: note: originally defined here
 1366 | struct v4l2_h264_weight_factors {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:122: warning: "V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED" redefined
  122 | #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED     0x04
      | 
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1403: note: this is the location of the previous definition
 1403 | #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED     0x01
      | 
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:123: warning: "V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH" redefined
  123 | #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH              0x08
      | 
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1404: note: this is the location of the previous definition
 1404 | #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH              0x02
      | 
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:125:8: error: redefinition of ‘struct v4l2_ctrl_h264_slice_params’
  125 | struct v4l2_ctrl_h264_slice_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1464:8: note: originally defined here
 1464 | struct v4l2_ctrl_h264_slice_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:173:8: error: redefinition of ‘struct v4l2_h264_dpb_entry’
  173 | struct v4l2_h264_dpb_entry {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1509:8: note: originally defined here
 1509 | struct v4l2_h264_dpb_entry {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from ../src/h264.c:36:
../include/h264-ctrls.h:185:8: error: redefinition of ‘struct v4l2_ctrl_h264_decode_params’
  185 | struct v4l2_ctrl_h264_decode_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/h264.c:35:
/usr/include/linux/v4l2-controls.h:1546:8: note: originally defined here
 1546 | struct v4l2_ctrl_h264_decode_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2/4] gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/context.c.o -MF src/v4l2_request_drv_video.so.p/context.c.o.d -o src/v4l2_request_drv_video.so.p/context.c.o -c ../src/context.c
FAILED: src/v4l2_request_drv_video.so.p/context.c.o 
gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/context.c.o -MF src/v4l2_request_drv_video.so.p/context.c.o.d -o src/v4l2_request_drv_video.so.p/context.c.o -c ../src/context.c
In file included from ../src/context.c:43:
../include/h264-ctrls.h:52:8: error: redefinition of ‘struct v4l2_ctrl_h264_sps’
   52 | struct v4l2_ctrl_h264_sps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1273:8: note: originally defined here
 1273 | struct v4l2_ctrl_h264_sps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from ../src/context.c:43:
../include/h264-ctrls.h:82:8: error: redefinition of ‘struct v4l2_ctrl_h264_pps’
   82 | struct v4l2_ctrl_h264_pps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1329:8: note: originally defined here
 1329 | struct v4l2_ctrl_h264_pps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from ../src/context.c:43:
../include/h264-ctrls.h:96:8: error: redefinition of ‘struct v4l2_ctrl_h264_scaling_matrix’
   96 | struct v4l2_ctrl_h264_scaling_matrix {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1361:8: note: originally defined here
 1361 | struct v4l2_ctrl_h264_scaling_matrix {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/context.c:43:
../include/h264-ctrls.h:101:8: error: redefinition of ‘struct v4l2_h264_weight_factors’
  101 | struct v4l2_h264_weight_factors {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1366:8: note: originally defined here
 1366 | struct v4l2_h264_weight_factors {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/context.c:43:
../include/h264-ctrls.h:122: warning: "V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED" redefined
  122 | #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED     0x04
      | 
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1403: note: this is the location of the previous definition
 1403 | #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED     0x01
      | 
In file included from ../src/context.c:43:
../include/h264-ctrls.h:123: warning: "V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH" redefined
  123 | #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH              0x08
      | 
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1404: note: this is the location of the previous definition
 1404 | #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH              0x02
      | 
In file included from ../src/context.c:43:
../include/h264-ctrls.h:125:8: error: redefinition of ‘struct v4l2_ctrl_h264_slice_params’
  125 | struct v4l2_ctrl_h264_slice_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1464:8: note: originally defined here
 1464 | struct v4l2_ctrl_h264_slice_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/context.c:43:
../include/h264-ctrls.h:173:8: error: redefinition of ‘struct v4l2_h264_dpb_entry’
  173 | struct v4l2_h264_dpb_entry {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1509:8: note: originally defined here
 1509 | struct v4l2_h264_dpb_entry {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from ../src/context.c:43:
../include/h264-ctrls.h:185:8: error: redefinition of ‘struct v4l2_ctrl_h264_decode_params’
  185 | struct v4l2_ctrl_h264_decode_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/context.c:28:
/usr/include/linux/v4l2-controls.h:1546:8: note: originally defined here
 1546 | struct v4l2_ctrl_h264_decode_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[3/4] gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/config.c.o -MF src/v4l2_request_drv_video.so.p/config.c.o.d -o src/v4l2_request_drv_video.so.p/config.c.o -c ../src/config.c
FAILED: src/v4l2_request_drv_video.so.p/config.c.o 
gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/config.c.o -MF src/v4l2_request_drv_video.so.p/config.c.o.d -o src/v4l2_request_drv_video.so.p/config.c.o -c ../src/config.c
In file included from ../src/config.c:38:
../include/h264-ctrls.h:52:8: error: redefinition of ‘struct v4l2_ctrl_h264_sps’
   52 | struct v4l2_ctrl_h264_sps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1273:8: note: originally defined here
 1273 | struct v4l2_ctrl_h264_sps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from ../src/config.c:38:
../include/h264-ctrls.h:82:8: error: redefinition of ‘struct v4l2_ctrl_h264_pps’
   82 | struct v4l2_ctrl_h264_pps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1329:8: note: originally defined here
 1329 | struct v4l2_ctrl_h264_pps {
      |        ^~~~~~~~~~~~~~~~~~
In file included from ../src/config.c:38:
../include/h264-ctrls.h:96:8: error: redefinition of ‘struct v4l2_ctrl_h264_scaling_matrix’
   96 | struct v4l2_ctrl_h264_scaling_matrix {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1361:8: note: originally defined here
 1361 | struct v4l2_ctrl_h264_scaling_matrix {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/config.c:38:
../include/h264-ctrls.h:101:8: error: redefinition of ‘struct v4l2_h264_weight_factors’
  101 | struct v4l2_h264_weight_factors {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1366:8: note: originally defined here
 1366 | struct v4l2_h264_weight_factors {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/config.c:38:
../include/h264-ctrls.h:122: warning: "V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED" redefined
  122 | #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED     0x04
      | 
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1403: note: this is the location of the previous definition
 1403 | #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED     0x01
      | 
In file included from ../src/config.c:38:
../include/h264-ctrls.h:123: warning: "V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH" redefined
  123 | #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH              0x08
      | 
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1404: note: this is the location of the previous definition
 1404 | #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH              0x02
      | 
In file included from ../src/config.c:38:
../include/h264-ctrls.h:125:8: error: redefinition of ‘struct v4l2_ctrl_h264_slice_params’
  125 | struct v4l2_ctrl_h264_slice_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1464:8: note: originally defined here
 1464 | struct v4l2_ctrl_h264_slice_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/config.c:38:
../include/h264-ctrls.h:173:8: error: redefinition of ‘struct v4l2_h264_dpb_entry’
  173 | struct v4l2_h264_dpb_entry {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1509:8: note: originally defined here
 1509 | struct v4l2_h264_dpb_entry {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from ../src/config.c:38:
../include/h264-ctrls.h:185:8: error: redefinition of ‘struct v4l2_ctrl_h264_decode_params’
  185 | struct v4l2_ctrl_h264_decode_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/linux/videodev2.h:65,
                 from ../src/request.h:37,
                 from ../src/config.h:33,
                 from ../src/config.c:27:
/usr/include/linux/v4l2-controls.h:1546:8: note: originally defined here
 1546 | struct v4l2_ctrl_h264_decode_params {
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

If I patch out all the struct definitions, I get this error:

[13/18] gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/h264.c.o -MF src/v4l2_request_drv_video.so.p/h264.c.o.d -o src/v4l2_request_drv_video.so.p/h264.c.o -c ../src/h264.c
FAILED: src/v4l2_request_drv_video.so.p/h264.c.o 
gcc -Isrc/v4l2_request_drv_video.so.p -Isrc -I../src -I../include -I/usr/include/libdrm -I/usr/include/valgrind -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -Wall -fvisibility=hidden -MD -MQ src/v4l2_request_drv_video.so.p/h264.c.o -MF src/v4l2_request_drv_video.so.p/h264.c.o.d -o src/v4l2_request_drv_video.so.p/h264.c.o -c ../src/h264.c
../src/h264.c: In function ‘h264_va_picture_to_v4l2’:
../src/h264.c:223:15: error: ‘struct v4l2_ctrl_h264_decode_params’ has no member named ‘num_slices’
  223 |         decode->num_slices = surface->slices_count;
      |               ^~
../src/h264.c: In function ‘h264_va_slice_to_v4l2’:
../src/h264.c:332:14: error: ‘struct v4l2_ctrl_h264_slice_params’ has no member named ‘size’
  332 |         slice->size = VASlice->slice_data_size;
      |              ^~
../src/h264.c:359:51: error: incompatible types when assigning to type ‘struct v4l2_h264_reference’ from type ‘unsigned int’
  359 |                         slice->ref_pic_list0[i] = idx;
      |                                                   ^~~
../src/h264.c:378:51: error: incompatible types when assigning to type ‘struct v4l2_h264_reference’ from type ‘unsigned int’
  378 |                         slice->ref_pic_list1[i] = idx;
      |                                                   ^~~
../src/h264.c:385:14: error: ‘struct v4l2_ctrl_h264_slice_params’ has no member named ‘pred_weight_table’
  385 |         slice->pred_weight_table.chroma_log2_weight_denom =
      |              ^~
../src/h264.c:387:14: error: ‘struct v4l2_ctrl_h264_slice_params’ has no member named ‘pred_weight_table’
  387 |         slice->pred_weight_table.luma_log2_weight_denom =
      |              ^~
../src/h264.c:392:44: error: ‘struct v4l2_ctrl_h264_slice_params’ has no member named ‘pred_weight_table’
  392 |                 h264_copy_pred_table(&slice->pred_weight_table.weight_factors[0],
      |                                            ^~
../src/h264.c:400:44: error: ‘struct v4l2_ctrl_h264_slice_params’ has no member named ‘pred_weight_table’
  400 |                 h264_copy_pred_table(&slice->pred_weight_table.weight_factors[1],
      |                                            ^~

Document that we rely on a newer libva

Debian stable uses libva 1.7.3, and our current code doesn't work with it. An arch linux with a newer libva (2.1.0) works, so we need to document that.

compile not pass

Hi there:
I`am on the sunxi h5 board to compile libve-v4l2-request can not pass ,
used libvb : https://github.com/01org/libva ,also used the inter libva 2.1.0 :

kernel:
Repository: https://github.com/bootlin/linux-cedrus
Branch: cedrus/4.18/vpu-support-merge

Error info:
request.c: In function ‘__vaDriverInit_0_39’:
request.c:93:8: error: ‘struct VADriverVTable’ has no member named ‘vaExportSurfaceHandle’
vtable->vaExportSurfaceHandle = RequestExportSurfaceHandle;

please help me ! Thanks

libva-v4l2-request on aarch64

Hi,

I am trying to build libva-v4l2-request on my board with gcc 8.2 but it can't link `tiled_to_planar' for some reason.

Can you please provide the right way to configure and build the libva-v4l2-request?

Here is the way i am trying:

./autogen.sh --prefix=/usr CFLAGS="-I/usr/src/linux-headers-$(uname -r)/include"

~/libva-v4l2-request$ make
Making all in src
make[1]: Entering directory '/home/ubuntu/libva-v4l2-request/src'
make  all-am
make[2]: Entering directory '/home/ubuntu/libva-v4l2-request/src'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-request.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-request.Tpo -c -o v4l2_request_drv_video_la-request.lo `test -f 'request.c' || echo './'`request.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-request.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-request.Tpo -c request.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-request.o
mv -f .deps/v4l2_request_drv_video_la-request.Tpo .deps/v4l2_request_drv_video_la-request.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-object_heap.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-object_heap.Tpo -c -o v4l2_request_drv_video_la-object_heap.lo `test -f 'object_heap.c' || echo './'`object_heap.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-object_heap.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-object_heap.Tpo -c object_heap.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-object_heap.o
mv -f .deps/v4l2_request_drv_video_la-object_heap.Tpo .deps/v4l2_request_drv_video_la-object_heap.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-config.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-config.Tpo -c -o v4l2_request_drv_video_la-config.lo `test -f 'config.c' || echo './'`config.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-config.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-config.Tpo -c config.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-config.o
mv -f .deps/v4l2_request_drv_video_la-config.Tpo .deps/v4l2_request_drv_video_la-config.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-surface.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-surface.Tpo -c -o v4l2_request_drv_video_la-surface.lo `test -f 'surface.c' || echo './'`surface.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-surface.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-surface.Tpo -c surface.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-surface.o
mv -f .deps/v4l2_request_drv_video_la-surface.Tpo .deps/v4l2_request_drv_video_la-surface.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-context.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-context.Tpo -c -o v4l2_request_drv_video_la-context.lo `test -f 'context.c' || echo './'`context.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-context.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-context.Tpo -c context.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-context.o
mv -f .deps/v4l2_request_drv_video_la-context.Tpo .deps/v4l2_request_drv_video_la-context.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-buffer.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-buffer.Tpo -c -o v4l2_request_drv_video_la-buffer.lo `test -f 'buffer.c' || echo './'`buffer.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-buffer.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-buffer.Tpo -c buffer.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-buffer.o
mv -f .deps/v4l2_request_drv_video_la-buffer.Tpo .deps/v4l2_request_drv_video_la-buffer.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-picture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-picture.Tpo -c -o v4l2_request_drv_video_la-picture.lo `test -f 'picture.c' || echo './'`picture.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-picture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-picture.Tpo -c picture.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-picture.o
mv -f .deps/v4l2_request_drv_video_la-picture.Tpo .deps/v4l2_request_drv_video_la-picture.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-subpicture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-subpicture.Tpo -c -o v4l2_request_drv_video_la-subpicture.lo `test -f 'subpicture.c' || echo './'`subpicture.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-subpicture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-subpicture.Tpo -c subpicture.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-subpicture.o
mv -f .deps/v4l2_request_drv_video_la-subpicture.Tpo .deps/v4l2_request_drv_video_la-subpicture.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-image.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-image.Tpo -c -o v4l2_request_drv_video_la-image.lo `test -f 'image.c' || echo './'`image.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-image.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-image.Tpo -c image.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-image.o
mv -f .deps/v4l2_request_drv_video_la-image.Tpo .deps/v4l2_request_drv_video_la-image.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-utils.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-utils.Tpo -c -o v4l2_request_drv_video_la-utils.lo `test -f 'utils.c' || echo './'`utils.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-utils.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-utils.Tpo -c utils.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-utils.o
mv -f .deps/v4l2_request_drv_video_la-utils.Tpo .deps/v4l2_request_drv_video_la-utils.Plo
depbase=`echo tiled_yuv.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool    --mode=compile gcc -DHAVE_CONFIG_H -I.     -I/usr/src/linux-headers-4.20.6/include -MT tiled_yuv.lo -MD -MP -MF $depbase.Tpo -c -o tiled_yuv.lo tiled_yuv.S &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/usr/src/linux-headers-4.20.6/include -MT tiled_yuv.lo -MD -MP -MF .deps/tiled_yuv.Tpo -c tiled_yuv.S  -fPIC -DPIC -o .libs/tiled_yuv.o
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-video.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-video.Tpo -c -o v4l2_request_drv_video_la-video.lo `test -f 'video.c' || echo './'`video.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-video.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-video.Tpo -c video.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-video.o
mv -f .deps/v4l2_request_drv_video_la-video.Tpo .deps/v4l2_request_drv_video_la-video.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-media.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-media.Tpo -c -o v4l2_request_drv_video_la-media.lo `test -f 'media.c' || echo './'`media.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-media.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-media.Tpo -c media.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-media.o
mv -f .deps/v4l2_request_drv_video_la-media.Tpo .deps/v4l2_request_drv_video_la-media.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-v4l2.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-v4l2.Tpo -c -o v4l2_request_drv_video_la-v4l2.lo `test -f 'v4l2.c' || echo './'`v4l2.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-v4l2.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-v4l2.Tpo -c v4l2.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-v4l2.o
mv -f .deps/v4l2_request_drv_video_la-v4l2.Tpo .deps/v4l2_request_drv_video_la-v4l2.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-mpeg2.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-mpeg2.Tpo -c -o v4l2_request_drv_video_la-mpeg2.lo `test -f 'mpeg2.c' || echo './'`mpeg2.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-mpeg2.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-mpeg2.Tpo -c mpeg2.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-mpeg2.o
mv -f .deps/v4l2_request_drv_video_la-mpeg2.Tpo .deps/v4l2_request_drv_video_la-mpeg2.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-h264.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-h264.Tpo -c -o v4l2_request_drv_video_la-h264.lo `test -f 'h264.c' || echo './'`h264.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-h264.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-h264.Tpo -c h264.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-h264.o
mv -f .deps/v4l2_request_drv_video_la-h264.Tpo .deps/v4l2_request_drv_video_la-h264.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-h265.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-h265.Tpo -c -o v4l2_request_drv_video_la-h265.lo `test -f 'h265.c' || echo './'`h265.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-4.20.6/include -MT v4l2_request_drv_video_la-h265.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-h265.Tpo -c h265.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-h265.o
mv -f .deps/v4l2_request_drv_video_la-h265.Tpo .deps/v4l2_request_drv_video_la-h265.Plo
/bin/bash ../libtool  --tag=CC   --mode=link gcc -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-4.20.6/include -module -avoid-version -no-undefined -Wl,--no-undefined  -o v4l2_request_drv_video.la -rpath /usr/lib/dri/ v4l2_request_drv_video_la-request.lo v4l2_request_drv_video_la-object_heap.lo v4l2_request_drv_video_la-config.lo v4l2_request_drv_video_la-surface.lo v4l2_request_drv_video_la-context.lo v4l2_request_drv_video_la-buffer.lo v4l2_request_drv_video_la-picture.lo v4l2_request_drv_video_la-subpicture.lo v4l2_request_drv_video_la-image.lo v4l2_request_drv_video_la-utils.lo tiled_yuv.lo v4l2_request_drv_video_la-video.lo v4l2_request_drv_video_la-media.lo v4l2_request_drv_video_la-v4l2.lo v4l2_request_drv_video_la-mpeg2.lo v4l2_request_drv_video_la-h264.lo v4l2_request_drv_video_la-h265.lo -ldrm -lva 
libtool: link: gcc -shared  -fPIC -DPIC  .libs/v4l2_request_drv_video_la-request.o .libs/v4l2_request_drv_video_la-object_heap.o .libs/v4l2_request_drv_video_la-config.o .libs/v4l2_request_drv_video_la-surface.o .libs/v4l2_request_drv_video_la-context.o .libs/v4l2_request_drv_video_la-buffer.o .libs/v4l2_request_drv_video_la-picture.o .libs/v4l2_request_drv_video_la-subpicture.o .libs/v4l2_request_drv_video_la-image.o .libs/v4l2_request_drv_video_la-utils.o .libs/tiled_yuv.o .libs/v4l2_request_drv_video_la-video.o .libs/v4l2_request_drv_video_la-media.o .libs/v4l2_request_drv_video_la-v4l2.o .libs/v4l2_request_drv_video_la-mpeg2.o .libs/v4l2_request_drv_video_la-h264.o .libs/v4l2_request_drv_video_la-h265.o   -ldrm -lva  -Wl,--no-undefined   -Wl,-soname -Wl,v4l2_request_drv_video.so -o .libs/v4l2_request_drv_video.so
.libs/v4l2_request_drv_video_la-image.o: In function `RequestDeriveImage':
image.c:(.text+0x5b4): undefined reference to `tiled_to_planar'
collect2: error: ld returned 1 exit status
Makefile:512: recipe for target 'v4l2_request_drv_video.la' failed
make[2]: *** [v4l2_request_drv_video.la] Error 1
make[2]: Leaving directory '/home/ubuntu/libva-v4l2-request/src'
Makefile:427: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/ubuntu/libva-v4l2-request/src'
Makefile:416: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Not able to use VLC

Hello,

thanks for the work.
I'm trying to make the libva work with vlc but without success. I have a Allwinner r16 soc on my device, and I followed the instructions from:
https://linux-sunxi.org/Sunxi-Cedrus
I compiled kernel 5.7rc5 enabling the cedrus options. I also added 256MB to the CMA, and added cma=256M to my kernel cmdline, but I'm not sure if this is effective because I didn't see decrease on my available RAM, but the dmesg shows:

cpi@clockworkpi:~$ dmesg | grep cma
[    0.000000] cma: Reserved 256 MiB at 0x60000000
[    0.000000] Kernel command line: console=ttyS0,115200n8 earlyprintk no_console_suspend root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=/sbin/init noinitrd panic=10 cma=256M
[    0.000000] Memory: 761032K/1044976K available (7168K kernel code, 404K rwdata, 1928K rodata, 1024K init, 261K bss, 21800K reserved, 262144K cma-reserved, 258532K highmem)
cpi@clockworkpi:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.0Gi        94Mi       481Mi       8.0Mi       424Mi       876Mi
Swap:            0B          0B          0B

I don't know if I should see less memory with free -h.

With new kernel I have /dev/video0 and /dev/media0 populated

After compiling and installing libva-v4l2-request from master branch (the release-2019.03 didn't compile), I noticed that it installs in the wrong directory (/usr/lib/dri), so I copied v4l2_request_drv_video.so and v4l2_request_drv_video.la to: /usr/lib/arm-linux-gnueabihf/dri/. I'm using Debian Bullseye to get latest mesa driver with lima support, and I have gpu acceleration on mali 400. My X is version 1.20.8, and Xorg.log outputs:

[    29.775] (II) modeset(0): glamor X acceleration enabled on Mali400
[    29.775] (II) modeset(0): glamor initialized
....
[    30.105] (II) modeset(0): [DRI2] Setup complete
[    30.105] (II) modeset(0): [DRI2]   DRI driver: sun4i-drm
[    30.105] (II) modeset(0): [DRI2]   VDPAU driver: sun4i-drm
...
[    30.617] (II) AIGLX: Loaded and initialized sun4i-drm
[    30.617] (II) GLX: Initialized DRI2 GL provider for screen 0

Running vainfo I get:

cpi@clockworkpi:~$ vainfo
error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: User environment variable requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.7.0)
vainfo: Driver version: v4l2-request
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointVLD

and v4l2-request-test works properly. But running VLC inside x11 I get errors. I enabled hardware acceleration and also set X11 video output (XCB), and VA-API video decoder, but to make sure that vlc is trying to use the right method I used the following command line to start vlc:

cvlc --no-audio --x11-display :0 --vout x11 --avcodec-hw vaapi big_buck_bunny_720_stereo.mp4

and I get the following error:

cpi@clockworkpi:~$ cvlc --no-audio --x11-display :0 --vout x11 --avcodec-hw vaapi big_buck_bunny_720_stereo.mp4
VLC media player 3.0.10 Vetinari (revision 3.0.10-0-g7f145afa84)
[00566a80] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[00586b70] main interface error: no suitable interface module
[004ebb98] main libvlc error: interface "globalhotkeys,none" initialization failed
[00586b70] dummy interface: using the dummy interface module...
[b3102538] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b29016b0] main video output error: video output creation failed
[b2589430] main decoder error: failed to create video output
[b3102838] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b29191a8] main video output error: video output creation failed
[b2589430] main decoder error: failed to create video output
[b3100898] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b29191a8] main video output error: video output creation failed
[b2589430] main decoder error: failed to create video output
[h264 @ 0xb258c2c0] get_buffer() failed
[h264 @ 0xb258c2c0] thread_get_buffer() failed
[h264 @ 0xb258c2c0] decode_slice_header error
[h264 @ 0xb258c2c0] no frame!
[b3100898] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b290ffa8] main video output error: video output creation failed
[b2589430] main decoder error: failed to create video output

My screen starts to flicker and no video is shown.
In my Xorg.log I get the many lines like this added:

[  1074.845] (WW) modeset(0): Page flip failed: No such file or directory
[  1074.845] (EE) modeset(0): present flip failed
[  1074.881] (WW) modeset(0): Page flip failed: No such file or directory
[  1074.881] (EE) modeset(0): present flip failed
[  1074.898] (WW) modeset(0): Page flip failed: No such file or directory
[  1074.898] (EE) modeset(0): present flip failed
....

If I change x11 to opengl with:

cvlc --no-audio --x11-display :0 --vout gl --avcodec-hw vaapi big_buck_bunny_720_stereo.mp4

cpi@clockworkpi:~$ cvlc --no-audio --x11-display :0 --vout gl --avcodec-hw vaapi big_buck_bunny_720_stereo.mp4
VLC media player 3.0.10 Vetinari (revision 3.0.10-0-g7f145afa84)
[004aca80] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[004cc8d0] main interface error: no suitable interface module
[00431b98] main libvlc error: interface "globalhotkeys,none" initialization failed
[004cc8d0] dummy interface: using the dummy interface module...
libva info: VA-API version 1.7.0
libva info: User environment variable requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
[b3102338] main video output error: video output creation failed
[b2589388] main decoder error: failed to create video output

The video works, the libva seems to be loaded but I have a very high usage of the cpu, and even if I don't set export LIBVA_DRIVER_NAME=v4l2_request the load usage still the same, with the difference that vlc cannot find the v4l2_request and instead look for sun4i-drm_drv_video.so which doesn't exist:

cpi@clockworkpi:~$ cvlc --no-audio --x11-display :0 --vout gl --avcodec-hw vaapi big_buck_bunny_720_stereo.mp4
VLC media player 3.0.10 Vetinari (revision 3.0.10-0-g7f145afa84)
[00572a80] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[005927f8] main interface error: no suitable interface module
[004f7b98] main libvlc error: interface "globalhotkeys,none" initialization failed
[005927f8] dummy interface: using the dummy interface module...
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/sun4i-drm_drv_video.so
libva info: va_openDriver() returns -1
[b3200d20] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
libva info: VA-API version 1.7.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

If I set x11 for vout (without export LIBVA_DRIVER_NAME=v4l2_request) I get the same error, and the screen flicker.

So, my problem seems to be in the vlc or xcb.

I tried to compile vlc from source and got the same error from the version in the package manager, but I don't know if I can try to do something to vlc to enable it to work.

If the problem is with x11 or xcb, how can I fix that? What do I have to compile/enable to make it work?

Would libva-v4l2-request work with opengl, or it must be xcb?

To finish, is there another program to try to see if the libva is working with video? Like mplayer, or mpv? If yes, how should I set it?

Thanks a lot!

v4l2-request: Unable to set format for type 2: Device or resource busy

Hi, I'm trying to use Cedrus on R16 and found the issue in v4l2-request context while setting type 2.

Target:

libva-v4l2-request: master
libva: 2.6.0.0
Linux-5.10

Target vainfo:

# vainfo
libva info: VA-API version 1.6.0
libva info: User environment variable requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.6 (libva 2.6.0.0)
vainfo: Driver version: v4l2-request
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointVLD

Player log:

[cplayer] Command line options: '-v' '--vo=gpu' '--hwdec-codecs=h264' '--hwdec=vaapi-copy' 'Big_Buck_Bunny_720_10s_1MB.mp4'
[cplayer] mpv 0.32.0-dirty Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Thu Jul  8 07:37:31 UTC 2021
[cplayer] ffmpeg library versions:
[cplayer]    libavutil       56.31.100
[cplayer]    libavcodec      58.54.100
[cplayer]    libavformat     58.29.100
[cplayer]    libswscale      5.5.100
[cplayer]    libavfilter     7.57.100
[cplayer]    libswresample   3.5.100
[cplayer] ffmpeg version: 4.2.2
[cplayer] 
[cplayer] Configuration: ./waf configure -o /nvme1/renew/kas/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/mpv/0.32.0-r0/build --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib --prefix=/usr --target=arm-linux-gnueabi --confdir=/etc --datadir=/usr/share --disable-manpage-build --disable-libsmbclient --disable-libbluray --disable-dvdnav --disable-cdda --disable-uchardet --disable-rubberband --disable-lcms2 --disable-vapoursynth --disable-drm --enable-egl --disable-gbm --disable-jack --disable-libarchive --enable-libass --enable-lua --enable-gl --enable-vaapi --disable-vdpau --disable-wayland --enable-x11 --disable-xv --disable-drm --enable-egl --disable-gbm --disable-jack --disable-libarchive --enable-libass --enable-lua --enable-gl --enable-vaapi --disable-vdpau --disable-wayland --enable-x11 --disable-xv --enable-gl-x11 --enable-egl-x11 --enable-vaapi-x11 --enable-vaapi-x-egl
[cplayer] List of enabled features: aligned_alloc alsa asm atomics build-date cplayer cplugins debug-build drmprime egl egl-helpers egl-x11 fchmod ffmpeg gbm.h gl gl-x11 glibc-thread-name glob glob-posix gnuc gpl iconv jpeg libass libass-osd libav-any libavcodec libavdevice libavutil libdl libm librt linux-fstatfs lua luajit memfd_create optimize oss-audio posix posix-or-mingw posix-spawn posix-spawn-native pthreads stdatomic vaapi vaapi-egl vaapi-x-egl vaapi-x11 vt.h x11 zlib
[cplayer] Reading config file /etc/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'vo' = 'gpu' (flags = 8)
[cplayer] Setting option 'hwdec-codecs' = 'h264' (flags = 8)
[cplayer] Setting option 'hwdec' = 'vaapi-copy' (flags = 8)
[cplayer] Setting option 'gpu-context' = 'x11egl' (flags = 8)
[cplayer] Setting option 'gpu-hwdec-interop' = 'vaapi-egl' (flags = 8)
[cplayer] Waiting for scripts...
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[osd/libass] Shaper: FriBidi 1.0.9 (SIMPLE)
[osd/libass] Setting up fonts...
[osd/libass] Loading font file '/etc/fonts/fonts.conf'
[osd/libass] Loading font file '/etc/fonts/conf.d'
[osd/libass] Error opening memory font 'fonts.conf'
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook 
[ytdl_hook] not a ytdl:// url 
[file] Opening Big_Buck_Bunny_720_10s_1MB.mp4
[demux] Trying demuxers for level=normal.
[osd/libass] Shaper: FriBidi 1.0.9 (SIMPLE)
[osd/libass] Setting up fonts...
[osd/libass] Loading font file '/etc/fonts/fonts.conf'
[osd/libass] Loading font file '/etc/fonts/conf.d'
[osd/libass] Error opening memory font 'fonts.conf'
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] Opening done: Big_Buck_Bunny_720_10s_1MB.mp4
[find_files] Loading external files in .
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[cplayer]  (+) Video --vid=1 (*) (h264 1280x720 30.000fps)
[display-tags] File tags:
[display-tags]  Artist: Blender Foundation 2008, Janus Bager Kristensen 2013
[display-tags]  Comment: Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
[display-tags]  Composer: Sacha Goedegebure
[display-tags]  Genre: Animation
[display-tags]  Title: Big Buck Bunny, Sunflower version
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :0
[vo/gpu/x11] XOpenIM() failed. Unicode input will not work.
[vo/gpu/x11] Display 0 (None-1): [0, 0, 800, 480] @ 61.576355 FPS
[vo/gpu/x11] Current display FPS: 61.576355
[vo/gpu/opengl] EGL_VERSION=1.4
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/opengl] Choosing visual EGL config 0x7, visual ID 0x21
[vo/gpu/opengl] GL_VERSION='2.1 Mesa 20.0.2'
[vo/gpu/opengl] Detected desktop OpenGL 2.1.
[vo/gpu/opengl] GL_VENDOR='lima'
[vo/gpu/opengl] GL_RENDERER='Mali400'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='1.20'
[vo/gpu/opengl] Combined OpenGL extensions string:
[vo/gpu/opengl] Loaded extension GL_ARB_map_buffer_range.
[vo/gpu/opengl] Loaded extension GL_ARB_vertex_array_object.
[vo/gpu/opengl] Loaded extension GL_ARB_sync.
[vo/gpu/opengl] Loaded extension GL_ARB_get_program_binary.
[vo/gpu/opengl] Loaded extension GL_ARB_debug_output.
[vo/gpu] Disabling HDR peak computation (one or more of the following is not supported: compute shaders=0, SSBO=0).
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Loading hwdec driver 'vaapi-egl'
[vo/gpu/vaapi-egl] VAAPI EGL interop Started!
[vo/gpu/vaapi-egl] VAAPI hwdec only works with OpenGL or Vulkan backends.
[vo/gpu] Loading failed.
[vo/gpu] Assuming 61.576355 FPS for display sync.
[vd] Container reported FPS: 30.000000
[vd] Codec list:
[vd]     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd]     h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd] Opening decoder h264
[vd] Looking at hwdec h264-vaapi-copy...
[vaapi] Initialized VAAPI: version 1.6
[vd] Trying hardware decoding via h264-vaapi-copy.
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
[vf] User filter list:
[vf]   (empty)
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vaapi_vld yuv420p
[vd] Codec profile: High (0x64)
[vd] Requesting pixfmt 'vaapi_vld' from decoder.
**v4l2-request: surface: calling v4l2_set_format
v4l2-request: context: calling v4l2_set_format
v4l2-request: Unable to set format for type 2: Device or resource busy
[ffmpeg/video] h264: Failed to create decode context: 1 (operation failed).
[ffmpeg/video] h264: Failed setup for format vaapi_vld: hwaccel initialisation returned error.**
[vd] Pixel formats supported by decoder: yuv420p yuv420p
[vd] Codec profile: High (0x64)
[vd] Requesting pixfmt 'yuv420p' from decoder.
[vd] Falling back to software decoding.
[vd] Detected 4 logical cores.
[vd] Requesting 5 threads for decoding.
[vd] DR failed - disabling.
[vd] Using software decoding.
[vd] Decoder format: 1280x720 yuv420p auto/auto/auto/auto/auto CL=mpeg2/4/h264

Any help would be appreciated.

Thanks,
Jagan.

Failed to decode mpeg4 (x264) video

Hello!

I'm using Orange Pi Plus 2 with Arch Linux (mainline 5.3.7-1-ARCH).
I've install libva-v4l2-request-git package.
and run vainfo, it display correct information.

vainfo: VA-API version: 1.5 (libva 2.5.0)
vainfo: Driver version: v4l2-request
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointVLD

so, I've trying decode MPEG4 video using VLC. Video is this file
and got this error (verbose log)

main debug: looking for hw decoder module matching "vaapi": 3 candidates
vaapi_drm error: profile(3) is not supported
main debug: no hw decoder modules matched

and I trying v4l2-request-test, mpeg2 is ok (log), but h264 is failed (log)

h264 preset is disabled some unknown reason, so I've turn on h264 using export CFLAGS=-DV4L2_PIX_FMT_H264_SLICE=1

How can I resolve this problem?
and It's have schedule for support GStreamer? I'm trying to porting OpenAuto to Sunxi boards.
Thanks!

Problems compiling libva-v4l2-request

Dear developers of the libva-v4l2-request,

I tried to compile your driver from a new fresh installed debian, configured with kernel 4.20.12 and also with headers installed and libva and libdrm in the version that you suggested, but I'm receiving this final message when ./autogen.sh finishes:

v4l2_request configuration summary:

VA-API version ................... : 1.4.0
VA-API drivers path .............. : /usr/lib/arm-linux-gnueabihf/dri
H.264 support .................... : no
H.265 support .................... : no
MPEG2 support .................... : no

So digging a little bit in configure, I concluded that libva driver checks in file linux/videodev2.h if V4L2_PIX_FMT_MPEG2_SLICE, V4L2_PIX_FMT_H264_SLICE and V4L2_PIX_FMT_HEVC_SLICE are defined.
My first conclusion was thinking that maybe linux headers weren't propertly, but after taking a look at: /usr/src/linux-headers-4.20.12/include/uapi/linux/videodev2.h I realized that correct headers were there...

What am I missing then? should I reference anywhere in your configure.ac file where linux headers reside?

I have also double checked that this file: /usr/include/linux/videodev2.h is diferent than the one in the linux headers installation path.

Thanks for your help,
Miguel Amez

FFmpeg with vaapi hardware decoder on Allwinner H3

I am trying to make the hardware decoder work with ffmpeg on orangepipcplus (allwinner H3). Operating system in Ubuntu 16.04.3 from Armbian.

Following these Sunxi-cedrus steps I built bootlin cedrus kernel and I have /dev/video0, /dev/media0 and /dev/dri/card0 all in the built kernel.

Also cloned and built both libva-utils, libva and libva-v4l2-request. Test application v4l2-request-test works fine.

Downloaded and build FFmpeg-4.1.3 with this flags ./configure --enable-vaapi . Then ran ffmpeg with command ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/card0 -i /root/big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4 -an output.mp4 -loglevel debug

ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --enable-vaapi
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
Splitting the commandline.
Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'vaapi'.
Reading option '-vaapi_device' ... matched as option 'vaapi_device' (set VAAPI hardware device (DRM path or X11 display name)) with argument '/dev/dri/card0'.
Reading option '-i' ... matched as input url with argument '/root/big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option 'output.mp4' ... matched as output url.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option vaapi_device (set VAAPI hardware device (DRM path or X11 display name)) with argument /dev/dri/card0.
[AVHWDeviceContext @ 0x145b280] Opened VA display via DRM device /dev/dri/card0.
[AVHWDeviceContext @ 0x145b280] libva: VA-API version 1.5.0
[AVHWDeviceContext @ 0x145b280] libva: va_getDriverName() returns -1
[AVHWDeviceContext @ 0x145b280] libva: User requested driver 'v4l2_request'
[AVHWDeviceContext @ 0x145b280] libva: Trying to open /usr/local/lib/dri/v4l2_request_drv_video.so
[AVHWDeviceContext @ 0x145b280] libva: Found init function __vaDriverInit_1_5
[AVHWDeviceContext @ 0x145b280] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x145b280] Initialised VAAPI connection: version 1.5
[AVHWDeviceContext @ 0x145b280] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x145b280] VAAPI driver: v4l2-request.
[AVHWDeviceContext @ 0x145b280] Driver not found in known nonstandard list, using standard behaviour.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url /root/big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4.
Applying option hwaccel (use HW accelerated decoding) with argument vaapi.
Successfully parsed a group of options.
Opening an input file: /root/big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4.
[NULL @ 0x14712f0] Opening '/root/big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4' for reading
[file @ 0x1471940] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14712f0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14712f0] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14712f0] Unknown dref type 0x206c7275 size 12
Last message repeated 3 times
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14712f0] Before avformat_find_stream_info() pos: 17960803 bytes read:58567 seeks:1 nb_streams:4
[h264 @ 0x1472420] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x1472420] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x1472420] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x1472420] Format yuv420p chosen by get_format().
[h264 @ 0x1472420] Reinit context to 864x480, pix_fmt: yuv420p
[h264 @ 0x1472420] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
Last message repeated 5 times
[aac @ 0x1478ca0] skip whole frame, skip left: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14712f0] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14712f0] After avformat_find_stream_info() pos: 293589 bytes read:354627 seeks:2 frames:14
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/root/big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: isommp423gp5
creation_time : 2011-08-04T02:50:53.000000Z
title : big_buck_bunny_480p_surround-fix.avi_002.AVI.MP4
artist : created with SUPER(C).v2011.bld.49
encoder : eRightSoft
comment : 10:51:04
Duration: 00:01:15.00, start: 0.000000, bitrate: 1915 kb/s
Stream #0:0(und), 13, 1/25: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 854x480 (864x480) [SAR 1:1 DAR 427:240], 0/1, 1814 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
Metadata:
creation_time : 2011-08-05T02:50:25.000000Z
handler_name : VideoHandler
Stream #0:1(und), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
Metadata:
creation_time : 2011-08-04T02:50:53.000000Z
handler_name : GPAC ISO Audio Handler
Stream #0:2(und), 0, 1/600: Data: none (mp4s / 0x7334706D), 0/1, 0 kb/s (default)
Metadata:
creation_time : 2011-08-04T02:50:57.000000Z
handler_name : GPAC MPEG-4 OD Handler
Stream #0:3(und), 0, 1/600: Data: none (mp4s / 0x7334706D), 0/1, 0 kb/s (default)
Metadata:
creation_time : 2011-08-04T02:50:57.000000Z
handler_name : GPAC MPEG-4 BIFS Handler
Successfully opened the file.
Parsing a group of options: output url output.mp4.
Applying option an (disable audio) with argument 1.
Successfully parsed a group of options.
Opening an output file: output.mp4.
File 'output.mp4' already exists. Overwrite ? [y/N] Y
[file @ 0x14769e0] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 4 logical cores
[h264 @ 0x148e2f0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x148e2f0] nal_unit_type: 8(PPS), nal_ref_idc: 3
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
[h264 @ 0x148e2f0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x148e2f0] Format vaapi_vld chosen by get_format().
[h264 @ 0x148e2f0] Format vaapi_vld requires hwaccel initialisation.
[h264 @ 0x148e2f0] Considering format 0x3231564e -> nv12.
[h264 @ 0x148e2f0] Picked nv12 (0x3231564e) as best match for yuv420p.
[AVHWFramesContext @ 0xb424b4d0] Created surface 0x4000000.
[AVHWFramesContext @ 0xb424b4d0] Direct mapping possible.
v4l2-request: Unable to set format for type 1: Device or resource busy
[AVHWFramesContext @ 0xb424b4d0] Failed to create surface: 1 (operation failed).
[h264 @ 0x148e2f0] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[h264 @ 0x148e2f0] Format vaapi_vld not usable, retrying get_format() without it.
[h264 @ 0x148e2f0] Format yuv420p chosen by get_format().
[h264 @ 0x148e2f0] Reinit context to 864x480, pix_fmt: yuv420p
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x15fe710] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x1569f00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x1550340] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x15dfb50] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[graph 0 input from stream 0:0 @ 0x145b110] Setting 'video_size' to value '854x480'
[graph 0 input from stream 0:0 @ 0x145b110] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x145b110] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x145b110] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x145b110] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x145b110] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x145b110] w:854 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[format @ 0x15fda20] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0x14784b0] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[mpeg4 @ 0x1475a60] intra_quant_bias = 0 inter_quant_bias = -64
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: isommp423gp5
comment : 10:51:04
title : big_buck_bunny_480p_surround-fix.avi_002.AVI.MP4
artist : created with SUPER(C).v2011.bld.49
encoder : Lavf58.20.100
Stream #0:0(und), 0, 1/12800: Video: mpeg4, 1 reference frame (mp4v / 0x7634706D), yuv420p(left), 854x480 [SAR 1:1 DAR 427:240], 0/1, q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
creation_time : 2011-08-05T02:50:25.000000Z
handler_name : VideoHandler
encoder : Lavc58.35.100 mpeg4
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
Clipping frame in rate conversion by 0.000008
[h264 @ 0x148e2f0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x15fe710] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x1569f00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x1550340] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x15dfb50] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x148e2f0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x15fe710] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
frame= 8 fps=0.0 q=7.8 Lsize= 107kB time=00:00:00.28 bitrate=3130.0kbits/s speed=0.998x
video:106kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.987936%
Input file #0 (/root/big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4):
Input stream #0:0 (video): 12 packets read (267476 bytes); 9 frames decoded;
Input stream #0:1 (audio): 0 packets read (0 bytes);
Input stream #0:2 (data): 0 packets read (0 bytes);
Input stream #0:3 (data): 0 packets read (0 bytes);
Total: 12 packets (267476 bytes) demuxed
Output file #0 (output.mp4):
Output stream #0:0 (video): 8 frames encoded; 8 packets muxed (108509 bytes);
Total: 8 packets (108509 bytes) muxed
9 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x1476a30] Statistics: 2 seeks, 4 writeouts
[AVIOContext @ 0x1479a90] Statistics: 354627 bytes read, 2 seeks

The important part in the log

[h264 @ 0x1523ca0] Format vaapi_vld chosen by get_format().
[h264 @ 0x1523ca0] Format vaapi_vld requires hwaccel initialisation.
[h264 @ 0x1523ca0] Considering format 0x3231564e -> nv12.
[h264 @ 0x1523ca0] Picked nv12 (0x3231564e) as best match for yuv420p.
[AVHWFramesContext @ 0xb424b4d0] Created surface 0x4000000.
[AVHWFramesContext @ 0xb424b4d0] Direct mapping possible.
v4l2-request: Unable to set format for type 1: Device or resource busy
[AVHWFramesContext @ 0xb424b4d0] Failed to create surface: 1 (operation failed).
[h264 @ 0x1523ca0] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[h264 @ 0x1523ca0] Format vaapi_vld not usable, retrying get_format() without it.

meson vdec support

The README only seems to mention this library being used with the Allwinner SoC's but I wonder if it should also work with the meson vdec kernel decoder used in Amlogic SoCs such as the S905X3?

Have you heard of anyone successfully testing it with an Amlogic SoC? If so, which kernel version was used?

Can't Compile

Hello

I have a raspberry pi 4 8GB model. with following details;

OS : Ubuntu 22.04 LTS 64 bit
Kernel : Linux pi-desktop 5.15.0-1014-raspi #16-Ubuntu SMP PREEMPT Thu Aug 25 09:50:55 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

I downloaded the zip file, extracted it and ran the ./autogen.sh file.

After successful execution of autogen, i ran "make" command and got following error;

make[2]: *** [Makefile:624: v4l2_request_drv_video_la-config.lo] Error 1
make[2]: Leaving directory '/home/pi/Downloads/libva-v4l2-request-dev-update_hevc_1/src'
make[1]: *** [Makefile:444: all] Error 2
make[1]: Leaving directory '/home/pi/Downloads/libva-v4l2-request-dev-update_hevc_1/src'
make: *** [Makefile:417: all-recursive] Error 1

how do i solve this error?

thanks
rex

compilation error: undeclared (first use in this function)..

Could you please help to resolve compilation issue. Thank you!

CC v4l2_request_drv_video_la-config.lo
config.c: In function ‘RequestQueryConfigProfiles’:
config.c:116:6: error: ‘V4L2_PIX_FMT_MPEG2_SLICE’ undeclared (first use in this function); did you mean ‘V4L2_PIX_FMT_MPEG2’?
V4L2_PIX_FMT_MPEG2_SLICE);
^~~~~~~~~~~~~~~~~~~~~~~~
V4L2_PIX_FMT_MPEG2
config.c:116:6: note: each undeclared identifier is reported only once for each function it appears in
config.c:124:6: error: ‘V4L2_PIX_FMT_H264_SLICE’ undeclared (first use in this function); did you mean ‘V4L2_PIX_FMT_H264_MVC’?
V4L2_PIX_FMT_H264_SLICE);
^~~~~~~~~~~~~~~~~~~~~~~
V4L2_PIX_FMT_H264_MVC
config.c:135:6: error: ‘V4L2_PIX_FMT_HEVC_SLICE’ undeclared (first use in this function); did you mean ‘V4L2_PIX_FMT_H264_SLICE’?
V4L2_PIX_FMT_HEVC_SLICE);
^~~~~~~~~~~~~~~~~~~~~~~
V4L2_PIX_FMT_H264_SLICE
Makefile:561: recipe for target 'v4l2_request_drv_video_la-config.lo' failed
make[2]: *** [v4l2_request_drv_video_la-config.lo] Error 1
make[2]: Leaving directory '/usr/src/libva-v4l2-request/src'
Makefile:393: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/libva-v4l2-request/src'
Makefile:393: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

gstreamer vaapi : No buffer space available

Hello,

I'm trying to play h264 video with gstreamer 1.18.4 following this : #20 but I'm getting:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'vaapidecode_h264-0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayEGL\)\ gldisplayegl0";
Got context from element 'vaapidecode_h264-0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayDRM\)\ vaapidisplaydrm1";
v4l2-request: Unable to enable stream: Invalid argument
v4l2-request: Unable to create buffer for type 1: No buffer space available
v4l2-request: Unable to create buffer for type 1: No buffer space available
v4l2-request: Unable to create buffer for type 1: No buffer space available
v4l2-request: Unable to create buffer for type 1: No buffer space available
v4l2-request: Unable to create buffer for type 1: No buffer space available

it seems it cannot allocated buffer (didn't check kernel source yet). Amy ideas what it can be ? Thanks.

P.S.: Using 5.14 kernel + github.com/noneucat/libva-v4l2-request.git and branch fix-kernel-5.14

Compilation errors with new tag release-2019.03

Hi Paul,

Following your indications I re-compiled the driver using tag release-2019.03 and fails during compilation. Take a look at the output:

root@prototipo:/home/projects/scripts/libva-v4l2-request# make
Making all in src
make[1]: se entra en el directorio '/home/projects/scripts/libva-v4l2-request/src'
make  all-am
make[2]: se entra en el directorio '/home/projects/scripts/libva-v4l2-request/src'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-config.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-config.Tpo -c -o v4l2_request_drv_video_la-con        fig.lo `test -f 'config.c' || echo './'`config.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-config.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-config.Tpo -c config.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-config.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from config.h:30,
                 from config.c:27:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-config.Tpo .deps/v4l2_request_drv_video_la-config.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-surface.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-surface.Tpo -c -o v4l2_request_drv_video_la-s        urface.lo `test -f 'surface.c' || echo './'`surface.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-surface.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-surface.Tpo -c surface.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-surfa        ce.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from context.h:30,
                 from request.h:32,
                 from surface.c:27:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-surface.Tpo .deps/v4l2_request_drv_video_la-surface.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-context.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-context.Tpo -c -o v4l2_request_drv_video_la-c        ontext.lo `test -f 'context.c' || echo './'`context.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-context.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-context.Tpo -c context.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-conte        xt.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from context.h:30,
                 from context.c:27:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-context.Tpo .deps/v4l2_request_drv_video_la-context.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-buffer.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-buffer.Tpo -c -o v4l2_request_drv_video_la-buf        fer.lo `test -f 'buffer.c' || echo './'`buffer.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-buffer.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-buffer.Tpo -c buffer.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-buffer.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from buffer.h:30,
                 from buffer.c:27:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-buffer.Tpo .deps/v4l2_request_drv_video_la-buffer.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-picture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-picture.Tpo -c -o v4l2_request_drv_video_la-p        icture.lo `test -f 'picture.c' || echo './'`picture.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-picture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-picture.Tpo -c picture.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-pictu        re.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from picture.h:30,
                 from picture.c:27:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-picture.Tpo .deps/v4l2_request_drv_video_la-picture.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-subpicture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-subpicture.Tpo -c -o v4l2_request_drv_vide        o_la-subpicture.lo `test -f 'subpicture.c' || echo './'`subpicture.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-subpicture.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-subpicture.Tpo -c subpicture.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video        _la-subpicture.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from context.h:30,
                 from request.h:32,
                 from subpicture.c:26:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-subpicture.Tpo .deps/v4l2_request_drv_video_la-subpicture.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-image.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-image.Tpo -c -o v4l2_request_drv_video_la-image        .lo `test -f 'image.c' || echo './'`image.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-image.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-image.Tpo -c image.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-image.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from image.h:30,
                 from image.c:27:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-image.Tpo .deps/v4l2_request_drv_video_la-image.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-utils.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-utils.Tpo -c -o v4l2_request_drv_video_la-utils        .lo `test -f 'utils.c' || echo './'`utils.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-utils.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-utils.Tpo -c utils.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-utils.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from /usr/include/va/va_backend.h:33,
                 from context.h:30,
                 from request.h:32,
                 from utils.c:30:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-utils.Tpo .deps/v4l2_request_drv_video_la-utils.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-video.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-video.Tpo -c -o v4l2_request_drv_video_la-video        .lo `test -f 'video.c' || echo './'`video.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-video.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-video.Tpo -c video.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-video.o
In file included from /usr/include/libdrm/drm.h:41,
                 from ../include/drm_fourcc.h:27,
                 from video.c:31:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-video.Tpo .deps/v4l2_request_drv_video_la-video.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-media.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-media.Tpo -c -o v4l2_request_drv_video_la-media        .lo `test -f 'media.c' || echo './'`media.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-media.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-media.Tpo -c media.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-media.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/media.h:27,
                 from media.c:31:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-media.Tpo .deps/v4l2_request_drv_video_la-media.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/        src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/ -MT v4l2_request_drv_video_la-v4l2.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-v4l2.Tpo -c -o v4l2_request_drv_video_la-v4l2.lo         `test -f 'v4l2.c' || echo './'`v4l2.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I/usr/include/libdrm -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6e3a9b05        3866-dirty/include/ -MT v4l2_request_drv_video_la-v4l2.lo -MD -MP -MF .deps/v4l2_request_drv_video_la-v4l2.Tpo -c v4l2.c  -fPIC -DPIC -o .libs/v4l2_request_drv_video_la-v4l2.o
In file included from /usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/videodev2.h:65,
                 from v4l2.c:30:
/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/Kernel        Headers" [-Wcpp]
 #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
  ^~~~~~~
mv -f .deps/v4l2_request_drv_video_la-v4l2.Tpo .deps/v4l2_request_drv_video_la-v4l2.Plo
/bin/bash ../libtool  --tag=CC   --mode=link gcc -I../include -I/usr/include/libdrm  -I/usr/src/linux-headers-5.0.0-g6e3a9b053866-dirty/include/uapi/ -I/usr/src/linux-headers-5.0.0-g6        e3a9b053866-dirty/include/ -module -avoid-version -no-undefined -Wl,--no-undefined  -o v4l2_request_drv_video.la -rpath /usr/lib/dri/ v4l2_request_drv_video_la-request.lo v4l2_request        _drv_video_la-object_heap.lo v4l2_request_drv_video_la-config.lo v4l2_request_drv_video_la-surface.lo v4l2_request_drv_video_la-context.lo v4l2_request_drv_video_la-buffer.lo v4l2_req        uest_drv_video_la-picture.lo v4l2_request_drv_video_la-subpicture.lo v4l2_request_drv_video_la-image.lo v4l2_request_drv_video_la-utils.lo tiled_yuv.lo v4l2_request_drv_video_la-video        .lo v4l2_request_drv_video_la-media.lo v4l2_request_drv_video_la-v4l2.lo v4l2_request_drv_video_la-mpeg2.lo v4l2_request_drv_video_la-h264.lo v4l2_request_drv_video_la-h265.lo -ldrm -        lva
libtool: link: gcc -shared  -fPIC -DPIC  .libs/v4l2_request_drv_video_la-request.o .libs/v4l2_request_drv_video_la-object_heap.o .libs/v4l2_request_drv_video_la-config.o .libs/v4l2_re        quest_drv_video_la-surface.o .libs/v4l2_request_drv_video_la-context.o .libs/v4l2_request_drv_video_la-buffer.o .libs/v4l2_request_drv_video_la-picture.o .libs/v4l2_request_drv_video_        la-subpicture.o .libs/v4l2_request_drv_video_la-image.o .libs/v4l2_request_drv_video_la-utils.o .libs/tiled_yuv.o .libs/v4l2_request_drv_video_la-video.o .libs/v4l2_request_drv_video_        la-media.o .libs/v4l2_request_drv_video_la-v4l2.o .libs/v4l2_request_drv_video_la-mpeg2.o .libs/v4l2_request_drv_video_la-h264.o .libs/v4l2_request_drv_video_la-h265.o   -ldrm -lva  -        Wl,--no-undefined   -Wl,-soname -Wl,v4l2_request_drv_video.so -o .libs/v4l2_request_drv_video.so
/usr/bin/ld: .libs/v4l2_request_drv_video_la-mpeg2.o: in function `mpeg2_set_controls':
/home/projects/scripts/libva-v4l2-request/src/mpeg2.c:109: undefined reference to `v4l2_timeval_to_ns'
/usr/bin/ld: /home/projects/scripts/libva-v4l2-request/src/mpeg2.c:117: undefined reference to `v4l2_timeval_to_ns'
/usr/bin/ld: .libs/v4l2_request_drv_video_la-h264.o: in function `h264_fill_dpb':
/home/projects/scripts/libva-v4l2-request/src/h264.c:195: undefined reference to `v4l2_timeval_to_ns'
/usr/bin/ld: .libs/v4l2_request_drv_video_la-h265.o: in function `h265_fill_slice_params':
/home/projects/scripts/libva-v4l2-request/src/h265.c:289: undefined reference to `v4l2_timeval_to_ns'
collect2: error: ld returned 1 exit status
Makefile:512: fallo en las instrucciones para el objetivo 'v4l2_request_drv_video.la'
make[2]: *** [v4l2_request_drv_video.la] Error 1
make[2]: se sale del directorio '/home/projects/scripts/libva-v4l2-request/src'
Makefile:427: fallo en las instrucciones para el objetivo 'all'
make[1]: *** [all] Error 2
make[1]: se sale del directorio '/home/projects/scripts/libva-v4l2-request/src'
Makefile:416: fallo en las instrucciones para el objetivo 'all-recursive'
make: *** [all-recursive] Error 1

Seems like v4l2_timeval_to_ns function is not available in linking time. I'm using kernel from tag release-2019.03 from https://github.com/bootlin/linux-cedrus re-compiled and installed in the system. Anything I'm missing?

thanks

DRM_FORMAT_MOD_ALLWINNER_MB32_TILED undeclared

Hi there,

it seems like videodev2.h is missing: DRM_FORMAT_MOD_ALLWINNER_MB32_TILED
So I can't compile.

Making all in src
make[1]: Entering directory '/home/user/workspace/allwinnerV3s/libva-v4l2-request/src'
make all-am
make[2]: Entering directory '/home/user/workspace/allwinnerV3s/libva-v4l2-request/src'
CC v4l2_request_drv_video_la-video.lo
video.c:54:20: error: ‘DRM_FORMAT_MOD_ALLWINNER_MB32_TILED’ undeclared here (not in a function); did you mean ‘DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED’?
.drm_modifier = DRM_FORMAT_MOD_ALLWINNER_MB32_TILED,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED
Makefile:624: recipe for target 'v4l2_request_drv_video_la-video.lo' failed
make[2]: *** [v4l2_request_drv_video_la-video.lo] Error 1
make[2]: Leaving directory '/home/user/workspace/allwinnerV3s/libva-v4l2-request/src'
Makefile:400: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/usr/workspace/allwinnerV3s/libva-v4l2-request/src'
Makefile:393: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

can't make on orangepi pc2

the error is
./configure: line 8738: syntax error near unexpected token `LIBVA,'

and when I comment these lines in configure file, it gives errors on making the library

Same behaviour running vlc with last tag release-2019.03

Sorry to inform about it, but I'm experiencing the same troubles with vlc:

[005008c8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[00488d40] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
libEGL warning: DRI2: failed to authenticate
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libEGL warning: DRI2: failed to authenticate
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No existe el fichero o el directorio
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No existe el fichero o el directorio
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No existe el fichero o el directorio
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No existe el fichero o el directorio
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
[005008c8] alsa audio output error: cannot open ALSA device "default": No existe el fichero o el directorio
[005008c8] main audio output error: module not functional
[006f3930] main decoder error: failed to create audio output
[b2c0ea50] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f15a70] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[b3b104a8] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f15a70] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[b3f9b930] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f15a70] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[0074fa08] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f16be0] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[006688c0] main decoder error: buffer deadlock prevented
[b2c02dc8] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f49e80] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[b3b104a8] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f49e80] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[b3f2f6a0] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f16be0] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[008c0d00] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f416d8] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[b2c13fb0] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f416d8] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[b3b100b8] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f83110] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))
[b3f29bb8] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[b3f396f8] main video output error: video output creation failed
[006688c0] main decoder error: failed to create video output
[mpeg2video @ 0xb3f01790] get_buffer() failed
[mpeg2video @ 0xb3f01790] thread_get_buffer() failed
[mpeg2video @ 0xb3f01790] get_buffer() failed (-1 (nil))

Anything I'm missing?

Thanks

"tiled_to_planar: symbol not found" runtime error on aarch64

issue

It seems I get a problem similar to #18. Although compilation runs fine, the same error is now thrown on runtime. Since the original issue was closed, I assume this is something new?
If aarch64 is not supported, it seems like a shame given this looks like the only immediate solution for vlc hw acceleration on most aarch64 platforms.

steps to reproduce:

on aarch64 device:

  1. compile and install
  2. run vlc and maki it use libva-v4l2-request

error log:

libva info: VA-API version 1.4.1
libva info: va_getDriverName() returns -1
libva info: User requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/dri/v4l2_request_drv_video.so
libva error: dlopen of /usr/lib/dri/v4l2_request_drv_video.so failed: Error relocating /usr/lib/dri/v4l2_request_drv_video.so: tiled_to_planar: symbol not found
libva info: va_openDriver() returns -1

need help with bug fixing

I know this library is deprecated but it is still a good solution for software with vaapi only support .

With some patches to the pbp-tools I can now e.g. stream my desktop or transcode files with ffmpeg.

Using the command

LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video1 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 ffmpeg -hwaccel vaapi -vaapi_device /dev/video1 -i big_buck_bunny_720p_h264.mov -an output.mp4 -loglevel verbose

produces a working file with speed=~2.33x but the result has frame glitches and artefacts.

Likewise with desktop streaming it seems that some frames are disordered but the result is recognizable.

(Old frames seem to merge periodically with new ones, which possibly means a surface/image/picture is not properly cleared or initialized)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.