[FFmpeg-devel] [PATCH] RTSP-MS 4/15: blocksize detection

Ronald S. Bultje rsbultje
Fri Jan 9 01:00:46 CET 2009


Hi Luca,

On Thu, Jan 8, 2009 at 2:27 PM, Luca Barbato <lu_zero at gentoo.org> wrote:
> Ronald S. Bultje wrote:
>> Hi Luca
>>
>> On Thu, Jan 8, 2009 at 5:24 AM, Luca Barbato <lu_zero at gentoo.org> wrote:
>>> Ronald S. Bultje wrote:
>>>> Well, that exists of course. We'll never read more than the buffer
>>>> size, and skip the rest until the next packet starts. Now, the problem
>>>> here is: what if the buffer wasn't large enough? We currently just
>>>> re-try to sync on a packet in tcp_read_packet() - i.e. essentially
>>>> skip it, or read as much as the buffer can hold as udp_read_packet().
>>>> Should we fail? Just continue and try to play what we can? In case of
>>>> the latter, which is what you (and Luca B.) appear to be leaning
>>>> towards, the attached patch would be enough and we can forget about
>>>> this whole Blocksize business.
>>> I'd give a try to use blocksize the way the standard defines it, so
>>> something the client sets and error out if it doesn't come accordingly.
>>
>> That's not what it says, right? It says that you can use any value
>> lower than requested by the client, "or override it with the
>> media-specific size if necessary". That second (overridden) value
>> could be any size, lower or higher (it is unspecified), and it would
>> still be compliant.
>
> Sigh, then this patch is ok as is ...

OK, my apologies, I should back that up with data. Here's a standard reply:

[..]
SETUP rtsp://wm.as34763.net/vruk_vr_hi/stream=1 RTSP/1.0
Transport: RTP/AVP/TCP;unicast;interleaved=0-1;mode=play
CSeq: 3
--
line='RTSP/1.0 200 OK'
line='Blocksize: 5996'
line='Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=5d394640;mode=PLAY'
line='Date: Thu, 08 Jan 2009 23:55:32 GMT'
line='CSeq: 3'
line='Session: 6937310006730872946;timeout=60'
line='Server: WMServer/9.1.1.3841'
line='Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch,
com.microsoft.wm.eosmsg, com.microsoft.wm.fastcache,
com.microsoft.wm.packetpairssrc, com.microsoft.wm.startupprofile'
line='Last-Modified: Sat, 30 Dec 1899 00:00:00 GMT'
line='Cache-Control: x-wms-stream-type="broadcast", no-cache,
no-user-cache, private'
line=''
[..]

According to the spec, I can insert the blocksize request in the
SETUP, so let's see:

[..]
SETUP rtsp://wm.as34763.net/vruk_vr_hi/stream=1 RTSP/1.0
Blocksize: 1500
Transport: RTP/AVP/TCP;unicast;interleaved=0-1;mode=play
CSeq: 3
--
line='RTSP/1.0 200 OK'
line='Blocksize: 5996'
line='Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=1edc63a0;mode=PLAY'
line='Date: Thu, 08 Jan 2009 23:59:12 GMT'
line='CSeq: 3'
line='Session: 9500638754305992890;timeout=60'
line='Server: WMServer/9.1.1.3862'
line='Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch,
com.microsoft.wm.eosmsg, com.microsoft.wm.fastcache,
com.microsoft.wm.packetpairssrc, com.microsoft.wm.startupprofile'
line='Last-Modified: Sat, 30 Dec 1899 00:00:00 GMT'
line='Cache-Control: x-wms-stream-type="broadcast", no-cache,
no-user-cache, private'
line=''
[..]

As you can see (and as I expected), it ignored our request...

And since you approved (I suppose under the assumption that this was
the case), I'll apply the patch that increases the reading buffer size
to 10 * RTP_MAX_PACKET_LENGTH.

Thanks,
Ronald




More information about the ffmpeg-devel mailing list