Using my amfEncodeNamedNumber and amfEncodeNumber - tested and working

This commit is contained in:
saxon 2018-07-29 10:24:27 +09:30
parent 60b88dbf6c
commit c205e3874a
1 changed files with 13 additions and 13 deletions

View File

@ -1020,27 +1020,27 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int {
if enc == nil {
return 0
}
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_capabilities, 15.0)))
//enc = amfEncodeNamedNumber(enc, pend, &av_capabilities, 15.0)
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
//unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_capabilities, 15.0)))
enc = amfEncodeNamedNumber(enc, pend, &av_capabilities, 15.0)
if enc == nil {
return 0
}
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_audioCodecs, r.m_fAudioCodecs)))
//enc = amfEncodeNamedNumber(enc, pend, &av_audioCodecs, float64(r.m_fAudioCodecs))
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
// unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_audioCodecs, r.m_fAudioCodecs)))
enc = amfEncodeNamedNumber(enc, pend, &av_audioCodecs, float64(r.m_fAudioCodecs))
if enc == nil {
return 0
}
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_videoCodecs, r.m_fVideoCodecs)))
//enc = amfEncodeNamedNumber(enc, pend, &av_videoCodecs, float64(r.m_fVideoCodecs))
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
//unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_videoCodecs, r.m_fVideoCodecs)))
enc = amfEncodeNamedNumber(enc, pend, &av_videoCodecs, float64(r.m_fVideoCodecs))
if enc == nil {
return 0
}
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_videoFunction, 1.0)))
//enc = amfEncodeNamedNumber(enc, pend, &av_videoFunction, 1.0)
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedNumber((*C.char)(
// unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_videoFunction, 1.0)))
enc = amfEncodeNamedNumber(enc, pend, &av_videoFunction, 1.0)
if enc == nil {
return 0
}
@ -1588,7 +1588,7 @@ func amfEncodeNamedNumber(output *byte, outend *byte, strName *C.AVal, dVal floa
return nil
}
output = amfEncodeInt16(output, outend, int16(strName.av_len))
memmove(unsafe.Pointer(output), unsafe.Pointer(outend), uintptr(strName.av_len))
memmove(unsafe.Pointer(output), unsafe.Pointer(strName.av_val), uintptr(strName.av_len))
output = (*byte)(incBytePtr(unsafe.Pointer(output), int(strName.av_len)))
return amfEncodeNumber(output, outend, dVal)
}