aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2010-12-27 09:08:20 +0000
committerNicolas George <nicolas.george@normalesup.org>2010-12-27 09:08:20 +0000
commit9128ae08b38f67147eb75248f7aa2b3247e4fe0c (patch)
treeb315afa11a9bd70bde846ec6086cba6e2bc223b5 /libavformat/avformat.h
parent107a7e3e7b6161cd9ccefeefab1d54be939de43e (diff)
downloadffmpeg-9128ae08b38f67147eb75248f7aa2b3247e4fe0c.tar.gz
Implement av_find_best_stream.
Originally committed as revision 26104 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index f166c090db..c6f282710c 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -22,7 +22,7 @@
#define AVFORMAT_AVFORMAT_H
#define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 90
+#define LIBAVFORMAT_VERSION_MINOR 91
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@@ -1141,6 +1141,37 @@ AVFormatContext *avformat_alloc_context(void);
int av_find_stream_info(AVFormatContext *ic);
/**
+ * Find the "best" stream in the file.
+ * The best stream is determined according to various heuristics as the most
+ * likely to be what the user expects.
+ * If the decoder parameter is non-NULL, av_find_best_stream will find the
+ * default decoder for the stream's codec; streams for which no decoder can
+ * be found are ignored.
+ *
+ * @param ic media file handle
+ * @param type stream type: video, audio, subtitles, etc.
+ * @param wanted_stream_nb user-requested stream number,
+ * or -1 for automatic selection
+ * @param related_stream try to find a stream related (eg. in the same
+ * program) to this one, or -1 if none
+ * @param decoder_ret if non-NULL, returns the decoder for the
+ * selected stream
+ * @param flags flags; none are currently defined
+ * @return the non-negative stream number in case of success,
+ * AVERROR_STREAM_NOT_FOUND if no stream with the requested type
+ * could be found,
+ * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
+ * @note If av_find_best_stream returns successfully and decoder_ret is not
+ * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
+ */
+int av_find_best_stream(AVFormatContext *ic,
+ enum AVMediaType type,
+ int wanted_stream_nb,
+ int related_stream,
+ AVCodec **decoder_ret,
+ int flags);
+
+/**
* Read a transport packet from a media file.
*
* This function is obsolete and should never be used.