mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
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.
This commit is contained in:
parent
183eaa9a25
commit
f5f49a66a2
@ -2780,31 +2780,20 @@ typedef struct AVCodec {
|
||||
* This is the primary way to find a codec from the user perspective.
|
||||
*/
|
||||
const char *name;
|
||||
enum AVMediaType type;
|
||||
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.
|
||||
* see CODEC_CAP_*
|
||||
*/
|
||||
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 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;
|
||||
enum AVMediaType type;
|
||||
enum CodecID id;
|
||||
/**
|
||||
* Codec capabilities.
|
||||
* see CODEC_CAP_*
|
||||
*/
|
||||
int capabilities;
|
||||
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 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 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 {
|
||||
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}
|
||||
|
||||
/*****************************************************************
|
||||
* 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
|
||||
* @{
|
||||
@ -2842,6 +2840,8 @@ typedef struct AVCodec {
|
||||
*/
|
||||
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.
|
||||
*
|
||||
@ -2854,6 +2854,13 @@ typedef struct AVCodec {
|
||||
*/
|
||||
int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
|
||||
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;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user