Re: [FFmpeg-devel] [RFC 0/6] Add V4L2 request API hwaccels

2019-04-08 Thread Jonas Karlman
On 2019-04-08 22:41, Mark Thompson wrote:
> On 08/04/2019 21:09, Jonas Karlman wrote:
>> Hello,
>>
>> This is a request for comments on a new hwaccel using the V4L2 request API
>> that was created in collaboration with Jernej Skrabec.
>>
>> The V4L2 ctrls needed for statless decoding is not yet stable and reside in
>> private kernel headers. This patchset adds a copy of the kernel private 
>> headers
>> needed for the hwaccel to compile.
> When is the interface likely to become stable?

The V4L2 request API should already be considered stable and is part of linux 
uapi since v4.20.
Hwaccels make use of a function v4l2_timeval_to_ns that was added in v5.0, 
configure should check for this function.

The format ctrls needed for stateless decoding is however not stable and only 
MPEG-2 ctrls has been added
in a non-public kernel header at [1], it will hopefully be promoted to 
linux/videodev2.h uapi header in 2-4 linux versions.
H264 and HEVC ctrls is currently in review on linux-media mailing list and is 
even further away.

[1] https://github.com/torvalds/linux/blob/master/include/media/mpeg2-ctrls.h

>
> I don't think including kernel headers here is a good idea.  Please just 
> check for appropriate headers - if the user is capable of building this then 
> they can also install the headers for their kernel.

Sorry for not being more clear in my cover letter, the headers is not intended 
to be added to ffmpeg and was only added to patchset in order to be able to 
build working hwaccels.
The format ctrls has intentionally been put in non-public kernel headers that 
wont be installed into userspace since the ctrls currently is considered 
unstable.

My hope is to get early feedback on current code and to re-submit hwaccels once 
format ctrls have been promoted to public kernel uapi headers.

>
>
> If I wanted to buy a single Allwinner SBC to test this on, what should I get?

The Pine H64 "Model B" at [2] could be a good candidate.

The MPEG-2 hwaccel should also works on Rockchip RK3399 SBCs with rockchip vpu 
patchset at [3].
Support for Rockchip RK3288 SBCs requires additional patches at [4] and [5].

[2] https://www.pine64.org/?product_cat=model-b
[3] https://patchwork.kernel.org/project/linux-media/list/?series=87499
[4] 
https://github.com/Kwiboo/linux-rockchip/commit/1f78093e05c7360515a185f48b7c5cb8ba1e3e15
[5] 
https://github.com/Kwiboo/linux-rockchip/commit/9216da3f1521a0be5889235abe7fa093a4894160

Regards,
Jonas

>
> Thanks,
>
> - Mark
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [RFC 0/6] Add V4L2 request API hwaccels

2019-04-08 Thread Mark Thompson
On 08/04/2019 21:09, Jonas Karlman wrote:
> Hello,
> 
> This is a request for comments on a new hwaccel using the V4L2 request API
> that was created in collaboration with Jernej Skrabec.
> 
> The V4L2 ctrls needed for statless decoding is not yet stable and reside in
> private kernel headers. This patchset adds a copy of the kernel private 
> headers
> needed for the hwaccel to compile.

When is the interface likely to become stable?

I don't think including kernel headers here is a good idea.  Please just check 
for appropriate headers - if the user is capable of building this then they can 
also install the headers for their kernel.


If I wanted to buy a single Allwinner SBC to test this on, what should I get?

Thanks,

- Mark
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [RFC 0/6] Add V4L2 request API hwaccels

2019-04-08 Thread Jonas Karlman
Hello,

This is a request for comments on a new hwaccel using the V4L2 request API
that was created in collaboration with Jernej Skrabec.

The V4L2 ctrls needed for statless decoding is not yet stable and reside in
private kernel headers. This patchset adds a copy of the kernel private headers
needed for the hwaccel to compile.

Patch 1 contains a new buffer pool function av_buffer_pool_reclaim() that will
free all available buffers in a buffer pool. This can be used to save memory
when seeking in e.g. H264 where a new hwaccel instance may get init:ed before
the current one is uninit. VAAPI may alloc 20+20 buffers during such overlap.

Patch 2 adds common code used in the hwaccels, libudev is used to enumerate
media and video devices to locate devices that supports stateless decoding.

Patch 3-5 adds hwaccels for MPEG-2, H264 and HEVC.

Patch 6 adds private linux headers for V4L2 ctrls. These headers will not be
needed once stable ctrls is moved to linux uapi headers.

Use --enable-v4l2-request --enable-libdrm --enable-libudev to enable hwaccels.

Playback can be tested using mpv patched with [1] or kodi-gbm on
Allwinner (H3, H6, A64) devices using the cedrus driver running linux v5.0.x
with patches from [2].

This hwaccel has in one form or another been used in Jernej Skrabec's
LibreELEC community images for Allwinner at [4] since Dec 20th 2018.

Latest work-in-progress version of this patchset can be found at [3].

Any feedback is welcomed, thanks.

[1] https://github.com/mpv-player/mpv/pull/6461
[2] 
https://github.com/LibreELEC/LibreELEC.tv/tree/allwinner/projects/Allwinner/patches/linux
[3] https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel
[4] 
https://forum.libreelec.tv/thread/13228-early-community-images-for-h3-h6-and-a64/?postID=99416#post99416

Regards,
Jonas

---

Jernej Skrabec (3):
  Add V4L2 request API h264 hwaccel
  Add V4L2 request API hevc hwaccel
  Add and use private linux headers for V4L2 request API ctrls

Jonas Karlman (3):
  avutil: add av_buffer_pool_reclaim()
  Add common V4L2 request API code
  Add V4L2 request API mpeg2 hwaccel

 configure   |  17 +
 libavcodec/Makefile |   4 +
 libavcodec/h264-ctrls.h | 192 +++
 libavcodec/h264_slice.c |   4 +
 libavcodec/h264dec.c|   3 +
 libavcodec/hevc-ctrls.h | 197 +++
 libavcodec/hevcdec.c|  10 +
 libavcodec/hwaccel.h|   2 +
 libavcodec/hwaccels.h   |   3 +
 libavcodec/mpeg12dec.c  |   6 +
 libavcodec/mpeg2-ctrls.h|  82 +++
 libavcodec/v4l2_request.c   | 885 
 libavcodec/v4l2_request.h   |  65 +++
 libavcodec/v4l2_request_h264.c  | 369 +
 libavcodec/v4l2_request_hevc.c  | 392 ++
 libavcodec/v4l2_request_mpeg2.c | 155 ++
 libavutil/buffer.c  |  13 +
 libavutil/buffer.h  |   5 +
 18 files changed, 2404 insertions(+)
 create mode 100644 libavcodec/h264-ctrls.h
 create mode 100644 libavcodec/hevc-ctrls.h
 create mode 100644 libavcodec/mpeg2-ctrls.h
 create mode 100644 libavcodec/v4l2_request.c
 create mode 100644 libavcodec/v4l2_request.h
 create mode 100644 libavcodec/v4l2_request_h264.c
 create mode 100644 libavcodec/v4l2_request_hevc.c
 create mode 100644 libavcodec/v4l2_request_mpeg2.c

-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".