public class DefaultDirectMediaPlayer extends DefaultMediaPlayer implements DirectMediaPlayer
For the pixel format you can use any format that is supported by the vlc video output, for example:
Constructor and Description |
---|
DefaultDirectMediaPlayer(LibVlc libvlc,
libvlc_instance_t instance,
BufferFormatCallback bufferFormatCallback,
RenderCallback renderCallback)
Create a new media player.
|
DefaultDirectMediaPlayer(LibVlc libvlc,
libvlc_instance_t instance,
String format,
int width,
int height,
int pitch,
RenderCallback renderCallback)
Create a new media player.
|
Modifier and Type | Method and Description |
---|---|
BufferFormat |
getBufferFormat()
Get the current buffer format.
|
com.sun.jna.Memory[] |
lock()
Lock the native memory buffers.
|
void |
unlock()
Unlock the native memory buffers.
|
addMediaOptions, addMediaPlayerEventListener, canPause, cycleSpu, enableEvents, enableLogo, enableMarquee, equalizerChanged, getAllChapterDescriptions, getAspectRatio, getAudioChannel, getAudioDelay, getAudioDescriptions, getAudioOutputDevice, getAudioOutputDevices, getAudioTrack, getAudioTrackCount, getBrightness, getChapter, getChapterCount, getChapterDescriptions, getChapterDescriptions, getCodecDescription, getContrast, getCropGeometry, getEqualizer, getFps, getGamma, getHue, getLength, getMediaDetails, getMediaMeta, getMediaMeta, getMediaPlayerState, getMediaState, getMediaStatistics, getMediaStatistics, getPosition, getRate, getRepeat, getSaturation, getScale, getSnapshot, getSnapshot, getSpu, getSpuCount, getSpuDelay, getSpuDescriptions, getSubItemMediaMeta, getSubItemTrackInfo, getTeletextPage, getTime, getTitle, getTitleCount, getTitleDescriptions, getTrackInfo, getTrackInfo, getVideoDescriptions, getVideoDimension, getVideoOutputs, getVideoTrack, getVideoTrackCount, getVolume, isAdjustVideo, isMediaParsed, isMute, isPlayable, isPlaying, isSeekable, mediaPlayerInstance, menuActivate, menuDown, menuLeft, menuRight, menuUp, mrl, mrl, mute, mute, nextChapter, nextFrame, parseMedia, pause, play, playMedia, playNextSubItem, playSubItem, prepareMedia, previousChapter, programScrambled, release, removeMediaPlayerEventListener, requestParseMedia, requestParseMediaWithOptions, saveSnapshot, saveSnapshot, saveSnapshot, saveSnapshot, setAdjustVideo, setAspectRatio, setAudioChannel, setAudioDelay, setAudioOutput, setAudioOutputDevice, setAudioTrack, setBrightness, setChapter, setContrast, setCropGeometry, setDeinterlace, setEqualizer, setGamma, setHue, setLogoFile, setLogoImage, setLogoLocation, setLogoOpacity, setLogoOpacity, setLogoPosition, setMarqueeColour, setMarqueeColour, setMarqueeLocation, setMarqueeOpacity, setMarqueeOpacity, setMarqueePosition, setMarqueeSize, setMarqueeText, setMarqueeTimeout, setPause, setPlaySubItems, setPosition, setRate, setRepeat, setSaturation, setScale, setSnapshotDirectory, setSpu, setSpuDelay, setStandardMediaOptions, setSubTitleFile, setSubTitleFile, setTeletextPage, setTime, setTitle, setVideoTitleDisplay, setVideoTrack, setVolume, skip, skipPosition, start, startMedia, stop, subItemCount, subItemIndex, subItems, subItemsMedia, subItemsMediaList, toggleTeletext, userData, userData
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addMediaOptions, addMediaPlayerEventListener, canPause, cycleSpu, enableEvents, enableLogo, enableMarquee, getAllChapterDescriptions, getAspectRatio, getAudioChannel, getAudioDelay, getAudioDescriptions, getAudioOutputDevice, getAudioOutputDevices, getAudioTrack, getAudioTrackCount, getBrightness, getChapter, getChapterCount, getChapterDescriptions, getChapterDescriptions, getCodecDescription, getContrast, getCropGeometry, getEqualizer, getFps, getGamma, getHue, getLength, getMediaDetails, getMediaMeta, getMediaMeta, getMediaPlayerState, getMediaState, getMediaStatistics, getMediaStatistics, getPosition, getRate, getRepeat, getSaturation, getScale, getSnapshot, getSnapshot, getSpu, getSpuCount, getSpuDelay, getSpuDescriptions, getSubItemMediaMeta, getSubItemTrackInfo, getTeletextPage, getTime, getTitle, getTitleCount, getTitleDescriptions, getTrackInfo, getTrackInfo, getVideoDescriptions, getVideoDimension, getVideoOutputs, getVideoTrack, getVideoTrackCount, getVolume, isAdjustVideo, isMediaParsed, isMute, isPlayable, isPlaying, isSeekable, mediaPlayerInstance, menuActivate, menuDown, menuLeft, menuRight, menuUp, mrl, mrl, mute, mute, nextChapter, nextFrame, parseMedia, pause, play, playMedia, playNextSubItem, playSubItem, prepareMedia, previousChapter, programScrambled, release, removeMediaPlayerEventListener, requestParseMedia, requestParseMediaWithOptions, saveSnapshot, saveSnapshot, saveSnapshot, saveSnapshot, setAdjustVideo, setAspectRatio, setAudioChannel, setAudioDelay, setAudioOutput, setAudioOutputDevice, setAudioTrack, setBrightness, setChapter, setContrast, setCropGeometry, setDeinterlace, setEqualizer, setGamma, setHue, setLogoFile, setLogoImage, setLogoLocation, setLogoOpacity, setLogoOpacity, setLogoPosition, setMarqueeColour, setMarqueeColour, setMarqueeLocation, setMarqueeOpacity, setMarqueeOpacity, setMarqueePosition, setMarqueeSize, setMarqueeText, setMarqueeTimeout, setPause, setPlaySubItems, setPosition, setRate, setRepeat, setSaturation, setScale, setSnapshotDirectory, setSpu, setSpuDelay, setStandardMediaOptions, setSubTitleFile, setSubTitleFile, setTeletextPage, setTime, setTitle, setVideoTitleDisplay, setVideoTrack, setVolume, skip, skipPosition, start, startMedia, stop, subItemCount, subItemIndex, subItems, subItemsMedia, subItemsMediaList, toggleTeletext, userData, userData
public DefaultDirectMediaPlayer(LibVlc libvlc, libvlc_instance_t instance, String format, int width, int height, int pitch, RenderCallback renderCallback)
This constructor does not support formats that require multiple planes (buffers).
libvlc
- native library interfaceinstance
- libvlc instancewidth
- width for the videoheight
- height for the videoformat
- pixel format (e.g. RV15, RV16, RV24, RV32, RGBA, YUYV)pitch
- pitch, also known as striderenderCallback
- callback to receive the video frame datapublic DefaultDirectMediaPlayer(LibVlc libvlc, libvlc_instance_t instance, BufferFormatCallback bufferFormatCallback, RenderCallback renderCallback)
libvlc
- native library interfaceinstance
- libvlc instancebufferFormatCallback
- callback to set the desired buffer formatrenderCallback
- callback to receive the video frame datapublic final BufferFormat getBufferFormat()
public final com.sun.jna.Memory[] lock()
DirectMediaPlayer
The lock must be held for as short a time as possible - locking the buffers will prevent the native video player from filling more frames.
A corresponding call to DirectMediaPlayer.unlock()
must always be made, no matter what
the return value from this method.
A client application must not interfere with the returned array - the returned array is the "live" array used by the media player, so a client must not add/remove/re-order/etc the returned array.
To mitigate this, a defensive copy of the array could have been returned, but this would be added overhead (even though slight) that can be avoided.
lock
in interface DirectMediaPlayer
null
public final void unlock()
DirectMediaPlayer
unlock
in interface DirectMediaPlayer
Copyright © 2009–2015 Caprica Software Limited. All rights reserved.