[Live-devel] Basic question
Ross Finlayson
finlayson at live.com
Wed Nov 12 09:01:30 PST 2003
>I also would like to send JPEG video through the Live server (currently
>our camera sends JPEG frames to a custom ActiveX). The frames are
>typically up to 50KBytes in size. If I derive a class from JPEGVideoSource
>and use the deliverFrame() function, it appears that I must parse through
>the JPEG frame based on the fMaxSize parameter (over multiple calls) which
>is specified by the caller.
You must only ensure that you don't copy more than "fMaxSize" bytes to
"fTo" (and return, in "fFrameSize", the number of bytes that you actually
copy). This doesn't require 'parsing through' the JPEG frame - just
comparing its actual size to "fMaxSize".
> I can't specify the amount of data I'd like to give the caller (in order
> to give an entire JPEG frame at once) - right?
Are you asking if the receiving object (in this case, a "JPEGVideoRTPSink")
can set its buffer large enough so that "fMaxSize" is larger than the
largest possible JPEG frame (i.e., >= 50 kBytes)? Yes, you can do this, by
setting the variable "OutPacketBuffer::numPacketsLimit". E.g., at that
start of your main program, you can do:
OutPacketBuffer::numPacketsLimit = 35;
This will give you a "fMaxSize" of >50 kBytes, because 35*1450 >
50000. (Each outgoing packet will be up to 1450 bytes in size.)
You should note, though, that having a JPEG frame fragmented over ~35 RTP
packets can be problematic. Depending on how smart or dumb the receiving
implementation is, the loss of just a single packet can lead to the loss of
the entire frame. (Note that the LIVE.COM JPEG/RTP receiving
implementation is currently 'dumb'; all packets of a fragmented JPEG packet
must be received in order for the frame to be passed back to the client.)
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list