Class PushBufferDataSourceAdapter

  • All Implemented Interfaces:
    javax.media.Controls, javax.media.Duration, javax.media.protocol.CaptureDevice, javax.media.protocol.Controls

    public class PushBufferDataSourceAdapter
    extends PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
    Implements PushBufferDataSource for a specific PullBufferDataSource.
    Author:
    Lyubomir Marinov
    • Constructor Detail

      • PushBufferDataSourceAdapter

        public PushBufferDataSourceAdapter​(javax.media.protocol.PullBufferDataSource dataSource)
        Initializes a new PushBufferDataSourceAdapter which is to implement PushBufferDataSource capabilities for a specific PullBufferDataSource.
        Parameters:
        dataSource - the PullBufferDataSource the new instance is to implement PushBufferDataSource capabilities for
    • Method Detail

      • disconnect

        public void disconnect()
        Implements DataSource.disconnect(). Disposes of the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance.
        Specified by:
        disconnect in interface javax.media.protocol.CaptureDevice
        Overrides:
        disconnect in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
      • getStreams

        public javax.media.protocol.PushBufferStream[] getStreams()
        Implements PushBufferDataSource.getStreams(). Gets the PushBufferStreams through which this PushBufferDataSource gives access to its media data.
        Specified by:
        getStreams in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
        Returns:
        an array of PushBufferStreams through which this PushBufferDataSource gives access to its media data
      • start

        public void start()
                   throws IOException
        Implements DataSource.start(). Starts the wrapped PullBufferDataSource and the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance.
        Specified by:
        start in interface javax.media.protocol.CaptureDevice
        Overrides:
        start in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
        Throws:
        IOException - if anything wrong happens while starting the wrapped PullBufferDataSource or the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance
      • stop

        public void stop()
                  throws IOException
        Implements DataSource.start(). Stops the wrapped PullBufferDataSource and the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance.
        Specified by:
        stop in interface javax.media.protocol.CaptureDevice
        Overrides:
        stop in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
        Throws:
        IOException - if anything wrong happens while stopping the wrapped PullBufferDataSource or the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance