Esempio n. 1
0
int rtp2disk(RtpSession *session,guint32 ts, int fd)
{
	char buffer[160];
	int err,havemore=1;
	while (havemore){
		err=rtp_session_recv_with_ts(session,buffer,160,ts,&havemore);
		if (err>0){
			rtp_session_set_data(session,(gpointer)1);
			/* to indicate that (for the application) the stream has started, so we can start
			recording on disk */
		}
		if (session->user_data != NULL)
			write(fd,buffer,err);
	}
	return 0;
}
Esempio n. 2
0
int rtp2disk(RtpSession *session,uint32_t ts, int fd)
{
	int err,havemore=1;
	while (havemore){
		err=rtp_session_recv_with_ts(session,recvbuf,160,ts,&havemore);
		if (havemore) printf("warning: havemore=%i!\n",havemore);
		if (err>0){
			rtp_session_set_data(session,(void*)1);
			/* to indicate that (for the application) the stream has started, so we can start
			recording on disk */
		}
		if (session->user_data != NULL) {
			size_t ret = write(fd,recvbuf,err);
			assert( ret == err );
		}
	}
	return 0;
}