[2/4] rtsp: Accept options via private avoptions instead of URL options

Message ID 1318442175-89118-2-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö Oct. 12, 2011, 5:56 p.m.
Eventually, the old way of passing options by adding
stuff to the URL can be dropped.

This avoids having to tamper with the user-specified URL to
pass options on the transport mode. This also works better
with redirects, since the options don't need to be parsed out
from the URL.
---
 libavformat/rtsp.c    |   27 +++++++++++++++++++++++++--
 libavformat/rtsp.h    |   12 +++++++++++-
 libavformat/version.h |    5 ++++-
 3 files changed, 40 insertions(+), 4 deletions(-)

Comments

Anton Khirnov Oct. 12, 2011, 8:30 p.m. | #1
On Wed, 12 Oct 2011 20:56:13 +0300, Martin Storsjö <martin@martin.st> wrote:
> Eventually, the old way of passing options by adding
> stuff to the URL can be dropped.
> 
> This avoids having to tamper with the user-specified URL to
> pass options on the transport mode. This also works better
> with redirects, since the options don't need to be parsed out
> from the URL.
> ---
>  libavformat/rtsp.c    |   27 +++++++++++++++++++++++++--
>  libavformat/rtsp.h    |   12 +++++++++++-
>  libavformat/version.h |    5 ++++-
>  3 files changed, 40 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index bd94c09..27cf78c 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -60,6 +60,13 @@
>  const AVOption ff_rtsp_options[] = {
>      { "initial_pause",  "Don't start playing the stream immediately", offsetof(RTSPState, initial_pause),  FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
>      FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
> +    { "rtsp_transport", "RTSP transport protocols", offsetof(RTSPState, lower_transport_mask), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
> +    { "udp", "UDP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_UDP}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
> +    { "tcp", "TCP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_TCP}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
> +    { "udp_multicast", "UDP multicast", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_UDP_MULTICAST}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
> +    { "http", "HTTP tunneling", 0, FF_OPT_TYPE_CONST, {.dbl = (1 << RTSP_LOWER_TRANSPORT_HTTP)}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
> +    { "rtsp_flags", "RTSP flags", offsetof(RTSPState, rtsp_flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_flags" },
> +    { "filter_src", "Only receive packets from the negotiated peer IP", 0, FF_OPT_TYPE_CONST, {.dbl = RTSP_FLAG_FILTER_SRC}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_flags" },
>      { NULL },
>  };

Except for FF->AV issue, some cosmetics suggestions
* we usually #define OFFSET(x) offsetof(priv context, x) and
  AV_OPT_FLAG_blah to something shorter, this saves a lot of space
* you can omit .dbl as it's the first element in the union
* min/max make no sense for named constants, so you can set them to 0
  and save some more space
* vertical alignment would help readability
feel free to implement as many or as few as you like

>  
> @@ -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.
Anton Khirnov Oct. 12, 2011, 8:37 p.m. | #2
On Wed, 12 Oct 2011 22:30:54 +0200, Anton Khirnov <anton@khirnov.net> 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.
Martin Storsjö Oct. 12, 2011, 8:41 p.m. | #3
On Wed, 12 Oct 2011, Anton Khirnov wrote:

> On Wed, 12 Oct 2011 22:30:54 +0200, Anton Khirnov <anton@khirnov.net> wrote:
>>
>>>      /** 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.

I kind of prefer flags over int options for something that's really a 
bool, specifying -filter_source 1 looks worse than -rtsp_flags 
filter_source I think. Or maybe not? But it's all quite cosmetic which one 
is chosen in this case, either one is doable for me in this case.

Flags might feel more scalable if there's going to be many other bool 
options, but I don't know if that really is the case...

// Martin
Anton Khirnov Oct. 12, 2011, 9:11 p.m. | #4
On Wed, 12 Oct 2011 23:41:40 +0300 (EEST), Martin Storsjö <martin@martin.st> wrote:
> On Wed, 12 Oct 2011, Anton Khirnov wrote:
> 
> > On Wed, 12 Oct 2011 22:30:54 +0200, Anton Khirnov <anton@khirnov.net> wrote:
> >>
> >>>      /** 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.
> 
> I kind of prefer flags over int options for something that's really a 
> bool, specifying -filter_source 1 looks worse than -rtsp_flags 
> filter_source I think. Or maybe not? But it's all quite cosmetic which one 
> is chosen in this case, either one is doable for me in this case.
> 
> Flags might feel more scalable if there's going to be many other bool 
> options, but I don't know if that really is the case...

Keep the flags if you prefer them, it's your code after all.

The next patch is ok in that case.
Martin Storsjö Oct. 13, 2011, 11:20 a.m. | #5
On Wed, 12 Oct 2011, Anton Khirnov wrote:

>
> On Wed, 12 Oct 2011 20:56:13 +0300, Martin Storsjö <martin@martin.st> wrote:
>>      FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
>> +    { "rtsp_transport", "RTSP transport protocols", offsetof(RTSPState, lower_transport_mask), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
>> +    { "udp", "UDP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_UDP}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
>> +    { "tcp", "TCP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_TCP}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
>> +    { "udp_multicast", "UDP multicast", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_UDP_MULTICAST}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
>> +    { "http", "HTTP tunneling", 0, FF_OPT_TYPE_CONST, {.dbl = (1 << RTSP_LOWER_TRANSPORT_HTTP)}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
>> +    { "rtsp_flags", "RTSP flags", offsetof(RTSPState, rtsp_flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_flags" },
>> +    { "filter_src", "Only receive packets from the negotiated peer IP", 0, FF_OPT_TYPE_CONST, {.dbl = RTSP_FLAG_FILTER_SRC}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_flags" },
>>      { NULL },
>>  };
>
> Except for FF->AV issue, some cosmetics suggestions
> * we usually #define OFFSET(x) offsetof(priv context, x) and
>  AV_OPT_FLAG_blah to something shorter, this saves a lot of space
> * you can omit .dbl as it's the first element in the union
> * min/max make no sense for named constants, so you can set them to 0
>  and save some more space
> * vertical alignment would help readability
> feel free to implement as many or as few as you like

Implemented all of these except for vertical alignment, which is a bit 
tricky since the length of the description texts vary a lot.

// Martin

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index bd94c09..27cf78c 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -60,6 +60,13 @@ 
 const AVOption ff_rtsp_options[] = {
     { "initial_pause",  "Don't start playing the stream immediately", offsetof(RTSPState, initial_pause),  FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
+    { "rtsp_transport", "RTSP transport protocols", offsetof(RTSPState, lower_transport_mask), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
+    { "udp", "UDP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_UDP}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
+    { "tcp", "TCP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_TCP}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
+    { "udp_multicast", "UDP multicast", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_UDP_MULTICAST}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
+    { "http", "HTTP tunneling", 0, FF_OPT_TYPE_CONST, {.dbl = (1 << RTSP_LOWER_TRANSPORT_HTTP)}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
+    { "rtsp_flags", "RTSP flags", offsetof(RTSPState, rtsp_flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_flags" },
+    { "filter_src", "Only receive packets from the negotiated peer IP", 0, FF_OPT_TYPE_CONST, {.dbl = RTSP_FLAG_FILTER_SRC}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_flags" },
     { NULL },
 };
 
@@ -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
+
 /**
  * Describes a single stream, as identified by a single m= line block in the
  * SDP content. In the case of RDT, one RTSPStream can represent multiple
diff --git a/libavformat/version.h b/libavformat/version.h
index 82a07db..fb8eeff 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -25,7 +25,7 @@ 
 
 #define LIBAVFORMAT_VERSION_MAJOR 53
 #define LIBAVFORMAT_VERSION_MINOR  8
-#define LIBAVFORMAT_VERSION_MICRO  0
+#define LIBAVFORMAT_VERSION_MICRO  1
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
@@ -86,5 +86,8 @@ 
 #ifndef FF_API_TIMESTAMP
 #define FF_API_TIMESTAMP               (LIBAVFORMAT_VERSION_MAJOR < 54)
 #endif
+#ifndef FF_API_RTSP_URL_OPTIONS
+#define FF_API_RTSP_URL_OPTIONS        (LIBAVFORMAT_VERSION_MAJOR < 54)
+#endif
 
 #endif /* AVFORMAT_VERSION_H */