[Live-devel] where to call signalNewFrameData

Ross Finlayson finlayson at live555.com
Thu Jan 26 13:46:46 PST 2017


> Thanks. Seems like I'm trying to do 2b. What I'm still not getting out of this is, where and how I would call signalNewFrameData on my source object. I've now added a callback I'm calling from my encoder class, which is a bit messy, because the encoder actually wasn't supposed to be aware of the streaming code. Is there a place within the live555 classes where this would have to go?

I’m not sure I understand your question.  You’ve said that you’re “trying to do 2b” - i.e.,  you:
	Have a separate thread that (somehow) waits for the arrival of new data.  When new data becomes available, have this new thread call “triggerEvent()”.

For example, your separate encoder thread could call the "signalNewFrameData()” that I outline in “liveMedia/DeviceSource.cpp”


> Another question: is there a way of figuring out that the connection was lost/closed? Currently, my session keeps sending forever, as I couldn't find out how to handle this.

Our server code will automatically shut down the stream (ultimately, by deleting your data source object - i.e., of your “FramedSource” subclass) when the client closes the stream (after sending a RTSP “TEARDOWN” command).  It will also shut down the stream after a period of inactivity from the client.  By default, this inactivity period is 65 seconds - which means that - even if a client dies without sending a “TEARDOWN” - our server will stop the stream after 65 seconds.  (This inactivity period is set by the parameter “reclamationSeconds” in the call to “RTSPServer::createNew()”.)

Of course, you should also make sure that your “FramedSource” subclass’s destructor does the right thing (e.g., shut down your encoder thread) whenever it gets called.


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




More information about the live-devel mailing list