Lines Matching defs:avctx
74 static int encode_write(AVCodecContext *avctx, AVFrame *frame, FILE *fout)
82 if ((ret = avcodec_send_frame(avctx, frame)) < 0) {
87 ret = avcodec_receive_packet(avctx, enc_pkt);
107 AVCodecContext *avctx = NULL;
143 if (!(avctx = avcodec_alloc_context3(codec))) {
148 avctx->width = width;
149 avctx->height = height;
150 avctx->time_base = (AVRational){1, 25};
151 avctx->framerate = (AVRational){25, 1};
152 avctx->sample_aspect_ratio = (AVRational){1, 1};
153 avctx->pix_fmt = AV_PIX_FMT_VAAPI;
156 if ((err = set_hwframe_ctx(avctx, hw_device_ctx)) < 0) {
161 if ((err = avcodec_open2(avctx, codec, NULL)) < 0) {
186 if ((err = av_hwframe_get_buffer(avctx->hw_frames_ctx, hw_frame, 0)) < 0) {
200 if ((err = (encode_write(avctx, hw_frame, fout))) < 0) {
209 err = encode_write(avctx, NULL, fout);
220 avcodec_free_context(&avctx);