summaryrefslogtreecommitdiff
path: root/externals
diff options
context:
space:
mode:
authorGravatar ameerj2020-10-26 23:07:36 -0400
committerGravatar ameerj2020-10-26 23:07:36 -0400
commiteb67a45ca82bc01ac843c853fd3c17f2a90e0250 (patch)
tree11e78a1b728ef0a608fae43d966b613eb4e6d58a /externals
parentMerge pull request #4827 from lioncash/trunc (diff)
downloadyuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.gz
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.xz
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.zip
video_core: NVDEC Implementation
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>
Diffstat (limited to 'externals')
-rw-r--r--externals/find-modules/FindFFmpeg.cmake100
1 files changed, 100 insertions, 0 deletions
diff --git a/externals/find-modules/FindFFmpeg.cmake b/externals/find-modules/FindFFmpeg.cmake
new file mode 100644
index 000000000..77b331e00
--- /dev/null
+++ b/externals/find-modules/FindFFmpeg.cmake
@@ -0,0 +1,100 @@
1# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil)
2# Once done this will define
3#
4# FFMPEG_FOUND - system has ffmpeg or libav
5# FFMPEG_INCLUDE_DIR - the ffmpeg include directory
6# FFMPEG_LIBRARIES - Link these to use ffmpeg
7# FFMPEG_LIBAVCODEC
8# FFMPEG_LIBAVFORMAT
9# FFMPEG_LIBAVUTIL
10#
11# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
12# Modified for other libraries by Lasse Kärkkäinen <tronic>
13# Modified for Hedgewars by Stepik777
14# Modified for FFmpeg-example Tuukka Pasanen 2018
15# Modified for yuzu toastUnlimted 2020
16#
17# Redistribution and use is allowed according to the terms of the New
18# BSD license.
19#
20
21include(FindPackageHandleStandardArgs)
22
23find_package_handle_standard_args(FFMPEG
24 FOUND_VAR FFMPEG_FOUND
25 REQUIRED_VARS
26 FFMPEG_LIBRARY
27 FFMPEG_INCLUDE_DIR
28 VERSION_VAR FFMPEG_VERSION
29)
30
31if(FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
32 # in cache already
33 set(FFMPEG_FOUND TRUE)
34else()
35 # use pkg-config to get the directories and then use these values
36 # in the FIND_PATH() and FIND_LIBRARY() calls
37 find_package(PkgConfig)
38 if(PKG_CONFIG_FOUND)
39 pkg_check_modules(_FFMPEG_AVCODEC libavcodec)
40 pkg_check_modules(_FFMPEG_AVUTIL libavutil)
41 pkg_check_modules(_FFMPEG_SWSCALE libswscale)
42 endif()
43
44 find_path(FFMPEG_AVCODEC_INCLUDE_DIR
45 NAMES libavcodec/avcodec.h
46 PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS}
47 /usr/include
48 /usr/local/include
49 /opt/local/include
50 /sw/include
51 PATH_SUFFIXES ffmpeg libav)
52
53 find_library(FFMPEG_LIBAVCODEC
54 NAMES avcodec
55 PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS}
56 /usr/lib
57 /usr/local/lib
58 /opt/local/lib
59 /sw/lib)
60
61 find_library(FFMPEG_LIBAVUTIL
62 NAMES avutil
63 PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS}
64 /usr/lib
65 /usr/local/lib
66 /opt/local/lib
67 /sw/lib)
68
69 find_library(FFMPEG_LIBSWSCALE
70 NAMES swscale
71 PATHS ${_FFMPEG_SWSCALE_LIBRARY_DIRS}
72 /usr/lib
73 /usr/local/lib
74 /opt/local/lib
75 /sw/lib)
76
77 if(FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVUTIL AND FFMPEG_LIBSWSCALE)
78 set(FFMPEG_FOUND TRUE)
79 endif()
80
81 if(FFMPEG_FOUND)
82 set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR})
83 set(FFMPEG_LIBRARIES
84 ${FFMPEG_LIBAVCODEC}
85 ${FFMPEG_LIBAVUTIL}
86 ${FFMPEG_LIBSWSCALE})
87 endif()
88
89 if(FFMPEG_FOUND)
90 if(NOT FFMPEG_FIND_QUIETLY)
91 message(STATUS
92 "Found FFMPEG or Libav: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}")
93 endif()
94 else()
95 if(FFMPEG_FIND_REQUIRED)
96 message(FATAL_ERROR
97 "Could not find libavcodec or libavutil or libswscale")
98 endif()
99 endif()
100endif()