Commit f5f49a66 authored by Anton Khirnov's avatar Anton Khirnov

lavc: reorder AVCodec fields.

Put all private fields at the end and mark them as such so they can be
easily changed/removed.

This breaks ABI.
parent 183eaa9a
...@@ -2780,31 +2780,20 @@ typedef struct AVCodec { ...@@ -2780,31 +2780,20 @@ typedef struct AVCodec {
* This is the primary way to find a codec from the user perspective. * This is the primary way to find a codec from the user perspective.
*/ */
const char *name; const char *name;
/**
* Descriptive name for the codec, meant to be more human readable than name.
* You should use the NULL_IF_CONFIG_SMALL() macro to define it.
*/
const char *long_name;
enum AVMediaType type; enum AVMediaType type;
enum CodecID id; enum CodecID id;
int priv_data_size;
int (*init)(AVCodecContext *);
int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
int (*close)(AVCodecContext *);
int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
/** /**
* Codec capabilities. * Codec capabilities.
* see CODEC_CAP_* * see CODEC_CAP_*
*/ */
int capabilities; int capabilities;
struct AVCodec *next;
/**
* Flush buffers.
* Will be called when seeking
*/
void (*flush)(AVCodecContext *);
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
/**
* Descriptive name for the codec, meant to be more human readable than name.
* You should use the NULL_IF_CONFIG_SMALL() macro to define it.
*/
const char *long_name;
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
...@@ -2812,6 +2801,15 @@ typedef struct AVCodec { ...@@ -2812,6 +2801,15 @@ typedef struct AVCodec {
const AVClass *priv_class; ///< AVClass for the private context const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
/*****************************************************************
* No fields below this line are part of the public API. They
* may not be used outside of libavcodec and can be changed and
* removed at will.
* New public fields should be added right above.
*****************************************************************
*/
int priv_data_size;
struct AVCodec *next;
/** /**
* @name Frame-level threading support functions * @name Frame-level threading support functions
* @{ * @{
...@@ -2842,6 +2840,8 @@ typedef struct AVCodec { ...@@ -2842,6 +2840,8 @@ typedef struct AVCodec {
*/ */
void (*init_static_data)(struct AVCodec *codec); void (*init_static_data)(struct AVCodec *codec);
int (*init)(AVCodecContext *);
int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
/** /**
* Encode data to an AVPacket. * Encode data to an AVPacket.
* *
...@@ -2854,6 +2854,13 @@ typedef struct AVCodec { ...@@ -2854,6 +2854,13 @@ typedef struct AVCodec {
*/ */
int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
int *got_packet_ptr); int *got_packet_ptr);
int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
int (*close)(AVCodecContext *);
/**
* Flush buffers.
* Will be called when seeking
*/
void (*flush)(AVCodecContext *);
} AVCodec; } AVCodec;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment