if (tracks[i].isEnabled()) { supported = tracks[i].getSupportedFormats(); tracks[i].setFormat(chosen); LOGGER.severe("Track " + i + " is set to transmit as: " + chosen); if (tracks[i].getFormat() instanceof AudioFormat) { int packetRate = 20; PacketSizeControl pktCtrl = (PacketSizeControl) processor.getControl(PacketSizeControl.class.getName()); if (pktCtrl != null) { try { pktCtrl.setPacketSize(getPacketSize(tracks[i].getFormat(), packetRate)); if (tracks[i].getFormat().getEncoding().equals(AudioFormat.ULAW_RTP)) { Codec[] codec = new Codec[3]; tracks[i].setCodecChain(codec); tracks[i].setEnabled(false); tracks[i].setEnabled(false);
if (control.getFormat() instanceof VideoFormat || control.getFormat() instanceof AudioFormat) { if (control.getFormat() instanceof AudioFormat) { control.setFormat(new AudioFormat(AudioFormat.GSM)); if (control.getFormat() instanceof VideoFormat) { VideoFormat desiredVideoFormat = null; Dimension targetDimension = new Dimension(352, 288); for (Format format : control.getSupportedFormats()) { if (format.isSameEncoding(checkFormat)) { candidates.add((VideoFormat) format); control.setFormat(desiredVideoFormat); control.setEnabled(true); System.out.println("Enabled track: " + control + " (" + control.getFormat() + ")");
if (!trackControl.isEnabled()) continue; Format[] supportedFormats = trackControl.getSupportedFormats(); trackControl.setEnabled(false); continue; trackControl.setEnabled(false); else if (!supportedFormat.equals(trackControl.getFormat()))
for (TrackControl trackControl : trackControls) Format trackFormat = trackControl.getFormat(); = trackControl.getSupportedFormats(); trackControl.setFormat(intersectionFormat); break;
Format trackFormat = track.getFormat(); track.setCodecChain( codecList.toArray(new Codec[codecList.size()])); track.setFormat(vp8Format); else
if (tc.getFormat() instanceof AudioFormat) tc.setCodecChain( new Codec[] { localUserAudioLevelEffect }); break;
if (!trackControl.isEnabled()) continue; : trackControl.getSupportedFormats())
/** * Gets the JMF <tt>Format</tt> in which this instance captures media. * * @return the JMF <tt>Format</tt> in which this instance captures media. */ public Format getProcessorFormat() { Processor processor = getProcessor(); if ((processor != null) && (this.processor == processor) && !processorIsPrematurelyClosed) { MediaType mediaType = getMediaType(); for (TrackControl trackControl : processor.getTrackControls()) { if (!trackControl.isEnabled()) continue; Format jmfFormat = trackControl.getFormat(); MediaType type = (jmfFormat instanceof VideoFormat) ? MediaType.VIDEO : MediaType.AUDIO; if (mediaType.equals(type)) return jmfFormat; } } return null; }
/** * Adds an audio level effect to the tracks of the specified * <tt>trackControl</tt> and so that we would notify interested listeners * of audio level changes. * * @param trackControl the <tt>TrackControl</tt> where we need to register * a level effect that would measure the audio levels of the * <tt>ReceiveStream</tt> associated with this class. * * @throws UnsupportedPlugInException if we fail to add our sound level * effect to the track control of <tt>mediaStream</tt>'s processor. */ private void registerStreamAudioLevelJMFEffect(TrackControl trackControl) throws UnsupportedPlugInException { //we register the effect regardless of whether or not we have any //listeners at this point because we won't get a second chance. //however the effect would do next to nothing unless we register a //first listener with it. // Assume there is only one audio track trackControl.setCodecChain(new Codec[] { streamAudioLevelEffect }); }
Format format) return trackControl.setFormat(format);
if (tc.getFormat() instanceof AudioFormat)
track.setCodecChain( new Codec[]{ outputAudioLevelEffect });
if (tracks[i].isEnabled()) { supported = tracks[i].getSupportedFormats(); tracks[i].setFormat(chosen); LOGGER.severe("Track " + i + " is set to transmit as: " + chosen); if (tracks[i].getFormat() instanceof AudioFormat) { int packetRate = 20; PacketSizeControl pktCtrl = (PacketSizeControl) processor.getControl(PacketSizeControl.class.getName()); if (pktCtrl != null) { try { pktCtrl.setPacketSize(getPacketSize(tracks[i].getFormat(), packetRate)); if (tracks[i].getFormat().getEncoding().equals(AudioFormat.ULAW_RTP)) { Codec codec[] = new Codec[3]; tracks[i].setCodecChain(codec); tracks[i].setEnabled(false); tracks[i].setEnabled(false);
trackControl.setCodecChain( new Codec[] trackControl.setCodecChain( new Codec[] { playerScaler });
if (tracks[i].isEnabled()) { supported = tracks[i].getSupportedFormats(); tracks[i].setFormat(chosen); LOGGER.error("Track " + i + " is set to transmit as:"); LOGGER.error(" " + chosen); if (tracks[i].getFormat() instanceof AudioFormat) { int packetRate = 20; PacketSizeControl pktCtrl = (PacketSizeControl) processor.getControl(PacketSizeControl.class.getName()); if (pktCtrl != null) { try { pktCtrl.setPacketSize(getPacketSize(tracks[i].getFormat(), packetRate)); if (tracks[i].getFormat().getEncoding().equals(AudioFormat.ULAW_RTP)) { Codec codec[] = new Codec[3]; tracks[i].setCodecChain(codec); tracks[i].setEnabled(false); tracks[i].setEnabled(false);
trackControl.setCodecChain(codecs);
codecs = new Codec[] { new HFlip(), scaler }; trackControl.setCodecChain(codecs); break;
trackControl.setCodecChain( hflip ? new Codec[]