Lines Matching defs:avctx

50         av_log(s->avctx, AV_LOG_WARNING, "Failed to set timeperframe");
68 av_log(s->avctx, log_warning || errno != EINVAL ? AV_LOG_WARNING : AV_LOG_DEBUG,
71 av_log(s->avctx, AV_LOG_DEBUG, "Encoder: %s = %d\n", name, value);
90 av_log(s->avctx, log_warning || errno != EINVAL ? AV_LOG_WARNING : AV_LOG_DEBUG,
150 if (s->avctx->max_b_frames)
151 av_log(s->avctx, AV_LOG_WARNING, "Encoder does not support b-frames yet\n");
154 v4l2_get_ext_ctrl(s, MPEG_CID(B_FRAMES), &s->avctx->max_b_frames, "number of B-frames", 0);
155 if (s->avctx->max_b_frames == 0)
158 avpriv_report_missing_feature(s->avctx, "DTS/PTS calculation for V4L2 encoding");
170 av_log(s->avctx, AV_LOG_WARNING,
176 AVCodecContext *avctx = s->avctx;
192 if (avctx->framerate.num || avctx->framerate.den)
193 v4l2_set_timeperframe(s, avctx->framerate.den, avctx->framerate.num);
197 v4l2_set_ext_ctrl(s, MPEG_CID(BITRATE) , avctx->bit_rate, "bit rate", 1);
199 v4l2_set_ext_ctrl(s, MPEG_CID(GOP_SIZE), avctx->gop_size,"gop size", 1);
201 av_log(avctx, AV_LOG_DEBUG,
204 avctx->codec_id, avctx->profile, avctx->framerate.num, avctx->framerate.den,
205 avctx->max_b_frames, avctx->gop_size, avctx->bit_rate, avctx->qmin, avctx->qmax);
207 switch (avctx->codec_id) {
209 if (avctx->profile != FF_PROFILE_UNKNOWN) {
210 val = v4l2_h264_profile_from_ff(avctx->profile);
212 av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n");
222 if (avctx->profile != FF_PROFILE_UNKNOWN) {
223 val = v4l2_mpeg4_profile_from_ff(avctx->profile);
225 av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n");
231 if (avctx->flags & AV_CODEC_FLAG_QPEL)
258 if (avctx->qmin >= 0 && avctx->qmax >= 0 && avctx->qmin > avctx->qmax) {
259 av_log(avctx, AV_LOG_WARNING, "Invalid qmin:%d qmax:%d. qmin should not "
260 "exceed qmax\n", avctx->qmin, avctx->qmax);
262 qmin = avctx->qmin >= 0 ? avctx->qmin : qmin;
263 qmax = avctx->qmax >= 0 ? avctx->qmax : qmax;
267 avctx->qmin >= 0);
269 avctx->qmax >= 0);
274 static int v4l2_send_frame(AVCodecContext *avctx, const AVFrame *frame)
276 V4L2m2mContext *s = ((V4L2m2mPriv*)avctx->priv_data)->context;
287 static int v4l2_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
289 V4L2m2mContext *s = ((V4L2m2mPriv*)avctx->priv_data)->context;
299 ret = ff_encode_get_frame(avctx, frame);
307 ret = v4l2_send_frame(avctx, frame);
317 av_log(avctx, AV_LOG_ERROR, "VIDIOC_STREAMON failed on output context\n");
325 av_log(avctx, AV_LOG_ERROR, "VIDIOC_STREAMON failed on capture context\n");
334 static av_cold int v4l2_encode_init(AVCodecContext *avctx)
338 V4L2m2mPriv *priv = avctx->priv_data;
351 output->height = capture->height = avctx->height;
352 output->width = capture->width = avctx->width;
356 output->av_pix_fmt = avctx->pix_fmt;
359 capture->av_codec_id = avctx->codec_id;
362 s->avctx = avctx;
365 av_log(avctx, AV_LOG_ERROR, "can't configure encoder\n");
375 if (pix_fmt_output != avctx->pix_fmt) {
377 av_log(avctx, AV_LOG_ERROR, "Encoder requires %s pixel format.\n", desc->name);
384 static av_cold int v4l2_encode_close(AVCodecContext *avctx)
386 return ff_v4l2_m2m_codec_end(avctx->priv_data);