Lines Matching defs:avctx
84 static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
86 FramePool *pool = avctx->internal->pool ?
87 (FramePool*)avctx->internal->pool->data : NULL;
91 if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
104 if (avctx->codec_type == AVMEDIA_TYPE_VIDEO &&
107 if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && pool->planes == planes &&
117 switch (avctx->codec_type) {
126 avcodec_align_dimensions2(avctx, &w, &h, pool->stride_align);
131 ret = av_image_fill_linesizes(linesize, avctx->pix_fmt, w);
144 ret = av_image_fill_plane_sizes(size, avctx->pix_fmt, h, linesize1);
192 av_buffer_unref(&avctx->internal->pool);
193 avctx->internal->pool = pool_buf;
201 static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
203 FramePool *pool = (FramePool*)avctx->internal->pool->data;
237 if (avctx->debug & FF_DEBUG_BUFFERS)
238 av_log(avctx, AV_LOG_DEBUG, "default_get_buffer called on frame %p", frame);
290 int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags)
294 if (avctx->hw_frames_ctx) {
295 ret = av_hwframe_get_buffer(avctx->hw_frames_ctx, frame, 0);
296 frame->width = avctx->coded_width;
297 frame->height = avctx->coded_height;
301 if ((ret = update_frame_pool(avctx, frame)) < 0)
304 switch (avctx->codec_type) {
306 return video_get_buffer(avctx, frame);
308 return audio_get_buffer(avctx, frame);