[FFmpeg-soc] [vlc-devel] ffmpeg rtsp access demuxer

Josh Allmann joshua.allmann at gmail.com
Thu Jun 24 10:23:15 CEST 2010


Hi,

2010/6/23 Rémi Denis-Courmont <rem at videolan.org>:
> On Saturday 12 June 2010 08:53:03 Josh Allmann, you wrote:
>> Hello,
>>
>> Here is a first attempt at integrating the RTSP layer from ffmpeg. It
>> does so by adding an access demuxer to the VLC scaffolding for
>> libavformat.
>>
>> All the major transports are working (udp, tcp, rtsp-http). I have not
>> yet looked at features like auth or muxing, but I can do that once I
>> know this patch is on the right track.
>
> @@ -117,10 +119,33 @@ int OpenDemux( vlc_object_t *p_this )
>     unsigned int  i;
>     int64_t       i_start_time = -1;
>     bool          b_can_seek;
> +    char          filename[128] = "", opts[8] = "";
> +    int           filename_len = 0;
>
> I'm afraid an RTSP URL could easily exceed 127 characters. Why don't you use
> asprintf() or similar instead?
>

Well, that's a good function to know. Fixed.

> +    if( var_CreateGetBool( p_demux, "rtsp-tcp" ) )
>
> var_InheritBool.
>

Fixed

> +        strcpy(opts, "?tcp");
>
> If I'm not mistaken, you could simply assign a const char pointer instead of
> using strcpy().

Fixed

>
> +    else if( var_CreateGetBool( p_demux, "rtsp-http" ) )
> +        strcpy(opts, "?http");
> +    else if( var_CreateGetBool( p_demux, "rtsp-udp" ) )
> +        strcpy(opts, "?udp");
>
> Same notes as above.
>

Fixed

> +    /* build the filename string */
> +    if( p_demux->psz_access )
> +    {
> +        filename_len += av_strlcatf( filename + filename_len,
> +                                     sizeof(filename) - filename_len,
> +                                     "%s://", p_demux->psz_access);
> +    }
> +    filename_len += av_strlcpy( filename + filename_len,
> +                                p_demux->psz_path,
> +                                sizeof(filename) - filename_len );
> +    filename_len += av_strlcpy( filename + filename_len,
> +                                opts,
> +                                sizeof(filename) - filename_len );
>
> As noted above, this could probably be corrected and simplified to
> if (psz_access) asprintf(...); else asprintf(...);
> plus error handling.
>

Indeed, simplified considerably.

> --
> Rémi Denis-Courmont
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Integrate-FFmpeg-RTSP.patch
Type: text/x-patch
Size: 5159 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20100624/e0131641/attachment.bin>


More information about the FFmpeg-soc mailing list