I am trying to use FFmpeg to decode a video using hardware acceleration. So far all is well, using examples as a guideline I was able to implement the d3d11va way. Now I'd like to also have the intel QSV way. but it seems there is an "API mismatch"
For dxva2, d3d11va2, nvdec, vaapi,..., I can use avcodec_get_hw_config to get the hw config and setup the get_format callback if necessary and get the pix_fmt. but Qsv is not there.
Not that I have a build that includes QSV as I can see h264_qsv when I do FFmpeg -decoders. That is another thing the decoder name is "h264_qsv" instead of "h264" for the DirectX variant.
I use avcodec_parameters_to_context and avcodec_find_decoderto get my AVCodec, following the examples.
I don't know if there were reason to have the qsv implementation not follow the same way FFmpeg setup the codec, the example uses avcodec_find_decoder_by_name but that is not really practical when I don't control the input video.
now I'd like to know what is the recommended way to open the AvCodec,
AvCodecContext and do the setup for the hardware acceleration so that the code is unified and minimize specific code. It seems QSV is alone in the way things are done to set it up.