return AVERROR_EXTERNAL;
}
+ frame->crop_right = 0;
+ frame->crop_left = 0;
+ frame->crop_top = 0;
+ frame->crop_bottom = 0;
+
frame->data[3] = (uint8_t*)ref->pixbuf;
if (ref->hw_frames_ctx) {
}
if (!image_buffer) {
- av_log(NULL, AV_LOG_DEBUG, "vt decoder cb: output image buffer is null\n");
+ av_log(avctx, AV_LOG_DEBUG, "vt decoder cb: output image buffer is null\n");
return;
}
AVVideotoolboxContext *videotoolbox = videotoolbox_get_context(avctx);
VTContext *vtctx = avctx->internal->hwaccel_priv_data;
- frame->crop_right = 0;
- frame->crop_left = 0;
- frame->crop_top = 0;
- frame->crop_bottom = 0;
-
if (vtctx->reconfig_needed == true) {
vtctx->reconfig_needed = false;
av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox decoder needs reconfig, restarting..\n");
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;
}