Package org.jitsi.impl.neomedia.device
Class AbstractMediaDevice
- java.lang.Object
-
- org.jitsi.impl.neomedia.device.AbstractMediaDevice
-
- All Implemented Interfaces:
MediaDevice
- Direct Known Subclasses:
AudioMixerMediaDevice,MediaDeviceImpl,VideoTranslatorMediaDevice
public abstract class AbstractMediaDevice extends Object implements MediaDevice
Defines the interface for MediaDevice required by the org.jitsi.impl.neomedia implementation of org.jitsi.service.neomedia.- Author:
- Lyubomir Marinov
-
-
Constructor Summary
Constructors Constructor Description AbstractMediaDevice()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconnect(javax.media.protocol.DataSource captureDevice)Connects to a specific CaptureDevice given in the form of a DataSource.protected abstract javax.media.protocol.DataSourcecreateOutputDataSource()Creates a DataSource instance for this MediaDevice which gives access to the captured media.protected javax.media.ProcessorcreatePlayer(javax.media.protocol.DataSource dataSource)Initializes a new Processor instance which is to be used to play back media on this MediaDevice.protected javax.media.RenderercreateRenderer()Initializes a new Renderer instance which is to play back media on this MediaDevice.MediaDeviceSessioncreateSession()Creates a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream.List<RTPExtension>getSupportedExtensions()Returns a List containing (at the time of writing) a single extension descriptor indicating RECVONLY support for mixer-to-client audio levels.List<MediaFormat>getSupportedFormats()Gets a list of MediaFormats supported by this MediaDevice.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jitsi.service.neomedia.device.MediaDevice
getDirection, getFormat, getMediaType, getSupportedFormats, getSupportedFormats
-
-
-
-
Method Detail
-
connect
public void connect(javax.media.protocol.DataSource captureDevice) throws IOExceptionConnects to a specific CaptureDevice given in the form of a DataSource. Explicitly defined in order to allow extenders to customize the connect procedure.- Parameters:
captureDevice- the CaptureDevice to be connected to- Throws:
IOException- if anything wrong happens while connecting to the specified captureDevice
-
createOutputDataSource
protected abstract javax.media.protocol.DataSource createOutputDataSource()
Creates a DataSource instance for this MediaDevice which gives access to the captured media.- Returns:
- a DataSource instance which gives access to the media captured by this MediaDevice
-
createPlayer
protected javax.media.Processor createPlayer(javax.media.protocol.DataSource dataSource) throws ExceptionInitializes a new Processor instance which is to be used to play back media on this MediaDevice. Allows extenders to, for example, disable the playback on this MediaDevice by completely overriding and returning null.- Parameters:
dataSource- the DataSource which is to be played back by the new Processor instance- Returns:
- a new Processor instance which is to be used to play back the media provided by the specified dataSource or null if the specified dataSource is to not be played back
- Throws:
Exception- if an exception is thrown byDataSource.connect(),Manager.createProcessor(DataSource), orDataSource.disconnect()
-
createRenderer
protected javax.media.Renderer createRenderer()
Initializes a new Renderer instance which is to play back media on this MediaDevice. Allows extenders to initialize a specific Renderer instance. The implementation of AbstractMediaDevice returns null which means that it is left to FMJ to choose a suitable Renderer irrespective of this MediaDevice.- 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.- Returns:
- a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream
-
getSupportedExtensions
public List<RTPExtension> getSupportedExtensions()
Returns a List containing (at the time of writing) a single extension descriptor indicating RECVONLY support for mixer-to-client audio levels.- Specified by:
getSupportedExtensionsin interfaceMediaDevice- Returns:
- a List containing the CSRC_AUDIO_LEVEL_URN extension descriptor.
-
getSupportedFormats
public List<MediaFormat> getSupportedFormats()
Gets a list of MediaFormats supported by this MediaDevice.- Specified by:
getSupportedFormatsin interfaceMediaDevice- Returns:
- the list of MediaFormats supported by this device
- See Also:
MediaDevice.getSupportedFormats()
-
-