[rtmpdump] [PATCH] Callback API

Howard Chu hyc at highlandsun.com
Mon Jan 9 09:54:55 CET 2012


Adam Malcontenti-Wilson wrote:
> Looks good, I especially like the documentation comment.
> One thing that wasn't immediately obvious to me was the code
> "RTMPCallbackNode *callbacks[4];" and why there were four, until I
> looked at the rest of the code. Might I suggest defining a
> RTMP_NUM_CALLBACK_TYPES or similar that gets used there both for
> extendability as well as making it obvious to people reading the code
> (like me). Other than that nitpick, hopefully this patch can get
> accepted.

The idea sounds good to me, but I won't have time to look at this in detail 
for another week or so.

> On Mon, Jan 9, 2012 at 3:53 AM, Antti Ajanki<antti.ajanki at iki.fi>  wrote:
>> The attached patch adds a callback interface for overriding (parts of) the
>> RTMP packet processing. This is based on Chris Larsen's and Adam
>> Malcontenti-Wilson's patches from last Fall.
>>
>> This is useful for implementing custom CDN authentication. My other
>> motivation is implementing remote procedure calls over RTMP in the open
>> source Flash player Lightspark, where a callback could be used to capture
>> incoming RPC packets and execute the corresponding functions on Lightspark's
>> virtual machine.
>>
>> The patch actually adds different callbacks on various levels of generality.
>> RTMP_CALLBACK_PACKET callbacks can be used to completely override RTMP
>> packet handling. Then there are more restricted callbacks, which only apply
>> to some particular types of packets but, on the other hand, avoid much of
>> the RTMP body parsing because that can be left to librtmp. See the comments
>> in rtmp.h for details on different types of callbacks.


More information about the rtmpdump mailing list