1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| private void initAudioVideoFormat() {
// Choisir le type du contenu
System.out.println("Transmitter.initVideoFormats: Processor configured.");
processor.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.RAW_RTP));
trackControls = processor.getTrackControls();
for (int i = 0; i < trackControls.length; i++) {
if (!trackControls[i].isEnabled()) {
trackControls[i].setEnabled(false);
System.out.println("Transmitter.initProcessor: Track " + i + " is disabled.");
continue;
}
supportedFormats = trackControls[i].getSupportedFormats();
if (supportedFormats.length == 0) {
trackControls[i].setEnabled(false);
System.out.println("Transmitter.initProcessor: Track " + i + " doesn't support any format.");
continue;
}
if (trackControls[i].getFormat() instanceof VideoFormat) {
trackControls[i].setFormat(checkForVideoSizes(trackControls[i].getFormat(), supportedFormats[0]));
} else if (trackControls[i].getFormat() instanceof AudioFormat) {
trackControls[i].setFormat(new AudioFormat(AudioFormat.GSM_RTP, 8000, 8, 1));
System.out.println("Output AudioFormat " + i + ": "
+ trackControls[i].getFormat().toString());
} else {
System.out.println("Unknown Format " + i + ": "
+ trackControls[i].getFormat().toString());
}
}
} |
Partager