[Live-devel] Is this correct code

vikas srivastava vikasjkmcs2005 at yahoo.co.in
Wed Jan 6 19:56:21 PST 2010


Hi Ross,

       I am using your Live555 and facing some difficulties , i am receiving stream over rtp and saving to file , following is the code

int
 
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
UsageEnvironment*env = BasicUsageEnvironment::createNew(*scheduler);
 main(intargc, char** argv) {
FileSink* fileSink;//Dot specify codecfileSink =FileSink::createNew(*env, 
 "test");
//**********************For RTP Stream receiving **************************sessionAddress.s_addr = our_inet_addr(sessionAddressStr);
Groupsock rtpGroupsock(*env, sessionAddress, rtpPort, ttl);
Groupsock rtcpGroupsock(*env, sessionAddress, rtcpPort, ttl);
source = MPEG1or2VideoRTPSource::createNew(*env, &rtpGroupsock); charconst* sessionAddressStr= "10.69.169.149";constunsignedshortrtpPortNum = 8888;constunsignedshortrtcpPortNum = rtpPortNum+1;constunsignedcharttl = 2;structin_addr sessionAddress;constPort rtpPort(rtpPortNum);constPort rtcpPort(rtcpPortNum);constunsignedestimatedSessionBandwidth = 160; // in kbps; for RTCP b/w sharegethostname((
CNAME[maxCNAMElen] = constunsignedmaxCNAMElen = 100;unsignedcharCNAME[maxCNAMElen+1];char*)CNAME, maxCNAMElen);'\0'; // just in caseRTCPInstance* rtcpInstance=RTCPInstance::createNew(*env, &rtcpGroupsock,
estimatedSessionBandwidth, CNAME,
NULL 
 fileSink->startPlaying(*source, afterPlaying, NULL);
env->taskScheduler().doEventLoop();return0;
 
}
 voidafterPlaying(void* /*clientData*/) {//Medium::close(videoSource);//For RTPMedium::close(source);
}
 
this code never give any error but still not saving inside file , file size is always to zero .
Pls help me out wht might be the reason.
 
Thaanks
Vikas/* we're a client */, source);


      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100107/80a1e157/attachment.html>


More information about the live-devel mailing list