[Live-devel] Proxy Server issue
Robert Clove
cloverobert at gmail.com
Thu Feb 7 22:02:40 PST 2013
Hello Sir,
Here is mine setup,i have 3 machines,.
Machine 1 is for streamer 1 and machine 2 is for streamer 2 and machine 3
is for proxy server.
i mine project there is some handshaking done between streamer and server
machine so that server came to know which streamer is active.
When the client wishes to see the stream from any of the streamer it send
the start stream request to the available streamer and
on the streamer the code for "testMPEG2TransportStreamer" executes with
"#define IMPLEMENT_RTSP_SERVER 1" as un-commented i mean the rtsp server is
also created
on the streamer.When there is stop stream the streaming is stopped with the
rtsp server also destroyed using medium::close().
i have created the rtsp server (in proxy server case)only once and
variables that i have taken global are:-
int Current_Streamer = 0;
int http_port;
ServerMediaSession* sms[50];
char StreamName[50][50];
CString MulticastIp[50];
int StreamerPort[50];
int taskScheduler = 0,tunneling = 0; //call
env->taskScheduler().doEventLoop(); forfirst time only.
char const* descriptionString={"Session streamed by
\"testOnDemandRTSPServer\""};
RTSPServer* rtspServer;
char* url[50];
Boolean reuseFirstSource = False;
Boolean iFramesOnly = False;
UsageEnvironment* env;
TaskScheduler* scheduler;
UserAuthenticationDatabase* authDB;
char* username = NULL;
char* password = NULL;
On start stream request in server i am creating thread which has the
following code
DWORD WINAPI START_STREAM_Thread()
{
//this is address for the streamer for which start stream is given,this
address we get by implementing rtsp server in the streamer
char const* inputAddressStr = MulticastIp[Current_Streamer];
//port on which streamer is streaming
portNumBits const inputPortNum = StreamerPort[Current_Streamer];
CString StreamURL ="rtsp://";
StreamURL +=inputAddressStr;
int verbosityLevel = 2;
Boolean streamRTPOverTCP = False;
portNumBits tunnelOverHTTPPortNum = inputPortNum
char const* proxiedStreamURL = StreamURL;
char const* streamName= StreamName[Current_Streamer];
sms[Current_Streamer]
= ProxyServerMediaSession::createNew(*env, rtspServer,
proxiedStreamURL, streamName,
username, password, tunnelOverHTTPPortNum, verbosityLevel);
rtspServer->addServerMediaSession(sms[Current_Streamer]);
url[Current_Streamer] = rtspServer->rtspURL(sms[Current_Streamer]);
delete[] url[Current_Streamer];
taskScheduler++;
if(taskScheduler == 1) //call env->taskScheduler().doEventLoop();
for first time only.
env->taskScheduler().doEventLoop(); // does not return
}
and on stop stream i am doing this:-
rtspServer->deleteServerMediaSession(sms[Current_Streamer]);
Medium::close(sms[Current_Streamer]);
sms[Current_Streamer]=NULL;
Now the problem is :-
client1 receives the stream from the streamer 1 and client 2 receives the
stream from streamer2.
It doesn't matter how many times the client 2 send the start and stop
stream to streamer 2,client 1 continues to receive the stream from streamer
1
but if client 1 send the stop stream,the client 2 also cannot receive the
stream from the streamer 2,i think the proxy server closes all the socket.
Current_Streamer variable maintain for which streamer the request has been
sent
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130208/37062edf/attachment.html>
More information about the live-devel
mailing list