aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/videotoolbox.c
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2021-01-02 14:30:36 +0200
committerJan Ekström <jeebjp@gmail.com>2021-01-02 14:36:22 +0200
commited524136e0d0ae26c9f11df42baf72689499f99f (patch)
treec24f09a4a7fa7958b3c254aca02261306fc0e71f /libavcodec/videotoolbox.c
parent2c6f532e0a29527347418d2d8c4ccfe57a6ace0e (diff)
downloadffmpeg-ed524136e0d0ae26c9f11df42baf72689499f99f.tar.gz
avcodec/videotoolbox: make FFmpeg-to-VT mapping error more informative
Now logs the actual failed-to-map pixel format as well as range.
Diffstat (limited to 'libavcodec/videotoolbox.c')
-rw-r--r--libavcodec/videotoolbox.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 8773de3393..49e726a75f 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -1088,7 +1088,13 @@ static int videotoolbox_common_init(AVCodecContext *avctx)
vtctx->vt_ctx->cv_pix_fmt_type =
av_map_videotoolbox_format_from_pixfmt2(hw_frames->sw_format, full_range);
if (!vtctx->vt_ctx->cv_pix_fmt_type) {
- av_log(avctx, AV_LOG_ERROR, "Unknown sw_format.\n");
+ const AVPixFmtDescriptor *attempted_format =
+ av_pix_fmt_desc_get(hw_frames->sw_format);
+ av_log(avctx, AV_LOG_ERROR,
+ "Failed to map underlying FFmpeg pixel format %s (%s range) to "
+ "a VideoToolbox format!\n",
+ attempted_format ? attempted_format->name : "<unknown>",
+ av_color_range_name(avctx->color_range));
err = AVERROR(EINVAL);
goto fail;
}