mirror of https://bitbucket.org/ausocean/av.git
Changed name of rtmpAlloc to C_RTMP_Alloc
This commit is contained in:
parent
fe16404448
commit
ba101285ff
11
rtmp/rtmp.go
11
rtmp/rtmp.go
|
@ -393,7 +393,7 @@ func (s *session) Write(data []byte) (int, error) {
|
||||||
return 0, Err(3)
|
return 0, Err(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if rtmpIsConnected(s.rtmp) == 0 {
|
// if C_RTMP_IsConnected(s.rtmp) == 0 {
|
||||||
if C.RTMP_IsConnected(s.rtmp) == 0 {
|
if C.RTMP_IsConnected(s.rtmp) == 0 {
|
||||||
return 0, Err(1)
|
return 0, Err(1)
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ func C_RTMP_IsConnected(r *C.RTMP) int32 {
|
||||||
|
|
||||||
func startSession(rtmp *C.RTMP, u string, timeout uint32) (*C.RTMP, error) {
|
func startSession(rtmp *C.RTMP, u string, timeout uint32) (*C.RTMP, error) {
|
||||||
connect_timeout := C.int(timeout)
|
connect_timeout := C.int(timeout)
|
||||||
rtmp = rtmpAlloc()
|
rtmp = C_RTMP_Alloc()
|
||||||
//rtmp = C.RTMP_Alloc()
|
//rtmp = C.RTMP_Alloc()
|
||||||
rtmpInit(rtmp)
|
rtmpInit(rtmp)
|
||||||
//C.RTMP_Init(rtmp)
|
//C.RTMP_Init(rtmp)
|
||||||
|
@ -447,8 +447,7 @@ func startSession(rtmp *C.RTMP, u string, timeout uint32) (*C.RTMP, error) {
|
||||||
|
|
||||||
return rtmp, nil
|
return rtmp, nil
|
||||||
}
|
}
|
||||||
|
func C_RTMP_Alloc() *C.RTMP {
|
||||||
func rtmpAlloc() *C.RTMP {
|
|
||||||
var r C.RTMP
|
var r C.RTMP
|
||||||
//return (*C.RTMP)(C.malloc(C.size_t(unsafe.Sizeof(r))))
|
//return (*C.RTMP)(C.malloc(C.size_t(unsafe.Sizeof(r))))
|
||||||
return (*C.RTMP)(allocate(unsafe.Sizeof(r)))
|
return (*C.RTMP)(allocate(unsafe.Sizeof(r)))
|
||||||
|
@ -571,7 +570,7 @@ func rtmpClose(r *C.RTMP) {
|
||||||
func closeInternal(r *C.RTMP, reconnect int32) {
|
func closeInternal(r *C.RTMP, reconnect int32) {
|
||||||
var i int32
|
var i int32
|
||||||
|
|
||||||
if rtmpIsConnected(r) != 0 {
|
if C_RTMP_IsConnected(r) != 0 {
|
||||||
if r.m_stream_id > 0 {
|
if r.m_stream_id > 0 {
|
||||||
i = int32(r.m_stream_id)
|
i = int32(r.m_stream_id)
|
||||||
if r.Link.protocol&RTMP_FEATURE_WRITE != 0 {
|
if r.Link.protocol&RTMP_FEATURE_WRITE != 0 {
|
||||||
|
@ -1264,7 +1263,7 @@ func rtmpConnectStream(r *C.RTMP, seekTime int32) int {
|
||||||
r.m_mediaChannel = 0
|
r.m_mediaChannel = 0
|
||||||
|
|
||||||
// TODO: read packet
|
// TODO: read packet
|
||||||
for r.m_bPlaying == 0 && rtmpIsConnected(r) != 0 &&
|
for r.m_bPlaying == 0 && C_RTMP_IsConnected(r) != 0 &&
|
||||||
C.RTMP_ReadPacket(r, &packet) != 0 {
|
C.RTMP_ReadPacket(r, &packet) != 0 {
|
||||||
|
|
||||||
// TODO: port is ready
|
// TODO: port is ready
|
||||||
|
|
Loading…
Reference in New Issue