RTMPDump源码分析-主要函数调用(0)

RTMPDump是基于librtmp库实现的一个RTMP客户端,可以认为是通过librtmp调用实现的典型的客户端,

RTMPDump其主页为:http://rtmpdump.mplayerhq.hu/rtmpdump.1.html


其中在librtmp的主页当中介绍librtmp的API的时候介绍了RTMPdump, 详细http://rtmpdump.mplayerhq.hu/librtmp.3.html。

  • The RTMPDump software package includes a basic client utility program in rtmpdump(1), some sample servers, and a library used to provide programmatic access to the RTMP protocol. This man page gives an overview of the RTMP library routines. These routines are found in the -lrtmp library. Many other routines are also available, but they are not documented yet.

    The basic interaction is as follows. A session handle is created using RTMP_Alloc() and initialized using RTMP_Init(). All session parameters are provided usingRTMP_SetupURL(). The network connection is established using RTMP_Connect(), and then the RTMP session is established using RTMP_ConnectStream(). The stream is read using RTMP_Read(). A client can publish a stream by calling RTMP_EnableWrite() before the RTMP_Connect() call, and then using RTMP_Write() after the session is established. While a stream is playing it may be paused and unpaused using RTMP_Pause(). The stream playback position can be moved using RTMP_Seek(). When RTMP_Read() returns 0 bytes, the stream is complete and may be closed using RTMP_Close(). The session handle is freed using RTMP_Free().

 RTMPDump就是用了librtmp的API实现了Download功能,从而通过RTMP访问服务器的内容。


RTMPDump.c中Download函数的调用就是从Socket中读取数据:



RTMP的NetConnection的过程就是调用librtmp的RTMP_Connect:


建立NetStream的过程就是调用librtmp的RTMP_ConnectStream:


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值