[FFmpeg-trac] #7030(avcodec:open): qsv in ffmpeg
FFmpeg
trac at avcodec.org
Tue Sep 3 09:19:31 EEST 2019
#7030: qsv in ffmpeg
-------------------------------------+-------------------------------------
Reporter: palich2000 | Owner:
Type: defect | Status: open
Priority: important | Component: avcodec
Version: git-master | Resolution:
Keywords: qsv | Blocked By:
regression |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by fulinjie):
Before commit
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=b0cd14fb1dab4b044f7fe6b53ac635409849de77#patch3,
{{{
- if (ist->hwaccel_id != HWACCEL_NONE)
- type = hw_device_match_type_by_hwaccel(ist->hwaccel_id);
- else
- type = hw_device_match_type_in_name(ist->dec->name);
- if (type != AV_HWDEVICE_TYPE_NONE) {
dev = hw_device_get_by_type(type);
}}}
dev could be got through dec->name and then calls
'''ff_qsv_init_session_device''' to CreateCORE/SetHandle and make sure the
decoder works well.
However, after this commit, dev could not be got in
hw_device_match_by_codec
{{{
dev = hw_device_match_by_codec(ist->dec);
}}}
because AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX is not configured as a
method in ff_qsv_hw_configs.
{{{
+ for (i = 0;; i++) {
+ config = avcodec_get_hw_config(codec, i);
+ if (!config)
+ return NULL;
+ if (!(config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX))
+ continue;
+ dev = hw_device_get_by_type(config->device_type);
+ if (dev)
+ return dev;
}
}}}
As a consequence, '''ff_qsv_init_internal_session''' was called to
CreateCORE only without SetHandle.
And it leads to the decode failure.
Also as Zhong has mentioned, the removal of ff_qsv_set_display_handle() in
ff_qsv_init_internal_session is one of the reasons as well.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/7030#comment:23>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list