Created RTMP go struct

This commit is contained in:
saxon 2018-07-19 00:40:36 +09:30
parent a00550b638
commit b6cd93fa4b
1 changed files with 43 additions and 2 deletions

View File

@ -121,6 +121,47 @@ type session struct {
timeout uint
}
type RTMP struct {
m_inChunkSize int
m_outChunkSize int
m_nBWCheckCounter int
m_nBytesIn int
m_nBytesInSent int
m_nBufferMS int
m_stream_id int
m_mediaChannel int
m_mediaStamp uint32
m_pauseStamp uint32
m_pausing int
m_nServerBw int
m_nClientBw int
m_nClientBw2 uint8
m_bPlaying uint8
m_bSendEncoding uint8
m_bSendCounter uint8
m_numInvokes int
m_numCalls int
m_methodCalls *C.RTMP_METHOD
m_channelsAllocatedIn int
m_channelsAllocatedOut int
m_vecChannelsIn **C.RTMPPacket
m_vecChannelsOut **C.RTMPPacket
m_channelTimestamp *int
m_fAudioCodecs float64
m_fVideoCodecs float64
m_fEncoding float64
m_fDuration float64
m_msgCounter int
m_polling int
m_resplen int
m_unackd int
m_clientID C.AVal
m_read C.RTMP_READ
m_write C.RTMPPacket
m_sb C.RTMPSockBuf
Link C.RTMP_LNK
}
var _ Session = (*session)(nil)
// NewSession returns a new session.
@ -200,9 +241,9 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
pkt.m_packetType = C.uint8_t(*indxBytePtr(buf, 0))
buf = incBytePtr(buf, 1)
pkt.m_nBodySize = C.uint32_t(afmDecodeInt24((*byte)(buf)))
pkt.m_nBodySize = C.uint32_t(C.AMF_DecodeInt24((*C.char)(buf)))
buf = incBytePtr(buf, 3)
pkt.m_nTimeStamp = C.uint32_t(afmDecodeInt24((*byte)(buf)))
pkt.m_nTimeStamp = C.uint32_t(C.AMF_DecodeInt24((*C.char)(buf)))
buf = incBytePtr(buf, 3)
pkt.m_nTimeStamp |= C.uint32_t(*indxBytePtr(buf, 0)) << 24
buf = incBytePtr(buf, 4)