/** * Whether the extractor is prepared. * * @return True if the extractor is prepared. False otherwise. */ public boolean isPrepared() { if (!prepared && tracksBuilt) { for (int i = 0; i < sampleQueues.size(); i++) { if (!sampleQueues.valueAt(i).hasFormat()) { return false; } } prepared = true; sampleQueueFormats = new MediaFormat[sampleQueues.size()]; for (int i = 0; i < sampleQueueFormats.length; i++) { MediaFormat format = sampleQueues.valueAt(i).getFormat(); if (MimeTypes.isVideo(format.mimeType) && (adaptiveMaxWidth != MediaFormat.NO_VALUE || adaptiveMaxHeight != MediaFormat.NO_VALUE)) { format = format.copyWithMaxVideoDimensions(adaptiveMaxWidth, adaptiveMaxHeight); } sampleQueueFormats[i] = format; } } return prepared; }