Go to the documentation of this file.
27 return ret ?
ret :
"unknown";
30 #define AV_LOG(...) av_log(NULL, AV_LOG_FATAL, __VA_ARGS__)
31 #define ERR_INTERNAL(msg, ...) \
33 AV_LOG(msg, codec->name __VA_ARGS__); \
36 #define ERR(msg) ERR_INTERNAL(msg, )
37 #define ERR_EXT(msg, ...) ERR_INTERNAL(msg, , __VA_ARGS__)
50 AV_LOG(
"Option %s offset %d nonsensical\n",
51 opt->name, opt->offset);
65 int is_decoder, is_encoder;
68 AV_LOG(
"Codec for format %s has no name\n",
76 ERR_EXT(
"Codec %s has unsupported type %s\n",
81 ERR(
"Non-audio codec %s has audio-only fields set\n");
85 ERR(
"Non-audio codec %s has audio-only capabilities set\n");
89 ERR(
"Non-video codec %s has video-only fields set\n");
91 ERR(
"Non-video codec %s exports cropping\n");
95 ERR(
"Codec %s wants mainfunction despite not being "
96 "slice-threading capable");
101 ERR(
"Codec %s has private-only threading support\n");
105 if (!!is_decoder + !!is_encoder != 1) {
106 ERR(
"Codec %s is decoder and encoder or neither.\n");
111 ERR(
"Encoder %s is both subtitle encoder and not subtitle encoder.");
113 ERR(
"Encoder %s does not implement exactly one encode API.\n");
115 ERR(
"Encoder %s has decoder-only thread functions or bsf.\n");
131 ERR(
"Encoder %s has decoder-only capabilities set\n");
134 ERR(
"Frame-threaded encoder %s claims to support flushing\n");
137 ERR(
"Subtitle decoder %s does not implement decode callback\n");
139 ERR(
"Automatic bitstream filtering unsupported for subtitles; "
140 "yet decoder %s has it set\n");
142 ERR(
"Decoder %s does not implement exactly one decode API.\n");
147 ERR(
"Decoder %s has encoder-only capabilities\n");
150 ERR(
"Decoder %s wants allocated progress without supporting"
154 ERR_EXT(
"Private context of codec %s is impossibly-sized (size %d).",
157 ERR(
"Codec %s lacks a corresponding descriptor\n");
158 }
else if (
desc->type != codec->
type)
159 ERR_EXT(
"The type of AVCodec %s and its AVCodecDescriptor differ: "
#define FF_CODEC_CAP_SETS_PKT_DTS
Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.
const AVClass * priv_class
AVClass for the private context.
int(* update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src)
Copy necessary context variables from a previous thread context to the current one.
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
int capabilities
Codec capabilities.
enum AVSampleFormat * sample_fmts
array of supported sample formats, or NULL if unknown, array is terminated by -1
const char * bsfs
Decoding only, a comma-separated list of bitstream filters to apply to packets before decoding.
int(* encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_CODEC_CAP_ENCODER_FLUSH
This encoder can be flushed using avcodec_flush_buffers().
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
const int * supported_samplerates
array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const AVRational * supported_framerates
array of supported framerates, or NULL if any, array is terminated by {0,0}
This struct describes the properties of a single codec described by an AVCodecID.
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This codec takes the reordered_opaque field from input AVFrames and returns it in the corresponding f...
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
static int priv_data_size_wrong(const AVCodec *codec)
Describe the class of an AVClass context structure.
static const char * get_type_string(enum AVMediaType type)
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE
Audio encoder supports receiving a different number of samples in each call.
#define FF_CODEC_CAP_EXPORTS_CROPPING
The decoder sets the cropping fields in the output frames manually.
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
int av_codec_is_decoder(const AVCodec *codec)
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
int(* update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src)
Copy variables back to the user-facing context.
int(* encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, const struct AVFrame *frame, int *got_packet_ptr)
Encode data to an AVPacket.
int(* receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt)
Encode API with decoupled frame/packet dataflow.
#define FF_CODEC_CAP_SETS_FRAME_PROPS
Codec handles output frame properties internally instead of letting the internal logic derive them fr...
int(* receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame)
Decode API with decoupled packet/frame dataflow.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF
Codec initializes slice-based threading with a main function.
int av_codec_is_encoder(const AVCodec *codec)
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
const char * name
Name of the codec implementation.
const AVCodec * av_codec_iterate(void **opaque)
Iterate over all registered codecs.
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
int caps_internal
Internal codec capabilities.
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
const struct AVOption * option
a pointer to the first option specified in the class if any or NULL
#define AV_CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time,...
#define FF_CODEC_CAP_ALLOCATE_PROGRESS
#define AV_CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
int(* decode)(struct AVCodecContext *avctx, void *outdata, int *got_frame_ptr, struct AVPacket *avpkt)
Decode picture or subtitle data.
#define AV_CODEC_CAP_AVOID_PROBING
Decoder is not a preferred choice for probing.
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
const uint64_t * channel_layouts
array of support channel layouts, or NULL if unknown. array is terminated by 0