Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.device
Class VideoTranslatorMediaDevice

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.device.AbstractMediaDevice
      extended by net.java.sip.communicator.impl.neomedia.device.VideoTranslatorMediaDevice
All Implemented Interfaces:
MediaDevice, MediaDeviceWrapper

public class VideoTranslatorMediaDevice
extends AbstractMediaDevice
implements MediaDeviceWrapper

Implements a MediaDevice which is to be used in video conferencing implemented with an RTP translator.

Author:
Lyubomir Marinov

Constructor Summary
VideoTranslatorMediaDevice(MediaDeviceImpl device)
          Initializes a new VideoTranslatorMediaDevice which enables a specific MediaDevice to be used in video conferencing implemented with an RTP translator.
 
Method Summary
(package private)  javax.media.protocol.DataSource createOutputDataSource()
          Creates a DataSource instance for this MediaDevice which gives access to the captured media.
(package private)  javax.media.Renderer createRenderer()
          Initializes a new Renderer instance which is to play back media on this MediaDevice.
 MediaDeviceSession createSession()
          Creates a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream.
 MediaDirection getDirection()
          Returns the MediaDirection supported by this device.
 MediaFormat getFormat()
          Returns the MediaFormat that this device is currently set to use when capturing data.
 MediaType getMediaType()
          Returns the MediaType that this device supports.
 List<MediaFormat> getSupportedFormats(QualityPreset localPreset, QualityPreset remotePreset)
          Returns a list of MediaFormat instances representing the media formats supported by this MediaDevice.
 MediaDevice getWrappedDevice()
          Gets the actual MediaDevice which this MediaDevice is effectively built on top of and forwarding to.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.device.AbstractMediaDevice
connect, getSupportedExtensions, getSupportedFormats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.neomedia.device.MediaDevice
getSupportedExtensions, getSupportedFormats
 

Constructor Detail

VideoTranslatorMediaDevice

public VideoTranslatorMediaDevice(MediaDeviceImpl device)
Initializes a new VideoTranslatorMediaDevice which enables a specific MediaDevice to be used in video conferencing implemented with an RTP translator.

Parameters:
device - the MediaDevice which the new instance is to enable to be used in video conferencing implemented with an RTP translator
Method Detail

createOutputDataSource

javax.media.protocol.DataSource createOutputDataSource()
Creates a DataSource instance for this MediaDevice which gives access to the captured media.

Specified by:
createOutputDataSource in class AbstractMediaDevice
Returns:
a DataSource instance which gives access to the media captured by this MediaDevice
See Also:
AbstractMediaDevice.createOutputDataSource()

createRenderer

javax.media.Renderer createRenderer()
Initializes a new Renderer instance which is to play back media on this MediaDevice.

Specified by:
createRenderer in class AbstractMediaDevice
Returns:
a new Renderer instance which is to play back media on this MediaDevice or null if a suitable Renderer is to be chosen irrespective of this MediaDevice

createSession

public MediaDeviceSession createSession()
Creates a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream.

Overrides:
createSession in class AbstractMediaDevice
Returns:
a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream
See Also:
AbstractMediaDevice.createSession()

getDirection

public MediaDirection getDirection()
Returns the MediaDirection supported by this device.

Specified by:
getDirection in interface MediaDevice
Returns:
MediaDirection.SENDONLY if this is a read-only device, MediaDirection.RECVONLY if this is a write-only device and MediaDirection.SENDRECV if this MediaDevice can both capture and render media
See Also:
MediaDevice.getDirection()

getFormat

public MediaFormat getFormat()
Returns the MediaFormat that this device is currently set to use when capturing data.

Specified by:
getFormat in interface MediaDevice
Returns:
the MediaFormat that this device is currently set to provide media in.
See Also:
MediaDevice.getFormat()

getMediaType

public MediaType getMediaType()
Returns the MediaType that this device supports.

Specified by:
getMediaType in interface MediaDevice
Returns:
MediaType.AUDIO if this is an audio device or MediaType.VIDEO in case of a video device
See Also:
MediaDevice.getMediaType()

getSupportedFormats

public List<MediaFormat> getSupportedFormats(QualityPreset localPreset,
                                             QualityPreset remotePreset)
Returns a list of MediaFormat instances representing the media formats supported by this MediaDevice.

Specified by:
getSupportedFormats in interface MediaDevice
Parameters:
localPreset - the preset used to set the send format parameters, used for video and settings
remotePreset - the preset used to set the receive format parameters, used for video and settings
Returns:
the list of MediaFormats supported by this device
See Also:
MediaDevice.getSupportedFormats(QualityPreset, QualityPreset)

getWrappedDevice

public MediaDevice getWrappedDevice()
Gets the actual MediaDevice which this MediaDevice is effectively built on top of and forwarding to.

Specified by:
getWrappedDevice in interface MediaDeviceWrapper
Returns:
the actual MediaDevice which this MediaDevice is effectively built on top of and forwarding to
See Also:
MediaDeviceWrapper.getWrappedDevice()

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.