[FFmpeg-devel] [PATCH 1/2] avcodec/nvenc: Include NVENC SDK header

Timo Rothenpieler timo at rothenpieler.org
Mon Dec 7 19:09:58 CET 2015


>> @@ -1603,6 +1603,7 @@ CONFIG_LIST="
>>      memalign_hack
>>      memory_poisoning
>>      neon_clobber_test
>> +    nvenc
> 
> You forgot to remove nvenc from EXTERNAL_LIBRARY_LIST

Yep, forgot about that.

>> +case $target_os in
>> +    mingw32*|mingw64*|win32|win64|linux|cygwin*)
>> +        disabled nvenc || enable nvenc
>> +        ;;
>> +    *)
>> +        disable nvenc
>> +        ;;
>> +esac
>> +
>> +if enabled nvenc; then
>> +    {
>> +        echo '#include "nvenc.h"'
>> +        echo 'int main(void) { return 0; }'
>> +    } | check_cc -I$source_path/libavcodec ||
>> +        disable nvenc
>> +fi
>> +
> 
> Is this check even needed when you're checking for compatible OSes above?
> Not to mention nvenc.h only includes stdlib.h and then typedefs everything
> it needs, which makes me think it should compile for any target out there.

It's kind of a sanity check to make sure it builds with the compiler
that's beeing used, in case it doesn't work on some weird/old compiler.
If that's not a concern, this check can be removed.

> In any case, do instead something like
> 
> enabled nvenc &&
>     check_cc -I$source_path/libavcodec <<EOF || disable nvenc
> #include "nvenc.h"
> int x;
> EOF

Doesn't check_cc need a main function? Or is it just about the EOF style
vs. { echo }?

> [...]
> 
>> diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
>> new file mode 100644
>> index 0000000..8b67c11
>> --- /dev/null
>> +++ b/libavcodec/nvenc.h
> 
> compat/nvenc/nvenc.h? It's the proper place for non ffmpeg headers, like we
> do with Avisynth.

Yes, will move it there.

> Or maybe both nvenc and the Avisynth stuff could be moved to a new "contrib"
> or "thirdparty" folder.

That's out of the scope of this patch, but sounds like a good idea to me.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151207/fd8933dd/attachment.sig>


More information about the ffmpeg-devel mailing list