Lines Matching refs:frame
38 #include <libavutil/frame.h>
94 static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt,
99 /* send the frame for encoding */
100 ret = avcodec_send_frame(ctx, frame);
102 fprintf(stderr, "Error sending the frame to the encoder\n");
113 fprintf(stderr, "Error encoding audio frame\n");
127 AVFrame *frame;
189 /* frame containing input raw audio */
190 frame = av_frame_alloc();
191 if (!frame) {
192 fprintf(stderr, "Could not allocate audio frame\n");
196 frame->nb_samples = c->frame_size;
197 frame->format = c->sample_fmt;
198 ret = av_channel_layout_copy(&frame->ch_layout, &c->ch_layout);
203 ret = av_frame_get_buffer(frame, 0);
213 /* make sure the frame is writable -- makes a copy if the encoder
215 ret = av_frame_make_writable(frame);
218 samples = (uint16_t*)frame->data[0];
227 encode(c, frame, pkt, f);
235 av_frame_free(&frame);