Class DataSource

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

    public class DataSource
    extends AbstractVideoPullBufferCaptureDevice
    Implements CaptureDevice and DataSource for the purposes of ivf (vp8 raw file, extracted from webm) file streaming.
    Author:
    Thomas Kuntz
    • Constructor Detail

      • DataSource

        public DataSource()
    • Method Detail

      • doConnect

        public void doConnect()
                       throws IOException
        doConnect allows us to initialize the DataSource with information that we couldn't have in the constructor, like the MediaLocator that give us the path of the ivf file which give us information on the format
        Overrides:
        doConnect in class AbstractPullBufferCaptureDevice
        Throws:
        IOException - if anything goes wrong while opening the connection to the media source specified by the MediaLocator of this DataSource
      • createStream

        protected IVFStream createStream​(int streamIndex,
                                         javax.media.control.FormatControl formatControl)
        Creates a new PullBufferStream which is to be at a specific zero-based index in the list of streams of this PullBufferDataSource. The Format-related information of the new instance is to be abstracted by a specific FormatControl. Implements AbstractPushBufferCaptureDevice.createStream(int, FormatControl).
        Specified by:
        createStream in class AbstractPullBufferCaptureDevice
        Parameters:
        streamIndex - the zero-based index of the PullBufferStream in the list of streams of this PullBufferDataSource
        formatControl - the FormatControl which is to abstract the Format-related information of the new instance
        Returns:
        a new PullBufferStream which is to be at the specified streamIndex in the list of streams of this PullBufferDataSource and which has its Format-related information abstracted by the specified formatControl
      • getSupportedFormats

        protected javax.media.Format[] getSupportedFormats​(int streamIndex)
        Gets the Formats which are to be reported by a FormatControl as supported formats for a PullBufferStream at a specific zero-based index in the list of streams of this PullBufferDataSource. Overrides the super implementation in order to return the list of Formats hardcoded as supported in IVFCaptureDevice because the super looks them up by CaptureDeviceInfo and it doesn't have some information (like the framerate etc.).
        Overrides:
        getSupportedFormats in class AbstractPullBufferCaptureDevice
        Parameters:
        streamIndex - the zero-based index of the PullBufferStream for which the specified FormatControl is to report the list of supported Formats
        Returns:
        an array of Formats to be reported by a FormatControl as the supported formats for the PullBufferStream at the specified streamIndex in the list of streams of this PullBufferDataSource