X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favformat.h;h=bf6f96d2a40b5907a733c4fcc09e543500da4d1f;hb=d42b09723ed154d5269b95efcc20cb1874f60816;hp=f9f9be5b02cfb9b90aced5aff193a7ede58a0498;hpb=50196a982bf7c8be9b41053fa0975473c217e709;p=ffmpeg diff --git a/libavformat/avformat.h b/libavformat/avformat.h index f9f9be5b02c..bf6f96d2a40 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1038,6 +1038,25 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); */ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max); +/** + * Probe a bytestream to determine the input format. Each time a probe returns + * with a score that is too low, the probe buffer size is increased and another + * attempt is made. When the maximum probe size is reached, the input format + * with the highest score is returned. + * + * @param pb the bytestream to probe + * @param fmt the input format is put here + * @param filename the filename of the stream + * @param logctx the log context + * @param offset the offset within the bytestream to probe from + * @param max_probe_size the maximum probe buffer size (zero for default) + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, + const char *filename, void *logctx, + unsigned int offset, unsigned int max_probe_size); + /** * Allocate all the structures needed to read an input stream. * This does not open the needed codecs for decoding the stream[s]. @@ -1072,8 +1091,8 @@ attribute_deprecated AVFormatContext *av_alloc_format_context(void); /** * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! + * avformat_free_context() can be used to free the context and everything + * allocated by the framework within it. */ AVFormatContext *avformat_alloc_context(void); @@ -1229,6 +1248,12 @@ void av_close_input_stream(AVFormatContext *s); */ void av_close_input_file(AVFormatContext *s); +/** + * Free an AVFormatContext and all its streams. + * @param s context to free + */ +void avformat_free_context(AVFormatContext *s); + /** * Add a new stream to a media file. * @@ -1243,23 +1268,8 @@ AVStream *av_new_stream(AVFormatContext *s, int id); AVProgram *av_new_program(AVFormatContext *s, int id); /** - * Add a new chapter. - * This function is NOT part of the public API - * and should ONLY be used by demuxers. - * - * @param s media file handle - * @param id unique ID for this chapter - * @param start chapter start time in time_base units - * @param end chapter end time in time_base units - * @param title chapter title - * - * @return AVChapter or NULL on error - */ -AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, - int64_t start, int64_t end, const char *title); - -/** - * Set the pts for a given stream. + * Set the pts for a given stream. If the new values would be invalid + * (<= 0), it leaves the AVStream unchanged. * * @param s stream * @param pts_wrap_bits number of bits effectively used by the pts @@ -1287,15 +1297,6 @@ int av_find_default_stream_index(AVFormatContext *s); */ int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags); -/** - * Ensure the index uses less memory than the maximum specified in - * AVFormatContext.max_index_size by discarding entries if it grows - * too large. - * This function is not part of the public API and should only be called - * by demuxers. - */ -void ff_reduce_index(AVFormatContext *s, int stream_index); - /** * Add an index entry into a sorted list. Update the entry if the list * already contains it.