[rtmpdump] r510 - in trunk/librtmp: rtmp.c rtmp.h

hyc subversion at mplayerhq.hu
Thu Jun 17 20:38:05 CEST 2010


Author: hyc
Date: Thu Jun 17 20:38:04 2010
New Revision: 510

Log:
Add RTMP_Socket(), RTMP_Pause(). Addresses the last remaining
direct references into RTMP struct from ffmpeg, should be able
to write version-independent apps now.

Modified:
   trunk/librtmp/rtmp.c
   trunk/librtmp/rtmp.h

Modified: trunk/librtmp/rtmp.c
==============================================================================
--- trunk/librtmp/rtmp.c	Sun Jun  6 09:17:29 2010	(r509)
+++ trunk/librtmp/rtmp.c	Thu Jun 17 20:38:04 2010	(r510)
@@ -279,6 +279,12 @@ RTMP_IsConnected(RTMP *r)
 }
 
 int
+RTMP_Socket(RTMP *r)
+{
+  return r->m_sb.sb_socket;
+}
+
+int
 RTMP_IsTimedout(RTMP *r)
 {
   return r->m_sb.sb_timedout;
@@ -1779,6 +1785,13 @@ RTMP_SendPause(RTMP *r, int DoPause, int
   return RTMP_SendPacket(r, &packet, TRUE);
 }
 
+int RTMP_Pause(RTMP *r, int DoPause)
+{
+  if (DoPause)
+    r->m_pauseStamp = r->m_channelTimestamp[r->m_mediaChannel];
+  return RTMP_SendPause(r, DoPause, r->m_pauseStamp);
+}
+
 SAVC(seek);
 
 int

Modified: trunk/librtmp/rtmp.h
==============================================================================
--- trunk/librtmp/rtmp.h	Sun Jun  6 09:17:29 2010	(r509)
+++ trunk/librtmp/rtmp.h	Thu Jun 17 20:38:04 2010	(r510)
@@ -289,6 +289,7 @@ extern "C"
   int RTMP_SendPacket(RTMP *r, RTMPPacket *packet, int queue);
   int RTMP_SendChunk(RTMP *r, RTMPChunk *chunk);
   int RTMP_IsConnected(RTMP *r);
+  int RTMP_Socket(RTMP *r);
   int RTMP_IsTimedout(RTMP *r);
   double RTMP_GetDuration(RTMP *r);
   int RTMP_ToggleStream(RTMP *r);
@@ -310,7 +311,13 @@ extern "C"
 
   int RTMP_SendCtrl(RTMP *r, short nType, unsigned int nObject,
 		     unsigned int nTime);
+
+  /* caller probably doesn't know current timestamp, should
+   * just use RTMP_Pause instead
+   */
   int RTMP_SendPause(RTMP *r, int DoPause, int dTime);
+  int RTMP_Pause(RTMP *r, int DoPause);
+
   int RTMP_FindFirstMatchingProperty(AMFObject *obj, const AVal *name,
 				      AMFObjectProperty * p);
 


More information about the rtmpdump mailing list