<html>
<head>
<meta content="text/html; charset=GB2312" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
One working on sub classing ProxyServerMediaSession and also sub
classing ProxyRTSPClient. I have overridden the
createNewProxyRTSPClient(). The problem I'm having is the
createNewProxyRTSPClient() is called from the constructor of the
ProxyServerMediaSession, and the method I just overrode is not being
called.<br>
<br>
According to the following post this is a know limitation with C++.<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=GB2312">
<a
href="http://www.codeproject.com/Tips/641610/Be-Careful-with-Virtual-Method">http://www.codeproject.com/Tips/641610/Be-Careful-with-Virtual-Method</a><br>
<br>
I can modify the source directly, but thought I would ask first as I
did a bunch of work to derive from the ProxyServerMediaSession and
ProxyRTSPClient.<br>
<br>
<u><b>In the ProxyServerMediaSession.hh</b></u><br>
protected:<br>
ProxyServerMediaSession(UsageEnvironment& env, RTSPServer*
ourRTSPServer,<br>
char const* inputStreamURL, char const* streamName,<br>
char const* username, char const* password,<br>
portNumBits tunnelOverHTTPPortNum, int verbosityLevel,
int socketNumToServer);<br>
<br>
// If you subclass "ProxyRTSPClient", then you should also
subclass "ProxyServerMediaSession" and redefine this virtual
function<br>
<font color="#ff0000"> // in order to create new objects of your
"ProxyRTSPClient" subclass:<br>
virtual ProxyRTSPClient* createNewProxyRTSPClient(char const*
rtspURL, char const* username, char const* password,<br>
portNumBits tunnelOverHTTPPortNum, int
verbosityLevel, int socketNumToServer);</font><br>
<br>
===========<br>
<br>
<u><b>In the ProxyServerMediaSession.cpp</b></u><br>
ProxyServerMediaSession::ProxyServerMediaSession(UsageEnvironment&
env, RTSPServer* ourRTSPServer,<br>
char const* inputStreamURL, char const*
streamName,<br>
char const* username, char const* password,<br>
portNumBits tunnelOverHTTPPortNum, int
verbosityLevel, int socketNumToServer)<br>
: ServerMediaSession(env, streamName, NULL, NULL, False, NULL),<br>
describeCompletedFlag(0), fOurRTSPServer(ourRTSPServer),
fClientMediaSession(NULL),<br>
fVerbosityLevel(verbosityLevel),
fPresentationTimeSessionNormalizer(new
PresentationTimeSessionNormalizer(envir())) {<br>
// Open a RTSP connection to the input stream, and send a
"DESCRIBE" command.<br>
// We'll use the SDP description in the response to set ourselves
up.<br>
<font color="#ff0000">fProxyRTSPClient =
createNewProxyRTSPClient(inputStreamURL, username, password,
tunnelOverHTTPPortNum,<br>
verbosityLevel > 0 ? verbosityLevel-1
: verbosityLevel, socketNumToServer);</font><br>
ProxyRTSPClient::sendDESCRIBE(fProxyRTSPClient);<br>
}<br>
<br>
If I override the createNewProxyRTSPClient, and instanciate the new
sub-class the ProxySErverMediaSession version of the
createNewProxyRTSPClient is called, not my overriden version.<br>
<br>
<br>
Thanks,<br>
Craig<br>
</body>
</html>