[FFmpeg-devel] [PATCH 2/5] avutil/hwcontext_cuda: add CUstream in cuda hwctx

Timo Rothenpieler timo at rothenpieler.org
Sat Jun 9 12:31:39 EEST 2018


Am 09.06.2018 um 03:25 schrieb James Almer:
> On 5/9/2018 5:49 AM, Timo Rothenpieler wrote:
>> On 08.05.2018 23:00, James Almer wrote:
>>> On 5/8/2018 3:36 PM, Timo Rothenpieler wrote:
>>>> ---
>>>>   configure                  | 6 ++++--
>>>>   doc/APIchanges             | 3 +++
>>>>   libavutil/hwcontext_cuda.c | 3 +++
>>>>   libavutil/hwcontext_cuda.h | 1 +
>>>>   libavutil/version.h        | 2 +-
>>>>   5 files changed, 12 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index 6626111ff2..9743de05d0 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -5887,8 +5887,10 @@ check_type "va/va.h va/va_enc_vp9.h"  "VAEncPictureParameterBufferVP9"
>>>>   check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
>>>>   
>>>>   if ! disabled ffnvcodec; then
>>>> -    check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.1" \
>>>> -        "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""
>>>> +    check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.2" \
>>>> +          "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" || \
>>>> +        { test_pkg_config ffnvcodec_tmp "ffnvcodec < 8.1" "" "" && check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.2" \
>>>> +          "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""; }
>>>
>>> ffnvcodec_tmp?
>>
>> I haven't found a more elegant way to do this.
>> Basically, the version requirement is
>>
>> ffnvcodec >= 8.1.24.2 || (ffnvcodec < 8.1 && ffnvcodec >= 8.0.14.2)
>>
>> As < 8.1 would also match 8.0.14.1, it must not enable ffnvcodec, which
>> is why i appended the _tmp.
>>
>> pkg-config does not seem able to evaluate such complex version checks,
>> and there is no lower level function than test_pkg_config.
> 
> Completely missed this reply, sorry about that.
> 
> The above check can be done with two calls to check_pkg_config(). You
> can't do logical or as far as i know, but logical and is implied if you
> pass two conditions.
> So if what you want is any 8.1 version as long as its higher than
> 8.1.24.1, or as fallback any 8.0 version as long as it's higher than
> 8.0.14.1, you'd do
> 
> check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.2" \
> "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h \
> ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" ||
> check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.2 ffnvcodec < 8.1" \
> "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h \
> ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""

That does seem better, and saves one invocation of pkg-config.
Will apply it like that.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3994 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180609/5def16a1/attachment.bin>


More information about the ffmpeg-devel mailing list