Top Description Fields Methods
com.sun.media.jfxmedia.control

public Interface VideoDataBuffer

Known Direct Implementers
com.sun.media.jfxmediaimpl.NativeVideoBuffer
Imports
java.lang.annotation.Native, java.nio.ByteBuffer

A VideoDataBuffer describes a single frame of video.

Field Summary

Modifier and TypeField and Description
public static final int
PACKED_FORMAT_PLANE

Plane index used by all packed formats

public static final int
YCBCR_PLANE_ALPHA

Plane index for YCbCr alpha data, this plane is optional

public static final int
YCBCR_PLANE_CB

Plane index for YCbCr blue chrominance data

public static final int
YCBCR_PLANE_CR

Plane index for YCbCr red chrominance data

public static final int
YCBCR_PLANE_LUMA

Plane index for YCbCr luminance data

Method Summary

Modifier and TypeMethod and Description
public VideoDataBuffer

Returns:

new buffer containing a converted copy of the source video image
convertToFormat
(VideoFormat
the video format to convert to
newFormat
)

Converts the video image to the specified format.

public ByteBuffer

Returns:

the ByteBuffer containing video data for the specified plane or null for non-existent or invalid planes
getBufferForPlane
(int
The numeric index of the plane
plane
)

Retrieve the data buffer for the specified plane.

public int

Returns:

the number of rows in the image
getEncodedHeight
()

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

public int

Returns:

the number of pixels per row in the image
getEncodedWidth
()

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

public VideoFormat

Returns:

the format of the videoDataBuffer
getFormat
()

public int

Returns:

the height
getHeight
()

Gets the height of the VideoDataBuffer

public int

Returns:

the number of planes this video buffer contains, or 1 for non-planar formats
getPlaneCount
()

public int[]

Returns:

an array containing the plane strides for all planes
getPlaneStrides
()

public int

Returns:

Number of bytes that comprises a single row of pixels in the specified plane. Will return zero if the plane is not in use.
getStrideForPlane
(int
The numeric index of the plane.
planeIndex
)

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

public double

Returns:

The buffer's timestamp.
getTimestamp
()

Retrieve the timestamp of the buffer.

public int

Returns:

the width of the buffer
getWidth
()

Gets the width of the VideoDataBuffer

public boolean

Returns:

true if an alpha channel is present
hasAlpha
()

Determine if a video buffer has an alpha channel.

public void
holdFrame()

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

public void
releaseFrame()

Releases a hold previously placed on this frame.

public void
setDirty()

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

Field Detail

PACKED_FORMAT_PLANEback to summary
public static final int PACKED_FORMAT_PLANE

Plane index used by all packed formats

Annotations
@Native
YCBCR_PLANE_ALPHAback to summary
public static final int YCBCR_PLANE_ALPHA

Plane index for YCbCr alpha data, this plane is optional

Annotations
@Native
YCBCR_PLANE_CBback to summary
public static final int YCBCR_PLANE_CB

Plane index for YCbCr blue chrominance data

Annotations
@Native
YCBCR_PLANE_CRback to summary
public static final int YCBCR_PLANE_CR

Plane index for YCbCr red chrominance data

Annotations
@Native
YCBCR_PLANE_LUMAback to summary
public static final int YCBCR_PLANE_LUMA

Plane index for YCbCr luminance data

Annotations
@Native

Method Detail

convertToFormatback to summary
public VideoDataBuffer convertToFormat(VideoFormat newFormat)

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.

Parameters
newFormat:VideoFormat

the video format to convert to

Returns:VideoDataBuffer

new buffer containing a converted copy of the source video image

getBufferForPlaneback to summary
public ByteBuffer getBufferForPlane(int plane)

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.

Parameters
plane:int

The numeric index of the plane

Returns:ByteBuffer

the ByteBuffer containing video data for the specified plane or null for non-existent or invalid planes

getEncodedHeightback to summary
public int getEncodedHeight()

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

Returns:int

the number of rows in the image

getEncodedWidthback to summary
public int getEncodedWidth()

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

Returns:int

the number of pixels per row in the image

getFormatback to summary
public VideoFormat getFormat()
Returns:VideoFormat

the format of the videoDataBuffer

getHeightback to summary
public int getHeight()

Gets the height of the VideoDataBuffer

Returns:int

the height

getPlaneCountback to summary
public int getPlaneCount()
Returns:int

the number of planes this video buffer contains, or 1 for non-planar formats

getPlaneStridesback to summary
public int[] getPlaneStrides()
Returns:int[]

an array containing the plane strides for all planes

See Also
getStrideForPlane
getStrideForPlaneback to summary
public int getStrideForPlane(int planeIndex)

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

Parameters
planeIndex:int

The numeric index of the plane.

Returns:int

Number of bytes that comprises a single row of pixels in the specified plane. Will return zero if the plane is not in use.

getTimestampback to summary
public double getTimestamp()

Retrieve the timestamp of the buffer.

Returns:double

The buffer's timestamp.

getWidthback to summary
public int getWidth()

Gets the width of the VideoDataBuffer

Returns:int

the width of the buffer

hasAlphaback to summary
public boolean 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.

Returns:boolean

true if an alpha channel is present

holdFrameback to summary
public void 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.

releaseFrameback to summary
public void 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.

setDirtyback to summary
public void setDirty()

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