org.jitsi.service.neomedia.DefaultStreamConnector Java Examples

The following examples show how to use org.jitsi.service.neomedia.DefaultStreamConnector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AudioChannel.java    From Spark with Apache License 2.0 4 votes vote down vote up
/**
 * Starts the transmission. Returns null if transmission started ok.
 * Otherwise it returns a string with the reason why the setup failed.
 * Starts receive also.
 */
public synchronized String start() {
	try
	{	        
     
 	MediaService mediaService = LibJitsi.getMediaService();	

 	MediaDevice device = null;
     List<MediaDevice> devices = mediaService.getDevices(MediaType.AUDIO, MediaUseCase.CALL);
     for (MediaDevice foundDevice : devices)
     {
     	if (foundDevice instanceof AudioMediaDeviceImpl)
     	{
     		AudioMediaDeviceImpl amdi = (AudioMediaDeviceImpl) foundDevice;
     		if(inLocator == amdi.getCaptureDeviceInfo().getLocator())
     		{
      		System.out.println("Test" + inLocator + "-" + amdi.getCaptureDeviceInfo().getLocator());
     			device = foundDevice;
     		}
     	}
     	System.out.println(foundDevice.getClass() + "-" +  inLocator);
     }
     mediaStream = mediaService.createMediaStream(device);
     
     mediaStream.setDirection(MediaDirection.SENDRECV);
     
     
     mediaStream.setFormat(format);
     connector = new DefaultStreamConnector(new DatagramSocket(this.localPort),new DatagramSocket(this.localRTCPPort));
     mediaStream.setConnector(connector);
     mediaStream.setTarget(
             new MediaStreamTarget(
                     new InetSocketAddress(this.ipAddress, this.remotePort),
                     new InetSocketAddress(this.ipAddress, this.remoteRTCPPort)));
     mediaStream.setName(MediaType.AUDIO.toString());
     mediaStream.start();
	}
	catch (Exception e)
	{
		e.printStackTrace();
	}
	return null;
}
 
Example #2
Source File: RuntimeConfiguration.java    From jitsi-videobridge-openfire-plugin with Apache License 2.0 2 votes vote down vote up
/**
 * When multiplexing of media streams is not possible, the videobridge will automatically fallback to using
 * dynamically allocated UDP ports in a specific range. This method returns the upper-bound of that range.
 *
 * Note that this method returns the configured value, which might differ from the configuration that is
 * in effect (as configuration changes require a restart to be taken into effect).
 *
 * @return A UDP port number value.
 */
public static int getMaxPort()
{
    return LibJitsi.getConfigurationService().getInt( DefaultStreamConnector.MAX_PORT_NUMBER_PROPERTY_NAME, MAX_PORT_DEFAULT_VALUE );
}
 
Example #3
Source File: RuntimeConfiguration.java    From jitsi-videobridge-openfire-plugin with Apache License 2.0 2 votes vote down vote up
/**
 * When multiplexing of media streams is not possible, the videobridge will automatically fallback to using
 * dynamically allocated UDP ports in a specific range. This method returns the lower-bound of that range.
 *
 * Note that this method returns the configured value, which might differ from the configuration that is
 * in effect (as configuration changes require a restart to be taken into effect).
 *
 * @return A UDP port number value.
 */
public static int getMinPort()
{
    return LibJitsi.getConfigurationService().getInt( DefaultStreamConnector.MIN_PORT_NUMBER_PROPERTY_NAME, MIN_PORT_DEFAULT_VALUE );
}