FFmpeg
Data Structures | Macros | Enumerations | Functions
codec_internal.h File Reference
#include <stdint.h>
#include "libavutil/attributes.h"
#include "codec.h"

Go to the source code of this file.

Data Structures

struct  FFCodecDefault
 
struct  FFCodec
 

Macros

#define FF_CODEC_CAP_INIT_THREADSAFE   (1 << 0)
 The codec does not modify any global variables in the init function, allowing to call the init function without locking any global mutexes. More...
 
#define FF_CODEC_CAP_INIT_CLEANUP   (1 << 1)
 The codec allows calling the close function for deallocation even if the init function returned a failure. More...
 
#define FF_CODEC_CAP_SETS_PKT_DTS   (1 << 2)
 Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually. More...
 
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM   (1 << 3)
 The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame setting. More...
 
#define FF_CODEC_CAP_EXPORTS_CROPPING   (1 << 4)
 The decoder sets the cropping fields in the output frames manually. More...
 
#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF   (1 << 5)
 Codec initializes slice-based threading with a main function. More...
 
#define FF_CODEC_CAP_ALLOCATE_PROGRESS   (1 << 6)
 
#define FF_CODEC_CAP_AUTO_THREADS   (1 << 7)
 Codec handles avctx->thread_count == 0 (auto) internally. More...
 
#define FF_CODEC_CAP_SETS_FRAME_PROPS   (1 << 8)
 Codec handles output frame properties internally instead of letting the internal logic derive them from AVCodecInternal.last_pkt_props. More...
 
#define FF_CODEC_TAGS_END   -1
 FFCodec.codec_tags termination value. More...
 
#define FF_CODEC_DECODE_CB(func)
 
#define FF_CODEC_DECODE_SUB_CB(func)
 
#define FF_CODEC_RECEIVE_FRAME_CB(func)
 
#define FF_CODEC_ENCODE_CB(func)
 
#define FF_CODEC_ENCODE_SUB_CB(func)
 
#define FF_CODEC_RECEIVE_PACKET_CB(func)
 

Enumerations

enum  FFCodecType {
  FF_CODEC_CB_TYPE_DECODE, FF_CODEC_CB_TYPE_DECODE_SUB, FF_CODEC_CB_TYPE_RECEIVE_FRAME, FF_CODEC_CB_TYPE_ENCODE,
  FF_CODEC_CB_TYPE_ENCODE_SUB, FF_CODEC_CB_TYPE_RECEIVE_PACKET
}
 

Functions

static const av_always_inline FFCodecffcodec (const AVCodec *codec)
 

Macro Definition Documentation

◆ FF_CODEC_CAP_INIT_THREADSAFE

#define FF_CODEC_CAP_INIT_THREADSAFE   (1 << 0)

The codec does not modify any global variables in the init function, allowing to call the init function without locking any global mutexes.

Definition at line 31 of file codec_internal.h.

◆ FF_CODEC_CAP_INIT_CLEANUP

#define FF_CODEC_CAP_INIT_CLEANUP   (1 << 1)

The codec allows calling the close function for deallocation even if the init function returned a failure.

Without this capability flag, a codec does such cleanup internally when returning failures from the init function and does not expect the close function to be called at all.

Definition at line 39 of file codec_internal.h.

◆ FF_CODEC_CAP_SETS_PKT_DTS

#define FF_CODEC_CAP_SETS_PKT_DTS   (1 << 2)

Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.

If the flag is set, decode.c won't overwrite this field. If it's unset, decode.c tries to guess the pkt_dts field from the input AVPacket.

Definition at line 46 of file codec_internal.h.

◆ FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM

#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM   (1 << 3)

The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame setting.

Definition at line 51 of file codec_internal.h.

◆ FF_CODEC_CAP_EXPORTS_CROPPING

#define FF_CODEC_CAP_EXPORTS_CROPPING   (1 << 4)

The decoder sets the cropping fields in the output frames manually.

If this cap is set, the generic code will initialize output frame dimensions to coded rather than display values.

Definition at line 57 of file codec_internal.h.

◆ FF_CODEC_CAP_SLICE_THREAD_HAS_MF

#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF   (1 << 5)

Codec initializes slice-based threading with a main function.

Definition at line 61 of file codec_internal.h.

◆ FF_CODEC_CAP_ALLOCATE_PROGRESS

#define FF_CODEC_CAP_ALLOCATE_PROGRESS   (1 << 6)

Definition at line 66 of file codec_internal.h.

◆ FF_CODEC_CAP_AUTO_THREADS

#define FF_CODEC_CAP_AUTO_THREADS   (1 << 7)

Codec handles avctx->thread_count == 0 (auto) internally.

Definition at line 70 of file codec_internal.h.

◆ FF_CODEC_CAP_SETS_FRAME_PROPS

#define FF_CODEC_CAP_SETS_FRAME_PROPS   (1 << 8)

Codec handles output frame properties internally instead of letting the internal logic derive them from AVCodecInternal.last_pkt_props.

Definition at line 75 of file codec_internal.h.

◆ FF_CODEC_TAGS_END

#define FF_CODEC_TAGS_END   -1

FFCodec.codec_tags termination value.

Definition at line 80 of file codec_internal.h.

◆ FF_CODEC_DECODE_CB

#define FF_CODEC_DECODE_CB (   func)
Value:
.cb.decode = (func)

Definition at line 254 of file codec_internal.h.

◆ FF_CODEC_DECODE_SUB_CB

#define FF_CODEC_DECODE_SUB_CB (   func)
Value:
.cb.decode_sub = (func)

Definition at line 257 of file codec_internal.h.

◆ FF_CODEC_RECEIVE_FRAME_CB

#define FF_CODEC_RECEIVE_FRAME_CB (   func)
Value:
.cb.receive_frame = (func)

Definition at line 260 of file codec_internal.h.

◆ FF_CODEC_ENCODE_CB

#define FF_CODEC_ENCODE_CB (   func)
Value:
.cb.encode = (func)

Definition at line 263 of file codec_internal.h.

◆ FF_CODEC_ENCODE_SUB_CB

#define FF_CODEC_ENCODE_SUB_CB (   func)
Value:
.cb.encode_sub = (func)

Definition at line 266 of file codec_internal.h.

◆ FF_CODEC_RECEIVE_PACKET_CB

#define FF_CODEC_RECEIVE_PACKET_CB (   func)
Value:
.cb.receive_packet = (func)

Definition at line 269 of file codec_internal.h.

Enumeration Type Documentation

◆ FFCodecType

Enumerator
FF_CODEC_CB_TYPE_DECODE 
FF_CODEC_CB_TYPE_DECODE_SUB 
FF_CODEC_CB_TYPE_RECEIVE_FRAME 
FF_CODEC_CB_TYPE_ENCODE 
FF_CODEC_CB_TYPE_ENCODE_SUB 
FF_CODEC_CB_TYPE_RECEIVE_PACKET 

Definition at line 91 of file codec_internal.h.

Function Documentation

◆ ffcodec()

static const av_always_inline FFCodec* ffcodec ( const AVCodec codec)
static
func
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition: jacosubdec.c:68
FF_CODEC_CB_TYPE_RECEIVE_PACKET
@ FF_CODEC_CB_TYPE_RECEIVE_PACKET
Definition: codec_internal.h:109
FF_CODEC_CB_TYPE_ENCODE_SUB
@ FF_CODEC_CB_TYPE_ENCODE_SUB
Definition: codec_internal.h:106
FF_CODEC_CB_TYPE_DECODE
@ FF_CODEC_CB_TYPE_DECODE
Definition: codec_internal.h:94
FF_CODEC_CB_TYPE_ENCODE
@ FF_CODEC_CB_TYPE_ENCODE
Definition: codec_internal.h:103
FF_CODEC_CB_TYPE_DECODE_SUB
@ FF_CODEC_CB_TYPE_DECODE_SUB
Definition: codec_internal.h:97
FF_CODEC_CB_TYPE_RECEIVE_FRAME
@ FF_CODEC_CB_TYPE_RECEIVE_FRAME
Definition: codec_internal.h:100