[FFmpeg-cvslog] r25535 - in trunk: configure libavformat/Makefile libavformat/allformats.c libavformat/rtsp.c

mstorsjo subversion
Thu Oct 21 14:18:49 CEST 2010


Author: mstorsjo
Date: Thu Oct 21 14:18:48 2010
New Revision: 25535

Log:
rtsp: Untangle the dependencies between the RTSP/SDP demuxers and RTSP muxer

This allows compilation of one of them without requiring the others'
dependencies to be present.

Modified:
   trunk/configure
   trunk/libavformat/Makefile
   trunk/libavformat/allformats.c
   trunk/libavformat/rtsp.c

Modified: trunk/configure
==============================================================================
--- trunk/configure	Thu Oct 21 14:13:02 2010	(r25534)
+++ trunk/configure	Thu Oct 21 14:18:48 2010	(r25535)
@@ -912,6 +912,7 @@ CONFIG_LIST="
     pic
     postproc
     rdft
+    rtpdec
     runtime_cpudetect
     shared
     small
@@ -1362,11 +1363,12 @@ mxf_d10_muxer_select="mxf_muxer"
 ogg_demuxer_select="golomb"
 psp_muxer_select="mov_muxer"
 rtp_demuxer_select="sdp_demuxer"
-rtsp_demuxer_select="http_protocol sdp_demuxer"
-rtsp_muxer_select="rtp_muxer http_protocol sdp_demuxer"
+rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
+rtsp_demuxer_select="http_protocol rtpdec"
+rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol"
 sap_demuxer_select="sdp_demuxer"
 sap_muxer_select="rtp_muxer rtp_protocol"
-sdp_demuxer_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
+sdp_demuxer_select="rtpdec"
 spdif_muxer_select="aac_parser"
 tg2_muxer_select="mov_muxer"
 tgp_muxer_select="mov_muxer"

Modified: trunk/libavformat/Makefile
==============================================================================
--- trunk/libavformat/Makefile	Thu Oct 21 14:13:02 2010	(r25534)
+++ trunk/libavformat/Makefile	Thu Oct 21 14:18:48 2010	(r25535)
@@ -230,11 +230,11 @@ OBJS-$(CONFIG_RTP_MUXER)                
                                             rtpenc_xiph.o \
                                             avc.o
 OBJS-$(CONFIG_RTSP_DEMUXER)              += rtsp.o httpauth.o
-OBJS-$(CONFIG_RTSP_MUXER)                += rtsp.o rtspenc.o httpauth.o
+OBJS-$(CONFIG_RTSP_MUXER)                += rtsp.o rtspenc.o httpauth.o \
+                                            rtpenc_chain.o
 OBJS-$(CONFIG_SAP_DEMUXER)               += sapdec.o
 OBJS-$(CONFIG_SAP_MUXER)                 += sapenc.o rtpenc_chain.o
-OBJS-$(CONFIG_SDP_DEMUXER)               += rtsp.o        \
-                                            rdt.o         \
+OBJS-$(CONFIG_RTPDEC)                    += rdt.o         \
                                             rtp.o         \
                                             rtpdec.o      \
                                             rtpdec_amr.o  \
@@ -247,8 +247,8 @@ OBJS-$(CONFIG_SDP_DEMUXER)              
                                             rtpdec_qt.o   \
                                             rtpdec_svq3.o \
                                             rtpdec_vp8.o  \
-                                            rtpdec_xiph.o \
-                                            rtpenc_chain.o
+                                            rtpdec_xiph.o
+OBJS-$(CONFIG_SDP_DEMUXER)               += rtsp.o
 OBJS-$(CONFIG_SEGAFILM_DEMUXER)          += segafilm.o
 OBJS-$(CONFIG_SHORTEN_DEMUXER)           += rawdec.o
 OBJS-$(CONFIG_SIFF_DEMUXER)              += siff.o

Modified: trunk/libavformat/allformats.c
==============================================================================
--- trunk/libavformat/allformats.c	Thu Oct 21 14:13:02 2010	(r25534)
+++ trunk/libavformat/allformats.c	Thu Oct 21 14:18:48 2010	(r25535)
@@ -183,7 +183,7 @@ void av_register_all(void)
     REGISTER_MUXDEMUX (RTSP, rtsp);
     REGISTER_MUXDEMUX (SAP, sap);
     REGISTER_DEMUXER  (SDP, sdp);
-#if CONFIG_SDP_DEMUXER
+#if CONFIG_RTPDEC
     av_register_rtp_dynamic_payload_handlers();
     av_register_rdt_dynamic_payload_handlers();
 #endif

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	Thu Oct 21 14:13:02 2010	(r25534)
+++ trunk/libavformat/rtsp.c	Thu Oct 21 14:18:48 2010	(r25535)
@@ -125,6 +125,7 @@ static int get_sockaddr(const char *buf,
     return 0;
 }
 
+#if CONFIG_RTPDEC
 /* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */
 static int sdp_parse_rtpmap(AVFormatContext *s,
                             AVCodecContext *codec, RTSPStream *rtsp_st,
@@ -457,6 +458,7 @@ static int sdp_parse(AVFormatContext *s,
     }
     return 0;
 }
+#endif /* CONFIG_RTPDEC */
 
 /* close and free RTSP streams */
 void ff_rtsp_close_streams(AVFormatContext *s)
@@ -483,9 +485,9 @@ void ff_rtsp_close_streams(AVFormatConte
                     av_metadata_free(&rtpctx->metadata);
                     av_free(rtpctx->streams[0]);
                     av_free(rtpctx);
-                } else if (rt->transport == RTSP_TRANSPORT_RDT)
+                } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
                     ff_rdt_parse_close(rtsp_st->transport_priv);
-                else
+                else if (CONFIG_RTPDEC)
                     rtp_parse_close(rtsp_st->transport_priv);
             }
             if (rtsp_st->rtp_handle)
@@ -514,17 +516,17 @@ static int rtsp_open_transport_ctx(AVFor
     if (!st)
         s->ctx_flags |= AVFMTCTX_NOHEADER;
 
-    if (s->oformat) {
+    if (s->oformat && CONFIG_RTSP_MUXER) {
         rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
                                       rtsp_st->rtp_handle,
                                       RTSP_TCP_MAX_PACKET_SIZE);
         /* Ownership of rtp_handle is passed to the rtp mux context */
         rtsp_st->rtp_handle = NULL;
-    } else if (rt->transport == RTSP_TRANSPORT_RDT)
+    } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
         rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
                                             rtsp_st->dynamic_protocol_context,
                                             rtsp_st->dynamic_handler);
-    else
+    else if (CONFIG_RTPDEC)
         rtsp_st->transport_priv = rtp_parse_open(s, st, rtsp_st->rtp_handle,
                                          rtsp_st->sdp_payload_type,
             (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP || !s->max_delay)
@@ -532,7 +534,7 @@ static int rtsp_open_transport_ctx(AVFor
 
     if (!rtsp_st->transport_priv) {
          return AVERROR(ENOMEM);
-    } else if (rt->transport != RTSP_TRANSPORT_RDT) {
+    } else if (rt->transport != RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) {
         if (rtsp_st->dynamic_handler) {
             rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv,
                                            rtsp_st->dynamic_protocol_context,
@@ -1068,7 +1070,7 @@ static int make_setup_request(AVFormatCo
         snprintf(cmd, sizeof(cmd),
                  "Transport: %s\r\n",
                  transport);
-        if (i == 0 && rt->server_type == RTSP_SERVER_REAL) {
+        if (i == 0 && rt->server_type == RTSP_SERVER_REAL && CONFIG_RTPDEC) {
             char real_res[41], real_csum[9];
             ff_rdt_calc_response_and_checksum(real_res, real_csum,
                                               real_challenge);
@@ -1133,7 +1135,8 @@ static int make_setup_request(AVFormatCo
              * potential NAT router by sending dummy packets.
              * RTP/RTCP dummy packets are used for RDT, too.
              */
-            if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && s->iformat)
+            if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && s->iformat &&
+                CONFIG_RTPDEC)
                 rtp_send_punch_packets(rtsp_st->rtp_handle);
             break;
         }
@@ -1232,6 +1235,7 @@ static int rtsp_read_play(AVFormatContex
     return 0;
 }
 
+#if CONFIG_RTSP_DEMUXER
 static int rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
 {
     RTSPState *rt = s->priv_data;
@@ -1268,7 +1272,9 @@ static int rtsp_setup_input_streams(AVFo
 
     return 0;
 }
+#endif /* CONFIG_RTSP_DEMUXER */
 
+#if CONFIG_RTSP_MUXER
 static int rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
 {
     RTSPState *rt = s->priv_data;
@@ -1332,6 +1338,7 @@ static int rtsp_setup_output_streams(AVF
 
     return 0;
 }
+#endif /* CONFIG_RTSP_MUXER */
 
 void ff_rtsp_close_connections(AVFormatContext *s)
 {
@@ -1548,9 +1555,9 @@ redirect:
         break;
     }
 
-    if (s->iformat)
+    if (s->iformat && CONFIG_RTSP_DEMUXER)
         err = rtsp_setup_input_streams(s, reply);
-    else
+    else if (CONFIG_RTSP_MUXER)
         err = rtsp_setup_output_streams(s, host);
     if (err)
         goto fail;
@@ -1589,6 +1596,7 @@ redirect:
 }
 #endif /* CONFIG_RTSP_DEMUXER || CONFIG_RTSP_MUXER */
 
+#if CONFIG_RTPDEC
 static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
                            uint8_t *buf, int buf_size, int64_t wait_end)
 {
@@ -1777,6 +1785,7 @@ end:
 
     return ret;
 }
+#endif /* CONFIG_RTPDEC */
 
 #if CONFIG_RTSP_DEMUXER
 static int rtsp_read_header(AVFormatContext *s,
@@ -2020,6 +2029,7 @@ AVInputFormat rtsp_demuxer = {
 };
 #endif /* CONFIG_RTSP_DEMUXER */
 
+#if CONFIG_SDP_DEMUXER
 static int sdp_probe(AVProbeData *p1)
 {
     const char *p = p1->buf, *p_end = p1->buf + p1->buf_size;
@@ -2104,7 +2114,9 @@ AVInputFormat sdp_demuxer = {
     rtsp_fetch_packet,
     sdp_read_close,
 };
+#endif /* CONFIG_SDP_DEMUXER */
 
+#if CONFIG_RTP_DEMUXER
 static int rtp_probe(AVProbeData *p)
 {
     if (av_strstart(p->filename, "rtp:", NULL))
@@ -2207,4 +2219,5 @@ AVInputFormat rtp_demuxer = {
     sdp_read_close,
     .flags = AVFMT_NOFILE,
 };
+#endif /* CONFIG_RTP_DEMUXER */
 



More information about the ffmpeg-cvslog mailing list