Lines Matching defs:frame
54 static AVFrame *frame = NULL;
59 static int output_video_frame(AVFrame *frame)
61 if (frame->width != width || frame->height != height ||
62 frame->format != pix_fmt) {
71 frame->width, frame->height,
72 av_get_pix_fmt_name(frame->format));
77 video_frame_count++, frame->coded_picture_number);
79 /* copy decoded frame to destination buffer:
82 (const uint8_t **)(frame->data), frame->linesize,
90 static int output_audio_frame(AVFrame *frame)
92 size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format);
94 audio_frame_count++, frame->nb_samples,
95 av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
103 * You should use libswresample or libavfilter to convert the frame
105 fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file);
123 ret = avcodec_receive_frame(dec, frame);
126 // frame available, but there were no errors during decoding
134 // write the frame data to output file
136 ret = output_video_frame(frame);
138 ret = output_audio_frame(frame);
140 av_frame_unref(frame);
299 frame = av_frame_alloc();
300 if (!frame) {
301 fprintf(stderr, "Could not allocate frame\n");
378 av_frame_free(&frame);