<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
--></style><title>Re: [Live-devel] Take input from a live source
instead of</title></head><body>
<blockquote type="cite" cite><font face="Verdana" size="-1">But at the
same time on transmiting a RTP packet,I need to capture a frame
into the buffers from the live souce(e.g,such like a webcamera).Does
it need mutithread programming?</font></blockquote>
<div><br></div>
<div>No. You can do this, within a single event loop, with a
chain of three objects:</div>
<div><br></div>
<div>FrameCapture => Encoder => RTP_Sink</div>
<div>where:</div>
<div><x-tab> </x-tab>-
"FrameCapture" is an instance of a new class (that you would
write) that subclasses "FramedSource". You should look
at the "DeviceSource" code as a model for how you might do
this.</div>
<div><x-tab> </x-tab>-
"Encoder" is an instance of a new class (that you would
write) that subclasses "FramedFilter". It would
compress each frame using your chosen codec.</div>
<div><x-tab> </x-tab>-
"RTP_Sink" is an instance of the appropriate subclass of
"RTPSink" (depending on the codec).</div>
<div><br></div>
<div>You would begin the streaming by calling</div>
<div><x-tab>
</x-tab>RTP_Sink->startPlaying(Encoder, ...);</div>
<div>and then</div>
<div><x-tab>
</x-tab>env->taskScheduler().doEventLoop();</div>
<div>to start the event loop.</div>
<div><br></div>
<x-sigsep><pre>--
</pre></x-sigsep>
<div><br>
Ross Finlayson<br>
Live Networks, Inc.<br>
http://www.live555.com/</div>
</body>
</html>