Package org.jitsi.impl.neomedia.device
Class MediaDeviceImpl
- java.lang.Object
-
- org.jitsi.impl.neomedia.device.AbstractMediaDevice
-
- org.jitsi.impl.neomedia.device.MediaDeviceImpl
-
- All Implemented Interfaces:
MediaDevice
- Direct Known Subclasses:
AudioMediaDeviceImpl,IVFMediaDevice,VideoGreyFadingMediaDevice
public class MediaDeviceImpl extends AbstractMediaDevice
Implements MediaDevice for the JMF CaptureDevice.- Author:
- Lyubomir Marinov, Emil Ivov
-
-
Constructor Summary
Constructors Constructor Description MediaDeviceImpl(javax.media.CaptureDeviceInfo captureDeviceInfo, org.jitsi.utils.MediaType mediaType)Initializes a new MediaDeviceImpl instance which is to provide an implementation of MediaDevice for a CaptureDevice with a specific CaptureDeviceInfo and which is of a specific MediaType.MediaDeviceImpl(org.jitsi.utils.MediaType mediaType)Initializes a new MediaDeviceImpl instance with a specific MediaType and with MediaDirection which does not allow sending.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.media.protocol.CaptureDevicecreateCaptureDevice()Creates the JMF CaptureDevice this instance represents and provides an implementation of MediaDevice for.protected javax.media.protocol.DataSourcecreateOutputDataSource()Creates a DataSource instance for this MediaDevice which gives access to the captured media.static javax.media.protocol.CaptureDevicecreateTracingCaptureDevice(javax.media.protocol.CaptureDevice captureDevice, org.jitsi.utils.logging.Logger logger)Creates a new CaptureDevice which traces calls to a specific CaptureDevice for debugging purposes.javax.media.CaptureDeviceInfogetCaptureDeviceInfo()Gets the CaptureDeviceInfo of the JMF CaptureDevice represented by this instance.StringgetCaptureDeviceInfoLocatorProtocol()Gets the protocol of the MediaLocator of the CaptureDeviceInfo represented by this instance.MediaDirectiongetDirection()Returns the MediaDirection supported by this device.MediaFormatgetFormat()Gets the MediaFormat in which this MediaDevice captures media.org.jitsi.utils.MediaTypegetMediaType()Gets the MediaType that this device supports.List<MediaFormat>getSupportedFormats(EncodingConfiguration encodingConfiguration)Gets the list of MediaFormats supported by this MediaDevice and enabled in encodingConfiguration.List<MediaFormat>getSupportedFormats(QualityPreset sendPreset, QualityPreset receivePreset)Gets the list of MediaFormats supported by this MediaDevice.List<MediaFormat>getSupportedFormats(QualityPreset sendPreset, QualityPreset receivePreset, EncodingConfiguration encodingConfiguration)Gets the list of MediaFormats supported by this MediaDevice and enabled in encodingConfiguration.StringtoString()Gets a human-readable String representation of this instance.-
Methods inherited from class org.jitsi.impl.neomedia.device.AbstractMediaDevice
connect, createPlayer, createRenderer, createSession, getSupportedExtensions, getSupportedFormats
-
-
-
-
Constructor Detail
-
MediaDeviceImpl
public MediaDeviceImpl(javax.media.CaptureDeviceInfo captureDeviceInfo, org.jitsi.utils.MediaType mediaType)Initializes a new MediaDeviceImpl instance which is to provide an implementation of MediaDevice for a CaptureDevice with a specific CaptureDeviceInfo and which is of a specific MediaType.- Parameters:
captureDeviceInfo- the CaptureDeviceInfo of the JMF CaptureDevice the new instance is to provide an implementation of MediaDevice formediaType- the MediaType of the new instance
-
MediaDeviceImpl
public MediaDeviceImpl(org.jitsi.utils.MediaType mediaType)
Initializes a new MediaDeviceImpl instance with a specific MediaType and with MediaDirection which does not allow sending.- Parameters:
mediaType- the MediaType of the new instance
-
-
Method Detail
-
createTracingCaptureDevice
public static javax.media.protocol.CaptureDevice createTracingCaptureDevice(javax.media.protocol.CaptureDevice captureDevice, org.jitsi.utils.logging.Logger logger)Creates a new CaptureDevice which traces calls to a specific CaptureDevice for debugging purposes.- Parameters:
captureDevice- the CaptureDevice which is to have its calls traced for debugging outputlogger- the Logger to be used for logging the trace messages- Returns:
- a new CaptureDevice which traces the calls to the specified captureDevice
-
createCaptureDevice
protected javax.media.protocol.CaptureDevice createCaptureDevice()
Creates the JMF CaptureDevice this instance represents and provides an implementation of MediaDevice for.- Returns:
- the JMF CaptureDevice this instance represents and provides an implementation of MediaDevice for; null if the creation fails
-
createOutputDataSource
protected javax.media.protocol.DataSource createOutputDataSource()
Creates a DataSource instance for this MediaDevice which gives access to the captured media.- Specified by:
createOutputDataSourcein classAbstractMediaDevice- Returns:
- a DataSource instance which gives access to the media captured by this MediaDevice
- See Also:
AbstractMediaDevice.createOutputDataSource()
-
getCaptureDeviceInfo
public javax.media.CaptureDeviceInfo getCaptureDeviceInfo()
Gets the CaptureDeviceInfo of the JMF CaptureDevice represented by this instance.- Returns:
- the CaptureDeviceInfo of the CaptureDevice represented by this instance
-
getCaptureDeviceInfoLocatorProtocol
public String getCaptureDeviceInfoLocatorProtocol()
Gets the protocol of the MediaLocator of the CaptureDeviceInfo represented by this instance.- Returns:
- the protocol of the MediaLocator of the CaptureDeviceInfo represented by this instance
-
getDirection
public MediaDirection getDirection()
Returns the MediaDirection supported by this device.- Returns:
MediaDirection.SENDONLYif this is a read-only device,MediaDirection.RECVONLYif this is a write-only device orMediaDirection.SENDRECVif this MediaDevice can both capture and render media- See Also:
MediaDevice.getDirection()
-
getFormat
public MediaFormat getFormat()
Gets the MediaFormat in which this MediaDevice captures media.- Returns:
- the MediaFormat in which this MediaDevice captures media
- See Also:
MediaDevice.getFormat()
-
getMediaType
public org.jitsi.utils.MediaType getMediaType()
Gets the MediaType that this device supports.- Returns:
MediaType.AUDIOif this is an audio device orMediaType.VIDEOif this is a video device- See Also:
MediaDevice.getMediaType()
-
getSupportedFormats
public List<MediaFormat> getSupportedFormats(EncodingConfiguration encodingConfiguration)
Gets the list of MediaFormats supported by this MediaDevice and enabled in encodingConfiguration.- Parameters:
encodingConfiguration- the EncodingConfiguration instance to use- Returns:
- the list of MediaFormats supported by this device and enabled in encodingConfiguration.
- See Also:
MediaDevice.getSupportedFormats()
-
getSupportedFormats
public List<MediaFormat> getSupportedFormats(QualityPreset sendPreset, QualityPreset receivePreset)
Gets the list of MediaFormats supported by this MediaDevice. Uses the current EncodingConfiguration from the media service (i.e. the global configuration).- Parameters:
sendPreset- the preset used to set some of the format parameters, used for video and settings.receivePreset- 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()
-
getSupportedFormats
public List<MediaFormat> getSupportedFormats(QualityPreset sendPreset, QualityPreset receivePreset, EncodingConfiguration encodingConfiguration)
Gets the list of MediaFormats supported by this MediaDevice and enabled in encodingConfiguration.- Parameters:
sendPreset- the preset used to set some of the format parameters, used for video and settings.receivePreset- the preset used to set the receive format parameters, used for video and settings.encodingConfiguration- the EncodingConfiguration instance to use- Returns:
- the list of MediaFormats supported by this device and enabled in encodingConfiguration.
- See Also:
MediaDevice.getSupportedFormats()
-
-