public IRTMPEvent decodeMessage ( RTMPConnection conn , Header header , IoBuffer in ) { IRTMPEvent message ; byte dataType = header . getDataType ( ) ; switch ( dataType ) { case TYPE_AUDIO_DATA : message = decodeAudioData ( in ) ; message . setSourceType ( Constants . SOURCE_TYPE_LIVE ) ; break ; case TYPE_VIDEO_DATA : message = decodeVideoData ( in ) ; message . setSourceType ( Constants . SOURCE_TYPE_LIVE ) ; break ; case TYPE_AGGREGATE : message = decodeAggregate ( in ) ; break ; case TYPE_FLEX_SHARED_OBJECT : // represents an SO in an AMF3 container message = decodeFlexSharedObject ( in ) ; break ; case TYPE_SHARED_OBJECT : message = decodeSharedObject ( in ) ; break ; case TYPE_FLEX_MESSAGE : message = decodeFlexMessage ( in ) ; break ; case TYPE_INVOKE : message = decodeAction ( conn . getEncoding ( ) , in , header ) ; break ; case TYPE_FLEX_STREAM_SEND : if ( log . isTraceEnabled ( ) ) { log . trace ( "Decoding flex stream send on stream id: {}" , header . getStreamId ( ) ) ; } // skip first byte in . get ( ) ; // decode stream data; slice from the current position message = decodeStreamData ( in . slice ( ) ) ; break ; case TYPE_NOTIFY : if ( log . isTraceEnabled ( ) ) { log . trace ( "Decoding notify on stream id: {}" , header . getStreamId ( ) ) ; } if ( header . getStreamId ( ) . doubleValue ( ) != 0.0d ) { message = decodeStreamData ( in ) ; } else { message = decodeAction ( conn . getEncoding ( ) , in , header ) ; } break ; case TYPE_PING : message = decodePing ( in ) ; break ; case TYPE_BYTES_READ : message = decodeBytesRead ( in ) ; break ; case TYPE_CHUNK_SIZE : message = decodeChunkSize ( in ) ; break ; case TYPE_SERVER_BANDWIDTH : message = decodeServerBW ( in ) ; break ; case TYPE_CLIENT_BANDWIDTH : message = decodeClientBW ( in ) ; break ; case TYPE_ABORT : message = decodeAbort ( in ) ; break ; default : log . warn ( "Unknown object type: {}" , dataType ) ; message = decodeUnknown ( dataType , in ) ; break ; } // add the header to the message message . setHeader ( header ) ; return message ; }
Decodes RTMP message event .