[Live-devel] How to use classes in livemedia library for motion JPEG?

Ross Finlayson finlayson at live.com
Tue Jun 15 19:34:36 PDT 2004


>I'm going to try to modify "testMPEG1or2VideoStreamer/Receiver.cpp" for 
>streaming motion JPEG(MJPEG).
>I do not know how / when to use "JPEGVideoSource", "JPEGVideoRTPSource", 
>"JPEGVideoRTPSink" classes and so on.

You won't use "JPEGVideoRTPSource" at all.  That class (like all of the 
"*RTPSource" classes) is used only for *receiving* RTP packets, not for 
sending them.

You would use (i) "JPEGVideoRTPSink", which will be fed by (ii) a 
*subclass* of "JPEGVideoSource".

Note that "JPEGVideoSource" is an abstract base class.  You must define and 
implement your own subclass of this class that delivers (in the 
"doGetNextFrame()" virtual function) complete JPEG video frames (but 
without the usual JPEG header).

Note also that - in addition to "doGetNextFrame()" - your subclass will 
also need to provide your own implementations of the pure virtual functions 
"type()", "qFactor()", "width()", and "height()".  (If you're planning to 
read from files, then the "qFactor()" function could be the tricky one, 
because the 'Q factor' value is not directly present in files' JPEG header.)


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list