[Live-devel] How to know when a RTSP stream is ready to play?
Ross Finlayson
finlayson at live555.com
Fri Mar 27 11:37:49 PDT 2020
> On Mar 28, 2020, at 6:49 AM, Matthew Czarnek <mczarnek at edge360.com> wrote:
>
> On my server, I'm calling this code to create a proxy Stream and add it to my session:
>
> ProxyServerMediaSession* proxyStream = ProxyServerMediaSession::createNew(*env, rtspServer, proxyURL, proxyStreamName);
> rtspServer->addServerMediaSession(proxyStream);
[…]
> So, I'm trying to find a way to make sure that on the server, I know that the stream is playing before I tell the client to start streaming from it. Not sure how to do this.
You can do this by calling:
envir()->taskScheduler().doEventLoop(&(proxyStream->describeCompletedFlag));
which waits (while still handling events) until the back-end RTSP “DESCRIBE” command has completed.
After this, you can also check
proxyStream->describeCompletedSuccessfully()
If this is True, then you know that the back-end "DESCRIBE" command completed successfully. If, however, it's False, then you know that the back-end "DESCRIBE" command completed, but unsuccessfully - presumably because the back-end stream does not exist.
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list