From 7a9fef826c9568f3917ae34270d2f2360c977bf7 Mon Sep 17 00:00:00 2001 From: saxon Date: Fri, 24 Aug 2018 06:49:47 +0930 Subject: [PATCH] rtmp: moved amf structs from rtmp.go to amf.go --- rtmp/amf.go | 29 +++++++++++++++++++++++++++++ rtmp/rtmp.go | 26 -------------------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/rtmp/amf.go b/rtmp/amf.go index 5170b278..a78fd291 100644 --- a/rtmp/amf.go +++ b/rtmp/amf.go @@ -21,3 +21,32 @@ const ( AMF_AVMPLUS /* switch to AMF3 */ AMF_INVALID = 0xff ) + +var ( + AMFObj_Invalid C_AMFObject + AMFProp_Invalid = C_AMFObjectProperty{p_type: AMF_INVALID} +) + +// typedef struct AMF_Object +// amf.h +67 +type C_AMFObject struct { + o_num int32 + o_props *C_AMFObjectProperty +} + +// typedef struct AMFObjectProperty +// amf.h +79 +type C_AMFObjectProperty struct { + p_name C_AVal + p_type C_AMFDataType + p_vu P_vu + p_UTCoffset int16 +} + +// typedef struct P_vu +// amf.h +73 +type P_vu struct { + p_number float64 + p_aval C_AVal + p_object C_AMFObject +} diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index d84f42c4..72a61385 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -208,8 +208,6 @@ var ( ) var ( - AMFObj_Invalid C_AMFObject - AMFProp_Invalid = C_AMFObjectProperty{p_type: AMF_INVALID} packetSize = [...]int{12, 8, 4, 1} RTMPProtocolStringsLower = [...]string{ "rtmp", @@ -374,30 +372,6 @@ type C_RTMP_LNK struct { port uint16 } -// typedef struct AMF_Object -// amf.h +67 -type C_AMFObject struct { - o_num int32 - o_props *C_AMFObjectProperty -} - -// typedef struct AMFObjectProperty -// amf.h +79 -type C_AMFObjectProperty struct { - p_name C_AVal - p_type C_AMFDataType - p_vu P_vu - p_UTCoffset int16 -} - -// typedef struct P_vu -// amf.h +73 -type P_vu struct { - p_number float64 - p_aval C_AVal - p_object C_AMFObject -} - // NewSession returns a new session. func NewSession(url string, connectTimeout uint) *Session { return &Session{