aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_demux.c
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2022-10-22 05:38:34 +0000
committerZhao Zhili <zhilizhao@tencent.com>2022-11-21 23:57:10 +0800
commitc0c0a5f106c3a3ab80ab53b57db2132e585e80a0 (patch)
tree0f25aad48543107db9df53006b9a70e38ad45541 /fftools/ffmpeg_demux.c
parentb7a3f169578cb6c8281afe33dd879df7d1029d6c (diff)
downloadffmpeg-c0c0a5f106c3a3ab80ab53b57db2132e585e80a0.tar.gz
fftools/ffmpeg_demux: set default hwaccel_output_format for mediacodec
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'fftools/ffmpeg_demux.c')
-rw-r--r--fftools/ffmpeg_demux.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 76778d774d..d2a6d39703 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -625,6 +625,10 @@ static void add_input_streams(const OptionsContext *o, AVFormatContext *ic)
"with old commandlines. This behaviour is DEPRECATED and will be removed "
"in the future. Please explicitly set \"-hwaccel_output_format qsv\".\n");
ist->hwaccel_output_format = AV_PIX_FMT_QSV;
+ } else if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "mediacodec")) {
+ // There is no real AVHWFrameContext implementation. Set
+ // hwaccel_output_format to avoid av_hwframe_transfer_data error.
+ ist->hwaccel_output_format = AV_PIX_FMT_MEDIACODEC;
} else if (hwaccel_output_format) {
ist->hwaccel_output_format = av_get_pix_fmt(hwaccel_output_format);
if (ist->hwaccel_output_format == AV_PIX_FMT_NONE) {