Class 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 its DataSource.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 the Processor.Configuring state.
    Author:
    Lyubomir Marinov
    • 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 its DataSource.disconnect().
        Parameters:
        receiveStream - the ReceiveStream which is to have its DataSource
        dataSource - 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 its DataSource.disconnect() and, optionally, activates the suppresses the call in question.
        Parameters:
        receiveStream - the ReceiveStream which is to have its DataSource
        dataSource - the DataSource of receiveStream which is to be wrapped by this instance
        suppressDisconnect - 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()
        Implements DataSource.disconnect(). Disconnects the wrapped DataSource if it has not been explicitly suppressed by setting the suppressDisconnect property of this instance.
        Specified by:
        disconnect in interface javax.media.protocol.CaptureDevice
        Overrides:
        disconnect in class PushBufferDataSourceDelegate<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()
        Implements PushBufferDataSource.getStreams(). Delegates to the wrapped DataSource of the ReceiveStream.
        Specified by:
        getStreams in class PushBufferDataSourceDelegate<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 to DataSource.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