[FFmpeg-devel] [PATCH 2/7] avformat/rtsp: allow receiving subtitles via RTP
Michael Niedermayer
michaelni at gmx.at
Fri Feb 13 00:10:52 CET 2015
On Thu, Feb 12, 2015 at 10:14:20PM +0100, Thomas Volkert wrote:
> On 02/08/2015 10:22 PM, Gilles Chanteperdrix wrote:
> >---
> > libavformat/rtsp.c | 9 ++++++---
> > 1 file changed, 6 insertions(+), 3 deletions(-)
> >
> >diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> >index ae62252..77407dd 100644
> >--- a/libavformat/rtsp.c
> >+++ b/libavformat/rtsp.c
> >@@ -68,10 +68,11 @@
> > { "filter_src", "only receive packets from the negotiated peer IP", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_FILTER_SRC}, 0, 0, DEC, "rtsp_flags" }
> > #define RTSP_MEDIATYPE_OPTS(name, longname) \
> >- { name, longname, OFFSET(media_type_mask), AV_OPT_TYPE_FLAGS, { .i64 = (1 << (AVMEDIA_TYPE_DATA+1)) - 1 }, INT_MIN, INT_MAX, DEC, "allowed_media_types" }, \
> >+ { name, longname, OFFSET(media_type_mask), AV_OPT_TYPE_FLAGS, { .i64 = (1 << (AVMEDIA_TYPE_SUBTITLE+1)) - 1 }, INT_MIN, INT_MAX, DEC, "allowed_media_types" }, \
> > { "video", "Video", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_VIDEO}, 0, 0, DEC, "allowed_media_types" }, \
> > { "audio", "Audio", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_AUDIO}, 0, 0, DEC, "allowed_media_types" }, \
> >- { "data", "Data", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_DATA}, 0, 0, DEC, "allowed_media_types" }
> >+ { "data", "Data", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_DATA}, 0, 0, DEC, "allowed_media_types" }, \
> >+ { "subtitle", "Subtitle", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_SUBTITLE}, 0, 0, DEC, "allowed_media_types" }
> > #define RTSP_REORDERING_OPTS() \
> > { "reorder_queue_size", "set number of packets to buffer for handling of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC }
> >@@ -399,6 +400,8 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
> > codec_type = AVMEDIA_TYPE_VIDEO;
> > } else if (!strcmp(st_type, "application")) {
> > codec_type = AVMEDIA_TYPE_DATA;
> >+ } else if (!strcmp(st_type, "text")) {
> >+ codec_type = AVMEDIA_TYPE_SUBTITLE;
> > }
> > if (codec_type == AVMEDIA_TYPE_UNKNOWN || !(rt->media_type_mask & (1 << codec_type))) {
> > s1->skip_media = 1;
> >@@ -2368,7 +2371,7 @@ static int rtp_read_header(AVFormatContext *s)
> > /* sdp_read_header initializes this again */
> > ff_network_close();
> >- rt->media_type_mask = (1 << (AVMEDIA_TYPE_DATA+1)) - 1;
> >+ rt->media_type_mask = (1 << (AVMEDIA_TYPE_SUBTITLE+1)) - 1;
> > ret = sdp_read_header(s);
> > s->pb = NULL;
>
> LGTM.
applied
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150213/3a9c322b/attachment.asc>
More information about the ffmpeg-devel
mailing list