[FFmpeg-devel] RTSP marker-bit packet merging

Luca Barbato lu_zero
Sun Feb 1 14:54:49 CET 2009


Ronald S. Bultje wrote:
> Hi Luca,
> 
> On Sat, Jan 31, 2009 at 11:13 AM, Luca Barbato <lu_zero at gentoo.org> wrote:
>> Ronald S. Bultje wrote:
>>> I think I agree on second thought. Attached patch OK to apply?
>> +    } else if (ioff == *olen) {
>>
>> It doesn't look right, reading the text doesn't shed much light on this,
>> I guess you assume the full rtp packets have the same size. Isn't it?
> 
> So I modeled the API after what I see in X-QT and ASF. The ASF payload
> header has a "offset or length" bit, and an accompanying value. If the
> bit is set, the value is a "length" of the RTP data in the packet
> directly after the payload header. Normally these are the same,
> although in theory (according to the spec), one RTP packet could
> contain multiple payload headers and multiple ASF data packets.
> Anyway, not important, it gets interesting if the bit is not set.
> Then, the field specifies an "offset" of the data in the complete ASF
> packet, which is divided over multiple packets.
> 
> Btw, if you recount our previous increasing of the buffer size in
> rtsp.c, you'll remember that indeed, for TCP as a lower transport, MS
> servers give huge RTP packets so one single big ASF packet fits in one
> RTP packet. For UDP, instead it divides them over multiple small RTP
> packets, so that multiple RTP packets make up one big ASF packet. The
> marker bit signals the completion of one ASF packet, as with other
> payloads. The offset field specifies the offset of this RTP packet in
> the complete ASF packet. If packets arrive in order, it means you
> should get this:
> 
> RTP packet 0: offset 0, size 1000, M=0 (empty buffer, filled to 1000bytes)
> RTP packet 1: offset 1000, size 1000, M=0 (buffer starts being
> 1000bytes, and is filled to 2000)
> RTP packet 2: offset 2000, size 1000, M=1 (buffer starts being
> 2000bytes, and is completed to 3000)

say that, by sheer luck, the server really consider the rtcp feedback 
and notices that the mtu changed.

 > RTP packet 0: offset 0, size 1000, M=0 (empty buffer, filled to 
1000bytes)
 > RTP packet 1: offset 1000, size 800, M=0 (buffer starts being
 > 1000bytes, and is filled to 1800)
 > RTP packet 2: offset 1800, size 1000, M=1 (buffer starts being
 > 1800bytes, and is completed to 2800)

I'm not sure if I misread the code but in this situation it will error 
out w/out reason.

lu - once I'll recover a bit of sanity

-- 

Luca Barbato
Gentoo Council Member
Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero





More information about the ffmpeg-devel mailing list