protected boolean checkSendMessageEnabled ( RTMPMessage message ) { IRTMPEvent body = message . getBody ( ) ; if ( ! receiveAudio && body instanceof AudioData ) { // The user doesn't want to get audio packets ( ( IStreamData < ? > ) body ) . getData ( ) . free ( ) ; if ( sendBlankAudio ) { // Send reset audio packet sendBlankAudio = false ; body = new AudioData ( ) ; // We need a zero timestamp if ( lastMessageTs >= 0 ) { body . setTimestamp ( lastMessageTs - timestampOffset ) ; } else { body . setTimestamp ( - timestampOffset ) ; } message = RTMPMessage . build ( body ) ; } else { return false ; } } else if ( ! receiveVideo && body instanceof VideoData ) { // The user doesn't want to get video packets ( ( IStreamData < ? > ) body ) . getData ( ) . free ( ) ; return false ; } return true ; }
Check if sending the given message was enabled by the client .