summaryrefslogtreecommitdiff
path: root/libavformat/rtspdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-05-24 08:44:10 +0200
committerAnton Khirnov <anton@khirnov.net>2011-05-27 06:52:52 +0200
commit4779f59378d54f30644ef79ce3a5c402546f3cb9 (patch)
tree29bbe51ffc7ad0916a27aa507f5c291800e65ba2 /libavformat/rtspdec.c
parent89d1b7f40671e0d455fe6b6670bf6f2bcf2eea2e (diff)
rtspdec: add initial_pause private option.
Deprecate corresponding AVFormatParameters field.
Diffstat (limited to 'libavformat/rtspdec.c')
-rw-r--r--libavformat/rtspdec.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index ccfc4d8e27..fa6bc05517 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -21,6 +21,7 @@
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
@@ -165,7 +166,12 @@ static int rtsp_read_header(AVFormatContext *s,
return AVERROR(ENOMEM);
rt->real_setup = rt->real_setup_cache + s->nb_streams;
- if (ap->initial_pause) {
+#if FF_API_FORMAT_PARAMETERS
+ if (ap->initial_pause)
+ rt->initial_pause = ap->initial_pause;
+#endif
+
+ if (rt->initial_pause) {
/* do not start immediately */
} else {
if (rtsp_read_play(s) < 0) {
@@ -399,6 +405,18 @@ static int rtsp_read_close(AVFormatContext *s)
return 0;
}
+static const AVOption options[] = {
+ { "initial_pause", "Don't start playing the stream immediately", offsetof(RTSPState, initial_pause), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+};
+
+const AVClass rtsp_demuxer_class = {
+ .class_name = "RTSP demuxer",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVInputFormat ff_rtsp_demuxer = {
"rtsp",
NULL_IF_CONFIG_SMALL("RTSP input format"),
@@ -411,4 +429,5 @@ AVInputFormat ff_rtsp_demuxer = {
.flags = AVFMT_NOFILE,
.read_play = rtsp_read_play,
.read_pause = rtsp_read_pause,
+ .priv_class = &rtsp_demuxer_class,
};