mirror of https://bitbucket.org/ausocean/av.git
Ported AMFProp_GetObject - tested and working
This commit is contained in:
parent
165a855d51
commit
48042f6813
16
rtmp/rtmp.go
16
rtmp/rtmp.go
|
@ -240,6 +240,8 @@ var (
|
|||
|
||||
var packetSize = [...]int{12, 8, 4, 1}
|
||||
|
||||
var AMFObj_Invalid C.AMFObject
|
||||
|
||||
var RTMPProtocolStringsLower = [...]string{
|
||||
"rtmp",
|
||||
"rtmpt",
|
||||
|
@ -1939,7 +1941,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_GetString (amf.c +342)
|
||||
// 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)
|
||||
|
@ -2140,7 +2142,7 @@ func C_HandleInvoke(r *C.RTMP, body *byte, nBodySize uint32) int32 {
|
|||
log.Println("13")
|
||||
var obj2 C.AMFObject
|
||||
var code, level C.AVal
|
||||
C.AMFProp_GetObject(C.AMF_GetProp(&obj, nil, 3), &obj2)
|
||||
C_AMFProp_GetObject(C.AMF_GetProp(&obj, nil, 3), &obj2)
|
||||
C_AMFProp_GetString(C.AMF_GetProp(&obj2, &av_code, -1), &code)
|
||||
C_AMFProp_GetString(C.AMF_GetProp(&obj2, &av_level, -1), &level)
|
||||
|
||||
|
@ -2258,6 +2260,16 @@ func C_AMFProp_GetString(prop *C.AMFObjectProperty, str *C.AVal) {
|
|||
}
|
||||
}
|
||||
|
||||
// void AMFProp_GetObject(AMFObjectProperty *prop, AMFObject *obj);
|
||||
// amf.c +351
|
||||
func C_AMFProp_GetObject(prop *C.AMFObjectProperty, obj *C.AMFObject) {
|
||||
if prop.p_type == AMF_OBJECT {
|
||||
*obj = prop.p_vu.p_object
|
||||
} else {
|
||||
*obj = AMFObj_Invalid
|
||||
}
|
||||
}
|
||||
|
||||
// void RTMPPacket_Free(RTMPPacket* p);
|
||||
// rtmp.c +203
|
||||
func C_RTMPPacket_Free(p *C.RTMPPacket) {
|
||||
|
|
Loading…
Reference in New Issue