Package org.jitsi.impl.neomedia.device
Class ReceiveStreamPushBufferDataSource
- java.lang.Object
-
- javax.media.protocol.DataSource
-
- javax.media.protocol.PushBufferDataSource
-
- org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePushBufferDataSource
-
- org.jitsi.impl.neomedia.protocol.PushBufferDataSourceDelegate<javax.media.protocol.PushBufferDataSource>
-
- org.jitsi.impl.neomedia.device.ReceiveStreamPushBufferDataSource
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.Duration,javax.media.protocol.CaptureDevice,javax.media.protocol.Controls
public class ReceiveStreamPushBufferDataSource extends PushBufferDataSourceDelegate<javax.media.protocol.PushBufferDataSource>
Wraps the DataSource of a specific ReceiveStream so that calls to itsDataSource.disconnect()can be explicitly controlled. It is introduced because it seems that after the DataSource of a ReceiveStream is disconnected, it cannot be connected to or started and if a Processor is created on it, it freezes in theProcessor.Configuringstate.- Author:
- Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.protocol.PushBufferDataSourceDelegate
dataSource
-
Fields inherited from class org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePushBufferDataSource
captureDevice, EMPTY_STREAMS
-
-
Constructor Summary
Constructors Constructor Description ReceiveStreamPushBufferDataSource(javax.media.rtp.ReceiveStream receiveStream, javax.media.protocol.PushBufferDataSource dataSource)Initializes a new ReceiveStreamPushBufferDataSource instance which is to wrap a specific DataSource of a specific ReceiveStream for the purposes of enabling explicitly control of calls to itsDataSource.disconnect().ReceiveStreamPushBufferDataSource(javax.media.rtp.ReceiveStream receiveStream, javax.media.protocol.PushBufferDataSource dataSource, boolean suppressDisconnect)Initializes a new ReceiveStreamPushBufferDataSource instance which is to wrap a specific DataSource of a specific ReceiveStream for the purposes of enabling explicitly control of calls to itsDataSource.disconnect()and, optionally, activates the suppresses the call in question.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect()ImplementsDataSource.disconnect().javax.media.rtp.ReceiveStreamgetReceiveStream()Gets the ReceiveStream which has its DataSource wrapped by this instance.javax.media.protocol.PushBufferStream[]getStreams()ImplementsPushBufferDataSource.getStreams().static voidsetNullTransferHandler(javax.media.rtp.ReceiveStream receiveStream)Sets a BufferTransferHandler on a specific ReceiveStream which reads data as soon as possible and throws it away.voidsetSuppressDisconnect(boolean suppressDisconnect)Sets the indicator which determines whether calls toDataSource.disconnect()on the wrapped DataSource are to be suppressed when there are such calls on this instance.-
Methods inherited from class org.jitsi.impl.neomedia.protocol.PushBufferDataSourceDelegate
connect, getContentType, getControl, getControls, getDataSource, getDuration, getLocator, start, stop
-
Methods inherited from class org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePushBufferDataSource
getCaptureDeviceInfo, getFormatControls
-
-
-
-
Constructor Detail
-
ReceiveStreamPushBufferDataSource
public ReceiveStreamPushBufferDataSource(javax.media.rtp.ReceiveStream receiveStream, javax.media.protocol.PushBufferDataSource dataSource)Initializes a new ReceiveStreamPushBufferDataSource instance which is to wrap a specific DataSource of a specific ReceiveStream for the purposes of enabling explicitly control of calls to itsDataSource.disconnect().- Parameters:
receiveStream- the ReceiveStream which is to have its DataSourcedataSource- the DataSource of receiveStream which is to be wrapped by this instance
-
ReceiveStreamPushBufferDataSource
public ReceiveStreamPushBufferDataSource(javax.media.rtp.ReceiveStream receiveStream, javax.media.protocol.PushBufferDataSource dataSource, boolean suppressDisconnect)Initializes a new ReceiveStreamPushBufferDataSource instance which is to wrap a specific DataSource of a specific ReceiveStream for the purposes of enabling explicitly control of calls to itsDataSource.disconnect()and, optionally, activates the suppresses the call in question.- Parameters:
receiveStream- the ReceiveStream which is to have its DataSourcedataSource- the DataSource of receiveStream which is to be wrapped by this instancesuppressDisconnect- true if calls to DataSource#disconnect() on the wrapped dataSource are to be suppressed when there are such calls on the new instance; otherwise, false
-
-
Method Detail
-
setNullTransferHandler
public static void setNullTransferHandler(javax.media.rtp.ReceiveStream receiveStream)
Sets a BufferTransferHandler on a specific ReceiveStream which reads data as soon as possible and throws it away.- Parameters:
receiveStream- the ReceiveStream on which to set a BufferTransferHandler which reads data as soon as possible and throws it away
-
disconnect
public void disconnect()
ImplementsDataSource.disconnect(). Disconnects the wrapped DataSource if it has not been explicitly suppressed by setting the suppressDisconnect property of this instance.- Specified by:
disconnectin interfacejavax.media.protocol.CaptureDevice- Overrides:
disconnectin classPushBufferDataSourceDelegate<javax.media.protocol.PushBufferDataSource>
-
getReceiveStream
public javax.media.rtp.ReceiveStream getReceiveStream()
Gets the ReceiveStream which has its DataSource wrapped by this instance.- Returns:
- the ReceiveStream which has its DataSource wrapped by this instance
-
getStreams
public javax.media.protocol.PushBufferStream[] getStreams()
ImplementsPushBufferDataSource.getStreams(). Delegates to the wrapped DataSource of the ReceiveStream.- Specified by:
getStreamsin classPushBufferDataSourceDelegate<javax.media.protocol.PushBufferDataSource>- Returns:
- an array of the PushBufferStreams of the wrapped DataSource of the ReceiveStream
-
setSuppressDisconnect
public void setSuppressDisconnect(boolean suppressDisconnect)
Sets the indicator which determines whether calls toDataSource.disconnect()on the wrapped DataSource are to be suppressed when there are such calls on this instance.- Parameters:
suppressDisconnect- true to suppress calls to DataSource#disconnect() on the wrapped DataSource when there are such calls on this instance; otherwise, false
-
-