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

hyc subversion at mplayerhq.hu
Mon Mar 22 10:39:08 CET 2010


Author: hyc
Date: Mon Mar 22 10:39:07 2010
New Revision: 385

Log:
Add accessors for debuglevel, libversion, ctrlC, to avoid external
programs depending on library internal variables.

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

Modified: trunk/librtmp/log.c
==============================================================================
--- trunk/librtmp/log.c	Mon Mar 22 06:59:14 2010	(r384)
+++ trunk/librtmp/log.c	Mon Mar 22 10:39:07 2010	(r385)
@@ -46,6 +46,16 @@ void RTMP_LogSetOutput(FILE *file)
 	fmsg = file;
 }
 
+void RTMP_LogSetLevel(RTMP_LogLevel level)
+{
+	RTMP_debuglevel = level;
+}
+
+RTMP_LogLevel RTMP_LogGetLevel()
+{
+	return RTMP_debuglevel;
+}
+
 void RTMP_LogPrintf(const char *format, ...)
 {
 	char str[MAX_PRINT_LEN]="";

Modified: trunk/librtmp/log.h
==============================================================================
--- trunk/librtmp/log.h	Mon Mar 22 06:59:14 2010	(r384)
+++ trunk/librtmp/log.h	Mon Mar 22 10:39:07 2010	(r385)
@@ -48,6 +48,8 @@ void RTMP_LogStatus(const char *format, 
 void RTMP_Log(int level, const char *format, ...);
 void RTMP_LogHex(int level, const char *data, unsigned long len);
 void RTMP_LogHexString(int level, const char *data, unsigned long len);
+void RTMP_LogSetLevel(RTMP_LogLevel lvl);
+RTMP_LogLevel RTMP_LogGetLevel();
 
 #ifdef __cplusplus
 }

Modified: trunk/librtmp/rtmp.c
==============================================================================
--- trunk/librtmp/rtmp.c	Mon Mar 22 06:59:14 2010	(r384)
+++ trunk/librtmp/rtmp.c	Mon Mar 22 10:39:07 2010	(r385)
@@ -138,6 +138,12 @@ RTMP_GetTime()
 }
 
 void
+RTMP_UserInterrupt()
+{
+  RTMP_ctrlC = true;
+}
+
+void
 RTMPPacket_Reset(RTMPPacket *p)
 {
   p->m_headerType = 0;
@@ -180,6 +186,12 @@ RTMPPacket_Dump(RTMPPacket *p)
       p->m_nBodySize, p->m_body ? (unsigned char)p->m_body[0] : 0);
 }
 
+int
+RTMP_LibVersion()
+{
+  return RTMP_LIB_VERSION;
+}
+
 void
 RTMP_TLS_Init()
 {

Modified: trunk/librtmp/rtmp.h
==============================================================================
--- trunk/librtmp/rtmp.h	Mon Mar 22 06:59:14 2010	(r384)
+++ trunk/librtmp/rtmp.h	Mon Mar 22 10:39:07 2010	(r385)
@@ -36,6 +36,8 @@ extern "C"
 {
 #endif
 
+#define RTMP_LIB_VERSION	0x020202	/* 2.2b */
+
 #define RTMP_FEATURE_HTTP	0x01
 #define RTMP_FEATURE_ENC	0x02
 #define RTMP_FEATURE_SSL	0x04
@@ -279,6 +281,8 @@ extern "C"
 
   void RTMP_Init(RTMP *r);
   void RTMP_Close(RTMP *r);
+  int RTMP_LibVersion();
+  void RTMP_UserInterrupt();	/* user typed Ctrl-C */
 
   bool RTMP_SendCtrl(RTMP *r, short nType, unsigned int nObject,
 		     unsigned int nTime);


More information about the rtmpdump mailing list