Top Description Fields Constructors Methods
com.sun.media.jfxmediaimpl

public abstract Class NativeMedia

extends Media
Class Inheritance
Known Direct Subclasses
com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMedia, com.sun.media.jfxmediaimpl.platform.ios.IOSMedia, com.sun.media.jfxmediaimpl.platform.osx.OSXMedia
Imports
com.sun.media.jfxmedia.Media, com.sun.media.jfxmedia.locator.Locator, com.sun.media.jfxmedia.track.Track, com.sun.media.jfxmediaimpl.platform.Platform, java.util.*, java.util.concurrent.locks.Lock, .ReentrantLock

Base Media implementation class. Platforms will extend this base class.

Todo

Nuke this class, it's not really necessary. At most we should have an impl interface

Field Summary

Modifier and TypeField and Description
protected final Lock
protected WeakHashMap<MarkerStateListener, Boolean>
protected final Lock
protected Map<String, Double>
protected NavigableMap<Double, String>

Constructor Summary

AccessConstructor and Description
protected
NativeMedia(Locator
The location of the media.
locator
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
addMarker(String
Arbitrary name of the marker
markerName
,
double
Presentation time for the marker
presentationTime
)

Implements abstract com.sun.media.jfxmedia.Media.addMarker.

Adds a marker to the media playback.

pack-priv void
public void
addTrack(Track track)

Overrides com.sun.media.jfxmedia.Media.addTrack.

Adds a Track.

public abstract void
pack-priv void
fireMarkerStateEvent(boolean hasMarkers)

public Map<String, Double>
getMarkers()

Implements abstract com.sun.media.jfxmedia.Media.getMarkers.

Get the markers of the media.

pack-priv Map.Entry<Double, String>
getNextMarker(double time, boolean inclusive)

public abstract Platform
public void
removeAllMarkers()

Implements abstract com.sun.media.jfxmedia.Media.removeAllMarkers.

Removes all markers, added programmatically, from the media playback.

public double
removeMarker(String
Name of the marker
markerName
)

Implements abstract com.sun.media.jfxmedia.Media.removeMarker.

Removes a marker by name.

pack-priv void
Inherited from com.sun.media.jfxmedia.Media:
getLocatorgetTrackstoString

Field Detail

listenerLockback to summary
protected final Lock listenerLock
markerListenersback to summary
protected WeakHashMap<MarkerStateListener, Boolean> markerListeners
markerLockback to summary
protected final Lock markerLock
markersByNameback to summary
protected Map<String, Double> markersByName
markersByTimeback to summary
protected NavigableMap<Double, String> markersByTime

Constructor Detail

NativeMediaback to summary
protected NativeMedia(Locator locator)

Constructor.

Parameters
locator:Locator

The location of the media.

Exceptions
IllegalArgumentException:
if locator is null.

Method Detail

addMarkerback to summary
public void addMarker(String markerName, double presentationTime)

Implements abstract com.sun.media.jfxmedia.Media.addMarker.

Doc from com.sun.media.jfxmedia.Media.addMarker.

Adds a marker to the media playback. This marker will not be as precise as embedded markers in the media file.

Parameters
markerName:String

Arbitrary name of the marker

presentationTime:double

Presentation time for the marker

Annotations
@Override
addMarkerStateListenerback to summary
pack-priv void addMarkerStateListener(MarkerStateListener listener)
addTrackback to summary
public void addTrack(Track track)

Overrides com.sun.media.jfxmedia.Media.addTrack.

Doc from com.sun.media.jfxmedia.Media.addTrack.

Adds a Track.

Annotations
@Override
disposeback to summary
public abstract void dispose()
fireMarkerStateEventback to summary
pack-priv void fireMarkerStateEvent(boolean hasMarkers)
getMarkersback to summary
public Map<String, Double> getMarkers()

Implements abstract com.sun.media.jfxmedia.Media.getMarkers.

Doc from com.sun.media.jfxmedia.Media.getMarkers.

Get the markers of the media. The returned Map is unmodifiable.

Returns:Map<String, Double>

the markers or null if no markers found.

Annotations
@Override
getNextMarkerback to summary
pack-priv Map.Entry<Double, String> getNextMarker(double time, boolean inclusive)
getPlatformback to summary
public abstract Platform getPlatform()
removeAllMarkersback to summary
public void removeAllMarkers()

Implements abstract com.sun.media.jfxmedia.Media.removeAllMarkers.

Doc from com.sun.media.jfxmedia.Media.removeAllMarkers.

Removes all markers, added programmatically, from the media playback. Embedded markers will still cause notifications to fire.

Annotations
@Override
removeMarkerback to summary
public double removeMarker(String markerName)

Implements abstract com.sun.media.jfxmedia.Media.removeMarker.

Doc from com.sun.media.jfxmedia.Media.removeMarker.

Removes a marker by name.

Parameters
markerName:String

Name of the marker

Returns:double

The presentation time of the deleted marker.

Annotations
@Override
removeMarkerStateListenerback to summary
pack-priv void removeMarkerStateListener(MarkerStateListener listener)