X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favformat.h;h=d63966662e0d3a9feaf59ce6b06bd1b83e858c07;hb=42610c4983c14cf320267ad4fad5db7c95f203b5;hp=a8f4accefffbf7ee30af4fd32edef77a37ab9dba;hpb=15786dc47118aded4e5f5c92d7663d188e999369;p=ffmpeg diff --git a/libavformat/avformat.h b/libavformat/avformat.h index a8f4accefff..d63966662e0 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -21,12 +21,8 @@ #ifndef AVFORMAT_H #define AVFORMAT_H -#ifdef __cplusplus -extern "C" { -#endif - -#define LIBAVFORMAT_VERSION_INT ((51<<16)+(10<<8)+0) -#define LIBAVFORMAT_VERSION 51.10.0 +#define LIBAVFORMAT_VERSION_INT ((51<<16)+(12<<8)+1) +#define LIBAVFORMAT_VERSION 51.12.1 #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) @@ -111,8 +107,11 @@ static inline void av_free_packet(AVPacket *pkt) /*************************************************/ /* fractional numbers for exact pts handling */ -/* the exact value of the fractional number is: 'val + num / den'. num - is assumed to be such as 0 <= num < den */ +/** + * the exact value of the fractional number is: 'val + num / den'. + * num is assumed to be such as 0 <= num < den + * @deprecated Use AVRational instead +*/ typedef struct AVFrac { int64_t val, num, den; } AVFrac attribute_deprecated; @@ -132,6 +131,7 @@ typedef struct AVProbeData { } AVProbeData; #define AVPROBE_SCORE_MAX 100 ///< max score, half of that is used for file extension based detection +#define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer typedef struct AVFormatParameters { AVRational time_base; @@ -170,7 +170,7 @@ typedef struct AVOutputFormat { const char *name; const char *long_name; const char *mime_type; - const char *extensions; /**< comma separated 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 */ @@ -204,7 +204,7 @@ typedef struct AVInputFormat { int (*read_probe)(AVProbeData *); /** read the format header and initialize the AVFormatContext structure. Return 0 if OK. 'ap' if non NULL contains - additionnal paramters. Only used in raw format right + additional paramters. Only used in raw format right now. 'av_new_stream' should be called to create new streams. */ int (*read_header)(struct AVFormatContext *, AVFormatParameters *ap); @@ -252,6 +252,13 @@ typedef struct AVInputFormat { struct AVInputFormat *next; } AVInputFormat; +enum AVStreamParseType { + AVSTREAM_PARSE_NONE, + AVSTREAM_PARSE_FULL, /**< full parsing and repack */ + AVSTREAM_PARSE_HEADERS, /**< only parse headers, don't repack */ + AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on packet boundary */ +}; + typedef struct AVIndexEntry { int64_t pos; int64_t timestamp; @@ -275,9 +282,11 @@ typedef struct AVStream { */ AVRational r_frame_rate; void *priv_data; +#if LIBAVFORMAT_VERSION_INT < (52<<16) /* internal data used in av_find_stream_info() */ int64_t codec_info_duration; int codec_info_nb_frames; +#endif /** encoding: PTS generation when outputing stream */ AVFrac pts; @@ -296,17 +305,15 @@ typedef struct AVStream { /** quality, as it has been removed from AVCodecContext and put in AVVideoFrame * MN:dunno if thats the right place, for it */ float quality; - /** decoding: position of the first frame of the component, in - AV_TIME_BASE fractional seconds. */ + /** decoding: pts of the first frame of the stream, in stream time base. */ int64_t start_time; - /** decoding: duration of the stream, in AV_TIME_BASE fractional - seconds. */ + /** decoding: duration of the stream, in stream time base. */ int64_t duration; char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */ /* av_read_frame() support */ - int need_parsing; ///< 1->full parsing needed, 2->only parse headers dont repack + enum AVStreamParseType need_parsing; struct AVCodecParserContext *parser; int64_t cur_dts; @@ -442,21 +449,51 @@ enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum CodecType type); /** - * Print nice hexa dump of a buffer - * @param f stream for output + * Send a nice hexadecimal dump of a buffer to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. * @param buf buffer * @param size buffer size + * + * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log */ void av_hex_dump(FILE *f, uint8_t *buf, int size); /** - * Print on 'f' a nice dump of a packet - * @param f stream for output + * Send a nice hexadecimal dump of a buffer to the log. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message, lower values signifying + * higher importance. + * @param buf buffer + * @param size buffer size + * + * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log + */ +void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size); + +/** + * Send a nice dump of a packet to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. * @param pkt packet to dump * @param dump_payload true if the payload must be displayed too */ void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload); +/** + * Send a nice dump of a packet to the log. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message, lower values signifying + * higher importance. + * @param pkt packet to dump + * @param dump_payload true if the payload must be displayed too + */ +void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload); + void av_register_all(void); /** codec tag <-> codec id */ @@ -494,7 +531,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, * @param filename filename to open. * @param fmt if non NULL, force the file format to use * @param buf_size optional buffer size (zero if default is OK) - * @param ap additionnal parameters needed when opening the file (NULL if default) + * @param ap additional parameters needed when opening the file (NULL if default) * @return 0 if OK. AVERROR_xxx otherwise. */ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, @@ -848,9 +885,5 @@ int match_ext(const char *filename, const char *extensions); #endif /* HAVE_AV_CONFIG_H */ -#ifdef __cplusplus -} -#endif - #endif /* AVFORMAT_H */