Lines Matching defs:avctx

263 int ff_nvdec_decode_uninit(AVCodecContext *avctx)
265 NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
292 static int nvdec_init_hwframes(AVCodecContext *avctx, AVBufferRef **out_frames_ref, int dummy)
297 ret = avcodec_get_hw_frames_parameters(avctx,
298 avctx->hw_device_ctx,
299 avctx->hwaccel->pix_fmt,
331 int ff_nvdec_decode_init(AVCodecContext *avctx)
333 NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
347 sw_desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
351 cuvid_codec_type = map_avcodec_id(avctx->codec_id);
353 av_log(avctx, AV_LOG_ERROR, "Unsupported codec ID\n");
357 cuvid_chroma_format = map_chroma_format(avctx->sw_pix_fmt);
359 av_log(avctx, AV_LOG_ERROR, "Unsupported chroma format\n");
364 if (!avctx->hw_frames_ctx) {
365 ret = nvdec_init_hwframes(avctx, &avctx->hw_frames_ctx, 1);
369 ret = nvdec_init_hwframes(avctx, &real_hw_frames_ref, 0);
373 real_hw_frames_ref = av_buffer_ref(avctx->hw_frames_ctx);
389 av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth\n");
394 frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
396 params.ulWidth = avctx->coded_width;
397 params.ulHeight = avctx->coded_height;
398 params.ulTargetWidth = avctx->coded_width;
399 params.ulTargetHeight = avctx->coded_height;
407 ret = nvdec_decoder_create(&ctx->decoder_ref, frames_ctx->device_ref, &params, avctx);
410 av_log(avctx, AV_LOG_WARNING, "Using more than 32 (%d) decode surfaces might cause nvdec to fail.\n",
412 av_log(avctx, AV_LOG_WARNING, "Try lowering the amount of threads. Using %d right now.\n",
413 avctx->thread_count);
439 ff_nvdec_decode_uninit(avctx);
560 int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame)
562 NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
585 av_log(avctx, AV_LOG_ERROR, "No decoder surfaces left\n");
602 int ff_nvdec_start_frame_sep_ref(AVCodecContext *avctx, AVFrame *frame, int has_sep_ref)
604 NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
609 ret = ff_nvdec_start_frame(avctx, frame);
619 av_log(avctx, AV_LOG_ERROR, "No decoder surfaces left\n");
636 int ff_nvdec_end_frame(AVCodecContext *avctx)
638 NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
640 void *logctx = avctx;
666 int ff_nvdec_simple_end_frame(AVCodecContext *avctx)
668 NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
669 int ret = ff_nvdec_end_frame(avctx);
674 int ff_nvdec_simple_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
677 NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
696 int ff_nvdec_frame_params(AVCodecContext *avctx,
705 sw_desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
709 cuvid_codec_type = map_avcodec_id(avctx->codec_id);
711 av_log(avctx, AV_LOG_ERROR, "Unsupported codec ID\n");
715 cuvid_chroma_format = map_chroma_format(avctx->sw_pix_fmt);
717 av_log(avctx, AV_LOG_VERBOSE, "Unsupported chroma format\n");
723 frames_ctx->width = (avctx->coded_width + 1) & ~1;
724 frames_ctx->height = (avctx->coded_height + 1) & ~1;