Lines Matching defs:avctx
43 static av_cold int davs2_init(AVCodecContext *avctx)
45 DAVS2Context *cad = avctx->priv_data;
49 cad->param.threads = avctx->thread_count;
56 av_log(avctx, AV_LOG_ERROR, "decoder created error.");
60 av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder);
64 static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, int *got_frame,
67 DAVS2Context *cad = avctx->priv_data;
78 avctx->width = headerset->width;
79 avctx->height = headerset->height;
80 avctx->pix_fmt = headerset->output_bit_depth == 10 ?
87 avctx->has_b_frames = FFMAX(avctx->has_b_frames, !headerset->low_delay);
90 avctx->framerate = ff_avs2_frame_rate_tab[headerset->frame_rate_id];
111 av_log(avctx, AV_LOG_ERROR, "Decoder error: unknown frame type\n");
120 av_log(avctx, AV_LOG_ERROR, "Decoder error: allocation failure, can't dump frames.\n");
136 frame->format = avctx->pix_fmt;
142 static void davs2_flush(AVCodecContext *avctx)
144 DAVS2Context *cad = avctx->priv_data;
153 av_log(avctx, AV_LOG_WARNING, "Decoder flushing failed.\n");
157 static int send_delayed_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
159 DAVS2Context *cad = avctx->priv_data;
164 av_log(avctx, AV_LOG_ERROR, "Decoder error: can't flush delayed frame\n");
168 ret = davs2_dump_frames(avctx, &cad->out_frame, got_frame, &cad->headerset, ret, frame);
174 static av_cold int davs2_end(AVCodecContext *avctx)
176 DAVS2Context *cad = avctx->priv_data;
180 davs2_flush(avctx);
188 static int davs2_decode_frame(AVCodecContext *avctx, AVFrame *frame,
191 DAVS2Context *cad = avctx->priv_data;
198 return send_delayed_frame(avctx, frame, got_frame);
210 av_log(avctx, AV_LOG_ERROR, "Decoder error: can't read packet\n");
217 ret = davs2_dump_frames(avctx, &cad->out_frame, got_frame, &cad->headerset, ret, frame);