FFmpeg
Data Structures | Functions | Variables
avcodec_internal.h File Reference
#include "libavutil/frame.h"
#include "packet.h"

Go to the source code of this file.

Data Structures

struct  SideDataMap
 

Functions

int ff_decode_receive_frame (struct AVCodecContext *avctx, struct AVFrame *frame)
 avcodec_receive_frame() implementation for decoders. More...
 
int ff_encode_receive_frame (struct AVCodecContext *avctx, struct AVFrame *frame)
 avcodec_receive_frame() implementation for encoders. More...
 
int ff_encode_preinit (struct AVCodecContext *avctx)
 
int ff_decode_preinit (struct AVCodecContext *avctx)
 Perform decoder initialization and validation. More...
 
void ff_decode_flush_buffers (struct AVCodecContext *avctx)
 
void ff_encode_flush_buffers (struct AVCodecContext *avctx)
 
struct AVCodecInternalff_decode_internal_alloc (void)
 
void ff_decode_internal_sync (struct AVCodecContext *dst, const struct AVCodecContext *src)
 
void ff_decode_internal_uninit (struct AVCodecContext *avctx)
 
struct AVCodecInternalff_encode_internal_alloc (void)
 
void ff_codec_close (struct AVCodecContext *avctx)
 
int ff_thread_init (struct AVCodecContext *s)
 
void ff_thread_free (struct AVCodecContext *s)
 
void ff_thread_flush (struct AVCodecContext *avctx)
 Wait for decoding threads to finish and reset internal state. More...
 
int ff_thread_receive_frame (struct AVCodecContext *avctx, AVFrame *frame)
 Submit available packets for decoding to worker threads, return a decoded frame if available. More...
 
int ff_decode_receive_frame_internal (struct AVCodecContext *avctx, AVFrame *frame)
 Do the actual decoding and obtain a decoded frame from the decoder, if available. More...
 
int ff_thread_get_packet (struct AVCodecContext *avctx, AVPacket *pkt)
 Get a packet for decoding. More...
 

Variables

const SideDataMap ff_sd_global_map []
 A map between packet and frame side data types. More...
 

Function Documentation

◆ ff_decode_receive_frame()

int ff_decode_receive_frame ( struct AVCodecContext avctx,
struct AVFrame frame 
)

avcodec_receive_frame() implementation for decoders.

Definition at line 815 of file decode.c.

Referenced by avcodec_receive_frame().

◆ ff_encode_receive_frame()

int ff_encode_receive_frame ( struct AVCodecContext avctx,
struct AVFrame frame 
)

avcodec_receive_frame() implementation for encoders.

Definition at line 881 of file encode.c.

Referenced by avcodec_receive_frame().

◆ ff_encode_preinit()

int ff_encode_preinit ( struct AVCodecContext avctx)

Definition at line 756 of file encode.c.

Referenced by avcodec_open2().

◆ ff_decode_preinit()

int ff_decode_preinit ( struct AVCodecContext avctx)

Perform decoder initialization and validation.

Called when opening the decoder, before the FFCodec.init() call.

Definition at line 1943 of file decode.c.

Referenced by avcodec_open2().

◆ ff_decode_flush_buffers()

void ff_decode_flush_buffers ( struct AVCodecContext avctx)

Definition at line 2280 of file decode.c.

Referenced by avcodec_flush_buffers().

◆ ff_encode_flush_buffers()

void ff_encode_flush_buffers ( struct AVCodecContext avctx)

Definition at line 894 of file encode.c.

Referenced by avcodec_flush_buffers().

◆ ff_decode_internal_alloc()

struct AVCodecInternal* ff_decode_internal_alloc ( void  )

Definition at line 2298 of file decode.c.

Referenced by avcodec_open2(), and init_thread().

◆ ff_decode_internal_sync()

void ff_decode_internal_sync ( struct AVCodecContext dst,
const struct AVCodecContext src 
)

◆ ff_decode_internal_uninit()

void ff_decode_internal_uninit ( struct AVCodecContext avctx)

Definition at line 2311 of file decode.c.

Referenced by ff_codec_close(), and ff_frame_thread_free().

◆ ff_encode_internal_alloc()

struct AVCodecInternal* ff_encode_internal_alloc ( void  )

Definition at line 904 of file encode.c.

Referenced by avcodec_open2().

◆ ff_codec_close()

void ff_codec_close ( struct AVCodecContext avctx)

Definition at line 428 of file avcodec.c.

Referenced by avcodec_close(), avcodec_free_context(), and avcodec_open2().

◆ ff_thread_init()

int ff_thread_init ( struct AVCodecContext s)

Definition at line 72 of file pthread.c.

Referenced by avcodec_open2().

◆ ff_thread_free()

void ff_thread_free ( struct AVCodecContext s)

Definition at line 84 of file pthread.c.

Referenced by ff_codec_close().

◆ ff_thread_flush()

void ff_thread_flush ( struct AVCodecContext avctx)

Wait for decoding threads to finish and reset internal state.

Called by avcodec_flush_buffers().

Parameters
avctxThe context.

Definition at line 984 of file pthread_frame.c.

Referenced by avcodec_flush_buffers().

◆ ff_thread_receive_frame()

int ff_thread_receive_frame ( struct AVCodecContext avctx,
AVFrame frame 
)

Submit available packets for decoding to worker threads, return a decoded frame if available.

Returns AVERROR(EAGAIN) if none is available.

Parameters are the same as FFCodec.receive_frame.

Definition at line 566 of file pthread_frame.c.

◆ ff_decode_receive_frame_internal()

int ff_decode_receive_frame_internal ( struct AVCodecContext avctx,
AVFrame frame 
)

Do the actual decoding and obtain a decoded frame from the decoder, if available.

When frame threading is used, this is invoked by the worker threads, otherwise by the top layer directly.

Definition at line 621 of file decode.c.

Referenced by decode_receive_frame_internal(), and frame_worker_thread().

◆ ff_thread_get_packet()

int ff_thread_get_packet ( struct AVCodecContext avctx,
AVPacket pkt 
)

Get a packet for decoding.

This gets invoked by the worker threads.

Definition at line 1106 of file pthread_frame.c.

Variable Documentation

◆ ff_sd_global_map

const SideDataMap ff_sd_global_map[]

A map between packet and frame side data types.

Terminated with an entry where packet=AV_PKT_DATA_NB.

Definition at line 58 of file avcodec.c.

Referenced by ff_decode_frame_props(), ff_decode_frame_props_from_pkt(), ff_decode_preinit(), and ff_encode_preinit().