rtmp: dealt with unsupported cases in C_RTMP_ClientPacket

This commit is contained in:
saxon 2018-08-25 23:22:22 +09:30
parent 77393a1de7
commit 6c84506af2
1 changed files with 90 additions and 86 deletions

View File

@ -662,35 +662,34 @@ func C_RTMP_ClientPacket(r *C_RTMP, packet *C_RTMPPacket) int32 {
switch packet.m_packetType {
case RTMP_PACKET_TYPE_CHUNK_SIZE:
log.Println("RTMP_PACKET_TYPE_CHUNK_SIZE")
// TODO: port this
//C.HandleChangeChunkSize(r, packet)
C_HandleChangeChunkSize(r, packet)
/*
case RTMP_PACKET_TYPE_BYTES_READ_REPORT:
log.Println("RTMP_PACKET_TYPE_BYTES_READ_REPORT")
// TODO: usue new logger here
//RTMP_Log(RTMP_LOGDEBUG, "%s, received: bytes read report", __FUNCTION__);
case RTMP_PACKET_TYPE_CONTROL:
panic("Unsupported packet type RTMP_PACKET_TYPE_CONTROL")
/*
log.Println("RTMP_PACKET_TYPE_CONTROL")
// TODO: port this
C.HandleCtrl(r, packet)
*/
case RTMP_PACKET_TYPE_SERVER_BW:
log.Println("RTMP_PACKET_TYPE_SERVER_BW")
// TODO: port this
//C.HandleServerBW(r, packet)
C_HandlServerBW(r, packet)
case RTMP_PACKET_TYPE_CLIENT_BW:
log.Println("RTMP_PACKET_TYPE_CLIENT_BW")
// TODO: port this
//C.HandleClientBW(r, packet)
C_HandleClientBW(r, packet)
/*
case RTMP_PACKET_TYPE_AUDIO:
log.Println("RTMP_PACKET_TYPE_AUDIO")
panic("Unsupported packet type RTMP_PACKET_TYPE_AUDIO")
/*
// TODO port this
//C.HandleAudio(r, packet) NOTE this does nothing
bHasMediaPacket = 1
@ -701,9 +700,11 @@ func C_RTMP_ClientPacket(r *C_RTMP, packet *C_RTMPPacket) int32 {
if r.m_pausing == 0 {
r.m_mediaStamp = packet.m_nTimeStamp
}
*/
case RTMP_PACKET_TYPE_VIDEO:
log.Println("RTMP_PACKET_TYPE_VIDEO:")
panic("Unsupported packet type RTMP_PACKET_TYPE_VIDEO")
/*
// TODO port this
// C.HandleVideo(r, packet) NOTE this does nothing
bHasMediaPacket = 1
@ -713,9 +714,10 @@ func C_RTMP_ClientPacket(r *C_RTMP, packet *C_RTMPPacket) int32 {
if r.m_pausing == 0 {
r.m_mediaStamp = packet.m_nTimeStamp
}
*/
case RTMP_PACKET_TYPE_FLEX_MESSAGE:
log.Println("RTMP_PACKET_TYPE_FLEX_MESSAGE:")
panic("Unsupported packet type RTMP_PACKET_TYPE_FLEX_MESSAGE")
/*
{
// TODO use new logger here
// RTMP_Log(RTMP_LOGDEBUG,"%s, flex message, size %u bytes, not fully supported", __FUNCTION__, packet.m_nBodySize);
@ -725,8 +727,10 @@ func C_RTMP_ClientPacket(r *C_RTMP, packet *C_RTMPPacket) int32 {
bHasMediaPacket = 2
}
}
*/
case RTMP_PACKET_TYPE_INFO:
log.Println(" RTMP_PACKET_TYPE_INFO:")
panic("Unsupported packet type RTMP_PACKET_TYPE_INFO")
/*
// TODO use new logger here
//RTMP_Log(RTMP_LOGDEBUG, "%s, received: notify %u bytes", __FUNCTION__,packet.m_nBodySize);
if C.HandleMetadata(r, packet.m_body, C.uint(packet.m_nBodySize)) != 0 {
@ -744,9 +748,10 @@ func C_RTMP_ClientPacket(r *C_RTMP, packet *C_RTMPPacket) int32 {
log.Println("HasMediaPacket")
bHasMediaPacket = 2
}
/*
case RTMP_PACKET_TYPE_FLASH_VIDEO:
log.Println("RTMP_PACKET_TYPE_FLASH_VIDEO:")
panic("Unsupported packet type RTMP_PACKET_TYPE_FLASH_VIDEO")
/*
{
var pos uint32 = 0
var nTimeStamp uint32 = uint32(packet.m_nTimeStamp)
@ -781,11 +786,10 @@ func C_RTMP_ClientPacket(r *C_RTMP, packet *C_RTMPPacket) int32 {
bHasMediaPacket = 1
}
*/
default:
log.Println("DEFAULT")
// TODO use new logger here
// RTMP_Log(RTMP_LOGDEBUG, "%s, unknown packet type received: 0x%02x", __FUNCTION__,packet.m_packetType);
*/
}
return bHasMediaPacket
}