Package org.jitsi.impl.neomedia.protocol
Class PullBufferDataSourceDelegate<T extends javax.media.protocol.DataSource>
- java.lang.Object
-
- javax.media.protocol.DataSource
-
- javax.media.protocol.PullBufferDataSource
-
- org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
-
- org.jitsi.impl.neomedia.protocol.PullBufferDataSourceDelegate<T>
-
- Type Parameters:
T- the very type of DataSource to be wrapped in a PullBufferDataSourceDelegate
- All Implemented Interfaces:
javax.media.Controls,javax.media.Duration,javax.media.protocol.CaptureDevice,javax.media.protocol.Controls
- Direct Known Subclasses:
RewritablePullBufferDataSource
public abstract class PullBufferDataSourceDelegate<T extends javax.media.protocol.DataSource> extends CaptureDeviceDelegatePullBufferDataSource
Implements most of PullBufferDataSource for a particular DataSource and requires extenders to only implementPullBufferDataSource.getStreams(). Intended to allow easier overriding of the streams returned by a DataSource.- Author:
- Damian Minkov
-
-
Field Summary
Fields Modifier and Type Field Description protected TdataSourceThe wrapped DataSource this instance delegates to.-
Fields inherited from class org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
captureDevice, EMPTY_STREAMS
-
-
Constructor Summary
Constructors Constructor Description PullBufferDataSourceDelegate(T dataSource)Initializes a new PullBufferDataSourceDelegate which is to delegate to a specific DataSource.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconnect()ImplementsDataSource.connect().voiddisconnect()ImplementsDataSource.disconnect().StringgetContentType()ImplementsDataSource.getContentType().ObjectgetControl(String controlType)ImplementsControls.getControl(String).Object[]getControls()ImplementsControls.getControls().TgetDataSource()Gets the DataSource wrapped by this instance.javax.media.TimegetDuration()ImplementsDuration.getDuration().javax.media.MediaLocatorgetLocator()ImplementsDataSource.getLocator().abstract javax.media.protocol.PullBufferStream[]getStreams()Gets the PullBufferStreams through which this PullBufferDataSource gives access to its media data.voidstart()ImplementsDataSource.start().voidstop()ImplementsDataSource.stop().-
Methods inherited from class org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
getCaptureDeviceInfo, getFormatControls
-
-
-
-
Field Detail
-
dataSource
protected final T extends javax.media.protocol.DataSource dataSource
The wrapped DataSource this instance delegates to.
-
-
Constructor Detail
-
PullBufferDataSourceDelegate
public PullBufferDataSourceDelegate(T dataSource)
Initializes a new PullBufferDataSourceDelegate which is to delegate to a specific DataSource.- Parameters:
dataSource- the DataSource the new instance is to delegate to
-
-
Method Detail
-
connect
public void connect() throws IOExceptionImplementsDataSource.connect(). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.connect()because the wrapped DataSource may not be a CaptureDevice yet it still needs to be connected.- Specified by:
connectin interfacejavax.media.protocol.CaptureDevice- Overrides:
connectin classCaptureDeviceDelegatePullBufferDataSource- Throws:
IOException- if the wrapped DataSource throws such an exception
-
disconnect
public void disconnect()
ImplementsDataSource.disconnect(). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.disconnect()because the wrapped DataSource may not be a CaptureDevice yet it still needs to be disconnected.- Specified by:
disconnectin interfacejavax.media.protocol.CaptureDevice- Overrides:
disconnectin classCaptureDeviceDelegatePullBufferDataSource
-
getContentType
public String getContentType()
ImplementsDataSource.getContentType(). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.getContentType()because the wrapped DataSource may not be a CaptureDevice yet it still needs to report the content type.- Overrides:
getContentTypein classCaptureDeviceDelegatePullBufferDataSource- Returns:
- a String value which describes the content type of the wrapped DataSource
-
getLocator
public javax.media.MediaLocator getLocator()
ImplementsDataSource.getLocator(). Delegates to the wrapped DataSource.- Overrides:
getLocatorin classjavax.media.protocol.DataSource- Returns:
- a MediaLocator value which describes the locator of the wrapped DataSource
-
getControl
public Object getControl(String controlType)
ImplementsControls.getControl(String). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.getControl(String)because the wrapped DataSource may not be a CaptureDevice yet it still needs to give access to the control.- Specified by:
getControlin interfacejavax.media.Controls- Overrides:
getControlin classCaptureDeviceDelegatePullBufferDataSource- 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 DataSource
-
getControls
public Object[] getControls()
ImplementsControls.getControls(). Delegates to the wrapped PullBufferDataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.getControls()because the wrapped DataSource may not be a CaptureDevice yet it still needs to give access to the controls.- Specified by:
getControlsin interfacejavax.media.Controls- Overrides:
getControlsin classCaptureDeviceDelegatePullBufferDataSource- Returns:
- an array of Objects which represent the controls of the wrapped DataSource
-
getDataSource
public T getDataSource()
Gets the DataSource wrapped by this instance.- Returns:
- the DataSource wrapped by this instance
-
getDuration
public javax.media.Time getDuration()
ImplementsDuration.getDuration(). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.getDuration()because the wrapped DataSource may not be a CaptureDevice yet it still needs to report the duration.- Specified by:
getDurationin interfacejavax.media.Duration- Overrides:
getDurationin classCaptureDeviceDelegatePullBufferDataSource- Returns:
- the duration of the wrapped DataSource
-
getStreams
public abstract javax.media.protocol.PullBufferStream[] getStreams()
Gets the PullBufferStreams through which this PullBufferDataSource gives access to its media data.- Overrides:
getStreamsin classCaptureDeviceDelegatePullBufferDataSource- Returns:
- an array of PullBufferStreams through which this PullBufferDataSource gives access to its media data
-
start
public void start() throws IOExceptionImplementsDataSource.start(). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.start()because the wrapped DataSource may not be a CaptureDevice yet it still needs to be started.- Specified by:
startin interfacejavax.media.protocol.CaptureDevice- Overrides:
startin classCaptureDeviceDelegatePullBufferDataSource- Throws:
IOException- if the wrapped DataSource throws such an exception
-
stop
public void stop() throws IOExceptionImplementsDataSource.stop(). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.stop()because the wrapped DataSource may not be a CaptureDevice yet it still needs to be stopped.- Specified by:
stopin interfacejavax.media.protocol.CaptureDevice- Overrides:
stopin classCaptureDeviceDelegatePullBufferDataSource- Throws:
IOException- if the wrapped DataSource throws such an exception
-
-