Lines Matching defs:avctx
32 int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx,
38 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
47 av_log(avctx, AV_LOG_ERROR, "Failed to create parameter "
55 av_log(avctx, AV_LOG_DEBUG, "Param buffer (type %d, %zu bytes) "
61 int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
68 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
95 av_log(avctx, AV_LOG_ERROR, "Failed to create slice "
100 av_log(avctx, AV_LOG_DEBUG, "Slice %d param buffer (%zu bytes) "
109 av_log(avctx, AV_LOG_ERROR, "Failed to create slice "
117 av_log(avctx, AV_LOG_DEBUG, "Slice %d data buffer (%zu bytes) "
125 static void ff_vaapi_decode_destroy_buffers(AVCodecContext *avctx,
128 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
136 av_log(avctx, AV_LOG_ERROR, "Failed to destroy "
146 av_log(avctx, AV_LOG_ERROR, "Failed to destroy slice "
153 int ff_vaapi_decode_issue(AVCodecContext *avctx,
156 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
160 av_log(avctx, AV_LOG_DEBUG, "Decode to surface %#x.\n",
166 av_log(avctx, AV_LOG_ERROR, "Failed to begin picture decode "
175 av_log(avctx, AV_LOG_ERROR, "Failed to upload decode "
184 av_log(avctx, AV_LOG_ERROR, "Failed to upload slices: "
192 av_log(avctx, AV_LOG_ERROR, "Failed to end picture decode "
204 ff_vaapi_decode_destroy_buffers(avctx, pic);
212 av_log(avctx, AV_LOG_ERROR, "Failed to end picture decode "
216 ff_vaapi_decode_destroy_buffers(avctx, pic);
227 int ff_vaapi_decode_cancel(AVCodecContext *avctx,
230 ff_vaapi_decode_destroy_buffers(avctx, pic);
280 static int vaapi_decode_find_best_format(AVCodecContext *avctx,
292 source_format = avctx->sw_pix_fmt;
298 av_log(avctx, AV_LOG_ERROR, "Failed to query surface attributes: "
310 av_log(avctx, AV_LOG_ERROR, "Failed to query surface attributes: "
328 av_log(avctx, AV_LOG_DEBUG, "Ignoring unknown format %#x.\n",
333 av_log(avctx, AV_LOG_DEBUG, "Considering format %#x -> %s.\n",
345 av_log(avctx, AV_LOG_ERROR, "No usable formats for decoding!\n");
349 av_log(avctx, AV_LOG_DEBUG, "Picked %s (%#x) as best match for %s.\n",
354 if (avctx->internal->hwaccel_priv_data) {
355 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
374 VAProfile (*profile_parser)(AVCodecContext *avctx);
425 * in avctx.
427 static int vaapi_decode_make_config(AVCodecContext *avctx,
443 codec_desc = avcodec_descriptor_get(avctx->codec_id);
460 av_log(avctx, AV_LOG_ERROR, "Failed to query profiles: "
471 if (avctx->codec_id != vaapi_profile_map[i].codec_id)
473 if (avctx->profile == vaapi_profile_map[i].codec_profile ||
478 vaapi_profile_map[i].profile_parser(avctx) :
498 av_log(avctx, AV_LOG_ERROR, "No support for codec %s "
499 "profile %d.\n", codec_desc->name, avctx->profile);
504 if (avctx->hwaccel_flags &
506 av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
508 codec_desc->name, avctx->profile);
509 av_log(avctx, AV_LOG_WARNING, "Using possibly-"
513 av_log(avctx, AV_LOG_VERBOSE, "Codec %s profile %d not "
515 codec_desc->name, avctx->profile);
525 av_log(avctx, AV_LOG_ERROR, "Failed to create decode "
545 if (avctx->coded_width < constraints->min_width ||
546 avctx->coded_height < constraints->min_height ||
547 avctx->coded_width > constraints->max_width ||
548 avctx->coded_height > constraints->max_height) {
549 av_log(avctx, AV_LOG_ERROR, "Hardware does not support image "
551 avctx->coded_width, avctx->coded_height,
559 av_log(avctx, AV_LOG_ERROR, "Hardware does not offer any "
569 frames->width = avctx->coded_width;
570 frames->height = avctx->coded_height;
572 err = vaapi_decode_find_best_format(avctx, device,
579 switch (avctx->codec_id) {
612 int ff_vaapi_common_frame_params(AVCodecContext *avctx,
625 err = vaapi_decode_make_config(avctx, hw_frames->device_ref, &va_config,
636 int ff_vaapi_decode_init(AVCodecContext *avctx)
638 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
645 err = ff_decode_get_hw_frames_ctx(avctx, AV_HWDEVICE_TYPE_VAAPI);
649 ctx->frames = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
654 err = vaapi_decode_make_config(avctx, ctx->frames->device_ref,
660 avctx->coded_width, avctx->coded_height,
666 av_log(avctx, AV_LOG_ERROR, "Failed to create decode "
672 av_log(avctx, AV_LOG_DEBUG, "Decode context initialised: "
678 ff_vaapi_decode_uninit(avctx);
682 int ff_vaapi_decode_uninit(AVCodecContext *avctx)
684 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
690 av_log(avctx, AV_LOG_ERROR, "Failed to destroy decode "
698 av_log(avctx, AV_LOG_ERROR, "Failed to destroy decode "