[FFmpeg-cvslog] lavf/segment: add stream_segment variant of the segment muxer

Stefano Sabatini git at videolan.org
Fri Jun 29 17:11:37 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Jan 13 15:38:13 2012 +0100| [a9a7e215e5207e674338b7ca9eb74e96ae5faf99] | committer: Stefano Sabatini

lavf/segment: add stream_segment variant of the segment muxer

This simplifies usage for segment streaming formats with no global
headers, tipically MPEG 2 transport stream "ts" files.

The seg class duplication is required in order to avoid an infinite loop
in libavformat/utils.c:format_child_next_class().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9a7e215e5207e674338b7ca9eb74e96ae5faf99
---

 libavformat/allformats.c |    1 +
 libavformat/segment.c    |   19 ++++++++++++++++++-
 libavformat/version.h    |    4 ++--
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index c3b8bb4..c8b9abf 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -215,6 +215,7 @@ void av_register_all(void)
 #endif
     REGISTER_DEMUXER  (SEGAFILM, segafilm);
     REGISTER_MUXER    (SEGMENT, segment);
+    REGISTER_MUXER    (SEGMENT, stream_segment);
     REGISTER_DEMUXER  (SHORTEN, shorten);
     REGISTER_DEMUXER  (SIFF, siff);
     REGISTER_DEMUXER  (SMACKER, smacker);
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 4a33c65..19d8855 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -269,7 +269,6 @@ static const AVClass seg_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-
 AVOutputFormat ff_segment_muxer = {
     .name           = "segment",
     .long_name      = NULL_IF_CONFIG_SMALL("segment muxer"),
@@ -280,3 +279,21 @@ AVOutputFormat ff_segment_muxer = {
     .write_trailer  = seg_write_trailer,
     .priv_class     = &seg_class,
 };
+
+static const AVClass sseg_class = {
+    .class_name = "stream_segment muxer",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
+AVOutputFormat ff_stream_segment_muxer = {
+    .name           = "stream_segment,ssegment",
+    .long_name      = NULL_IF_CONFIG_SMALL("streaming segment muxer"),
+    .priv_data_size = sizeof(SegmentContext),
+    .flags          = AVFMT_NOFILE,
+    .write_header   = seg_write_header,
+    .write_packet   = seg_write_packet,
+    .write_trailer  = seg_write_trailer,
+    .priv_class     = &sseg_class,
+};
diff --git a/libavformat/version.h b/libavformat/version.h
index 34b8a07..7057e2c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR 54
-#define LIBAVFORMAT_VERSION_MINOR 11
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR 12
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list