Using all my encoding functions in sendConnectPacket - tested and working

This commit is contained in:
saxon 2018-07-29 10:26:05 +09:30
parent c205e3874a
commit 1f6a59b050
1 changed files with 9 additions and 9 deletions

View File

@ -1045,9 +1045,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int {
return 0
}
if r.Link.pageUrl.av_len != 0 {
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedString((*C.char)(
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_pageUrl, &r.Link.pageUrl)))
//enc = amfEncodeNamedString(enc, pend, &av_pageUrl, &r.Link.pageUrl)
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedString((*C.char)(
//unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_pageUrl, &r.Link.pageUrl)))
enc = amfEncodeNamedString(enc, pend, &av_pageUrl, &r.Link.pageUrl)
if enc == nil {
return 0
}
@ -1055,9 +1055,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int {
}
if r.m_fEncoding != 0.0 || r.m_bSendEncoding != 0 {
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_objectEncoding, r.m_fEncoding)))
//enc = amfEncodeNamedNumber(enc, pend, &av_objectEncoding, float64(r.m_fEncoding))
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
//unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_objectEncoding, r.m_fEncoding)))
enc = amfEncodeNamedNumber(enc, pend, &av_objectEncoding, float64(r.m_fEncoding))
if enc == nil {
return 0
}
@ -1077,9 +1077,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int {
/* add auth string */
if r.Link.auth.av_len != 0 {
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeBoolean((*C.char)(
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), r.Link.lFlags&RTMP_LF_AUTH)))
//enc = amfEncodeBoolean(enc, pend, int(r.Link.lFlags&RTMP_LF_AUTH))
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeBoolean((*C.char)(
// unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), r.Link.lFlags&RTMP_LF_AUTH)))
enc = amfEncodeBoolean(enc, pend, int(r.Link.lFlags&RTMP_LF_AUTH))
if enc == nil {
return 0
}