Commit 183eaa9a authored by Anton Khirnov's avatar Anton Khirnov

lavf: reorder AVInput/OutputFormat fields.

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

This breaks ABI.
parent f372ce11
...@@ -309,34 +309,16 @@ typedef struct AVOutputFormat { ...@@ -309,34 +309,16 @@ typedef struct AVOutputFormat {
const char *long_name; const char *long_name;
const char *mime_type; const char *mime_type;
const char *extensions; /**< comma-separated filename extensions */ const char *extensions; /**< comma-separated filename extensions */
/**
* size of private data so that it can be allocated in the wrapper
*/
int priv_data_size;
/* output support */ /* output support */
enum CodecID audio_codec; /**< default audio codec */ enum CodecID audio_codec; /**< default audio codec */
enum CodecID video_codec; /**< default video codec */ enum CodecID video_codec; /**< default video codec */
int (*write_header)(struct AVFormatContext *); enum CodecID subtitle_codec; /**< default subtitle codec */
/**
* Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
* pkt can be NULL in order to flush data buffered in the muxer.
* When flushing, return 0 if there still is more data to flush,
* or 1 if everything was flushed and there is no more buffered
* data.
*/
int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
int (*write_trailer)(struct AVFormatContext *);
/** /**
* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
* AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
* AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH
*/ */
int flags; int flags;
/**
* Currently only used to set pixel format if not YUV420P.
*/
int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
AVPacket *in, int flush);
/** /**
* List of supported codec_id-codec_tag pairs, ordered by "better * List of supported codec_id-codec_tag pairs, ordered by "better
...@@ -344,10 +326,37 @@ typedef struct AVOutputFormat { ...@@ -344,10 +326,37 @@ typedef struct AVOutputFormat {
*/ */
const struct AVCodecTag * const *codec_tag; const struct AVCodecTag * const *codec_tag;
enum CodecID subtitle_codec; /**< default subtitle codec */
const AVClass *priv_class; ///< AVClass for the private context const AVClass *priv_class; ///< AVClass for the private context
/*****************************************************************
* No fields below this line are part of the public API. They
* may not be used outside of libavformat and can be changed and
* removed at will.
* New public fields should be added right above.
*****************************************************************
*/
struct AVOutputFormat *next;
/**
* size of private data so that it can be allocated in the wrapper
*/
int priv_data_size;
int (*write_header)(struct AVFormatContext *);
/**
* Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
* pkt can be NULL in order to flush data buffered in the muxer.
* When flushing, return 0 if there still is more data to flush,
* or 1 if everything was flushed and there is no more buffered
* data.
*/
int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
int (*write_trailer)(struct AVFormatContext *);
/**
* Currently only used to set pixel format if not YUV420P.
*/
int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
AVPacket *in, int flush);
/** /**
* Test if the given codec can be stored in this container. * Test if the given codec can be stored in this container.
* *
...@@ -355,9 +364,6 @@ typedef struct AVOutputFormat { ...@@ -355,9 +364,6 @@ typedef struct AVOutputFormat {
* A negative number if unknown. * A negative number if unknown.
*/ */
int (*query_codec)(enum CodecID id, int std_compliance); int (*query_codec)(enum CodecID id, int std_compliance);
/* private fields */
struct AVOutputFormat *next;
} AVOutputFormat; } AVOutputFormat;
/** /**
* @} * @}
...@@ -381,6 +387,38 @@ typedef struct AVInputFormat { ...@@ -381,6 +387,38 @@ typedef struct AVInputFormat {
*/ */
const char *long_name; const char *long_name;
/**
* Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
* AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
* AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
*/
int flags;
/**
* If extensions are defined, then no probe is done. You should
* usually not use extension format guessing because it is not
* reliable enough
*/
const char *extensions;
const struct AVCodecTag * const *codec_tag;
const AVClass *priv_class; ///< AVClass for the private context
/*****************************************************************
* No fields below this line are part of the public API. They
* may not be used outside of libavformat and can be changed and
* removed at will.
* New public fields should be added right above.
*****************************************************************
*/
struct AVInputFormat *next;
/**
* General purpose read-only value that the format can use.
*/
int value;
/** /**
* Size of private data so that it can be allocated in the wrapper. * Size of private data so that it can be allocated in the wrapper.
*/ */
...@@ -436,25 +474,6 @@ typedef struct AVInputFormat { ...@@ -436,25 +474,6 @@ typedef struct AVInputFormat {
int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index, int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
int64_t *pos, int64_t pos_limit); int64_t *pos, int64_t pos_limit);
/**
* Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
* AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
* AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
*/
int flags;
/**
* If extensions are defined, then no probe is done. You should
* usually not use extension format guessing because it is not
* reliable enough
*/
const char *extensions;
/**
* General purpose read-only value that the format can use.
*/
int value;
/** /**
* Start/resume playing - only meaningful if using a network-based format * Start/resume playing - only meaningful if using a network-based format
* (RTSP). * (RTSP).
...@@ -467,8 +486,6 @@ typedef struct AVInputFormat { ...@@ -467,8 +486,6 @@ typedef struct AVInputFormat {
*/ */
int (*read_pause)(struct AVFormatContext *); int (*read_pause)(struct AVFormatContext *);
const struct AVCodecTag * const *codec_tag;
/** /**
* Seek to timestamp ts. * Seek to timestamp ts.
* Seeking will be done so that the point from which all active streams * Seeking will be done so that the point from which all active streams
...@@ -476,11 +493,6 @@ typedef struct AVInputFormat { ...@@ -476,11 +493,6 @@ typedef struct AVInputFormat {
* Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
*/ */
int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
const AVClass *priv_class; ///< AVClass for the private context
/* private fields */
struct AVInputFormat *next;
} AVInputFormat; } AVInputFormat;
/** /**
* @} * @}
......
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