[MPlayer-cvslog] CVS: main/libmpdemux/realrtsp rtsp_session.h, 1.2, 1.3 rtsp_session.c, 1.8, 1.9 rtsp.c, 1.17, 1.18 real.c, 1.11, 1.12

Roberto Togni CVS syncmail at mplayerhq.hu
Fri Jan 6 15:39:13 CET 2006


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main/libmpdemux/realrtsp
In directory mail:/var2/tmp/cvs-serv32532/libmpdemux/realrtsp

Modified Files:
	rtsp_session.h rtsp_session.c rtsp.c real.c 
Log Message:
This patch makes real rtsp tell the server to deliver data at specified 
bandwidth, if bandwidth cmdline option is given. Also, if that's given, 
it uses it for sdp stream selection. If not given, the behavior is the 
same as before.

It's used to implement something like turboplay in realplayer.

Patch by Tomas Janousek >>> tomi (At) nomi (.) cz <<<


Index: rtsp_session.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rtsp_session.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rtsp_session.h	28 May 2003 21:40:53 -0000	1.2
+++ rtsp_session.h	6 Jan 2006 14:39:10 -0000	1.3
@@ -30,7 +30,7 @@
 
 typedef struct rtsp_session_s rtsp_session_t;
 
-rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, int port, int *redir);
+rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, int port, int *redir, uint32_t bandwidth);
 
 int rtsp_session_read(rtsp_session_t *session, char *data, int len);
 

Index: rtsp_session.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rtsp_session.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- rtsp_session.c	18 Oct 2004 20:08:12 -0000	1.8
+++ rtsp_session.c	6 Jan 2006 14:39:10 -0000	1.9
@@ -71,13 +71,12 @@
 };
 
 //rtsp_session_t *rtsp_session_start(char *mrl) {
-rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, int port, int *redir) {
+rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, int port, int *redir, uint32_t bandwidth) {
 
   rtsp_session_t *rtsp_session=malloc(sizeof(rtsp_session_t));
   char *server;
   char *mrl_line = NULL;
   rmff_header_t *h;
-  uint32_t bandwidth=10485800;
 
   rtsp_session->recv = xbuffer_init(BUF_SIZE);
 

Index: rtsp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rtsp.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- rtsp.c	5 Dec 2005 01:27:32 -0000	1.17
+++ rtsp.c	6 Jan 2006 14:39:10 -0000	1.18
@@ -877,7 +877,7 @@
       file++;
     mrl = malloc(sizeof(char)*(strlen(stream->streaming_ctrl->url->hostname)+strlen(file)+16));
     sprintf(mrl,"rtsp://%s:%i/%s",stream->streaming_ctrl->url->hostname,port,file);
-    rtsp = rtsp_session_start(fd,&mrl, file, stream->streaming_ctrl->url->hostname, port, &redirected);
+    rtsp = rtsp_session_start(fd,&mrl, file, stream->streaming_ctrl->url->hostname, port, &redirected, stream->streaming_ctrl->bandwidth);
 
     if( redirected == 1) {
       url_free(stream->streaming_ctrl->url);

Index: real.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/real.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- real.c	15 Dec 2004 18:16:24 -0000	1.11
+++ real.c	6 Jan 2006 14:39:10 -0000	1.12
@@ -706,12 +706,17 @@
   char *mrl=rtsp_get_mrl(rtsp_session);
   unsigned int size;
   int status;
+  uint32_t maxbandwidth = bandwidth;
   
   /* get challenge */
   challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1"));
 #ifdef LOG
   printf("real: Challenge1: %s\n", challenge1);
 #endif
+
+  /* set a reasonable default to get the best stream, unless bandwidth given */
+  if (!bandwidth)
+      bandwidth = 10485800;
   
   /* request stream description */
   rtsp_schedule_field(rtsp_session, "Accept: application/sdp");
@@ -811,6 +816,13 @@
   rtsp_schedule_field(rtsp_session, subscribe);
   rtsp_request_setparameter(rtsp_session,NULL);
 
+  /* set delivery bandwidth */
+  if (maxbandwidth) {
+      sprintf(buf, "SetDeliveryBandwidth: Bandwidth=%u;BackOff=0", maxbandwidth);
+      rtsp_schedule_field(rtsp_session, buf);
+      rtsp_request_setparameter(rtsp_session,NULL);
+  }
+
   {
     int s_ss = 0, s_ms = 0, e_ss = 0, e_ms = 0;
     char *str;




More information about the MPlayer-cvslog mailing list