Package org.jitsi.impl.neomedia.protocol
Class CaptureDeviceDelegatePullBufferDataSource
- java.lang.Object
-
- javax.media.protocol.DataSource
-
- javax.media.protocol.PullBufferDataSource
-
- org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.Duration,javax.media.protocol.CaptureDevice,javax.media.protocol.Controls
- Direct Known Subclasses:
PullBufferDataSourceDelegate
public class CaptureDeviceDelegatePullBufferDataSource extends javax.media.protocol.PullBufferDataSource implements javax.media.protocol.CaptureDeviceRepresents a PullBufferDataSource which is also a CaptureDevice through delegation to a specific CaptureDevice.- Author:
- Damian Minkov, Lubomir Marinov
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.media.protocol.CaptureDevicecaptureDeviceThe CaptureDevice this instance delegates to in order to implement its CaptureDevice functionality.protected static javax.media.protocol.PullBufferStream[]EMPTY_STREAMSThe constant which represents an empty array with PullBufferStream element type.
-
Constructor Summary
Constructors Constructor Description CaptureDeviceDelegatePullBufferDataSource(javax.media.protocol.CaptureDevice captureDevice)Initializes a new CaptureDeviceDelegatePullBufferDataSource instance which delegates to a specific CaptureDevice in order to implement its CaptureDevice functionality.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()ImplementsCaptureDevice.connect().voiddisconnect()ImplementsCaptureDevice.disconnect().javax.media.CaptureDeviceInfogetCaptureDeviceInfo()ImplementsCaptureDevice.getCaptureDeviceInfo().StringgetContentType()ImplementsDataSource.getContentType().ObjectgetControl(String controlType)ImplementsControls.getControl(String).Object[]getControls()ImplementsControls.getControls().javax.media.TimegetDuration()ImplementsDuration.getDuration().javax.media.control.FormatControl[]getFormatControls()ImplementsCaptureDevice.getFormatControls().javax.media.protocol.PullBufferStream[]getStreams()ImplementsPullBufferDataSource.getStreams().voidstart()ImplementsCaptureDevice.start().voidstop()ImplementsCaptureDevice.start().
-
-
-
Field Detail
-
captureDevice
protected final javax.media.protocol.CaptureDevice captureDevice
The CaptureDevice this instance delegates to in order to implement its CaptureDevice functionality.
-
EMPTY_STREAMS
protected static final javax.media.protocol.PullBufferStream[] EMPTY_STREAMS
The constant which represents an empty array with PullBufferStream element type. Explicitly defined in order to reduce unnecessary allocations.
-
-
Constructor Detail
-
CaptureDeviceDelegatePullBufferDataSource
public CaptureDeviceDelegatePullBufferDataSource(javax.media.protocol.CaptureDevice captureDevice)
Initializes a new CaptureDeviceDelegatePullBufferDataSource instance which delegates to a specific CaptureDevice in order to implement its CaptureDevice functionality.- Parameters:
captureDevice- the CaptureDevice the new instance is to delegate to in order to provide its CaptureDevice functionality
-
-
Method Detail
-
getStreams
public javax.media.protocol.PullBufferStream[] getStreams()
ImplementsPullBufferDataSource.getStreams(). Delegates to the wrapped CaptureDevice if it implements PullBufferDataSource; otherwise, returns an empty array with PullBufferStream element type.- Specified by:
getStreamsin classjavax.media.protocol.PullBufferDataSource- Returns:
- an array of PullBufferStreams as returned by the wrapped CaptureDevice if it implements PullBufferDataSource; otherwise, an empty array with PullBufferStream element type
-
getContentType
public String getContentType()
ImplementsDataSource.getContentType(). Delegates to the wrapped CaptureDevice if it implements DataSource; otherwise, returnsContentDescriptor.CONTENT_UNKNOWN.- Specified by:
getContentTypein classjavax.media.protocol.DataSource- Returns:
- a String value which describes the content type of the wrapped CaptureDevice if it implements DataSource; otherwise, ContentDescriptor#CONTENT_UNKNOWN
-
connect
public void connect() throws IOExceptionImplementsCaptureDevice.connect(). Delegates to the wrapped CaptureDevice if available; otherwise, does nothing.- Specified by:
connectin interfacejavax.media.protocol.CaptureDevice- Specified by:
connectin classjavax.media.protocol.DataSource- Throws:
IOException- if the wrapped CaptureDevice throws such an exception
-
disconnect
public void disconnect()
ImplementsCaptureDevice.disconnect(). Delegates to the wrapped CaptureDevice if available; otherwise, does nothing.- Specified by:
disconnectin interfacejavax.media.protocol.CaptureDevice- Specified by:
disconnectin classjavax.media.protocol.DataSource
-
start
public void start() throws IOExceptionImplementsCaptureDevice.start(). Delegates to the wrapped CaptureDevice if available; otherwise, does nothing.- Specified by:
startin interfacejavax.media.protocol.CaptureDevice- Specified by:
startin classjavax.media.protocol.DataSource- Throws:
IOException- if the wrapped CaptureDevice throws such an exception
-
stop
public void stop() throws IOExceptionImplementsCaptureDevice.start(). Delegates to the wrapped CaptureDevice if available; otherwise, does nothing.- Specified by:
stopin interfacejavax.media.protocol.CaptureDevice- Specified by:
stopin classjavax.media.protocol.DataSource- Throws:
IOException- if the wrapped CaptureDevice throws such an exception
-
getControl
public Object getControl(String controlType)
ImplementsControls.getControl(String). Delegates to the wrapped CaptureDevice if it implements DataSource; otherwise, returns null.- Specified by:
getControlin interfacejavax.media.Controls- Parameters:
controlType- a String value which names the type of the control to be retrieved- Returns:
- an Object which represents the control of the requested controlType of the wrapped CaptureDevice if it implements DataSource; otherwise, null
-
getControls
public Object[] getControls()
ImplementsControls.getControls(). Delegates to the wrapped CaptureDevice if it implements DataSource; otherwise, returns an empty array with Object element type.- Specified by:
getControlsin interfacejavax.media.Controls- Returns:
- the array of controls for the wrapped CaptureDevice if it implements DataSource; otherwise, an empty array with Object element type
-
getDuration
public javax.media.Time getDuration()
ImplementsDuration.getDuration(). Delegates to the wrapped CaptureDevice if it implements DataSource; otherwise, returnsDuration.DURATION_UNKNOWN.- Specified by:
getDurationin interfacejavax.media.Duration- Returns:
- the duration of the wrapped CaptureDevice as returned by its implementation of DataSource if any; otherwise, returns DataSource#DURATION_UNKNOWN
-
getFormatControls
public javax.media.control.FormatControl[] getFormatControls()
ImplementsCaptureDevice.getFormatControls(). Delegates to the wrapped CaptureDevice if available; otherwise, returns an empty array with FormatControl element type.- Specified by:
getFormatControlsin interfacejavax.media.protocol.CaptureDevice- Returns:
- the array of FormatControls of the wrapped CaptureDevice if available; otherwise, an empty array with FormatControl element type
-
getCaptureDeviceInfo
public javax.media.CaptureDeviceInfo getCaptureDeviceInfo()
ImplementsCaptureDevice.getCaptureDeviceInfo(). Delegates to the wrapped CaptureDevice if available; otherwise, returns null.- Specified by:
getCaptureDeviceInfoin interfacejavax.media.protocol.CaptureDevice- Returns:
- the CaptureDeviceInfo of the wrapped CaptureDevice if available; otherwise, null
-
-