[FFmpeg-devel] [PATCH] doc/examples/encode_video: add qsv encoder support

Nicolas George george at nsup.org
Wed Aug 2 09:28:51 EEST 2017

L'octidi 8 thermidor, an CCXXV, Li, Zhong a écrit :
> It is similar to hw_device_match_type_in_name() in ffmpeg_hw.c:
> 	if (strstr(codec_name, type_name))
>        return type;

I must say, I really do not like the idea of having an API example
making that terrible construct official.

If testing the hw device type is really absolutely necessary in the API,
then we need some kind of avcodec_get_hw_type() function to do that
cleanly, before considering the API usable and documenting it.

Testing the codec name in external code is a big no, testing part of it
for a three-letter substring even more so.


  Nicolas George

More information about the ffmpeg-devel mailing list