mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-05 04:19:57 +00:00
eb67a45ca8
This commit aims to implement the NVDEC (Nvidia Decoder) functionality, with video frame decoding being handled by the FFmpeg library. The process begins with Ioctl commands being sent to the NVDEC and VIC (Video Image Composer) emulated devices. These allocate the necessary GPU buffers for the frame data, along with providing information on the incoming video data. A Submit command then signals the GPU to process and decode the frame data. To decode the frame, the respective codec's header must be manually composed from the information provided by NVDEC, then sent with the raw frame data to the ffmpeg library. Currently, H264 and VP9 are supported, with VP9 having some minor artifacting issues related mainly to the reference frame composition in its uncompressed header. Async GPU is not properly implemented at the moment. Co-Authored-By: David <25727384+ogniK5377@users.noreply.github.com>
101 lines
2.5 KiB
CMake
101 lines
2.5 KiB
CMake
# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil)
|
|
# Once done this will define
|
|
#
|
|
# FFMPEG_FOUND - system has ffmpeg or libav
|
|
# FFMPEG_INCLUDE_DIR - the ffmpeg include directory
|
|
# FFMPEG_LIBRARIES - Link these to use ffmpeg
|
|
# FFMPEG_LIBAVCODEC
|
|
# FFMPEG_LIBAVFORMAT
|
|
# FFMPEG_LIBAVUTIL
|
|
#
|
|
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
|
|
# Modified for other libraries by Lasse Kärkkäinen <tronic>
|
|
# Modified for Hedgewars by Stepik777
|
|
# Modified for FFmpeg-example Tuukka Pasanen 2018
|
|
# Modified for yuzu toastUnlimted 2020
|
|
#
|
|
# Redistribution and use is allowed according to the terms of the New
|
|
# BSD license.
|
|
#
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(FFMPEG
|
|
FOUND_VAR FFMPEG_FOUND
|
|
REQUIRED_VARS
|
|
FFMPEG_LIBRARY
|
|
FFMPEG_INCLUDE_DIR
|
|
VERSION_VAR FFMPEG_VERSION
|
|
)
|
|
|
|
if(FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|
|
# in cache already
|
|
set(FFMPEG_FOUND TRUE)
|
|
else()
|
|
# use pkg-config to get the directories and then use these values
|
|
# in the FIND_PATH() and FIND_LIBRARY() calls
|
|
find_package(PkgConfig)
|
|
if(PKG_CONFIG_FOUND)
|
|
pkg_check_modules(_FFMPEG_AVCODEC libavcodec)
|
|
pkg_check_modules(_FFMPEG_AVUTIL libavutil)
|
|
pkg_check_modules(_FFMPEG_SWSCALE libswscale)
|
|
endif()
|
|
|
|
find_path(FFMPEG_AVCODEC_INCLUDE_DIR
|
|
NAMES libavcodec/avcodec.h
|
|
PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS}
|
|
/usr/include
|
|
/usr/local/include
|
|
/opt/local/include
|
|
/sw/include
|
|
PATH_SUFFIXES ffmpeg libav)
|
|
|
|
find_library(FFMPEG_LIBAVCODEC
|
|
NAMES avcodec
|
|
PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS}
|
|
/usr/lib
|
|
/usr/local/lib
|
|
/opt/local/lib
|
|
/sw/lib)
|
|
|
|
find_library(FFMPEG_LIBAVUTIL
|
|
NAMES avutil
|
|
PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS}
|
|
/usr/lib
|
|
/usr/local/lib
|
|
/opt/local/lib
|
|
/sw/lib)
|
|
|
|
find_library(FFMPEG_LIBSWSCALE
|
|
NAMES swscale
|
|
PATHS ${_FFMPEG_SWSCALE_LIBRARY_DIRS}
|
|
/usr/lib
|
|
/usr/local/lib
|
|
/opt/local/lib
|
|
/sw/lib)
|
|
|
|
if(FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVUTIL AND FFMPEG_LIBSWSCALE)
|
|
set(FFMPEG_FOUND TRUE)
|
|
endif()
|
|
|
|
if(FFMPEG_FOUND)
|
|
set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR})
|
|
set(FFMPEG_LIBRARIES
|
|
${FFMPEG_LIBAVCODEC}
|
|
${FFMPEG_LIBAVUTIL}
|
|
${FFMPEG_LIBSWSCALE})
|
|
endif()
|
|
|
|
if(FFMPEG_FOUND)
|
|
if(NOT FFMPEG_FIND_QUIETLY)
|
|
message(STATUS
|
|
"Found FFMPEG or Libav: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}")
|
|
endif()
|
|
else()
|
|
if(FFMPEG_FIND_REQUIRED)
|
|
message(FATAL_ERROR
|
|
"Could not find libavcodec or libavutil or libswscale")
|
|
endif()
|
|
endif()
|
|
endif()
|