[Live-devel] ByteStreamFileSource closing pipe file descriptor

Wiser, Tyson TWiser at logostech.net
Fri Sep 4 11:00:53 PDT 2015


Hi Ross,

I have an RTSP server application that uses a woefully out-of-date version of live555. I'm in the process of updating to the latest version of live555 and have come across an API change that puzzles me.

Basically, I have a thread that generates H.264 video and feeds it through a pipe to a ByteStreamFileSource instance in the RTSP thread.  The ByteStreamFileSource instance is created by an OnDemandServerMediaSubsession subclass that passes the pipe's read file descriptor into the ByteStreamFileSource through its createNew() function.  ByteStreamFileSource used to have a constructor and createNew() parameter called deleteFidOnClose that let me manage the file descriptor.  That parameter has now gone away and the ByteStreamFileSource instance closes the file descriptor in its desctructor.

Because of this change, when a DESCRIBE message is received and a temporary OnDemandServerMediaSubsession subclass object (and thus ByteStreamFileSource object) is created and destroyed, it ends up closing the read end of my pipe. This means that when the actual objects are created after the SETUP message, my other thread gets broken pipe errors when it tries to write to the pipe.

I'm able to get around this by checking for a clientSessionId of 0 in my SubclassOnDemandServerMediaSubsession::createNewStreamSource() function. In this case I don't use the real file descriptor, but this seems like a hack to me.  Is there a better way to prevent my file descriptor from getting closed before I want it to?

I appreciate your help and all the work you put into this great library.

Thanks,
Tyson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150904/54b0510f/attachment.html>


More information about the live-devel mailing list