@ SuppressWarnings ( "null" ) private < T > T visitMediaFormats ( MediaArgs mediaArgs , MediaFormatVisitor < T > mediaFormatVisitor ) { MediaFormat [ ] mediaFormats = mediaArgs . getMediaFormats ( ) ; if ( mediaFormats != null ) { for ( MediaFormat mediaFormat : mediaFormats ) { T returnValue = mediaFormatVisitor . visit ( mediaFormat ) ; if ( returnValue != null ) { return returnValue ; } } } return null ; }
Iterate over all media formats defined in media args . Ignores invalid media formats . If the media format visitor returns a value that is not null iteration is stopped and the value is returned from this method .