diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2026-05-03 19:14:57 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2026-05-03 19:14:57 +0000 |
| commit | ade6f2fbcbb4e9423e0518e10b7252f1a9424635 (patch) | |
| tree | e38ed966ca9e4ed76c062cdf7cebeb7853577b81 /media-video | |
| parent | 0da94736172ff69e26d6ba1f15f3ea8e5e3cf52c (diff) | |
| download | baldeagleos-repo-ade6f2fbcbb4e9423e0518e10b7252f1a9424635.tar.gz baldeagleos-repo-ade6f2fbcbb4e9423e0518e10b7252f1a9424635.tar.xz baldeagleos-repo-ade6f2fbcbb4e9423e0518e10b7252f1a9424635.zip | |
Adding metadata
Diffstat (limited to 'media-video')
| -rw-r--r-- | media-video/ffmpeg/Manifest | 1 | ||||
| -rw-r--r-- | media-video/ffmpeg/ffmpeg-8.1.ebuild | 18 | ||||
| -rw-r--r-- | media-video/ffmpeg/ffmpeg-9999.ebuild | 16 | ||||
| -rw-r--r-- | media-video/ffmpeg/files/60-dma-heap-ffmpeg.rules | 1 | ||||
| -rw-r--r-- | media-video/mpv/files/mpv-0.41.0-v4l2request.patch | 463 | ||||
| -rw-r--r-- | media-video/mpv/mpv-0.41.0-r2.ebuild (renamed from media-video/mpv/mpv-0.41.0-r1.ebuild) | 5 | ||||
| -rw-r--r-- | media-video/mpv/mpv-9999.ebuild | 5 |
7 files changed, 504 insertions, 5 deletions
diff --git a/media-video/ffmpeg/Manifest b/media-video/ffmpeg/Manifest index eee2e1083be3..3093cb7f093b 100644 --- a/media-video/ffmpeg/Manifest +++ b/media-video/ffmpeg/Manifest @@ -17,3 +17,4 @@ DIST ffmpeg-8.1.tar.xz.asc 520 BLAKE2B 5bbf0a315c5d8db98b6e1ffd98bc51577b0dd3150 DIST ffmpeg-rpi-6.1-r3.patch 800738 BLAKE2B b7e449ee5eec8b50a3b3bba233c5269f3b6845dbd18a619b844c841a97345ce24c7a5d7f4da05b08e3cb49668426b9044f3d3553d9c2ef3a50aec7199bfa3c09 SHA512 aeaf12afabf5f2192fb0b6ef47397d8477b109e49cee8c02a890d1656a27b1985c62c719ef72966d8c97b0709918233b65ea2e0ef988771507e4be137fcd9158 DIST ffmpeg-rpi-7.1.1.patch 847869 BLAKE2B efc3fef1810034b40eee1f637499171529fc6027c4fc0ef66da587c704a7742b454903aa060b21305e1d9a714eb31d96cd93f93d7cadb5815a0de22ac040b9e1 SHA512 a3f9013aec9b17e0fc1689d946e57e251a88eac3f9e7856d46fe9614fea29211feaf106d32a31f97c0e8c83c1685ca454c31f9bcb5dafb669a0933d683e581c8 DIST ffmpeg-rpi-8.0.patch 850353 BLAKE2B 17c97bc7f1eb1d514a946780cf9c96520d6f09061c5e3d4add323d36fa0ebefef337ed9d1e1398a07547e37218ba20fc9a9677d3fc8e0c65d3ae2b2a63556e8a SHA512 b4692d704a5256001147260e9345bf148e4f0fb492acefaf38793821a9bad53409702cb08eff039c82eeba8bc17cd5f994a463680e18ff3fcfae5905ae3335e9 +DIST ffmpeg-soc-8.1.patch 702636 BLAKE2B 425247f9f41d13d706a9f7de00c14ad5606987e10a01c320c0b6a9091e0f340d0c34230b1a945c53c8bddc472105a6a6dbd96421e11f855f9427d1c4f7342028 SHA512 f24ae85846d98b1bdcde0d80916236c83497042edd6eb6c7b7f650c4fe787a04b6aa56cee89afa1f115501dd65edf2b120e4997b02d5f8e8a4a46edfd5ead387 diff --git a/media-video/ffmpeg/ffmpeg-8.1.ebuild b/media-video/ffmpeg/ffmpeg-8.1.ebuild index 5bae4217f393..e5b144b71b32 100644 --- a/media-video/ffmpeg/ffmpeg-8.1.ebuild +++ b/media-video/ffmpeg/ffmpeg-8.1.ebuild @@ -3,9 +3,9 @@ EAPI=8 -inherit flag-o-matic multilib-minimal toolchain-funcs +inherit flag-o-matic multilib-minimal toolchain-funcs udev -FFMPEG_SOC_PATCH= +FFMPEG_SOC_PATCH=ffmpeg-soc-8.1.patch FFMPEG_SUBSLOT=60.62.62 # avutil.avcodec.avformat SONAME if [[ ${PV} == 9999 ]]; then @@ -500,7 +500,6 @@ multilib_src_configure() { in_iuse soc && use soc && conf+=( - --disable-epoxy --enable-libudev --enable-sand --enable-v4l2-request @@ -605,3 +604,16 @@ multilib_src_install() { in_iuse chromium && use chromium && multilib_is_native_abi && emake V=1 DESTDIR="${D}" install-libffmpeg } + +multilib_src_install_all() { + in_iuse soc && use soc && udev_dorules "${FILESDIR}"/60-dma-heap-ffmpeg.rules + einstalldocs +} + +pkg_postinst() { + in_iuse soc && use soc udev_reload +} + +pkg_postrm() { + in_iuse soc && use soc udev_reload +} diff --git a/media-video/ffmpeg/ffmpeg-9999.ebuild b/media-video/ffmpeg/ffmpeg-9999.ebuild index 4baa4ee8ffaa..2d5e6f142756 100644 --- a/media-video/ffmpeg/ffmpeg-9999.ebuild +++ b/media-video/ffmpeg/ffmpeg-9999.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit flag-o-matic multilib-minimal toolchain-funcs +inherit flag-o-matic multilib-minimal toolchain-funcs udev FFMPEG_SOC_PATCH= FFMPEG_SUBSLOT=60.62.62 # avutil.avcodec.avformat SONAME @@ -503,7 +503,6 @@ multilib_src_configure() { in_iuse soc && use soc && conf+=( - --disable-epoxy --enable-libudev --enable-sand --enable-v4l2-request @@ -608,3 +607,16 @@ multilib_src_install() { in_iuse chromium && use chromium && multilib_is_native_abi && emake V=1 DESTDIR="${D}" install-libffmpeg } + +multilib_src_install_all() { + in_iuse soc && use soc && udev_dorules "${FILESDIR}"/60-dma-heap-ffmpeg.rules + einstalldocs +} + +pkg_postinst() { + in_iuse soc && use soc udev_reload +} + +pkg_postrm() { + in_iuse soc && use soc udev_reload +} diff --git a/media-video/ffmpeg/files/60-dma-heap-ffmpeg.rules b/media-video/ffmpeg/files/60-dma-heap-ffmpeg.rules new file mode 100644 index 000000000000..36c6e5835c06 --- /dev/null +++ b/media-video/ffmpeg/files/60-dma-heap-ffmpeg.rules @@ -0,0 +1 @@ +SUBSYSTEM=="dma_heap", KERNEL=="linux,cma", GROUP="video", MODE="0660" diff --git a/media-video/mpv/files/mpv-0.41.0-v4l2request.patch b/media-video/mpv/files/mpv-0.41.0-v4l2request.patch new file mode 100644 index 000000000000..7cd10d17c073 --- /dev/null +++ b/media-video/mpv/files/mpv-0.41.0-v4l2request.patch @@ -0,0 +1,463 @@ +https://github.com/mpv-player/mpv/pull/14690 + +To try this, use the following command: + +mpv --vo=gpu --gpu-context=drm --hwdec=v4l2request --gpu-hwdec-interop=v4l2request-overlay --drm-draw-plane=overlay --drm-drmprime-video-plane=primary --profile=fast + +This will work for HEVC on the Raspberry Pi with RPi kernel 6.18. It should work +for HEVC and other codecs on other boards with a mainline kernel, assuming a VPU +driver is available, but you may need to tweak the arguments. + +-- Chewi + +From 1800573999b29a145de3eb303a0b51d840a6b3de Mon Sep 17 00:00:00 2001 +From: Jonas Karlman <jonas@kwiboo.se> +Date: Sun, 18 Aug 2024 17:42:14 -0700 +Subject: [PATCH 1/2] meson: add detection logic for v4l2request support + +We will probably adjust this to look for a specific libavutil version after +v4l2request support is merged upstream, but this check is fine for now. +--- a/meson.build ++++ b/meson.build +@@ -1447,6 +1447,16 @@ if features['ios-gl'] + sources += files('video/out/hwdec/hwdec_ios_gl.m') + endif + ++v4l2request = get_option('v4l2request').require( ++ cc.has_header_symbol('libavutil/hwcontext.h', ++ 'AV_HWDEVICE_TYPE_V4L2REQUEST', ++ dependencies: libavutil) ++) ++features += {'v4l2request': v4l2request.allowed()} ++if features['v4l2request'] ++ sources += files('video/v4l2request.c') ++endif ++ + libva = dependency('libva', version: '>= 1.1.0', required: get_option('vaapi')) + + vaapi_drm = dependency('libva-drm', version: '>= 1.1.0', required: +@@ -1921,6 +1931,7 @@ summary({'cocoa': features['cocoa'] and features['swift'], + 'libmpv': get_option('libmpv'), + 'lua': features['lua'], + 'opengl': features['gl'], ++ 'v4l2request': features['v4l2request'], + 'vulkan': features['vulkan'], + 'wayland': features['wayland'], + 'x11': features['x11']}, +--- a/meson.options ++++ b/meson.options +@@ -103,6 +103,7 @@ option('d3d-hwaccel', type: 'feature', value: 'auto', description: 'D3D11VA hwac + option('d3d9-hwaccel', type: 'feature', value: 'auto', description: 'DXVA2 hwaccel') + option('gl-dxinterop-d3d9', type: 'feature', value: 'auto', description: 'OpenGL/DirectX DXVA2 hwaccel') + option('ios-gl', type: 'feature', value: 'auto', description: 'iOS OpenGL ES interop support') ++option('v4l2request', type: 'feature', value: 'auto', description: 'V4L2 Request API hwaccel') + option('videotoolbox-gl', type: 'feature', value: 'auto', description: 'Videotoolbox with OpenGL') + option('videotoolbox-pl', type: 'feature', value: 'auto', description: 'Videotoolbox with libplacebo') + + +From beb3771179b45096702c0b15704bf5b0ca5f9d61 Mon Sep 17 00:00:00 2001 +From: Philip Langdale <philipl@overt.org> +Date: Sun, 18 Aug 2024 17:43:41 -0700 +Subject: [PATCH 2/2] vo: hwdec: drmprime: add separate hwdecs for v4l2request + +With all the machinery in place, we can now add the v4l2request hwdecs with a +different hw device type, and a different initialisation path. This applies to +both the drmprime and drmprime_overlay hwdecs. + +At the moment, the device initialisation is done in the bare minimum way, but +it can be extended to take a device path (for example) if that makes sense as +we better understand what meaningful configuration will be. + +Co-authored-by: Jonas Karlman <jonas@kwiboo.se> +--- a/video/hwdec.c ++++ b/video/hwdec.c +@@ -125,6 +125,9 @@ static const struct hwcontext_fns *const hwcontext_fns[] = { + #if HAVE_DRM + &hwcontext_fns_drmprime, + #endif ++#if HAVE_V4L2REQUEST ++ &hwcontext_fns_v4l2request, ++#endif + #if HAVE_VAAPI + &hwcontext_fns_vaapi, + #endif +--- a/video/hwdec.h ++++ b/video/hwdec.h +@@ -119,6 +119,7 @@ extern const struct hwcontext_fns hwcontext_fns_cuda; + extern const struct hwcontext_fns hwcontext_fns_d3d11; + extern const struct hwcontext_fns hwcontext_fns_drmprime; + extern const struct hwcontext_fns hwcontext_fns_dxva2; ++extern const struct hwcontext_fns hwcontext_fns_v4l2request; + extern const struct hwcontext_fns hwcontext_fns_vaapi; + extern const struct hwcontext_fns hwcontext_fns_vdpau; + +--- a/video/out/gpu/hwdec.c ++++ b/video/out/gpu/hwdec.c +@@ -38,6 +38,8 @@ extern const struct ra_hwdec_driver ra_hwdec_drmprime; + extern const struct ra_hwdec_driver ra_hwdec_drmprime_overlay; + extern const struct ra_hwdec_driver ra_hwdec_aimagereader; + extern const struct ra_hwdec_driver ra_hwdec_vulkan; ++extern const struct ra_hwdec_driver ra_hwdec_v4l2request; ++extern const struct ra_hwdec_driver ra_hwdec_v4l2request_overlay; + + const struct ra_hwdec_driver *const ra_hwdec_drivers[] = { + #if HAVE_D3D_HWACCEL +@@ -73,6 +75,10 @@ const struct ra_hwdec_driver *const ra_hwdec_drivers[] = { + &ra_hwdec_drmprime, + &ra_hwdec_drmprime_overlay, + #endif ++#if HAVE_V4L2REQUEST ++ &ra_hwdec_v4l2request, ++ &ra_hwdec_v4l2request_overlay, ++#endif + #if HAVE_ANDROID_MEDIA_NDK + &ra_hwdec_aimagereader, + #endif +--- a/video/out/hwdec/hwdec_drmprime.c ++++ b/video/out/hwdec/hwdec_drmprime.c +@@ -77,7 +77,7 @@ static const char *forked_pix_fmt_names[] = { + "rpi4_10", + }; + +-static int init(struct ra_hwdec *hw) ++static int pre_init(struct ra_hwdec *hw) + { + struct priv_owner *p = hw->priv; + +@@ -92,36 +92,12 @@ static int init(struct ra_hwdec *hw) + return -1; + } + +- /* +- * The drm_params resource is not provided when using X11 or Wayland, but +- * there are extensions that supposedly provide this information from the +- * drivers. Not properly documented. Of course. +- */ +- mpv_opengl_drm_params_v2 *params = ra_get_native_resource(hw->ra_ctx->ra, +- "drm_params_v2"); +- +- /* +- * Respect drm_device option, so there is a way to control this when not +- * using a DRM gpu context. If drm_params_v2 are present, they will already +- * respect this option. +- */ +- void *tmp = talloc_new(NULL); +- struct drm_opts *drm_opts = mp_get_config_group(tmp, hw->global, &drm_conf); +- const char *opt_path = drm_opts->device_path; +- +- const char *device_path = params && params->render_fd > -1 ? +- drmGetRenderDeviceNameFromFd(params->render_fd) : +- opt_path ? opt_path : "/dev/dri/renderD128"; +- MP_VERBOSE(hw, "Using DRM device: %s\n", device_path); ++ return 0; ++} + +- int ret = av_hwdevice_ctx_create(&p->hwctx.av_device_ref, +- AV_HWDEVICE_TYPE_DRM, +- device_path, NULL, 0); +- talloc_free(tmp); +- if (ret != 0) { +- MP_VERBOSE(hw, "Failed to create hwdevice_ctx: %s\n", av_err2str(ret)); +- return -1; +- } ++static int post_init(struct ra_hwdec *hw) ++{ ++ struct priv_owner *p = hw->priv; + + /* + * At the moment, there is no way to discover compatible formats +@@ -154,6 +130,75 @@ static int init(struct ra_hwdec *hw) + return 0; + } + ++static int init_drmprime(struct ra_hwdec *hw) ++{ ++ struct priv_owner *p = hw->priv; ++ ++ int ret = pre_init(hw); ++ if (ret < 0) ++ return ret; ++ ++ /* ++ * The drm_params resource is not provided when using X11 or Wayland, but ++ * there are extensions that supposedly provide this information from the ++ * drivers. Not properly documented. Of course. ++ */ ++ mpv_opengl_drm_params_v2 *params = ra_get_native_resource(hw->ra_ctx->ra, ++ "drm_params_v2"); ++ ++ /* ++ * Respect drm_device option, so there is a way to control this when not ++ * using a DRM gpu context. If drm_params_v2 are present, they will already ++ * respect this option. ++ */ ++ void *tmp = talloc_new(NULL); ++ struct drm_opts *drm_opts = mp_get_config_group(tmp, hw->global, &drm_conf); ++ const char *opt_path = drm_opts->device_path; ++ ++ const char *device_path = params && params->render_fd > -1 ? ++ drmGetRenderDeviceNameFromFd(params->render_fd) : ++ opt_path ? opt_path : "/dev/dri/renderD128"; ++ MP_VERBOSE(hw, "Using DRM device: %s\n", device_path); ++ ++ ret = av_hwdevice_ctx_create(&p->hwctx.av_device_ref, ++ AV_HWDEVICE_TYPE_DRM, ++ device_path, NULL, 0); ++ talloc_free(tmp); ++ if (ret < 0) { ++ MP_VERBOSE(hw, "Failed to create hwdevice_ctx: %s\n", av_err2str(ret)); ++ return ret; ++ } ++ ++ return post_init(hw); ++} ++ ++#if HAVE_V4L2REQUEST ++static int init_v4l2request(struct ra_hwdec *hw) ++{ ++ struct priv_owner *p = hw->priv; ++ ++ int ret = pre_init(hw); ++ if (ret < 0) ++ return ret; ++ ++ /* ++ * AVCodecHWConfig contains a combo of a pixel format and hwdevice type, ++ * correct type must be created here or hwaccel will fail. ++ * ++ * FIXME: Create hwdevice based on type in AVCodecHWConfig ++ */ ++ ret = av_hwdevice_ctx_create(&p->hwctx.av_device_ref, ++ AV_HWDEVICE_TYPE_V4L2REQUEST, ++ NULL, NULL, 0); ++ if (ret < 0) { ++ MP_VERBOSE(hw, "Failed to create hwdevice_ctx: %s\n", av_err2str(ret)); ++ return ret; ++ } ++ ++ return post_init(hw); ++} ++#endif ++ + static void mapper_unmap(struct ra_hwdec_mapper *mapper) + { + struct priv_owner *p_owner = mapper->owner->priv; +@@ -308,7 +353,7 @@ const struct ra_hwdec_driver ra_hwdec_drmprime = { + .priv_size = sizeof(struct priv_owner), + .imgfmts = {IMGFMT_DRMPRIME, 0}, + .device_type = AV_HWDEVICE_TYPE_DRM, +- .init = init, ++ .init = init_drmprime, + .uninit = uninit, + .mapper = &(const struct ra_hwdec_mapper_driver){ + .priv_size = sizeof(struct dmabuf_interop_priv), +@@ -318,3 +363,21 @@ const struct ra_hwdec_driver ra_hwdec_drmprime = { + .unmap = mapper_unmap, + }, + }; ++ ++#if HAVE_V4L2REQUEST ++const struct ra_hwdec_driver ra_hwdec_v4l2request = { ++ .name = "v4l2request", ++ .priv_size = sizeof(struct priv_owner), ++ .imgfmts = {IMGFMT_DRMPRIME, 0}, ++ .device_type = AV_HWDEVICE_TYPE_V4L2REQUEST, ++ .init = init_v4l2request, ++ .uninit = uninit, ++ .mapper = &(const struct ra_hwdec_mapper_driver){ ++ .priv_size = sizeof(struct dmabuf_interop_priv), ++ .init = mapper_init, ++ .uninit = mapper_uninit, ++ .map = mapper_map, ++ .unmap = mapper_unmap, ++ }, ++}; ++#endif +--- a/video/out/hwdec/hwdec_drmprime_overlay.c ++++ b/video/out/hwdec/hwdec_drmprime_overlay.c +@@ -246,7 +246,7 @@ static void uninit(struct ra_hwdec *hw) + } + } + +-static int init(struct ra_hwdec *hw) ++static int pre_init(struct ra_hwdec *hw) + { + struct priv *p = hw->priv; + int draw_plane, drmprime_video_plane; +@@ -267,15 +267,15 @@ static int init(struct ra_hwdec *hw) + drm_params->connector_id, draw_plane, drmprime_video_plane); + if (!p->ctx) { + mp_err(p->log, "Failed to retrieve DRM atomic context.\n"); +- goto err; ++ return -1; + } + if (!p->ctx->drmprime_video_plane) { + mp_warn(p->log, "No drmprime video plane. You might need to specify it manually using --drm-drmprime-video-plane\n"); +- goto err; ++ return -1; + } + } else { + mp_verbose(p->log, "Failed to retrieve DRM fd from native display.\n"); +- goto err; ++ return -1; + } + + drmModeCrtcPtr crtc; +@@ -289,7 +289,7 @@ static int init(struct ra_hwdec *hw) + uint64_t has_prime; + if (drmGetCap(p->ctx->fd, DRM_CAP_PRIME, &has_prime) < 0) { + MP_ERR(hw, "Card does not support prime handles.\n"); +- goto err; ++ return -1; + } + + if (has_prime) { +@@ -298,19 +298,67 @@ static int init(struct ra_hwdec *hw) + + disable_video_plane(hw); + ++ return 0; ++} ++ ++static int init_drmprime(struct ra_hwdec *hw) ++{ ++ struct priv *p = hw->priv; ++ ++ int ret = pre_init(hw); ++ if (ret < 0) ++ goto err; ++ + p->hwctx = (struct mp_hwdec_ctx) { + .driver_name = hw->driver->name, + .hw_imgfmt = IMGFMT_DRMPRIME, + }; + + char *device = drmGetDeviceNameFromFd2(p->ctx->fd); +- int ret = av_hwdevice_ctx_create(&p->hwctx.av_device_ref, +- AV_HWDEVICE_TYPE_DRM, device, NULL, 0); ++ ret = av_hwdevice_ctx_create(&p->hwctx.av_device_ref, ++ AV_HWDEVICE_TYPE_DRM, device, NULL, 0); + + if (device) + free(device); + +- if (ret != 0) { ++ if (ret < 0) { ++ MP_VERBOSE(hw, "Failed to create hwdevice_ctx: %s\n", av_err2str(ret)); ++ goto err; ++ } ++ ++ hwdec_devices_add(hw->devs, &p->hwctx); ++ ++ return 0; ++ ++err: ++ uninit(hw); ++ return ret; ++} ++ ++#if HAVE_V4L2REQUEST ++static int init_v4l2request(struct ra_hwdec *hw) ++{ ++ struct priv *p = hw->priv; ++ ++ int ret = pre_init(hw); ++ if (ret < 0) ++ goto err; ++ ++ p->hwctx = (struct mp_hwdec_ctx) { ++ .driver_name = hw->driver->name, ++ .hw_imgfmt = IMGFMT_DRMPRIME, ++ }; ++ ++ /* ++ * AVCodecHWConfig contains a combo of a pixel format and hwdevice type, ++ * correct type must be created here or hwaccel will fail. ++ * ++ * FIXME: Create hwdevice based on type in AVCodecHWConfig ++ */ ++ ret = av_hwdevice_ctx_create(&p->hwctx.av_device_ref, ++ AV_HWDEVICE_TYPE_V4L2REQUEST, ++ NULL, NULL, 0); ++ if (ret < 0) { + MP_VERBOSE(hw, "Failed to create hwdevice_ctx: %s\n", av_err2str(ret)); + goto err; + } +@@ -321,15 +369,28 @@ static int init(struct ra_hwdec *hw) + + err: + uninit(hw); +- return -1; ++ return ret; + } ++#endif + + const struct ra_hwdec_driver ra_hwdec_drmprime_overlay = { + .name = "drmprime-overlay", + .priv_size = sizeof(struct priv), + .imgfmts = {IMGFMT_DRMPRIME, 0}, + .device_type = AV_HWDEVICE_TYPE_DRM, +- .init = init, ++ .init = init_drmprime, ++ .overlay_frame = overlay_frame, ++ .uninit = uninit, ++}; ++ ++#if HAVE_V4L2REQUEST ++const struct ra_hwdec_driver ra_hwdec_v4l2request_overlay = { ++ .name = "v4l2request-overlay", ++ .priv_size = sizeof(struct priv), ++ .imgfmts = {IMGFMT_DRMPRIME, 0}, ++ .device_type = AV_HWDEVICE_TYPE_V4L2REQUEST, ++ .init = init_v4l2request, + .overlay_frame = overlay_frame, + .uninit = uninit, + }; ++#endif +--- a/video/out/vo_dmabuf_wayland.c ++++ b/video/out/vo_dmabuf_wayland.c +@@ -861,6 +861,7 @@ static int preinit(struct vo *vo) + // Initialize all possible hwdec drivers. + ra_hwdec_ctx_init(&p->hwdec_ctx, vo->hwdec_devs, "vaapi", false); + ra_hwdec_ctx_init(&p->hwdec_ctx, vo->hwdec_devs, "drmprime", false); ++ ra_hwdec_ctx_init(&p->hwdec_ctx, vo->hwdec_devs, "v4l2request", false); + + p->src = (struct mp_rect){0, 0, 0, 0}; + return 0; +--- /dev/null ++++ b/video/v4l2request.c +@@ -0,0 +1,34 @@ ++/* ++ * This file is part of mpv. ++ * ++ * mpv is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * mpv is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with mpv. If not, see <http://www.gnu.org/licenses/>. ++ */ ++ ++#include <libavutil/hwcontext.h> ++ ++#include "hwdec.h" ++ ++static struct AVBufferRef *v4l2request_create_standalone(struct mpv_global *global, ++ struct mp_log *log, struct hwcontext_create_dev_params *params) ++{ ++ AVBufferRef* ref = NULL; ++ av_hwdevice_ctx_create(&ref, AV_HWDEVICE_TYPE_V4L2REQUEST, NULL, NULL, 0); ++ ++ return ref; ++} ++ ++const struct hwcontext_fns hwcontext_fns_v4l2request = { ++ .av_hwdevice_type = AV_HWDEVICE_TYPE_V4L2REQUEST, ++ .create_dev = v4l2request_create_standalone, ++}; diff --git a/media-video/mpv/mpv-0.41.0-r1.ebuild b/media-video/mpv/mpv-0.41.0-r2.ebuild index 8c83a0d3a51f..7b47fc0f852b 100644 --- a/media-video/mpv/mpv-0.41.0-r1.ebuild +++ b/media-video/mpv/mpv-0.41.0-r2.ebuild @@ -128,6 +128,10 @@ BDEPEND=" wayland? ( dev-util/wayland-scanner ) " +PATCHES=( + "${FILESDIR}"/${PN}-0.41.0-v4l2request.patch +) + pkg_setup() { use lua && lua-single_pkg_setup python-single-r1_pkg_setup @@ -204,6 +208,7 @@ src_configure() { # hardware decoding $(meson_feature nvenc cuda-hwaccel) + $(meson_feature soc v4l2request) $(meson_feature vaapi) $(meson_feature vdpau) ) diff --git a/media-video/mpv/mpv-9999.ebuild b/media-video/mpv/mpv-9999.ebuild index 7d0b341344ea..1bef5e7c02b5 100644 --- a/media-video/mpv/mpv-9999.ebuild +++ b/media-video/mpv/mpv-9999.ebuild @@ -129,6 +129,10 @@ BDEPEND=" wayland? ( >=dev-util/wayland-scanner-1.23 ) " +PATCHES=( + "${FILESDIR}"/${PN}-0.41.0-v4l2request.patch +) + pkg_setup() { use lua && lua-single_pkg_setup python-single-r1_pkg_setup @@ -206,6 +210,7 @@ src_configure() { # hardware decoding $(meson_feature nvenc cuda-hwaccel) + $(meson_feature soc v4l2request) $(meson_feature vaapi) $(meson_feature vdpau) ) |
