mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2025-01-09 13:45:21 +00:00
600e246a94
Lakka 5.x Switch changes (#1853) Lakka v5.x switchroot 5.1.2 (#1871) Fix Switch Issue's in upstream 5.x (#1888) Minor Switch Changes (#1893) Lakka v5.x switch 3 (#1895) Lakka v5.x switch 4 (#1898) L4T: Xorg-server: Fix build issue (#1924) Switch: remove ra patch Lakka v5.x switch 6 (#1926) Cleanups, More LibreELEC Stuff, more permission fixes, Misc switch stuff. (#1930) Switch: U-Boot: bump version to 2024-NX02 (#1946) L4T/Ayn post-upstreaming fixes - retroarch_joypad_autoconfig: remove spaces from file names - retroarch: remove Switch specific patch merged upstream - libXv: move to L4T packages folder (package removed in upstream) - bring some packages from v5.x to L4T packages - ffmpeg: remove vulkan - remove stella core from Switch build (missing C++ headers) - Ayn/Odin: use proper kernel arg to not hide kernel messages in console - connman: add wpa_supplicant support back
76 lines
3.0 KiB
Diff
76 lines
3.0 KiB
Diff
From ffa9de21d7415d53f2f02b674438a41daaeee209 Mon Sep 17 00:00:00 2001
|
|
From: CTCaer <ctcaer@gmail.com>
|
|
Date: Sat, 5 Mar 2022 03:30:44 +0000
|
|
Subject: [PATCH 02/39] fftools/libavformat: Enforce nvv4l2
|
|
|
|
This enforces NVV4L2 even if user requests another codec.
|
|
Additionally, it forces nvv4l2 to go through software codecs first to get context if needed.
|
|
---
|
|
fftools/ffplay.c | 25 +++++++++++++++++++++++++
|
|
libavformat/demux.c | 13 +++++++++++++
|
|
2 files changed, 38 insertions(+)
|
|
|
|
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
|
|
index d6479aef5f..86f8425a15 100644
|
|
--- a/fftools/ffplay.c
|
|
+++ b/fftools/ffplay.c
|
|
@@ -2590,6 +2590,31 @@ static int stream_component_open(VideoState *is, int stream_index)
|
|
case AVMEDIA_TYPE_SUBTITLE: is->last_subtitle_stream = stream_index; forced_codec_name = subtitle_codec_name; break;
|
|
case AVMEDIA_TYPE_VIDEO : is->last_video_stream = stream_index; forced_codec_name = video_codec_name; break;
|
|
}
|
|
+
|
|
+#if CONFIG_NVV4L2
|
|
+ /* Reset requested decoder in order to enforce NVV4L2 if possible. */
|
|
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO && forced_codec_name) {
|
|
+ if (strcmp(forced_codec_name, "h264") == 0)
|
|
+ forced_codec_name = NULL;
|
|
+ else if (strcmp(forced_codec_name, "hevc") == 0)
|
|
+ forced_codec_name = NULL;
|
|
+ else if (strcmp(forced_codec_name, "mpeg2video") == 0)
|
|
+ forced_codec_name = NULL;
|
|
+ else if (strcmp(forced_codec_name, "mpeg4") == 0)
|
|
+ forced_codec_name = NULL;
|
|
+ else if (strcmp(forced_codec_name, "vp8") == 0)
|
|
+ forced_codec_name = NULL;
|
|
+ else if (strcmp(forced_codec_name, "vp9") == 0 &&
|
|
+ avctx->pix_fmt != AV_PIX_FMT_YUV420P10) {
|
|
+ forced_codec_name = NULL;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ /* NVV4L2 does not support VP9 with YUV420P10. */
|
|
+ if (!forced_codec_name && avctx->pix_fmt == AV_PIX_FMT_YUV420P10)
|
|
+ forced_codec_name = "vp9";
|
|
+#endif
|
|
+
|
|
if (forced_codec_name)
|
|
codec = avcodec_find_decoder_by_name(forced_codec_name);
|
|
if (!codec) {
|
|
diff --git a/libavformat/demux.c b/libavformat/demux.c
|
|
index b19ab86d08..ae60a819d5 100644
|
|
--- a/libavformat/demux.c
|
|
+++ b/libavformat/demux.c
|
|
@@ -77,6 +77,19 @@ static const AVCodec *find_probe_decoder(AVFormatContext *s, const AVStream *st,
|
|
if (codec_id == AV_CODEC_ID_H264)
|
|
return avcodec_find_decoder_by_name("h264");
|
|
#endif
|
|
+#if CONFIG_NVV4L2
|
|
+ /* NVV4L2 decoders depend on context init from base decoders */
|
|
+ if (codec_id == AV_CODEC_ID_HEVC)
|
|
+ return avcodec_find_decoder_by_name("hevc");
|
|
+ else if (codec_id == AV_CODEC_ID_MPEG2VIDEO)
|
|
+ return avcodec_find_decoder_by_name("mpeg2video");
|
|
+ else if (codec_id == AV_CODEC_ID_MPEG4)
|
|
+ return avcodec_find_decoder_by_name("mpeg4");
|
|
+ else if (codec_id == AV_CODEC_ID_VP8)
|
|
+ return avcodec_find_decoder_by_name("vp8");
|
|
+ else if (codec_id == AV_CODEC_ID_VP9)
|
|
+ return avcodec_find_decoder_by_name("vp9");
|
|
+#endif
|
|
|
|
codec = ff_find_decoder(s, st, codec_id);
|
|
if (!codec)
|
|
--
|
|
2.25.1
|
|
|