This is my streamer which stremas a file to a paricular ip and port no
int main(int argc, char** argv) {
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
env = BasicUsageEnvironment::createNew(*scheduler);
char const* destinationAddressStr
#ifdef USE_SSM
= "232.255.42.42";
#else
= "192.168.15.168";
const unsigned short rtpPortNum = 1234;
const unsigned short rtcpPortNum = rtpPortNum+1;
const unsigned char ttl = 7;
struct in_addr destinationAddress;
destinationAddress.s_addr = our_inet_addr(destinationAddressStr);
const Port rtpPort(rtpPortNum);
const Port rtcpPort(rtcpPortNum);
Groupsock rtpGroupsock(*env, destinationAddress, rtpPort, ttl);
Groupsock rtcpGroupsock(*env, destinationAddress, rtcpPort, ttl);
play();
env->taskScheduler().doEventLoop();
}
void play() {
unsigned const inputDataChunkSize
= TRANSPORT_PACKETS_PER_NETWORK_PACKET*TRANSPORT_PACKET_SIZE;
ByteStreamFileSource* fileSource
= ByteStreamFileSource::createNew(*env, inputFileName, inputDataChunkSize);
if (fileSource == NULL) {
*env << "Unable to open file \"" << inputFileName
<< "\" as a byte-stream file source\n";
exit(1);
}
*env << "Beginning to read from file...\n";
videoSink->startPlaying(*videoSource, afterPlaying, videoSink);
}
This is my kind of server manager that receives/captures the streaming streamed by streamer and give us the ip to view the streaming in vlc player
int main(int argc, char** argv) {
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
env = BasicUsageEnvironment::createNew(*scheduler);
UserAuthenticationDatabase* authDB = NULL;
RTSPServer* rtspServer = RTSPServer::createNew(*env, 554, authDB);
{char const* streamName = "m";
char const* inputAddressStr = "192.168.15.168";
portNumBits const inputPortNum = 1234;
Boolean const inputStreamIsRawUDP = False;
ServerMediaSession* sms
= ServerMediaSession::createNew(*env, streamName, streamName,descriptionString);
sms->addSubsession(MPEG2TransportUDPServerMediaSubsession
::createNew(*env, inputAddressStr, inputPortNum, inputStreamIsRawUDP));
rtspServer->addServerMediaSession(sms);
char* url = rtspServer->rtspURL(sms);
*env << "\n\"" << streamName << "\" stream, from a UDP Transport Stream input source \n\t(";
if (inputAddressStr != NULL) {
*env << "IP multicast address " << inputAddressStr << ",";
} else {
*env << "unicast;";
}
*env << " port " << inputPortNum << ")\n";
*env << "Play this stream using the URL \"" << url << "\"\n";
delete[] url;
}
Now i need an idea how to make the server manager listen to atleast two streamer and give us the 2 different url to view streaming streamed by different streamer.... This is all done using live media... Can any one help