[Live-devel] Find a particular rtsp session

Ross Finlayson finlayson at live555.com
Tue Jun 14 20:30:14 PDT 2011


>Thanks! That put me on the right track, one last question. Once I 
>have a list of RTSPClientSession objects, what's the best way to 
>grab it's FramedSource? There doesn't seem to be a straight forward 
>way to acquire it.

You're right - there isn't, unfortunately.  This information isn't 
exposed to the "RTSPServer" code, because it's not needed there. 
Instead, it's used by the "ServerMediaS(ubs)ession" object for the 
stream, via the 'streamToken' pointer (which the "RTSPServer" code 
treats as opaque).

Here's what I would do.  Unfortunately it requires first moving the 
definition of "class StreamState" from 
"OnDemandServerMediaSubsession.cpp" to 
"include/OnDemandServerMediaSubsession.hh".  (I might make that 
change in a future release of the code.)

1/ Have your "OnDemandServerMediaSubsession" subclass export a function
	FramedSource* framedSource(void* streamToken) {
		StreamState* streamState = (StreamState*)streamToken;
		return streamState->mediaSource();
	}

2/ In your "RTSPServer" subclass, for each RTSPClientSession* clientSession :
	for (unsigned i = 0; i < fNumStreamStates; ++i) {
		YourOnDemandServerMediaSubsession* subsession
			= (YourOnDemandServerMediaSubsession*) 
(fStreamStates[i].subsession);
		FramedSource* source = 
subsession->framedSource(fStreamStates[i].streamToken);
	}
-- 

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


More information about the live-devel mailing list