[FFmpeg-soc] [PATCH] rtsp tunneling

Ronald S. Bultje rsbultje at gmail.com
Thu Jun 3 20:51:02 CEST 2010


Hi,

On Wed, Jun 2, 2010 at 6:59 PM, Josh Allmann <joshua.allmann at gmail.com> wrote:
> First three are related to http, the last adds actual tunnelling
> support to rtsp.

HTTP doesn't need the new flag, you can always open delayed.

For RTSP/HTTP.


> +    /* base64 encode rtsp if tunnelling */
> +    if (rt->rtsp_hd_out != rt->rtsp_hd) {
> +        if (!av_base64_encode(base64buf, sizeof(base64buf), buf, strlen(buf))) {
> +            av_log(s, AV_LOG_ERROR, "Unable to base64 encode RTSP.\n");
> +            return;
> +        }
> +        out_buf = base64buf;
> +    }
> +

I don't like the if at the top, I'd add a rtsp_protocol_mode with an
enum (like the transport enums in rtsp.h), using
RTSP_PROTOCOL_MODE_PLAIN or RTSP_PROTOCOL_MODE_HTTP. You can also call
it tunnel_mode or so.

> -    url_write(rt->rtsp_hd, buf, strlen(buf));
> +    url_write(rt->rtsp_hd_out, out_buf, strlen(out_buf));
>      if (send_content_length > 0 && send_content)
> -        url_write(rt->rtsp_hd, send_content, send_content_length);
> +        url_write(rt->rtsp_hd_out, send_content, send_content_length);

I'd prefer if you'd do the patch that splits rtsp_hd into hd_in/out separately.

+                 "Content-Length: 32767\r\n"
+                 "Expires: Sun, 9 Jan 1972 00:00:00 GMT\r\n",

??

The rest is pretty, well done!

Ronald


More information about the FFmpeg-soc mailing list