public abstract class DeviceSystem extends PropertyChangeNotifier
#createRenderer(boolean)
method.Modifier and Type | Field and Description |
---|---|
static int |
FEATURE_REINITIALIZE
The constant/flag (to be) returned by
getFeatures() in order to
indicate that the respective DeviceSystem supports invoking its
initialize() more than once. |
static java.lang.String |
LOCATOR_PROTOCOL_ANDROIDCAMERA |
static java.lang.String |
LOCATOR_PROTOCOL_CIVIL |
static java.lang.String |
LOCATOR_PROTOCOL_DIRECTSHOW |
static java.lang.String |
LOCATOR_PROTOCOL_IMGSTREAMING |
static java.lang.String |
LOCATOR_PROTOCOL_MEDIARECORDER |
static java.lang.String |
LOCATOR_PROTOCOL_QUICKTIME |
static java.lang.String |
LOCATOR_PROTOCOL_VIDEO4LINUX2 |
static java.lang.String |
PROP_DEVICES |
Modifier | Constructor and Description |
---|---|
protected |
DeviceSystem(MediaType mediaType,
java.lang.String locatorProtocol) |
protected |
DeviceSystem(MediaType mediaType,
java.lang.String locatorProtocol,
int features) |
Modifier and Type | Method and Description |
---|---|
javax.media.Renderer |
createRenderer()
Initializes a new Renderer instance which is to perform playback
on a device contributed by this system.
|
protected abstract void |
doInitialize()
Invoked by
initialize() to perform the very logic of the
initialization of this DeviceSystem. |
protected static java.util.List<javax.media.CaptureDeviceInfo> |
filterDeviceListByLocatorProtocol(java.util.List<javax.media.CaptureDeviceInfo> deviceList,
java.lang.String locatorProtocol)
Returns a List of CaptureDeviceInfos which are elements
of a specific List of CaptureDeviceInfos and have a
specific MediaLocator protocol.
|
static DeviceSystem[] |
getDeviceSystems(MediaType mediaType) |
int |
getFeatures()
Gets the flags indicating the optional features supported by this
DeviceSystem.
|
javax.media.Format |
getFormat()
Returns the format depending on the media type: AudioFormat for AUDIO,
VideoFormat for VIDEO.
|
java.lang.String |
getLocatorProtocol()
Gets the protocol of the MediaLocators of the
CaptureDeviceInfos (to be) registered (with FMJ) by this
DeviceSystem.
|
MediaType |
getMediaType() |
protected java.lang.String |
getRendererClassName()
Gets the name of the class which implements the Renderer
interface to render media on a playback or notification device associated
with this DeviceSystem.
|
protected void |
initialize()
Initializes this DeviceSystem i.e.
|
static void |
initializeDeviceSystems()
Initializes the DeviceSystem instances which are to represent
the supported device systems/backends such as DirectShow, PortAudio,
PulseAudio, QuickTime, video4linux2.
|
static void |
initializeDeviceSystems(MediaType mediaType)
Initializes the DeviceSystem instances which are to represent
the supported device systems/backends which are to capable of capturing
and playing back media of a specific type such as audio or video.
|
(package private) static void |
invokeDeviceSystemInitialize(DeviceSystem deviceSystem)
Invokes
initialize() on a specific DeviceSystem. |
(package private) static void |
invokeDeviceSystemInitialize(DeviceSystem deviceSystem,
boolean asynchronous)
Invokes
initialize() on a specific DeviceSystem. |
protected void |
postInitialize()
Invoked as part of the execution of
initialize() after the
execution of doInitialize() regardless of whether the latter
completed successfully. |
protected void |
preInitialize()
Invoked as part of the execution of
initialize() before the
execution of doInitialize() . |
java.lang.String |
toString()
Returns a human-readable representation of this DeviceSystem.
|
addPropertyChangeListener, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener
public static final int FEATURE_REINITIALIZE
getFeatures()
in order to
indicate that the respective DeviceSystem supports invoking its
initialize()
more than once.public static final java.lang.String LOCATOR_PROTOCOL_ANDROIDCAMERA
public static final java.lang.String LOCATOR_PROTOCOL_CIVIL
public static final java.lang.String LOCATOR_PROTOCOL_DIRECTSHOW
public static final java.lang.String LOCATOR_PROTOCOL_IMGSTREAMING
public static final java.lang.String LOCATOR_PROTOCOL_MEDIARECORDER
public static final java.lang.String LOCATOR_PROTOCOL_QUICKTIME
public static final java.lang.String LOCATOR_PROTOCOL_VIDEO4LINUX2
public static final java.lang.String PROP_DEVICES
protected DeviceSystem(MediaType mediaType, java.lang.String locatorProtocol) throws java.lang.Exception
java.lang.Exception
protected DeviceSystem(MediaType mediaType, java.lang.String locatorProtocol, int features) throws java.lang.Exception
java.lang.Exception
protected static java.util.List<javax.media.CaptureDeviceInfo> filterDeviceListByLocatorProtocol(java.util.List<javax.media.CaptureDeviceInfo> deviceList, java.lang.String locatorProtocol)
deviceList
- the List of CaptureDeviceInfo which
are to be filtered based on the specified MediaLocator protocollocatorProtocol
- the protocol of the MediaLocators of the
CaptureDeviceInfos which are to be returnedpublic static DeviceSystem[] getDeviceSystems(MediaType mediaType)
public static void initializeDeviceSystems()
initialize()
method will be called
again as part of the subsequent invocation only if the
DeviceSystem in question returns a set of flags from its
getFeatures()
method which contains the constant/flag
FEATURE_REINITIALIZE
.public static void initializeDeviceSystems(MediaType mediaType)
mediaType
- the MediaType of the DeviceSystems to
be initializedstatic void invokeDeviceSystemInitialize(DeviceSystem deviceSystem) throws java.lang.Exception
initialize()
on a specific DeviceSystem. The
method returns after the invocation returns.deviceSystem
- the DeviceSystem to invoke
initialize() onjava.lang.Exception
- if an error occurs during the initialization of
initialize() on the specified deviceSystemstatic void invokeDeviceSystemInitialize(DeviceSystem deviceSystem, boolean asynchronous) throws java.lang.Exception
initialize()
on a specific DeviceSystem.deviceSystem
- the DeviceSystem to invoke
initialize() onasynchronous
- true if the invocation is to be performed in
a separate thread and the method is to return immediately without waiting
for the invocation to return; otherwise, falsejava.lang.Exception
- if an error occurs during the initialization of
initialize() on the specified deviceSystempublic javax.media.Renderer createRenderer()
protected abstract void doInitialize() throws java.lang.Exception
initialize()
to perform the very logic of the
initialization of this DeviceSystem. This instance has been
prepared for initialization by an earlier call to
preInitialize()
and the initialization will be completed with a
subsequent call to postInitialize()
.java.lang.Exception
- if an error occurs during the initialization of this
instance. The initialization of this instance will be completed with a
subsequent call to postInitialize() regardless of any
Exception thrown by doInitialize().public final int getFeatures()
public javax.media.Format getFormat()
public final java.lang.String getLocatorProtocol()
public final MediaType getMediaType()
protected java.lang.String getRendererClassName()
#createRenderer(boolean)
.protected final void initialize() throws java.lang.Exception
Note: The method is synchronized on this instance in order to
guarantee that the whole initialization procedure (which includes
doInitialize()
) executes once at any given time.
java.lang.Exception
- if an error occurs during the initialization of this
DeviceSystemprotected void postInitialize() throws java.lang.Exception
initialize()
after the
execution of doInitialize()
regardless of whether the latter
completed successfully. The implementation of DeviceSystem fires
a new PropertyChangeEvent to notify that the value of the
property PROP_DEVICES
of this instance may have changed i.e.
that the list of devices detected by this instance may have changed.java.lang.Exception
protected void preInitialize() throws java.lang.Exception
initialize()
before the
execution of doInitialize()
. The implementation of
DeviceSystem removes from FMJ's CaptureDeviceManager
the CaptureDeviceInfos whose MediaLocator has the same
protocol as getLocatorProtocol()
of this instance.java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.