Class VideoApi

java.lang.Object
uk.co.caprica.vlcj.player.base.VideoApi

public final class VideoApi extends Object
Behaviour pertaining to media player video.
  • Method Details

    • setDeinterlace

      public void setDeinterlace(DeinterlaceMode deinterlaceMode)
      Set the de-interlace filter to use.
      Parameters:
      deinterlaceMode - mode, or null to disable the de-interlace filter
    • setAdjustVideo

      public void setAdjustVideo(boolean adjustVideo)
      Enable/disable the video adjustments.

      The video adjustment controls must be enabled after the video has started playing.

      Parameters:
      adjustVideo - true if the video adjustments are enabled, otherwise false
    • isAdjustVideo

      public boolean isAdjustVideo()
      Test whether or not the video adjustments are enabled.
      Returns:
      true if the video adjustments are enabled, otherwise false
    • contrast

      public float contrast()
      Get the current video contrast.
      Returns:
      contrast, in the range from 0.0 to 2.0
    • setContrast

      public void setContrast(float contrast)
      Set the video contrast.

      Video adjustments must be enabled for this to have any effect.

      Parameters:
      contrast - contrast value, in the range from 0.0 to 2.0
    • brightness

      public float brightness()
      Get the current video brightness.
      Returns:
      brightness, in the range from 0.0 to 2.0
    • setBrightness

      public void setBrightness(float brightness)
      Set the video brightness.

      Video adjustments must be enabled for this to have any effect.

      Parameters:
      brightness - brightness value, in the range from 0.0 to 2.0
    • hue

      public float hue()
      Get the current video hue.
      Returns:
      hue, in the range from -180.0 to 180.0
    • setHue

      public void setHue(float hue)
      Set the video hue.

      Video adjustments must be enabled for this to have any effect.

      Parameters:
      hue - hue value, in the range from -180.0 to 180.0
    • saturation

      public float saturation()
      Get the current video saturation.
      Returns:
      saturation, in the range from 0.0 to 3.0
    • setSaturation

      public void setSaturation(float saturation)
      Set the video saturation.

      Video adjustments must be enabled for this to have any effect.

      Parameters:
      saturation - saturation value, in the range from 0.0 to 3.0
    • gamma

      public float gamma()
      Get the current video gamma.
      Returns:
      gamma value, in the range from 0.01 to 10.0
    • setGamma

      public void setGamma(float gamma)
      Set the video gamma.

      Video adjustments must be enabled for this to have any effect.

      Changing gamma may not be supported by all video outputs, e.g. vdpau

      Parameters:
      gamma - gamma, in the range from 0.01 to 10.0
    • setVideoTitleDisplay

      public void setVideoTitleDisplay(Position position, int timeout)
      Set if, and how, the video title will be shown when playing media.
      Parameters:
      position - position, Position.DISABLE to prevent the title from appearing
      timeout - time to display the title in milliseconds (ignored when the title is disabled)
    • aspectRatio

      public String aspectRatio()
      Get the video aspect ratio.
      Returns:
      aspect ratio
    • setAspectRatio

      public void setAspectRatio(String aspectRatio)
      Set the video aspect ratio
      Parameters:
      aspectRatio - aspect ratio, e.g. "16:9", "4:3", "185:100" for 1:85.1 and so on
    • scale

      public float scale()
      Get the current video scale (zoom).
      Returns:
      scale
    • setScale

      public void setScale(float factor)
      Set the video scaling factor.
      Parameters:
      factor - scaling factor, or zero to scale the video the size of the container
    • cropGeometry

      public String cropGeometry()
      Get the current video crop geometry.
      Returns:
      crop geometry
    • setCropGeometry

      public void setCropGeometry(String cropGeometry)
      Set the crop geometry.

      The format for the crop geometry is one of:

      • numerator:denominator
      • widthxheight+x+y
      • left:top:right:bottom
      For example:
       mediaPlayer.setCropGeometry("4:3");         // W:H
       mediaPlayer.setCropGeometry("719x575+0+0"); // WxH+L+T
       mediaPlayer.setCropGeometry("6+10+6+10");   // L+T+R+B
       
      Parameters:
      cropGeometry - formatted string describing the desired crop geometry
    • videoDimension

      public Dimension videoDimension()
      Get the video size.

      The video dimensions are not available until after the video has started playing and a video output has been created.

      Returns:
      video size if available, or null
    • trackCount

      public int trackCount()
      Get the number of available video tracks.
      Returns:
      number of tracks
    • track

      public int track()
      Get the current video track.
      Returns:
      track identifier, see trackDescriptions()
    • setTrack

      public int setTrack(int track)
      Set a new video track to play.

      The track identifier must be one of those returned by trackDescriptions().

      Video can be disabled by passing here the identifier of the track with a description of "Disable".

      There is no guarantee that the available track identifiers go in sequence from zero up to trackCount()-1. The trackDescriptions() method should always be used to ascertain the available track identifiers.

      Parameters:
      track - track identifier
      Returns:
      current video track identifier
    • newViewpoint

      public Viewpoint newViewpoint()
      Create a new viewpoint instance for 360 degree video.

      The caller must release the returned instance when it no longer has a use for it

      Returns:
      viewpoint, or null on error
    • updateViewpoint

      public boolean updateViewpoint(Viewpoint viewpoint, boolean absolute)
      Update the viewpoint for 360 degree video.
      Parameters:
      viewpoint - new viewpoint
      absolute - true if viewpoint contains absolute values; false if they are relative
      Returns:
      true if successful; false on error
    • trackDescriptions

      public List<TrackDescription> trackDescriptions()
      Get the video (i.e. "title") track descriptions.

      The media must be playing before this information is available.

      Returns:
      list of descriptions, may be empty but will never be null