-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[ffmpeg] Add NVIDIA Codec feature for Windows and Linux #9171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
30153ea
Add NVIDIA Codec support for Windows, Linux and Linux for Tegra
marcbertola 2804186
[ffnvcodec] Fix typos, add/remove comments
marcbertola c56a092
Bump nvcodec version to 9.1.23.1
marcbertola ebb5481
Merge remote-tracking branch 'upstream/master' into ffmpeg-nvcodec
marcbertola 5420690
Update version number as per change request
marcbertola 955e86d
Use PORT variable instead of hardcoded portname
marcbertola 2bb5353
Identify the release the hash pertains to
marcbertola a61a143
Find nvcodec in 'installed' instead of 'packages'
marcbertola 92786a4
Force FFmpeg to look for nvcodec headers in the installed directory i…
marcbertola f542c5c
Use p option on cygpath to convert full path in case it contains more…
marcbertola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| Source: ffnvcodec | ||
| Version: 9.1.23.0 | ||
| Homepage: https://github.com/FFmpeg/nv-codec-headers | ||
| Description: FFmpeg version of Nvidia Codec SDK headers. | ||
| Source: ffnvcodec | ||
| Version: 9.1.23.1 | ||
dan-shaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Homepage: https://github.com/FFmpeg/nv-codec-headers | ||
| Description: FFmpeg version of Nvidia Codec SDK headers. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/bash | ||
|
|
||
| # Deploys the ffnvcodec.pc file to the MSYS rootfs so that pkgconfig can find it. | ||
|
|
||
| set -e | ||
| export PATH=/usr/bin:$PATH | ||
|
|
||
| SOURCE_PATH="$1" | ||
| CURRENT_PACKAGES_DIR="$2" | ||
|
|
||
| pushd ${SOURCE_PATH} | ||
|
|
||
| # Create ffnvcodec.pc | ||
| make PREFIX=${CURRENT_PACKAGES_DIR} | ||
| make install PREFIX=${CURRENT_PACKAGES_DIR} | ||
|
|
||
|
|
||
| popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * This copyright notice applies to this header file only: | ||
| * | ||
| * Copyright (c) 2010-2019 NVIDIA Corporation | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person | ||
| * obtaining a copy of this software and associated documentation | ||
| * files (the "Software"), to deal in the Software without | ||
| * restriction, including without limitation the rights to use, | ||
| * copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the software, and to permit persons to whom the | ||
| * software is furnished to do so, subject to the following | ||
| * conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be | ||
| * included in all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
| * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
| * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
| * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| * OTHER DEALINGS IN THE SOFTWARE. | ||
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,53 @@ | ||
| # Header-only-library | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO FFmpeg/nv-codec-headers | ||
| REF n9.1.23.0 | ||
| SHA512 d9cb1ad496d971da31165e643c6c4f433561a856050503783051604f24ea5f9997859b05695632ea94ce9659966915789e6d7f7d536764804c9f673d1c8c63e4 | ||
| HEAD_REF master | ||
| ) | ||
|
|
||
| file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) | ||
|
|
||
| #Handle copyright | ||
| file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
| # Get nvcodec | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO FFmpeg/nv-codec-headers | ||
| REF 4a0bbfd58724d6d19851cd8a6f7a9098dde9ab77 # 9.1.23.1 | ||
| SHA512 39b643c6925558428f2e814fc3441878a906f324163396b8c6139ce48f62308c3dc2416b9c995eaed890338919ca0dfc9437fbb6b6d078f7a6f1b9675104c223 | ||
| HEAD_REF master | ||
| ) | ||
|
|
||
| # ==================================================== | ||
| # Install the pkgconfig info for the `nvcodec` package | ||
| # ==================================================== | ||
|
|
||
| # Windows | ||
| if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") | ||
| set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh) | ||
| vcpkg_acquire_msys(MSYS_ROOT PACKAGES make pkg-config) | ||
| set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) | ||
|
|
||
| message(STATUS "Building ${_csc_PROJECT_PATH} for Release") | ||
| file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) | ||
|
|
||
| # Make and deploy the ffnvcodec.pc file using MSYS | ||
| # (so that FFmpeg can find it in the MSYS rootfs) | ||
| vcpkg_execute_required_process( | ||
| COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" | ||
| "${SOURCE_PATH}" | ||
| "${CURRENT_PACKAGES_DIR}" | ||
| WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} | ||
| LOGNAME build-${TARGET_TRIPLET} | ||
| ) | ||
|
|
||
| # Linux, etc. | ||
| else() | ||
| FIND_PROGRAM(MAKE make) | ||
| IF (NOT MAKE) | ||
| MESSAGE(FATAL_ERROR "MAKE not found") | ||
| ENDIF () | ||
|
|
||
| vcpkg_execute_required_process( | ||
| COMMAND make PREFIX=$${CURRENT_PACKAGES_DIR} | ||
| WORKING_DIRECTORY ${SOURCE_PATH} | ||
| LOGNAME make-${TARGET_TRIPLET} | ||
| ) | ||
dan-shaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # FFmpeg uses pkgconfig to find ffnvcodec.pc, so install it where | ||
| # FFMpeg's call to pkgconfig expects to find it. | ||
| file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) | ||
| endif() | ||
|
|
||
| # Install the files to their default vcpkg locations | ||
| file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) | ||
| file(INSTALL ${CURRENT_PORT_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.