[FFmpeg-devel] [PATCH] Add an RTSP muxer

Michael Niedermayer michaelni
Mon Jan 4 17:49:07 CET 2010


On Mon, Jan 04, 2010 at 04:35:33PM +0100, Diego Biurrun wrote:
> On Mon, Jan 04, 2010 at 05:11:13PM +0200, Martin Storsj? wrote:
> > 
> > 
> > From bcc2219ea1d544807aab24668086973a1de00625 Mon Sep 17 00:00:00 2001
> > From: Martin Storsjo <martin at martin.st>
> > Date: Mon, 4 Jan 2010 16:07:04 +0200
> > Subject: [PATCH 19/24] Create RTPMuxContext objects as private transport for output RTSP sessions
> > 
> > --- a/libavformat/rtsp.c
> > +++ b/libavformat/rtsp.c
> > @@ -682,11 +683,15 @@ static void rtsp_close_streams(RTSPState *rt)
> >          rtsp_st = rt->rtsp_streams[i];
> >          if (rtsp_st) {
> >              if (rtsp_st->transport_priv) {
> > +                if (rt->is_output) {
> > +                    ff_rtp_write_close(rtsp_st->transport_priv);
> > +                } else {
> >                  if (rt->transport == RTSP_TRANSPORT_RDT)
> >                      ff_rdt_parse_close(rtsp_st->transport_priv);
> >                  else
> >                      rtp_parse_close(rtsp_st->transport_priv);
> >              }
> > +            }
> >              if (rtsp_st->rtp_pb)
> >                  url_fclose(rtsp_st->rtp_pb);
> >              else if (rtsp_st->rtp_handle)
> 
> The indentation of the closing brace is off.  Also I think this would
> be more readable if you merged the else and the if line.
> 
> > From 20f92d556b98b5f9a51932c10a1e97a8351a56e3 Mon Sep 17 00:00:00 2001
> > From: Martin Storsjo <martin at martin.st>
> > Date: Mon, 4 Jan 2010 16:42:17 +0200
> > Subject: [PATCH 24/24] Add an RTSP muxer
> > 
> > --- a/libavformat/rtsp.c
> > +++ b/libavformat/rtsp.c
> > @@ -44,7 +44,7 @@
> >  
> > -#if CONFIG_RTSP_DEMUXER
> > +#if CONFIG_RTSP_DEMUXER || CONFIG_RTSP_MUXER
> >  static int tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
> >                             uint8_t *buf, int buf_size);
> >  static int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
> 
> All those #ifdefs make me think that it's time to split this file.

And me they remind that they arent needed
heres a patch to get rid of them
luca, ok to apply below?

Index: libavformat/rtsp.c
===================================================================
--- libavformat/rtsp.c	(revision 20997)
+++ libavformat/rtsp.c	(working copy)
@@ -43,13 +43,11 @@
 //#define DEBUG
 //#define DEBUG_RTP_TCP
 
-#if CONFIG_RTSP_DEMUXER
 static int tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
                            uint8_t *buf, int buf_size);
 static int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
                            unsigned char **content_ptr,
                            int return_on_interleaved_data);
-#endif
 
 #if LIBAVFORMAT_VERSION_INT < (53 << 16)
 int rtsp_default_protocols = (1 << RTSP_LOWER_TRANSPORT_UDP);

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100104/9218f55c/attachment.pgp>



More information about the ffmpeg-devel mailing list