[Live-devel] Real Capture

Ross Finlayson finlayson at live555.com
Sun Mar 15 15:05:28 PDT 2009


>I want to use liveMedia to send the real time encoded data over rtsp,
>which means: capture -> encode ->send.
>
>I know that I could create a subclass of DeviceSource to capture data

No, this would not be a *subclass* of "DeviceSource", but a subclass 
of "FramedSource" that would (perhaps) be modeled on the 
"DeviceSource.cpp" code.  (See 
<http://www.live555.com/liveMedia/faq.html#liveInput-unicast>)


>  but where to add the encode code??

You would write your own subclass of "FramedFilter" that implements 
the "doGetNextFrame()" virtual function by (i) calling 
"getNextFrame()" on its upstream source, and (ii) encode the received 
data before delivering it to the downstream object.

Your "ServerMediaSubsession" subclass would then implement the 
"createNewStreamSource()" virtual function by (i) creating an object 
of your 'data source' class, (ii) creating an object of your 
'encoding filter' class (which takes the 'data source' object as 
input parameter), and then returns a pointer to your 'encoding 
filter' object.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list