APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.media.jfxmediaimpl

pack-priv final Class NativeVideoBuffer

extends Object
implements VideoDataBuffer
Class Inheritance
All Implemented Interfaces
com.sun.media.jfxmedia.control.VideoDataBuffer
Imports
com.sun.media.jfxmedia.control.VideoDataBuffer, .VideoFormat, java.nio.ByteBuffer, java.util.concurrent.atomic.AtomicInteger

Native implementation of VideoDataBuffer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private NativeVideoBuffer
private static final boolean
private static final NativeVideoBuffer.VideoBufferDisposer
private final AtomicInteger
private long

Constructor Summary

AccessConstructor and Description
private
NativeVideoBuffer(long nativePeer)

Method Summary

Modifier and TypeMethod and Description
public VideoDataBuffer
convertToFormat(VideoFormat newFormat)

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.convertToFormat.

Converts the video image to the specified format.

public static NativeVideoBuffer
createVideoBuffer(long nativePeer)

public ByteBuffer
getBufferForPlane(int plane)

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getBufferForPlane.

Retrieve the data buffer for the specified plane.

public int
getEncodedHeight()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getEncodedHeight.

Gets the height of the image as created by the decoder, this may be larger than the display height.

public int
getEncodedWidth()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getEncodedWidth.

Gets the width of the image as created by the decoder, this may be larger than the display width.

public VideoFormat
public int
getHeight()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getHeight.

Gets the height of the VideoDataBuffer

public int
public int[]
public int
getStrideForPlane(int planeIndex)

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getStrideForPlane.

Returns the number of bytes in each row of pixels for the specified plane.

public double
getTimestamp()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getTimestamp.

Retrieve the timestamp of the buffer.

public int
getWidth()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getWidth.

Gets the width of the VideoDataBuffer

public boolean
hasAlpha()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.hasAlpha.

Determine if a video buffer has an alpha channel.

public void
holdFrame()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.holdFrame.

Place a hold on a buffer so that it cannot be reused by the buffer pool from whence it came.

private native long
nativeConvertToFormat(long handle, int formatType)

private static native void
nativeDisposeBuffer(long handle)

private native ByteBuffer
nativeGetBufferForPlane(long handle, int plane)

private native int
private native int
nativeGetEncodedWidth(long handle)

private native int
nativeGetFormat(long handle)

private native int
nativeGetHeight(long handle)

private native int
nativeGetPlaneCount(long handle)

private native int[]
nativeGetPlaneStrides(long handle)

private native double
nativeGetTimestamp(long handle)

private native int
nativeGetWidth(long handle)

private native boolean
nativeHasAlpha(long handle)

private native void
nativeSetDirty(long handle)

public void
releaseFrame()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.releaseFrame.

Releases a hold previously placed on this frame.

public void
setDirty()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.setDirty.

Flags a video buffer indicating the contents of the buffer have been updated and any cached representations need to be updated.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cachedBGRARepback to summary
private NativeVideoBuffer cachedBGRARep
DEBUG_DISPOSED_BUFFERSback to summary
private static final boolean DEBUG_DISPOSED_BUFFERS
disposerback to summary
private static final NativeVideoBuffer.VideoBufferDisposer disposer
holdCountback to summary
private final AtomicInteger holdCount
nativePeerback to summary
private long nativePeer

Constructor Detail

NativeVideoBufferback to summary
private NativeVideoBuffer(long nativePeer)

Method Detail

convertToFormatback to summary
public VideoDataBuffer convertToFormat(VideoFormat newFormat)

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.convertToFormat.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.convertToFormat.

Converts the video image to the specified format. You can only convert TO either ARGB_PRE or BGRA_PRE, converting to YCbCr is not supported here. Once a conversion is done, a reference to the converted buffer is retained so that future conversions do not need to be performed.

Annotations
@Override
createVideoBufferback to summary
public static NativeVideoBuffer createVideoBuffer(long nativePeer)
getBufferForPlaneback to summary
public ByteBuffer getBufferForPlane(int plane)

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getBufferForPlane.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.getBufferForPlane.

Retrieve the data buffer for the specified plane. For chunky formats, pass PACKED_FORMAT_PLANE as the plane index. If an invalid plane index is passed this method returns null.

Annotations
@Override
getEncodedHeightback to summary
public int getEncodedHeight()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getEncodedHeight.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.getEncodedHeight.

Gets the height of the image as created by the decoder, this may be larger than the display height.

Annotations
@Override
getEncodedWidthback to summary
public int getEncodedWidth()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getEncodedWidth.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.getEncodedWidth.

Gets the width of the image as created by the decoder, this may be larger than the display width.

Annotations
@Override
getFormatback to summary
public VideoFormat getFormat()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getFormat.

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getHeight.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.getHeight.

Gets the height of the VideoDataBuffer

Annotations
@Override
getPlaneCountback to summary
public int getPlaneCount()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getPlaneCount.

Annotations
@Override
getPlaneStridesback to summary
public int[] getPlaneStrides()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getPlaneStrides.

Annotations
@Override
getStrideForPlaneback to summary
public int getStrideForPlane(int planeIndex)

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getStrideForPlane.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.getStrideForPlane.

Returns the number of bytes in each row of pixels for the specified plane.

Annotations
@Override
getTimestampback to summary
public double getTimestamp()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getTimestamp.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.getTimestamp.

Retrieve the timestamp of the buffer.

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.getWidth.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.getWidth.

Gets the width of the VideoDataBuffer

Annotations
@Override
hasAlphaback to summary
public boolean hasAlpha()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.hasAlpha.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.hasAlpha.

Determine if a video buffer has an alpha channel. This merely determines if the buffer itself has an alpha channel, not if there is any transparency to the image.

Annotations
@Override
holdFrameback to summary
public void holdFrame()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.holdFrame.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.holdFrame.

Place a hold on a buffer so that it cannot be reused by the buffer pool from whence it came. Holding a buffer too long may cause additional buffers to be allocated which will increase memory usage, so one should take care to release a frame as soon as possible.

Annotations
@Override
nativeConvertToFormatback to summary
private native long nativeConvertToFormat(long handle, int formatType)
nativeDisposeBufferback to summary
private static native void nativeDisposeBuffer(long handle)
nativeGetBufferForPlaneback to summary
private native ByteBuffer nativeGetBufferForPlane(long handle, int plane)
nativeGetEncodedHeightback to summary
private native int nativeGetEncodedHeight(long handle)
nativeGetEncodedWidthback to summary
private native int nativeGetEncodedWidth(long handle)
nativeGetFormatback to summary
private native int nativeGetFormat(long handle)
nativeGetHeightback to summary
private native int nativeGetHeight(long handle)
nativeGetPlaneCountback to summary
private native int nativeGetPlaneCount(long handle)
nativeGetPlaneStridesback to summary
private native int[] nativeGetPlaneStrides(long handle)
nativeGetTimestampback to summary
private native double nativeGetTimestamp(long handle)
nativeGetWidthback to summary
private native int nativeGetWidth(long handle)
nativeHasAlphaback to summary
private native boolean nativeHasAlpha(long handle)
nativeSetDirtyback to summary
private native void nativeSetDirty(long handle)
releaseFrameback to summary
public void releaseFrame()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.releaseFrame.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.releaseFrame.

Releases a hold previously placed on this frame. When the hold count reaches zero then the frame will be disposed or reused, thus preventing memory allocation overhead.

Annotations
@Override
setDirtyback to summary
public void setDirty()

Implements com.sun.media.jfxmedia.control.VideoDataBuffer.setDirty.

Doc from com.sun.media.jfxmedia.control.VideoDataBuffer.setDirty.

Flags a video buffer indicating the contents of the buffer have been updated and any cached representations need to be updated.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
com.sun.media.jfxmediaimpl back to summary

private Class NativeVideoBuffer.VideoBufferDisposer

extends Object
implements ResourceDisposer
Class Inheritance
  • java.lang.Object
  • com.sun.media.jfxmediaimpl.NativeVideoBuffer.VideoBufferDisposer
All Implemented Interfaces
com.sun.media.jfxmediaimpl.MediaDisposer.ResourceDisposer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

VideoBufferDisposerback to summary
private VideoBufferDisposer()

Method Detail

disposeResourceback to summary
public void disposeResource(Object resource)

Implements com.sun.media.jfxmediaimpl.MediaDisposer.ResourceDisposer.disposeResource.

Doc from com.sun.media.jfxmediaimpl.MediaDisposer.ResourceDisposer.disposeResource.

Dispose the provided resource.

Annotations
@Override