mirror of https://bitbucket.org/ausocean/av.git
Added todo comments
This commit is contained in:
parent
965641be16
commit
3ae7bf79da
|
@ -132,6 +132,7 @@ func (s *session) Write(data []byte) (int, error) {
|
|||
|
||||
func rtmpWrite(r *C.RTMP, data []byte) int {
|
||||
buf := sliceToPtr(data)
|
||||
// TODO: port RTMPPacket
|
||||
var pkt = &r.m_write
|
||||
var pend, enc unsafe.Pointer
|
||||
size := len(data)
|
||||
|
@ -157,8 +158,10 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
|
|||
|
||||
pkt.m_packetType = C.uchar(*(*byte)(buf))
|
||||
buf = incPtr(buf,1)
|
||||
// TODO: port this
|
||||
pkt.m_nBodySize = C.AMF_DecodeInt24((*C.char)(buf))
|
||||
buf = incPtr(buf,3)
|
||||
// TODO: replace with ported version
|
||||
pkt.m_nTimeStamp = C.AMF_DecodeInt24((*C.char)(buf))
|
||||
buf = incPtr(buf,3)
|
||||
pkt.m_nTimeStamp |= C.uint(*((*byte)(buf))) << 24
|
||||
|
@ -177,7 +180,7 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
|
|||
} else {
|
||||
pkt.m_headerType = RTMP_PACKET_SIZE_MEDIUM
|
||||
}
|
||||
|
||||
// TODO: Port this
|
||||
if int(C.RTMPPacket_Alloc(pkt, pkt.m_nBodySize)) == 0 {
|
||||
log.Println("Failed to allocate packet")
|
||||
return 0
|
||||
|
@ -187,6 +190,7 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
|
|||
pend = incPtr(enc,int(pkt.m_nBodySize))
|
||||
|
||||
if pkt.m_packetType == RTMP_PACKET_TYPE_INFO {
|
||||
// TODO: Port this
|
||||
enc = unsafe.Pointer(C.AMF_EncodeString((*C.char)(enc), (*C.char)(pend), &setDataFrame))
|
||||
pkt.m_nBytesRead = C.uint(math.Abs(float64(uintptr(enc) -
|
||||
uintptr(unsafe.Pointer(pkt.m_body)))))
|
||||
|
@ -204,7 +208,9 @@ func rtmpWrite(r *C.RTMP, data []byte) int {
|
|||
s2 -= num
|
||||
buf = incPtr(buf,num)
|
||||
if pkt.m_nBytesRead == pkt.m_nBodySize {
|
||||
// TODO: Port this
|
||||
ret = int(C.RTMP_SendPacket(r, pkt, 0))
|
||||
// TODO: Port this
|
||||
C.RTMPPacket_Free(pkt)
|
||||
pkt.m_nBytesRead = 0
|
||||
if ret == 0 {
|
||||
|
|
Loading…
Reference in New Issue