[Live-devel] Reading custom packets (was: Re: RTSP Client subclassing questions.)
Cristiano Belloni
belloni at imavis.com
Mon Jan 28 07:10:53 PST 2008
Ross Finlayson wrote:
> Yes - it already exists, in the implementation of the
> "MPEG4ESVideoRTPSource" class: i.e., in the implementation of the RTP
> payload format for MPEG-4 video. Note, in particular, the
> "MPEG4ESVideoRTPSource::processSpecialHeader()" function.
>
Ok, I'd like to re-implement the processSpecialHeader() function.
Two quick questions:
1) Is resultSpecialHeaderSize the length of the special header starting
from the start of the packet? If, for example, I have a special (i.e.
nonstandard) header 16 bytes long at the beginning of the frame, if i
set resultSpecialHeaderSize to 16, will the first 16 bytes of the packet
be skipped when the packet is recombined in a frame?
2) My nonstandard packets could be mixed. That is, all packets are, say,
1440 bytes long. When I have an end-of-frame packet long n bytes, the
remaining (1440-n) bytes will be the next start-of-frame packet.
My strategy in this case would be setting fCurrentPacketCompletesFrame
to true (because the frame is ending), memcpy the starting part of the
next packet to an internal buffer for later use
<http://www.live555.com/liveMedia/doxygen/html/classMultiFramedRTPSource.html#65638cd05149a4ad6010902f416a52ff>,
but then I need something to set the packet length to n bytes. Does
removePadding(numBytes) function remove the last numByes and set the
packet length accordingly?
Then, I get the next packet. Its starting part is in my internal buffer,
and I need to copy it at the beginning of the packet (removing the
header in the meanwhile). How can I do this?
Thanks,
Cristiano.
--
Belloni Cristiano
Imavis Srl.
www.imavis.com <http://www.imavis.com>
belloni at imavis.com <mailto://belloni@imavis.com>
More information about the live-devel
mailing list