diff options
| author | Djihad Mahboubi <76681596+Djihads80@users.noreply.github.com> | 2026-11-01 17:25:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-01 17:25:14 +0100 |
| commit | 6957331b913bd50dfab106071e8c7ff4fa662599 (patch) | |
| tree | d4e4aea57d2b0198009576b16aa25fb4394dc176 /src/video_core/host1x | |
| parent | fce9c5fd25c66558eb8ed4e9e5ca9129589a5e7d (diff) | |
| parent | 959973a76abaa5444b4b300c37b6d8245ac89396 (diff) | |
Merge pull request #218 from Djihads80/fix/nx2-video-av1
nx2: play AV1 movies (FFmpeg with dav1d on Windows and Linux x86_64)
Diffstat (limited to 'src/video_core/host1x')
| -rw-r--r-- | src/video_core/host1x/codecs/codec.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/host1x/ffmpeg.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/host1x/nvdec_common.h | 1 | ||||
| -rw-r--r-- | src/video_core/host1x/nx2_video_decoder.cpp | 4 |
4 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/host1x/codecs/codec.cpp b/src/video_core/host1x/codecs/codec.cpp index 56332866e5..3cbef1d891 100644 --- a/src/video_core/host1x/codecs/codec.cpp +++ b/src/video_core/host1x/codecs/codec.cpp @@ -104,6 +104,8 @@ std::string_view Codec::GetCurrentCodecName() const { return "H265"; case Host1x::NvdecCommon::VideoCodec::VP9: return "VP9"; + case Host1x::NvdecCommon::VideoCodec::AV1: + return "AV1"; default: return "Unknown"; } diff --git a/src/video_core/host1x/ffmpeg.cpp b/src/video_core/host1x/ffmpeg.cpp index 676e5820a5..1af8307adc 100644 --- a/src/video_core/host1x/ffmpeg.cpp +++ b/src/video_core/host1x/ffmpeg.cpp @@ -163,6 +163,8 @@ Decoder::Decoder(Tegra::Host1x::NvdecCommon::VideoCodec codec) { return AV_CODEC_ID_VP8; case Tegra::Host1x::NvdecCommon::VideoCodec::VP9: return AV_CODEC_ID_VP9; + case Tegra::Host1x::NvdecCommon::VideoCodec::AV1: + return AV_CODEC_ID_AV1; default: UNIMPLEMENTED_MSG("Unknown codec {}", codec); return AV_CODEC_ID_NONE; diff --git a/src/video_core/host1x/nvdec_common.h b/src/video_core/host1x/nvdec_common.h index 0857a9f95c..26d7c86c98 100644 --- a/src/video_core/host1x/nvdec_common.h +++ b/src/video_core/host1x/nvdec_common.h @@ -22,6 +22,7 @@ enum class VideoCodec : u64 { VP8 = 0x5, H265 = 0x7, VP9 = 0x9, + AV1 = 0xA, }; struct Offset { diff --git a/src/video_core/host1x/nx2_video_decoder.cpp b/src/video_core/host1x/nx2_video_decoder.cpp index 7d185ca573..9b34bd84af 100644 --- a/src/video_core/host1x/nx2_video_decoder.cpp +++ b/src/video_core/host1x/nx2_video_decoder.cpp @@ -35,6 +35,10 @@ std::optional<NvdecCommon::VideoCodec> CodecFromMime(std::string_view mime) { if (mime.find("vp8") != std::string_view::npos) { return NvdecCommon::VideoCodec::VP8; } + // "video/av01" or "video/av1". FFmpeg decodes AV1 with libdav1d. + if (mime.find("av01") != std::string_view::npos || mime.find("av1") != std::string_view::npos) { + return NvdecCommon::VideoCodec::AV1; + } if (mime.find("avc") != std::string_view::npos || mime.find("264") != std::string_view::npos) { return NvdecCommon::VideoCodec::H264; } |
