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 a PullBufferDataSource and CaptureDevice using the Video for Linux Two API Specification.
    Author:
    Lyubomir Marinov
    • Constructor Detail

      • DataSource

        public DataSource()
        Initializes a new DataSource instance.
      • DataSource

        public DataSource​(javax.media.MediaLocator locator)
        Initializes a new DataSource instance from a specific MediaLocator.
        Parameters:
        locator - the MediaLocator to create the new instance from
    • Method Detail

      • createStream

        protected Video4Linux2Stream 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.
        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
      • getFFmpegPixFmt

        public static int getFFmpegPixFmt​(int v4l2PixFmt)
        Gets the Video for Linux Two API Specification pixel format matching a specific FFmpeg pixel format.
        Parameters:
        v4l2PixFmt - the FFmpeg pixel format to get the matching Video for Linux Two API Specification pixel format of
        Returns:
        the Video for Linux Two API Specification pixel format matching the specified FFmpeg format
      • getV4L2PixFmt

        public static int getV4L2PixFmt​(int ffmpegPixFmt)
        Gets the FFmpeg pixel format matching a specific Video for Linux Two API Specification pixel format.
        Parameters:
        ffmpegPixFmt - the Video for Linux Two API Specification pixel format to get the matching FFmpeg pixel format of
        Returns:
        the FFmpeg pixel format matching the specified Video for Linux Two API Specification pixel format