private RTPFormat createVideoFormat ( int payload , Text description ) { Iterator < Text > it = description . split ( ' ' ) . iterator ( ) ; //encoding name Text token = it . next ( ) ; token . trim ( ) ; EncodingName name = new EncodingName ( token ) ; //clock rate //TODO : convert to frame rate token = it . next ( ) ; token . trim ( ) ; int clockRate = token . toInteger ( ) ; RTPFormat rtpFormat = getFormat ( payload ) ; if ( rtpFormat == null ) { formats . add ( new RTPFormat ( payload , FormatFactory . createVideoFormat ( name , clockRate ) ) ) ; } else { //TODO: recreate format anyway. it is illegal to use clock rate as frame rate ( ( VideoFormat ) rtpFormat . getFormat ( ) ) . setName ( name ) ; ( ( VideoFormat ) rtpFormat . getFormat ( ) ) . setFrameRate ( clockRate ) ; } return rtpFormat ; }
Creates or updates video format using payload number and text format description .