localhost = InetAddress.getLocalHost(); AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7002, 7020, new AudioFormat(AudioFormat.GSM_RTP), null); AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7020, 7002, new AudioFormat(AudioFormat.GSM_RTP), null);
/** * Gets the name of the Video for Linux Two API Specification device which * represents the media source of this <tt>DataSource</tt>. * * @return the name of the Video for Linux Two API Specification device * which represents the media source of this <tt>DataSource</tt> */ private String getDeviceName() { MediaLocator locator = getLocator(); return ((locator != null) && DeviceSystem.LOCATOR_PROTOCOL_VIDEO4LINUX2 .equalsIgnoreCase(locator.getProtocol())) ? locator.getRemainder() : null; }
/** * Updates the deviceUID based on the current locator. * * @return True if the deviceUID has been updated. False otherwise. */ private boolean updateDeviceUID() { MediaLocator locator = getLocator(); if(locator != null) { String remainder = locator.getRemainder(); if(remainder != null && remainder.length() > 1) { synchronized(startStopMutex) { this.deviceUID = remainder.substring(1); } return true; } } return false; }
locator.getProtocol()))
String id = locator.getRemainder(); s = locator.toString();
: oldRenderDevice.equals(newRenderDevice)) ? -1 : audioSystem.getIMMDeviceIndex( newRenderDevice.getRemainder(), eRender);
/** * Sets the <tt>MediaLocator</tt> which specifies the playback device to be * used by this <tt>Renderer</tt>. * * @param locator the <tt>MediaLocator</tt> which specifies the playback * device to be used by this <tt>Renderer</tt> */ public void setLocator(MediaLocator locator) { if (this.locator == null) { if (locator == null) return; } else if (this.locator.equals(locator)) return; this.locator = locator; }
/** * Gets the <tt>CaptureDeviceInfo</tt> of a specific <tt>CaptureDevice</tt> * by locating its registration in JMF using its <tt>MediaLocator</tt>. * * @param captureDevice the <tt>CaptureDevice</tt> to gets the * <tt>CaptureDeviceInfo</tt> of * @return the <tt>CaptureDeviceInfo</tt> of the specified * <tt>CaptureDevice</tt> as registered in JMF */ public static CaptureDeviceInfo getCaptureDeviceInfo( DataSource captureDevice) { /* * TODO The implemented search for the CaptureDeviceInfo of this * CaptureDevice by looking for its MediaLocator is inefficient. */ @SuppressWarnings("unchecked") Vector<CaptureDeviceInfo> captureDeviceInfos = CaptureDeviceManager.getDeviceList(null); MediaLocator locator = captureDevice.getLocator(); for (CaptureDeviceInfo captureDeviceInfo : captureDeviceInfos) if (captureDeviceInfo.getLocator().toString().equals( locator.toString())) return captureDeviceInfo; return null; }
locator.getProtocol())) String remainder = locator.getRemainder();
/** * Returns the name of the PulseAudio source that this <tt>DataSource</tt> * is configured to input audio data from. * * @return the name of the PulseAudio source that this <tt>DataSource</tt> * is configured to input audio data from */ private String getLocatorDev() { MediaLocator locator = getLocator(); String locatorDev; if (locator == null) { locatorDev = null; } else { locatorDev = locator.getRemainder(); if ((locatorDev != null) && (locatorDev.length() <= 0)) locatorDev = null; } return locatorDev; } }
/** * Gets the protocol of the <tt>MediaLocator</tt> of the * <tt>CaptureDeviceInfo</tt> represented by this instance. * * @return the protocol of the <tt>MediaLocator</tt> of the * <tt>CaptureDeviceInfo</tt> represented by this instance */ public String getCaptureDeviceInfoLocatorProtocol() { CaptureDeviceInfo cdi = getCaptureDeviceInfo(); if (cdi != null) { MediaLocator locator = cdi.getLocator(); if (locator != null) return locator.getProtocol(); } return null; }
/** * Gets a <tt>CapatureDeviceInfo2</tt> which is known to this instance and * is identified by a specific <tt>MediaLocator</tt>. * * @param locator the <tt>MediaLocator</tt> of the * <tt>CaptureDeviceInfo2</tt> to be returned * @return a <tt>CaptureDeviceInfo2</tt> which is known to this instance and * is identified by the specified <tt>locator</tt> */ public CaptureDeviceInfo2 getDevice(MediaLocator locator) { CaptureDeviceInfo2 device = null; if (devices != null) { for (CaptureDeviceInfo2 aDevice : devices) { MediaLocator aLocator = aDevice.getLocator(); if (locator.equals(aLocator)) { device = aDevice; break; } } } return device; }
if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null) return ml; if ((ml = new MediaLocator("file:" + url)) != null) return ml; } else { String file = "file:" + System.getProperty("user.dir") + File.separator + url; if ((ml = new MediaLocator(file)) != null) return ml;
locator.getProtocol())) String remainder = locator.getRemainder();
/** * Returns the name of the sink this <tt>PulseAudioRenderer</tt> is * configured to connect {@link #stream} to. * * @return the name of the sink this <tt>PulseAudioRenderer</tt> is * configured to connect {@link #stream} to */ private String getLocatorDev() { MediaLocator locator = getLocator(); String locatorDev; if (locator == null) { locatorDev = null; } else { locatorDev = locator.getRemainder(); if ((locatorDev != null) && (locatorDev.length() <= 0)) locatorDev = null; } return locatorDev; }
String protocol = locator.getProtocol(); String cdi2Protocol = cdi2Locator.getProtocol();
/** * Checks whether the playback and notification configuration share the same * device. * * @return are audio out and notifications using the same device. */ public boolean audioOutAndNotificationsShareSameDevice() { AudioSystem audioSystem = getDeviceConfiguration().getAudioSystem(); CaptureDeviceInfo notify = audioSystem.getSelectedDevice(AudioSystem.DataFlow.NOTIFY); CaptureDeviceInfo playback = audioSystem.getSelectedDevice(AudioSystem.DataFlow.PLAYBACK); if (notify == null) return (playback == null); else { if (playback == null) return false; else return notify.getLocator().equals(playback.getLocator()); } }
/** * Initialize the Audio Channel to make it able to send and receive audio. */ @Override public void initialize() { String ip; String localIp; int localPort; int remotePort; if (this.getLocal().getSymmetric() != null) { ip = this.getLocal().getIp(); localIp = this.getLocal().getLocalIp(); localPort = getFreePort(); remotePort = this.getLocal().getSymmetric().getPort(); LOGGER.fine(this.getLocal().getConnection() + " " + ip + ": " + localPort + "->" + remotePort); } else { ip = this.getRemote().getIp(); localIp = this.getLocal().getLocalIp(); localPort = this.getLocal().getPort(); remotePort = this.getRemote().getPort(); } audioChannel = new AudioChannel(new MediaLocator(this.getMediaLocator()), localIp, ip, localPort, remotePort, AudioFormatUtils.getAudioFormat(this.getPayloadType()),this); }
locator.getProtocol())) return null; String remainder = locator.getRemainder(); String split[] = remainder.split(","); int index
/** * {@inheritDoc} * * Implements * {@link AbstractPushBufferCaptureDevice#createStream(int, FormatControl)}. */ @Override protected AudioSilenceStream createStream( int streamIndex, FormatControl formatControl) { return new AudioSilenceStream( this, formatControl, !NO_TRANSFER_DATA.equalsIgnoreCase( getLocator().getRemainder())); }