uk.co.caprica.vlcj.player
Class MediaPlayer

java.lang.Object
  extended by uk.co.caprica.vlcj.player.MediaPlayer
Direct Known Subclasses:
DirectMediaPlayer, EmbeddedMediaPlayer, HeadlessMediaPlayer

public abstract class MediaPlayer
extends java.lang.Object

Media player implementation.

This is the main class that developers working with VLCJ are expected to use.

This implementation provides the following functions:

The basic life-cycle is:

   // Set some options for libvlc
   String[] libvlcArgs = {...add options here...};
 
   // Create a factory
   MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs);
 
   // Create a full-screen strategy
   FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(mainFrame);
   
   // Create a media player instance for the run-time operating system
   EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
   
   // Set standard options as needed to be applied to all subsequently played media items
   String[] standardMediaOptions = {"video-filter=logo", "logo-file=vlcj-logo.png", "logo-opacity=25"}; 
   mediaPlayer.setStandardMediaOptions(standardMediaOptions);

   // Add a component to be notified of player events
   mediaPlayer.addMediaPlayerEventListener(new MediaPlayerEventAdapter() {...add implementation here...});
   
   // Create and set a new component to display the rendered video (not shown: add the Canvas to a Frame)
   Canvas videoSurface = new Canvas();
   mediaPlayer.setVideoSurface(videoSurface);

   // Play a particular item, with options if necessary
   String mediaPath = "/path/to/some/movie.mpg";
   String[] mediaOptions = {};
   mediaPlayer.playMedia(mediaPath, mediaOptions);
   
   // Do some interesting things in the application
   ...
   
   // Cleanly dispose of the media player instance and any associated native resources
   mediaPlayer.release();
   
   // Cleanly dispose of the media player factory and any associated native resources
   mediaPlayerFactory.release();
 
With regard to overlaying logos there are three approaches.

The first way is to specify standard options for the media player - this will set the logo for any subsequently played media item, for example:

   String[] standardMediaOptions = {"video-filter=logo", "logo-file=vlcj-logo.png", "logo-opacity=25"};
   mediaPlayer.setStandardMediaOptions(standardMediaOptions);
 
The second way is to specify options when playing the media item, for example:
   String[] mediaOptions = {"video-filter=logo", "logo-file=vlcj-logo.png", "logo-opacity=25"};
   mediaPlayer.playMedia(mediaPath, mediaOptions);
 
The final way is to use the methods of this class to set various logo properties, for example:
   mediaPlayer.setLogoFile("vlcj-logo.png");
   mediaPlayer.setLogoOpacity(25);
   mediaPlayer.setLogoLocation(10, 10);
   mediaPlayer.enableLogo(true);
 
For this latter method, it is not possible to enable the logo until after the video has started playing. There is also a noticeable stutter in video play-back when enabling the logo filter in this way.

With regard to overlaying marquees, again there are three approaches (similar to those for logos).

In this instance only the final way showing the usage of the API is used, for example:

   mediaPlayer.setMarqueeText("VLCJ is quite good");
   mediaPlayer.setMarqueeSize(60);
   mediaPlayer.setMarqueeOpacity(70);
   mediaPlayer.setMarqueeColour(Color.green);
   mediaPlayer.setMarqueeTimeout(3000);
   mediaPlayer.setMarqueeLocation(300, 400);
   mediaPlayer.enableMarquee(true);
 
With regard to video adjustment controls, after the video has started playing:
   mediaPlayer.setAdjustVideo(true);
   mediaPlayer.setGamma(0.9f);
   mediaPlayer.setHue(10);
 
Some media when played may cause one or more media sub-items to created. These sub-items subsequently need to be played. The media player can be set to automatically play these sub-items via setPlaySubItems(boolean), otherwise playNextSubItem() can be invoked in response to a MediaPlayerEventListener#finished() event.


Field Summary
protected  LibVlc libvlc
           
 
Constructor Summary
MediaPlayer(libvlc_instance_t instance)
          Create a new media player.
 
Method Summary
 void addMediaOptions(java.lang.String... mediaOptions)
          Add options to the current media.
 void addMediaPlayerEventListener(MediaPlayerEventListener listener)
          Add a component to be notified of media player events.
 boolean canPause()
           
 void cycleSpu()
          Select the next sub-title track (or disable sub-titles).
 void enableLogo(boolean enable)
          Enable/disable the logo.
 void enableMarquee(boolean enable)
          Enable/disable the marquee.
 java.lang.String getAspectRatio()
           
 int getAudioChannel()
          Get the current audio channel.
 long getAudioDelay()
          Get the audio delay.
 java.util.List<TrackDescription> getAudioDescriptions()
          Get the audio track descriptions.
 int getAudioTrack()
          Get the current audio track.
 int getAudioTrackCount()
          Get the number of available audio tracks.
 float getBrightness()
          Get the current video brightness.
 int getChapter()
          Get the current chapter.
 int getChapterCount()
          Get the chapter count.
 java.util.List<java.lang.String> getChapterDescriptions(int title)
          Get the chapter descriptions for a title.
 float getContrast()
          Get the current video contrast.
 java.lang.String getCropGeometry()
           
 float getFps()
           
 float getGamma()
          Get the current video gamma.
 int getHue()
          Get the current video hue.
 long getLength()
          Get the length of the current media item.
 libvlc_state_t getMediaPlayerState()
           
 libvlc_state_t getMediaState()
           
 libvlc_media_stats_t getMediaStatistics()
          Get the current media statistics.
 float getPosition()
          Get the current play-back position.
 float getRate()
          Get the current video play rate.
 float getSaturation()
          Get the current video saturation.
 float getScale()
           
 java.awt.image.BufferedImage getSnapshot()
          Get a snapshot of the currently playing video.
 int getSpu()
          Get the current sub-title track.
 int getSpuCount()
          Get the number of sub-pictures/sub-titles.
 java.util.List<TrackDescription> getSpuDescriptions()
          Get the sub-title track descriptions.
 long getTime()
          Get the current play-back time.
 int getTitle()
          Get the current title.
 int getTitleCount()
          Get the number of titles.
 java.util.List<TrackDescription> getTitleDescriptions()
          Get the title descriptions.
 java.util.List<TrackDescription> getVideoDescriptions()
          Get the video (i.e.
 java.awt.Dimension getVideoDimension()
          Get the video size.
 int getVideoOutputs()
          Get the number of video outputs for the media player.
 int getVideoTrack()
          Get the current video track.
 int getVideoTrackCount()
          Get the number of available video tracks.
 int getVolume()
          Get the current volume.
 boolean isAdjustVideo()
          Test whether or not the video adjustments are enabled.
 boolean isMute()
          Test whether or not the volume is currently muted.
 boolean isPlayable()
           
 boolean isPlaying()
           
 boolean isSeekable()
           
 libvlc_media_player_t mediaPlayerInstance()
          Provide access to the native media player instance.
 void menuActivate()
          Requires vlc 1.2.0 or later.
 void menuDown()
          Requires vlc 1.2.0 or later.
 void menuLeft()
          Requires vlc 1.2.0 or later.
 void menuRight()
          Requires vlc 1.2.0 or later.
 void menuUp()
          Requires vlc 1.2.0 or later.
 void mute()
          Toggle volume mute.
 void mute(boolean mute)
          Mute or un-mute the volume.
 void nextChapter()
          Jump to the next chapter.
 void nextFrame()
          Advance one frame.
protected  void onAfterRelease()
          Allow sub-classes to clean-up.
protected  void onBeforePlay()
          Allow sub-classes to do something just before the video is started.
 void pause()
          Pause play-back.
 void play()
          Begin play-back.
 void playMedia(java.lang.String mrl)
          Play a new media item.
 void playMedia(java.lang.String mrl, java.lang.String... mediaOptions)
          Play a new media item, with options.
 boolean playNextSubItem()
          Play the next sub-item (if there is one).
 void prepareMedia(java.lang.String mrl)
          Prepare a new media item for play-back, but do not begin playing.
 void prepareMedia(java.lang.String mrl, java.lang.String... mediaOptions)
          Prepare a new media item for play-back, but do not begin playing.
 void previousChapter()
          Jump to the previous chapter.
 void release()
          Release the media player, freeing all associated (including native) resources.
 void removeMediaPlayerEventListener(MediaPlayerEventListener listener)
          Remove a component that was previously interested in notifications of media player events.
 void saveSnapshot()
          Save a snapshot of the currently playing video.
 void saveSnapshot(java.io.File file)
          Save a snapshot of the currently playing video.
 void selectAudioOutput(java.lang.String outputName)
          Set the desired audio output.
 void setAdjustVideo(boolean adjustVideo)
          Enable/disable the video adjustments.
 void setAspectRatio(java.lang.String aspectRatio)
           
 void setAudioChannel(int channel)
          Set the audio channel.
 void setAudioDelay(long delay)
          Set the audio delay.
 void setAudioTrack(int track)
          Set a new audio track to play.
 void setBrightness(float brightness)
          Set the video brightness.
 void setChapter(int chapterNumber)
          Set the chapter.
 void setContrast(float contrast)
          Set the video contrast.
 void setCropGeometry(java.lang.String cropGeometry)
          Set the crop geometry.
 void setDeinterlace(java.lang.String deinterlaceMode)
          Set the de-interlace filter to use.
 void setEnableKeyInputHandling(boolean enable)
           
 void setEnableMouseInputHandling(boolean enable)
           
 void setGamma(float gamma)
          Set the video gamma.
 void setHue(int hue)
          Set the video hue.
 void setLogoFile(java.lang.String logoFile)
          Set the logo file.
 void setLogoLocation(int x, int y)
          Set the logo location.
 void setLogoOpacity(float opacity)
          Set the logo opacity.
 void setLogoOpacity(int opacity)
          Set the logo opacity.
 void setLogoPosition(libvlc_logo_position_e position)
          Set the logo position.
 void setMarqueeColour(java.awt.Color colour)
          Set the marquee colour.
 void setMarqueeColour(int colour)
          Set the marquee colour.
 void setMarqueeLocation(int x, int y)
          Set the marquee location.
 void setMarqueeOpacity(float opacity)
          Set the marquee opacity.
 void setMarqueeOpacity(int opacity)
          Set the marquee opacity.
 void setMarqueeSize(int size)
          Set the marquee size.
 void setMarqueeText(java.lang.String text)
          Set the marquee text.
 void setMarqueeTimeout(int timeout)
          Set the marquee timeout.
 void setPause(boolean pause)
          Pause/resume.
 void setPlaySubItems(boolean playSubItems)
          Set whether or not the media player should automatically play media sub- items.
 void setPosition(float position)
          Jump to a specific position.
 int setRate(float rate)
          Set the video play rate.
 void setSaturation(float saturation)
          Set the video saturation.
 void setScale(float factor)
           
 void setSpu(int spu)
          Set the current sub-title track.
 void setStandardMediaOptions(java.lang.String... options)
          Set standard media options for all media items subsequently played.
 void setTime(long time)
          Jump to a specific moment.
 void setTitle(int title)
          Set a new title to play.
 void setVideoTrack(int track)
          Set a new video track to play.
 void setVolume(int volume)
          Set the volume.
 void skip(float delta)
          Skip forward or backward by a change in position.
 void skip(long delta)
          Skip forward or backward by a period of time.
 void stop()
          Stop play-back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

libvlc

protected final LibVlc libvlc
Constructor Detail

MediaPlayer

public MediaPlayer(libvlc_instance_t instance)
Create a new media player.

Parameters:
instance -
Method Detail

addMediaPlayerEventListener

public void addMediaPlayerEventListener(MediaPlayerEventListener listener)
Add a component to be notified of media player events.

Parameters:
listener - component to notify

removeMediaPlayerEventListener

public void removeMediaPlayerEventListener(MediaPlayerEventListener listener)
Remove a component that was previously interested in notifications of media player events.

Parameters:
listener - component to stop notifying

setStandardMediaOptions

public void setStandardMediaOptions(java.lang.String... options)
Set standard media options for all media items subsequently played.

This will not affect any currently playing media item.

Parameters:
options - options to apply to all subsequently played media items

playMedia

public void playMedia(java.lang.String mrl)
Play a new media item.

The new media will begin play-back immediately.

Parameters:
mrl - media resource locator

playMedia

public void playMedia(java.lang.String mrl,
                      java.lang.String... mediaOptions)
Play a new media item, with options.

The new media will begin play-back immediately.

Parameters:
mrl - media resource locator
mediaOptions - media item options

prepareMedia

public void prepareMedia(java.lang.String mrl)
Prepare a new media item for play-back, but do not begin playing.

Parameters:
mrl - media resource locator

prepareMedia

public void prepareMedia(java.lang.String mrl,
                         java.lang.String... mediaOptions)
Prepare a new media item for play-back, but do not begin playing.

Parameters:
mrl - media resource locator
mediaOptions - media item options

addMediaOptions

public void addMediaOptions(java.lang.String... mediaOptions)
Add options to the current media.

Parameters:
mediaOptions - media options

setPlaySubItems

public void setPlaySubItems(boolean playSubItems)
Set whether or not the media player should automatically play media sub- items.

Parameters:
playSubItems - true to automatically play sub-items, otherwise false

playNextSubItem

public boolean playNextSubItem()
Play the next sub-item (if there is one).

Returns:
true if there is a sub-item, otherwise false

isPlayable

public boolean isPlayable()
Returns:

isPlaying

public boolean isPlaying()
Returns:

isSeekable

public boolean isSeekable()
Returns:

canPause

public boolean canPause()
Returns:

getLength

public long getLength()
Get the length of the current media item.

Returns:
length, in milliseconds

getTime

public long getTime()
Get the current play-back time.

Returns:
current time, expressed as a number of milliseconds

getPosition

public float getPosition()
Get the current play-back position.

Returns:
current position, expressed as a percentage (e.g. 0.15 is returned for 15% complete)

getFps

public float getFps()
Returns:

getRate

public float getRate()
Get the current video play rate.

Returns:
rate, where 1.0 is normal speed, 0.5 is half speed, 2.0 is double speed and so on

getVideoOutputs

public int getVideoOutputs()
Get the number of video outputs for the media player.

Returns:
number of video outputs, may be zero

getVideoDimension

public java.awt.Dimension getVideoDimension()
Get the video size.

The video dimensions are not available until after the video has started playing.

Returns:
video size if available, or null

getAspectRatio

public java.lang.String getAspectRatio()
Returns:

getScale

public float getScale()
Returns:

getCropGeometry

public java.lang.String getCropGeometry()
Returns:

getMediaStatistics

public libvlc_media_stats_t getMediaStatistics()
Get the current media statistics.

Statistics are only updated if the video is playing.

Returns:
media statistics

getMediaState

public libvlc_state_t getMediaState()
Returns:

getMediaPlayerState

public libvlc_state_t getMediaPlayerState()
Returns:

getTitleCount

public int getTitleCount()
Get the number of titles.

Returns:
number of titles, or -1 if none

getTitle

public int getTitle()
Get the current title.

Returns:
title number

setTitle

public void setTitle(int title)
Set a new title to play.

Parameters:
title - title number

getVideoTrackCount

public int getVideoTrackCount()
Get the number of available video tracks.

Returns:
number of tracks

getVideoTrack

public int getVideoTrack()
Get the current video track.

This does not return the id of the track, see getVideoDescriptions().

Returns:
track number, starting at 1, or -1 if the video is currently disabled

setVideoTrack

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

This does not take the track number returned from getVideoTrack(), rather it takes the track id obtained from see getVideoDescriptions().

Parameters:
track - track id, or -1 to disable the video

getAudioTrackCount

public int getAudioTrackCount()
Get the number of available audio tracks.

Returns:
track count

getAudioTrack

public int getAudioTrack()
Get the current audio track.

Returns:
track number

setAudioTrack

public void setAudioTrack(int track)
Set a new audio track to play.

Parameters:
track - track number

play

public void play()
Begin play-back.

If called when the play-back is paused, the play-back will resume from the current position.


stop

public void stop()
Stop play-back.

A subsequent play will play-back from the start.


setPause

public void setPause(boolean pause)
Pause/resume.

Requires vlc 1.1.1 or later.

Parameters:
pause - true to pause, false to play/resume

pause

public void pause()
Pause play-back.

If the play-back is currently paused it will begin playing.


nextFrame

public void nextFrame()
Advance one frame.


skip

public void skip(long delta)
Skip forward or backward by a period of time.

Parameters:
delta - time period, in milliseconds

skip

public void skip(float delta)
Skip forward or backward by a change in position.

Parameters:
delta -

setTime

public void setTime(long time)
Jump to a specific moment.

Parameters:
time - time since the beginning, in milliseconds

setPosition

public void setPosition(float position)
Jump to a specific position.

Parameters:
position - position value, a percentage (e.g. 0.15 is 15%)

setRate

public int setRate(float rate)
Set the video play rate.

Some media protocols are not able to change the rate.

Parameters:
rate - rate, where 1.0 is normal speed, 0.5 is half speed, 2.0 is double speed and so on
Returns:
-1 on error, 0 on success

setAspectRatio

public void setAspectRatio(java.lang.String aspectRatio)
Parameters:
aspectRatio -

setScale

public void setScale(float factor)
Parameters:
factor -

setCropGeometry

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

The format for the crop geometry is one of:

For example:
   mediaPlayer.setCropGeometry("4:3");
   mediaPlayer.setCropGeometry("719x575+0+0");
   mediaPlayer.setCropGeometry("6:10:6:10");
 

Parameters:
cropGeometry - formatted string describing the desired crop geometry

selectAudioOutput

public void selectAudioOutput(java.lang.String outputName)
Set the desired audio output. The change will not be applied until the media player has been stopped and then played again.

Parameters:
outputName - name of the desired audio output

mute

public void mute()
Toggle volume mute.


mute

public void mute(boolean mute)
Mute or un-mute the volume.

Parameters:
mute - true to mute the volume, false to un-mute it

isMute

public boolean isMute()
Test whether or not the volume is currently muted.

Returns:
mute true if the volume is muted, false if the volume is not muted

getVolume

public int getVolume()
Get the current volume.

Returns:
volume, in the range 0 to 100 where 100 is full volume

setVolume

public void setVolume(int volume)
Set the volume.

Parameters:
volume - volume, in the range 0 to 200 where 200 is full volume

getAudioChannel

public int getAudioChannel()
Get the current audio channel. For channel values see libvlc_audio_output_channel_t. Warning this API is subject to change.

Returns:
audio channel

setAudioChannel

public void setAudioChannel(int channel)
Set the audio channel. For channel values see libvlc_audio_output_channel_t. Warning this API is subject to change.

Parameters:
channel - channel

getAudioDelay

public long getAudioDelay()
Get the audio delay.

Returns:
audio delay, in microseconds

setAudioDelay

public void setAudioDelay(long delay)
Set the audio delay.

The audio delay is set for the current item only and will be reset to zero each time the media changes.

Parameters:
delay - desired audio delay, in microseconds

getChapterCount

public int getChapterCount()
Get the chapter count.

Returns:
number of chapters, or -1 if no chapters

getChapter

public int getChapter()
Get the current chapter.

Returns:
chapter number, where zero is the first chatper, or -1 if no media

setChapter

public void setChapter(int chapterNumber)
Set the chapter.

Parameters:
chapterNumber - chapter number, where zero is the first chapter

nextChapter

public void nextChapter()
Jump to the next chapter.

If the play-back is already at the last chapter, this will have no effect.


previousChapter

public void previousChapter()
Jump to the previous chapter.

If the play-back is already at the first chapter, this will have no effect.


menuActivate

public void menuActivate()
Requires vlc 1.2.0 or later.


menuUp

public void menuUp()
Requires vlc 1.2.0 or later.


menuDown

public void menuDown()
Requires vlc 1.2.0 or later.


menuLeft

public void menuLeft()
Requires vlc 1.2.0 or later.


menuRight

public void menuRight()
Requires vlc 1.2.0 or later.


getSpuCount

public int getSpuCount()
Get the number of sub-pictures/sub-titles.

Returns:
number of sub-titles

getSpu

public int getSpu()
Get the current sub-title track.

Returns:
sub-title number, or -1 if none

setSpu

public void setSpu(int spu)
Set the current sub-title track.

Parameters:
spu - sub-title number, or -1 for none

cycleSpu

public void cycleSpu()
Select the next sub-title track (or disable sub-titles).


getTitleDescriptions

public java.util.List<TrackDescription> getTitleDescriptions()
Get the title descriptions.

Returns:
list of descriptions

getVideoDescriptions

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

Returns:
list of descriptions

getAudioDescriptions

public java.util.List<TrackDescription> getAudioDescriptions()
Get the audio track descriptions.

Returns:
list of descriptions

getSpuDescriptions

public java.util.List<TrackDescription> getSpuDescriptions()
Get the sub-title track descriptions.

Returns:
list of descriptions

getChapterDescriptions

public java.util.List<java.lang.String> getChapterDescriptions(int title)
Get the chapter descriptions for a title.

Parameters:
title - title number TODO is it number or index?
Returns:
list of descriptions

saveSnapshot

public void saveSnapshot()
Save a snapshot of the currently playing video.

The snapshot will be created in the user's home directory and be assigned a filename based on the current time.


saveSnapshot

public void saveSnapshot(java.io.File file)
Save a snapshot of the currently playing video.

Any missing directory path will be created if it does not exist.

Parameters:
file - file to contain the snapshot

getSnapshot

public java.awt.image.BufferedImage getSnapshot()
Get a snapshot of the currently playing video.

This implementation uses the native libvlc method to save a snapshot of the currently playing video. This snapshot is saved to a temporary file and then the resultant image is loaded from the file.

The size of the image will be that produced by the libvlc native snapshot function.

Returns:
snapshot image

enableLogo

public void enableLogo(boolean enable)
Enable/disable the logo.

The logo will not be enabled if there is currently no video being played.

Parameters:
enable - true to show the logo, false to hide it

setLogoOpacity

public void setLogoOpacity(int opacity)
Set the logo opacity.

Parameters:
opacity - opacity in the range 0 to 255 where 255 is fully opaque

setLogoOpacity

public void setLogoOpacity(float opacity)
Set the logo opacity.

Parameters:
opacity - opacity percentage in the range 0.0 to 1.0 where 1.0 is fully opaque

setLogoLocation

public void setLogoLocation(int x,
                            int y)
Set the logo location.

Parameters:
x - x co-ordinate for the top left of the logo
y - y co-ordinate for the top left of the logo

setLogoPosition

public void setLogoPosition(libvlc_logo_position_e position)
Set the logo position.

Parameters:
position - position

setLogoFile

public void setLogoFile(java.lang.String logoFile)
Set the logo file.

Parameters:
logoFile - logo file name

enableMarquee

public void enableMarquee(boolean enable)
Enable/disable the marquee.

The marquee will not be enabled if there is currently no video being played.

Parameters:
enable - true to show the marquee, false to hide it

setMarqueeText

public void setMarqueeText(java.lang.String text)
Set the marquee text.

Parameters:
text - text

setMarqueeColour

public void setMarqueeColour(java.awt.Color colour)
Set the marquee colour.

Parameters:
colour - colour, any alpha component will be masked off

setMarqueeColour

public void setMarqueeColour(int colour)
Set the marquee colour.

Parameters:
colour - RGB colour value

setMarqueeOpacity

public void setMarqueeOpacity(int opacity)
Set the marquee opacity.

Parameters:
opacity - opacity in the range 0 to 100 where 255 is fully opaque

setMarqueeOpacity

public void setMarqueeOpacity(float opacity)
Set the marquee opacity.

Parameters:
opacity - opacity percentage in the range 0.0 to 1.0 where 1.0 is fully opaque

setMarqueeSize

public void setMarqueeSize(int size)
Set the marquee size.

Parameters:
size - size, height of the marquee text in pixels

setMarqueeTimeout

public void setMarqueeTimeout(int timeout)
Set the marquee timeout.

Parameters:
timeout - timeout, in milliseconds

setMarqueeLocation

public void setMarqueeLocation(int x,
                               int y)
Set the marquee location.

Parameters:
x - x co-ordinate for the top left of the marquee
y - y co-ordinate for the top left of the marquee

setDeinterlace

public void setDeinterlace(java.lang.String deinterlaceMode)
Set the de-interlace filter to use. Available modes:

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.

Requires vlc 1.1.1 or later.

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

isAdjustVideo

public boolean isAdjustVideo()
Test whether or not the video adjustments are enabled.

Requires vlc 1.1.1 or later.

Returns:
true if the video adjustments are enabled, otherwise false

getContrast

public float getContrast()
Get the current video contrast.

Requires vlc 1.1.1 or later.

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. Requires vlc 1.1.1 or later.

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

getBrightness

public float getBrightness()
Get the current video brightness.

Requires vlc 1.1.1 or later.

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.

Requires vlc 1.1.1 or later.

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

getHue

public int getHue()
Get the current video hue.

Requires vlc 1.1.1 or later.

Returns:
hue, in the range from 0 to 360

setHue

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

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

Requires vlc 1.1.1 or later.

Parameters:
hue - hue value, in the range from 0 to 360

getSaturation

public float getSaturation()
Get the current video saturation.

Requires vlc 1.1.1 or later.

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.

Requires vlc 1.1.1 or later.

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

getGamma

public float getGamma()
Get the current video gamma.

Requires vlc 1.1.1 or later.

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.

Requires vlc 1.1.1 or later.

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

setEnableMouseInputHandling

public void setEnableMouseInputHandling(boolean enable)
Parameters:
enable -

setEnableKeyInputHandling

public void setEnableKeyInputHandling(boolean enable)
Parameters:
enable -

release

public final void release()
Release the media player, freeing all associated (including native) resources.


mediaPlayerInstance

public final libvlc_media_player_t mediaPlayerInstance()
Provide access to the native media player instance.

Returns:
media player instance

onBeforePlay

protected void onBeforePlay()
Allow sub-classes to do something just before the video is started.


onAfterRelease

protected void onAfterRelease()
Allow sub-classes to clean-up.


(C)2010 Caprica Software Limited