From 9c460b90cf9c9bd8f41bbe89151fc6cccdd31314 Mon Sep 17 00:00:00 2001 From: saxon Date: Wed, 15 Aug 2018 03:14:35 +0930 Subject: [PATCH] Ported AMFProp_GetNumber - tested and working --- rtmp/rtmp.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index f79953bf..b60af923 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -1942,9 +1942,7 @@ func C_HandleClientBW(r *C.RTMP, packet *C.RTMPPacket) { // int HandleInvoke(RTMP* r, const char* body, unsigned int nBodySize); // rtmp.c +2912 -// TODO port AMFProp_GetObject (amf.c +342) // TODO port AMFProp_GetNumber (amf.c +330) -// TODO port AMF_GetProp (amf.c +1249) // TODO port AV_erase (rtmp.c +2393) // TODO port SendReleaseStream (rtmp.c +1816) // TODO port SendFCPublish (rtmp.c +1846) @@ -2293,6 +2291,12 @@ func C_AMF_GetProp(obj *C.AMFObject, name *C.AVal, nIndex int32) *C.AMFObjectPro return (*C.AMFObjectProperty)(&AMFProp_Invalid) } +// double AMFProp_GetNumber(AMFObjectProperty* prop); +// amf.c +330 +func C_AMFProp_GetNumber(prop *C.AMFObjectProperty) float64 { + return float64(prop.p_vu.p_number) +} + // void RTMPPacket_Free(RTMPPacket* p); // rtmp.c +203 func C_RTMPPacket_Free(p *C.RTMPPacket) {