On Wed, 12 Oct 2011 22:30:54 +0200, Anton Khirnov <[email protected]> wrote: > > > > > @@ -1308,15 +1315,23 @@ int ff_rtsp_connect(AVFormatContext *s) > > char *option_list, *option, *filename; > > int port, err, tcp_fd; > > RTSPMessageHeader reply1 = {0}, *reply = &reply1; > > - int lower_transport_mask = 0; > > + int lower_transport_mask = rt->lower_transport_mask; > > char real_challenge[64] = ""; > > struct sockaddr_storage peer; > > socklen_t peer_len = sizeof(peer); > > > > if (!ff_network_init()) > > return AVERROR(EIO); > > -redirect: > > + > > rt->control_transport = RTSP_MODE_PLAIN; > > + if (lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_HTTP)) { > > + lower_transport_mask = 1 << RTSP_LOWER_TRANSPORT_TCP; > > + rt->control_transport = RTSP_MODE_TUNNEL; > > + } > > + if (rt->rtsp_flags & RTSP_FLAG_FILTER_SRC) > > + rt->filter_source = 1; > > + > > +redirect: > > /* extract hostname and port */ > > av_url_split(NULL, 0, auth, sizeof(auth), > > host, sizeof(host), &port, path, sizeof(path), > > s->filename); > > @@ -1326,6 +1341,7 @@ redirect: > > if (port < 0) > > port = RTSP_DEFAULT_PORT; > > > > +#if FF_API_RTSP_URL_OPTIONS > > /* search for options */ > > option_list = strrchr(path, '?'); > > if (option_list) { > > @@ -1333,6 +1349,7 @@ redirect: > > * the options back into the same string. */ > > filename = option_list; > > while (option_list) { > > + int handled = 1; > > /* move the option pointer */ > > option = ++option_list; > > option_list = strchr(option_list, '&'); > > @@ -1358,10 +1375,16 @@ redirect: > > memmove(++filename, option, len); > > filename += len; > > if (option_list) *filename = '&'; > > + handled = 0; > > } > > + if (handled) > > + av_log(s, AV_LOG_WARNING, "Options passed via URL are " > > + "deprecated, use -rtsp_transport > > " > > + "and -rtsp_flags instead.\n"); > > } > > *filename = 0; > > } > > +#endif > > > > if (!lower_transport_mask) > > lower_transport_mask = (1 << RTSP_LOWER_TRANSPORT_NB) - 1; > > diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h > > index 5327b00..ba87c53 100644 > > --- a/libavformat/rtsp.h > > +++ b/libavformat/rtsp.h > > @@ -38,7 +38,10 @@ enum RTSPLowerTransport { > > RTSP_LOWER_TRANSPORT_UDP = 0, /**< UDP/unicast */ > > RTSP_LOWER_TRANSPORT_TCP = 1, /**< TCP; interleaved in RTSP > > */ > > RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, /**< UDP/multicast */ > > - RTSP_LOWER_TRANSPORT_NB > > + RTSP_LOWER_TRANSPORT_NB, > > + RTSP_LOWER_TRANSPORT_HTTP = 8, /**< HTTP tunneled - not a > > proper > > + transport mode as such, > > + only for use via > > AVOptions */ > > }; > > > > /** > > @@ -350,8 +353,15 @@ typedef struct RTSPState { > > > > /** Whether the server accepts the x-Dynamic-Rate header */ > > int accept_dynamic_rate; > > + > > + /** > > + * Various option flags for the RTSP muxer/demuxer. > > + */ > > + int rtsp_flags; > > } RTSPState; > > > > +#define RTSP_FLAG_FILTER_SRC 0x1 > > I would make this a separate option -- makes for less code, since you > can set rt->filter_source directly. >
Disregard this, i wrote this before looking at the next patch. Though i wonder if using flags is really better. They require more knowledge from the user. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
