Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 14th, 2010  |  syntax: Pascal  |  size: 18.89 KB  |  views: 545  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. {$ifndef NO_SMART_LINK}
  2. {$smartlink on}
  3. {$endif}
  4. unit lrtmp;
  5.  
  6. interface
  7.  
  8. {$PACKRECORDS C}
  9.  
  10. uses
  11.  ctypes,
  12.  sockets;
  13.  
  14. Const
  15. {$ifdef windows}
  16.   LibRtmp = 'librtmp'; // Library name
  17.   { matching lib version for librtmp.dll, needed for initialization }
  18.   RTMP_LIBRTMP_VER_STRING='2.3';
  19. {$else windows}
  20.   LibRtmp = 'rtmp'; // Library name
  21.   { matching lib version for librtmp, needed for initialization }
  22.   RTMP_LIBRTMP_VER_STRING='2.3';
  23. {$endif windows}
  24.  
  25. {$I inttypes}
  26.  
  27. {AMF Constants}
  28. Const
  29.     AMF_NUMBER = 0;
  30.     AMF_BOOLEAN = 1;
  31.     AMF_STRING = 2;
  32.     AMF_OBJECT = 3;
  33.     AMF_MOVIECLIP = 4;
  34.     AMF_NULL = 5;
  35.     AMF_UNDEFINED = 6;
  36.     AMF_REFERENCE = 7;
  37.     AMF_ECMA_ARRAY = 8;
  38.     AMF_OBJECT_END = 9;
  39.     AMF_STRICT_ARRAY = 10;
  40.     AMF_DATE = 11;
  41.     AMF_LONG_STRING = 12;
  42.     AMF_UNSUPPORTED = 13;
  43.     AMF_RECORDSET = 14;
  44.     AMF_XML_DOC = 15;
  45.     AMF_TYPED_OBJECT = 16;
  46.     AMF_AVMPLUS = 17;
  47.     AMF_INVALID = $ff;
  48.     AMF3_UNDEFINED = 0;
  49.     AMF3_NULL = 1;
  50.     AMF3_FALSE = 2;
  51.     AMF3_TRUE = 3;
  52.     AMF3_INTEGER = 4;
  53.     AMF3_DOUBLE = 5;
  54.     AMF3_STRING = 6;
  55.     AMF3_XML_DOC = 7;
  56.     AMF3_DATE = 8;
  57.     AMF3_ARRAY = 9;
  58.     AMF3_OBJECT = 10;
  59.     AMF3_XML = 11;
  60.     AMF3_BYTE_ARRAY = 12;
  61.  
  62. {RTMP Constants}
  63. const
  64.   RTMP_LIB_VERSION = $020300;  
  65.   RTMP_FEATURE_HTTP = $01;  
  66.   RTMP_FEATURE_ENC = $02;  
  67.   RTMP_FEATURE_SSL = $04;  
  68.   RTMP_FEATURE_MFP = $08;  
  69.   RTMP_FEATURE_WRITE = $10;  
  70.   RTMP_FEATURE_HTTP2 = $20;  
  71.   RTMP_PROTOCOL_UNDEFINED = -(1);  
  72.   RTMP_PROTOCOL_RTMP = 0;  
  73.   RTMP_PROTOCOL_RTMPE = RTMP_FEATURE_ENC;  
  74.   RTMP_PROTOCOL_RTMPT = RTMP_FEATURE_HTTP;  
  75.   RTMP_PROTOCOL_RTMPS = RTMP_FEATURE_SSL;  
  76.   RTMP_PROTOCOL_RTMPTE = RTMP_FEATURE_HTTP or RTMP_FEATURE_ENC;  
  77.   RTMP_PROTOCOL_RTMPTS = RTMP_FEATURE_HTTP or RTMP_FEATURE_SSL;  
  78.   RTMP_PROTOCOL_RTMFP = RTMP_FEATURE_MFP;  
  79.   RTMP_DEFAULT_CHUNKSIZE = 128;  
  80.   RTMP_BUFFER_CACHE_SIZE = 16*1024;  
  81.   RTMP_CHANNELS = 65600;  
  82.   RTMP_PACKET_TYPE_AUDIO = $08;  
  83.   RTMP_PACKET_TYPE_VIDEO = $09;  
  84.   RTMP_PACKET_TYPE_INFO = $12;  
  85.   RTMP_MAX_HEADER_SIZE = 18;  
  86.   RTMP_PACKET_SIZE_LARGE = 0;  
  87.   RTMP_PACKET_SIZE_MEDIUM = 1;  
  88.   RTMP_PACKET_SIZE_SMALL = 2;  
  89.   RTMP_PACKET_SIZE_MINIMUM = 3;  
  90.   RTMP_LF_AUTH = $0001;  
  91.   RTMP_LF_LIVE = $0002;  
  92.   RTMP_LF_SWFV = $0004;  
  93.   RTMP_LF_PLST = $0008;  
  94.   RTMP_LF_BUFX = $0010;  
  95.   RTMP_LF_FTCU = $0020;  
  96.   RTMP_SWF_HASHLEN = 32;  
  97.   RTMP_READ_HEADER = $01;  
  98.   RTMP_READ_RESUME = $02;  
  99.   RTMP_READ_NO_IGNORE = $04;  
  100.   RTMP_READ_GOTKF = $08;  
  101.   RTMP_READ_GOTFLVK = $10;  
  102.   RTMP_READ_SEEKING = $20;  
  103.   RTMP_READ_COMPLETE = -(3);  
  104.   RTMP_READ_ERROR = -(2);  
  105.   RTMP_READ_EOF = -(1);  
  106.   RTMP_READ_IGNORE = 0;  
  107.  
  108. {AMF Types}
  109. Type
  110.     AVal = record
  111.           av_val : pcchar;
  112.           av_len : cint;
  113.         end;
  114.     PAVal  = ^AVal;
  115.     AMF3ClassDef = record
  116.           cd_name : AVal;
  117.           cd_externalizable : cchar;
  118.           cd_dynamic : cchar;
  119.           cd_num : cint;
  120.           cd_props : PAVal;
  121.         end;
  122.     PAMF3ClassDef  = ^AMF3ClassDef;
  123.     AMF3DataType =  Longint;
  124.     PAMF3DataType  = ^AMF3DataType;
  125.     AMFDataType =  Longint;
  126.     PAMFDataType  = ^AMFDataType;
  127.     AMFObjectProperty = record
  128.           {undefined structure}
  129.         end;
  130.     PAMFObjectProperty  = ^AMFObjectProperty;
  131.     AMFObject = record
  132.           o_num : cint;
  133.           o_props : PAMFObjectProperty;
  134.         end;
  135.     PAMFObject  = ^AMFObject;
  136.    
  137. {RTMP Types}
  138.  
  139. Type
  140.   TArray0toRTMP_SWF_HASHLEN1OfUint8_t = array[0..(RTMP_SWF_HASHLEN)-1] of uint8_t;
  141.   TArray0toRTMP_SWF_HASHLEN101OfCchar = array[0..(RTMP_SWF_HASHLEN+10)-1] of cchar;
  142.   TArray0toRTMP_MAX_HEADER_SIZE1OfCchar = array[0..(RTMP_MAX_HEADER_SIZE)-1] of cchar;
  143.   TArray0toRTMP_CHANNELS1OfCint = array[0..(RTMP_CHANNELS)-1] of cint;
  144.   TArray0toRTMP_BUFFER_CACHE_SIZE1OfCchar = array[0..(RTMP_BUFFER_CACHE_SIZE)-1] of cchar;
  145.   TArray0to6OfPcchar = array[0..6] of pcchar;
  146.  
  147.   RTMPChunk = record
  148.       c_headerSize : cint;
  149.       c_chunkSize : cint;
  150.       c_chunk : pcchar;
  151.       c_header : TArray0toRTMP_MAX_HEADER_SIZE1OfCchar;
  152.     end;
  153.  
  154.   PRTMPChunk  = ^RTMPChunk;
  155.  
  156.   RTMPPacket = record
  157.       m_headerType : uint8_t;
  158.       m_packetType : uint8_t;
  159.       m_hasAbsTimestamp : uint8_t;
  160.       m_nChannel : cint;
  161.       m_nTimeStamp : uint32_t;
  162.       m_nInfoField2 : int32_t;
  163.       m_nBodySize : uint32_t;
  164.       m_nBytesRead : uint32_t;
  165.       m_chunk : PRTMPChunk;
  166.       m_body : pcchar;
  167.     end;
  168.  
  169.   PRTMPPacket  = ^RTMPPacket;
  170.   TArray0toRTMP_CHANNELS1OfPRTMPPacket = array[0..(RTMP_CHANNELS)-1] of PRTMPPacket;
  171.  
  172.   RTMPSockBuf = record
  173.       sb_socket : cint;
  174.       sb_size : cint;
  175.       sb_start : pcchar;
  176.       sb_buf : TArray0toRTMP_BUFFER_CACHE_SIZE1OfCchar;
  177.       sb_timedout : cint;
  178.       sb_ssl : pointer;
  179.     end;
  180.  
  181.   RTMP_LNK = record
  182.       hostname : AVal;
  183.       sockshost : AVal;
  184.       playpath0 : AVal;
  185.       playpath : AVal;
  186.       tcUrl : AVal;
  187.       swfUrl : AVal;
  188.       pageUrl : AVal;
  189.       app : AVal;
  190.       auth : AVal;
  191.       flashVer : AVal;
  192.       subscribepath : AVal;
  193.       token : AVal;
  194.       extras : AMFObject;
  195.       edepth : cint;
  196.       seekTime : cint;
  197.       stopTime : cint;
  198.       lFlags : cint;
  199.       swfAge : cint;
  200.       protocol : cint;
  201.       timeout : cint;
  202.       socksport : cushort;
  203.       port : cushort;
  204.       dh : pointer;
  205.       rc4keyIn : pointer;
  206.       rc4keyOut : pointer;
  207.       SWFSize : uint32_t;
  208.       SWFHash : TArray0toRTMP_SWF_HASHLEN1OfUint8_t;
  209.       SWFVerificationResponse : TArray0toRTMP_SWF_HASHLEN101OfCchar;
  210.     end;
  211.  
  212.   RTMP_READ = record
  213.       buf : pcchar;
  214.       bufpos : pcchar;
  215.       buflen : cuint;
  216.       timestamp : uint32_t;
  217.       dataType : uint8_t;
  218.       flags : uint8_t;
  219.       status : int8_t;
  220.       initialFrameType : uint8_t;
  221.       nResumeTS : uint32_t;
  222.       metaHeader : pcchar;
  223.       initialFrame : pcchar;
  224.       nMetaHeaderSize : uint32_t;
  225.       nInitialFrameSize : uint32_t;
  226.       nIgnoredFrameCounter : uint32_t;
  227.       nIgnoredFlvFrameCounter : uint32_t;
  228.     end;
  229.  
  230.   RTMP_METHOD = record
  231.       name : AVal;
  232.       num : cint;
  233.     end;
  234.  
  235.   PRTMP_METHOD  = ^RTMP_METHOD;
  236.  
  237.   RTMP = record
  238.       m_inChunkSize : cint;
  239.       m_outChunkSize : cint;
  240.       m_nBWCheckCounter : cint;
  241.       m_nBytesIn : cint;
  242.       m_nBytesInSent : cint;
  243.       m_nBufferMS : cint;
  244.       m_stream_id : cint;
  245.       m_mediaChannel : cint;
  246.       m_mediaStamp : uint32_t;
  247.       m_pauseStamp : uint32_t;
  248.       m_pausing : cint;
  249.       m_nServerBW : cint;
  250.       m_nClientBW : cint;
  251.       m_nClientBW2 : uint8_t;
  252.       m_bPlaying : uint8_t;
  253.       m_bSendEncoding : uint8_t;
  254.       m_bSendCounter : uint8_t;
  255.       m_numInvokes : cint;
  256.       m_numCalls : cint;
  257.       m_methodCalls : PRTMP_METHOD;
  258.       m_vecChannelsIn : TArray0toRTMP_CHANNELS1OfPRTMPPacket;
  259.       m_vecChannelsOut : TArray0toRTMP_CHANNELS1OfPRTMPPacket;
  260.       m_channelTimestamp : TArray0toRTMP_CHANNELS1OfCint;
  261.       m_fAudioCodecs : double;
  262.       m_fVideoCodecs : double;
  263.       m_fEncoding : double;
  264.       m_fDuration : double;
  265.       m_msgCounter : cint;
  266.       m_polling : cint;
  267.       m_resplen : cint;
  268.       m_unackd : cint;
  269.       m_clientID : AVal;
  270.       m_read : RTMP_READ;
  271.       m_write : RTMPPacket;
  272.       m_sb : RTMPSockBuf;
  273.       Link : RTMP_LNK;
  274.     end;
  275.    
  276.   PRTMP  = ^RTMP;
  277.   PRTMP_LNK  = ^RTMP_LNK;
  278.   PRTMP_READ  = ^RTMP_READ;
  279.   PRTMPSockBuf  = ^RTMPSockBuf;
  280.  
  281.  
  282. {RTMP Variables}
  283. var
  284.     RTMPProtocolStringsLower : TArray0to6OfPcchar;cvar;external;
  285.     RTMP_DefaultFlashVer : AVal;cvar;external;
  286.     RTMP_ctrlC : cint;cvar;external;
  287.  
  288.  {AMF Functions}
  289. function AMF_EncodeString(output:pcchar; outend:pcchar; var str:AVal):pcchar;cdecl;external External_library name 'AMF_EncodeString';
  290. function AMF_EncodeNumber(output:pcchar; outend:pcchar; dVal:double):pcchar;cdecl;external External_library name 'AMF_EncodeNumber';
  291. function AMF_EncodeInt16(output:pcchar; outend:pcchar; nVal:cshort):pcchar;cdecl;external External_library name 'AMF_EncodeInt16';
  292. function AMF_EncodeInt24(output:pcchar; outend:pcchar; nVal:cint):pcchar;cdecl;external External_library name 'AMF_EncodeInt24';
  293. function AMF_EncodeInt32(output:pcchar; outend:pcchar; nVal:cint):pcchar;cdecl;external External_library name 'AMF_EncodeInt32';
  294. function AMF_EncodeBoolean(output:pcchar; outend:pcchar; bVal:cint):pcchar;cdecl;external External_library name 'AMF_EncodeBoolean';
  295. function AMF_EncodeNamedString(output:pcchar; outend:pcchar; var name:AVal; var value:AVal):pcchar;cdecl;external External_library name 'AMF_EncodeNamedString';
  296. function AMF_EncodeNamedNumber(output:pcchar; outend:pcchar; var name:AVal; dVal:double):pcchar;cdecl;external External_library name 'AMF_EncodeNamedNumber';
  297. function AMF_EncodeNamedBoolean(output:pcchar; outend:pcchar; var name:AVal; bVal:cint):pcchar;cdecl;external External_library name 'AMF_EncodeNamedBoolean';
  298. function AMF_DecodeInt16(data:pcchar):cushort;cdecl;external External_library name 'AMF_DecodeInt16';
  299. function AMF_DecodeInt24(data:pcchar):cuint;cdecl;external External_library name 'AMF_DecodeInt24';
  300. function AMF_DecodeInt32(data:pcchar):cuint;cdecl;external External_library name 'AMF_DecodeInt32';
  301. procedure AMF_DecodeString(data:pcchar; var str:AVal);cdecl;external External_library name 'AMF_DecodeString';
  302. procedure AMF_DecodeLongString(data:pcchar; var str:AVal);cdecl;external External_library name 'AMF_DecodeLongString';
  303. function AMF_DecodeBoolean(data:pcchar):cint;cdecl;external External_library name 'AMF_DecodeBoolean';
  304. function AMF_DecodeNumber(data:pcchar):double;cdecl;external External_library name 'AMF_DecodeNumber';
  305. function AMF_Encode(var obj:AMFObject; pBuffer:pcchar; pBufEnd:pcchar):pcchar;cdecl;external External_library name 'AMF_Encode';
  306. function AMF_Decode(var obj:AMFObject; pBuffer:pcchar; nSize:cint; bDecodeName:cint):cint;cdecl;external External_library name 'AMF_Decode';
  307. function AMF_DecodeArray(var obj:AMFObject; pBuffer:pcchar; nSize:cint; nArrayLen:cint; bDecodeName:cint):cint;cdecl;external External_library name 'AMF_DecodeArray';
  308. function AMF3_Decode(var obj:AMFObject; pBuffer:pcchar; nSize:cint; bDecodeName:cint):cint;cdecl;external External_library name 'AMF3_Decode';
  309. procedure AMF_Dump(var obj:AMFObject);cdecl;external External_library name 'AMF_Dump';
  310. procedure AMF_Reset(var obj:AMFObject);cdecl;external External_library name 'AMF_Reset';
  311. procedure AMF_AddProp(var obj:AMFObject; var prop:AMFObjectProperty);cdecl;external External_library name 'AMF_AddProp';
  312. function AMF_CountProp(var obj:AMFObject):cint;cdecl;external External_library name 'AMF_CountProp';
  313. function AMF_GetProp(var obj:AMFObject; var name:AVal; nIndex:cint):PAMFObjectProperty;cdecl;external External_library name 'AMF_GetProp';
  314. function AMFProp_GetType(var prop:AMFObjectProperty):AMFDataType;cdecl;external External_library name 'AMFProp_GetType';
  315. procedure AMFProp_SetNumber(var prop:AMFObjectProperty; dval:double);cdecl;external External_library name 'AMFProp_SetNumber';
  316. procedure AMFProp_SetBoolean(var prop:AMFObjectProperty; bflag:cint);cdecl;external External_library name 'AMFProp_SetBoolean';
  317. procedure AMFProp_SetString(var prop:AMFObjectProperty; var str:AVal);cdecl;external External_library name 'AMFProp_SetString';
  318. procedure AMFProp_SetObject(var prop:AMFObjectProperty; var obj:AMFObject);cdecl;external External_library name 'AMFProp_SetObject';
  319. procedure AMFProp_GetName(var prop:AMFObjectProperty; var name:AVal);cdecl;external External_library name 'AMFProp_GetName';
  320. procedure AMFProp_SetName(var prop:AMFObjectProperty; var name:AVal);cdecl;external External_library name 'AMFProp_SetName';
  321. function AMFProp_GetNumber(var prop:AMFObjectProperty):double;cdecl;external External_library name 'AMFProp_GetNumber';
  322. function AMFProp_GetBoolean(var prop:AMFObjectProperty):cint;cdecl;external External_library name 'AMFProp_GetBoolean';
  323. procedure AMFProp_GetString(var prop:AMFObjectProperty; var str:AVal);cdecl;external External_library name 'AMFProp_GetString';
  324. procedure AMFProp_GetObject(var prop:AMFObjectProperty; var obj:AMFObject);cdecl;external External_library name 'AMFProp_GetObject';
  325. function AMFProp_IsValid(var prop:AMFObjectProperty):cint;cdecl;external External_library name 'AMFProp_IsValid';
  326. function AMFProp_Encode(var prop:AMFObjectProperty; pBuffer:pcchar; pBufEnd:pcchar):pcchar;cdecl;external External_library name 'AMFProp_Encode';
  327. function AMF3Prop_Decode(var prop:AMFObjectProperty; pBuffer:pcchar; nSize:cint; bDecodeName:cint):cint;cdecl;external External_library name 'AMF3Prop_Decode';
  328. function AMFProp_Decode(var prop:AMFObjectProperty; pBuffer:pcchar; nSize:cint; bDecodeName:cint):cint;cdecl;external External_library name 'AMFProp_Decode';
  329. procedure AMFProp_Dump(var prop:AMFObjectProperty);cdecl;external External_library name 'AMFProp_Dump';
  330. procedure AMFProp_Reset(var prop:AMFObjectProperty);cdecl;external External_library name 'AMFProp_Reset';
  331. procedure AMF3CD_AddProp(var cd:AMF3ClassDef; var prop:AVal);cdecl;external External_library name 'AMF3CD_AddProp';
  332. function AMF3CD_GetProp(var cd:AMF3ClassDef; idx:cint):PAVal;cdecl;external External_library name 'AMF3CD_GetProp';
  333.  
  334. {RTMP Functions}
  335. procedure RTMPPacket_Reset(var p:RTMPPacket);cdecl;external External_library name 'RTMPPacket_Reset';
  336. procedure RTMPPacket_Dump(var p:RTMPPacket);cdecl;external External_library name 'RTMPPacket_Dump';
  337. function RTMPPacket_Alloc(var p:RTMPPacket; nSize:cint):cint;cdecl;external External_library name 'RTMPPacket_Alloc';
  338. procedure RTMPPacket_Free(var p:RTMPPacket);cdecl;external External_library name 'RTMPPacket_Free';
  339. function RTMP_GetTime:uint32_t;cdecl;external External_library name 'RTMP_GetTime';
  340. function RTMP_ParseURL(url:pcchar; var protocol:cint; var host:AVal; var port:cuint; var playpath:AVal;
  341.            var app:AVal):cint;cdecl;external External_library name 'RTMP_ParseURL';
  342. procedure RTMP_ParsePlaypath(var input:AVal; var output:AVal);cdecl;external External_library name 'RTMP_ParsePlaypath';
  343. procedure RTMP_SetBufferMS(var r:RTMP; size:cint);cdecl;external External_library name 'RTMP_SetBufferMS';
  344. procedure RTMP_UpdateBufferMS(var r:RTMP);cdecl;external External_library name 'RTMP_UpdateBufferMS';
  345. function RTMP_SetOpt(var r:RTMP; var opt:AVal; var arg:AVal):cint;cdecl;external External_library name 'RTMP_SetOpt';
  346. function RTMP_SetupURL(var r:RTMP; url:pcchar):cint;cdecl;external External_library name 'RTMP_SetupURL';
  347. procedure RTMP_SetupStream(var r:RTMP; protocol:cint; var hostname:AVal; port:cuint; var sockshost:AVal;
  348.             var playpath:AVal; var tcUrl:AVal; var swfUrl:AVal; var pageUrl:AVal; var app:AVal;
  349.             var auth:AVal; var swfSHA256Hash:AVal; swfSize:uint32_t; var flashVer:AVal; var subscribepath:AVal;
  350.             dStart:cint; dStop:cint; bLiveStream:cint; timeout:clong);cdecl;external External_library name 'RTMP_SetupStream';
  351. function RTMP_Connect(var r:RTMP; var cp:RTMPPacket):cint;cdecl;external External_library name 'RTMP_Connect';
  352. function RTMP_Connect0(var r:RTMP; var svc:sockaddr):cint;cdecl;external External_library name 'RTMP_Connect0';
  353. function RTMP_Connect1(var r:RTMP; var cp:RTMPPacket):cint;cdecl;external External_library name 'RTMP_Connect1';
  354. function RTMP_Serve(var r:RTMP):cint;cdecl;external External_library name 'RTMP_Serve';
  355. function RTMP_ReadPacket(var r:RTMP; var packet:RTMPPacket):cint;cdecl;external External_library name 'RTMP_ReadPacket';
  356. function RTMP_SendPacket(var r:RTMP; var packet:RTMPPacket; queue:cint):cint;cdecl;external External_library name 'RTMP_SendPacket';
  357. function RTMP_SendChunk(var r:RTMP; var chunk:RTMPChunk):cint;cdecl;external External_library name 'RTMP_SendChunk';
  358. function RTMP_IsConnected(var r:RTMP):cint;cdecl;external External_library name 'RTMP_IsConnected';
  359. function RTMP_Socket(var r:RTMP):cint;cdecl;external External_library name 'RTMP_Socket';
  360. function RTMP_IsTimedout(var r:RTMP):cint;cdecl;external External_library name 'RTMP_IsTimedout';
  361. function RTMP_GetDuration(var r:RTMP):double;cdecl;external External_library name 'RTMP_GetDuration';
  362. function RTMP_ToggleStream(var r:RTMP):cint;cdecl;external External_library name 'RTMP_ToggleStream';
  363. function RTMP_ConnectStream(var r:RTMP; seekTime:cint):cint;cdecl;external External_library name 'RTMP_ConnectStream';
  364. function RTMP_ReconnectStream(var r:RTMP; seekTime:cint):cint;cdecl;external External_library name 'RTMP_ReconnectStream';
  365. procedure RTMP_DeleteStream(var r:RTMP);cdecl;external External_library name 'RTMP_DeleteStream';
  366. function RTMP_GetNextMediaPacket(var r:RTMP; var packet:RTMPPacket):cint;cdecl;external External_library name 'RTMP_GetNextMediaPacket';
  367. function RTMP_ClientPacket(var r:RTMP; var packet:RTMPPacket):cint;cdecl;external External_library name 'RTMP_ClientPacket';
  368. procedure RTMP_Init(var r:RTMP);cdecl;external External_library name 'RTMP_Init';
  369. procedure RTMP_Close(var r:RTMP);cdecl;external External_library name 'RTMP_Close';
  370. function RTMP_Alloc:PRTMP;cdecl;external External_library name 'RTMP_Alloc';
  371. procedure RTMP_Free(var r:RTMP);cdecl;external External_library name 'RTMP_Free';
  372. procedure RTMP_EnableWrite(var r:RTMP);cdecl;external External_library name 'RTMP_EnableWrite';
  373. function RTMP_LibVersion:cint;cdecl;external External_library name 'RTMP_LibVersion';
  374. procedure RTMP_UserInterrupt;cdecl;external External_library name 'RTMP_UserInterrupt';
  375. function RTMP_SendCtrl(var r:RTMP; nType:cshort; nObject:cuint; nTime:cuint):cint;cdecl;external External_library name 'RTMP_SendCtrl';
  376. function RTMP_SendPause(var r:RTMP; DoPause:cint; dTime:cint):cint;cdecl;external External_library name 'RTMP_SendPause';
  377. function RTMP_Pause(var r:RTMP; DoPause:cint):cint;cdecl;external External_library name 'RTMP_Pause';
  378. function RTMP_FindFirstMatchingProperty(var obj:AMFObject; var name:AVal; var p:AMFObjectProperty):cint;cdecl;external External_library name 'RTMP_FindFirstMatchingProperty';
  379. function RTMPSockBuf_Fill(var sb:RTMPSockBuf):cint;cdecl;external External_library name 'RTMPSockBuf_Fill';
  380. function RTMPSockBuf_Send(var sb:RTMPSockBuf; buf:pcchar; len:cint):cint;cdecl;external External_library name 'RTMPSockBuf_Send';
  381. function RTMPSockBuf_Close(var sb:RTMPSockBuf):cint;cdecl;external External_library name 'RTMPSockBuf_Close';
  382. function RTMP_SendCreateStream(var r:RTMP):cint;cdecl;external External_library name 'RTMP_SendCreateStream';
  383. function RTMP_SendSeek(var r:RTMP; dTime:cint):cint;cdecl;external External_library name 'RTMP_SendSeek';
  384. function RTMP_SendServerBW(var r:RTMP):cint;cdecl;external External_library name 'RTMP_SendServerBW';
  385. function RTMP_SendClientBW(var r:RTMP):cint;cdecl;external External_library name 'RTMP_SendClientBW';
  386. procedure RTMP_DropRequest(var r:RTMP; i:cint; freeit:cint);cdecl;external External_library name 'RTMP_DropRequest';
  387. function RTMP_ReadData(var r:RTMP; buf:pcchar; size:cint):cint;cdecl;external External_library name 'RTMP_ReadData';
  388. function RTMP_WriteData(var r:RTMP; buf:pcchar; size:cint):cint;cdecl;external External_library name 'RTMP_WriteData';
  389. function RTMP_HashSWF(url:pcchar; var size:cuint; hash:pcuchar; age:cint):cint;cdecl;external External_library name 'RTMP_HashSWF';
  390.  
  391. implementation
  392.  
  393.  
  394. end.