7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package com.sun.media.jfxmedia.control;
26
27 import java.nio.ByteBuffer;
28
29 /**
30 * A {@code VideoDataBuffer} describes a single frame of video.
31 */
32 public interface VideoDataBuffer {
33 /** Plane index used by all packed formats */
34 public static final int PACKED_FORMAT_PLANE = 0;
35
36 /** Plane index for YCbCr luminance data */
37 public static final int YCBCR_PLANE_LUMA = 0;
38 /** Plane index for YCbCr red chrominance data */
39 public static final int YCBCR_PLANE_CR = 1;
40 /** Plane index for YCbCr blue chrominance data */
41 public static final int YCBCR_PLANE_CB = 2;
42 /** Plane index for YCbCr alpha data, this plane is optional */
43 public static final int YCBCR_PLANE_ALPHA = 3;
44
45 /**
46 * Retrieve the data buffer for the specified plane. For chunky formats,
47 * pass {@link PACKED_FORMAT_PLANE} as the plane index. If an invalid plane
48 * index is passed this method returns null.
49 *
50 * @param plane The numeric index of the plane
51 * @return the {@code ByteBuffer} containing video data for the specified
52 * plane or null for non-existent or invalid planes
53 */
54 public ByteBuffer getBufferForPlane(int plane);
55
56 /**
57 * Retrieve the timestamp of the buffer.
58 *
59 * @return The buffer's timestamp.
60 */
61 public double getTimestamp();
62
63 /**
|
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package com.sun.media.jfxmedia.control;
26
27 import java.lang.annotation.Native;
28 import java.nio.ByteBuffer;
29
30 /**
31 * A {@code VideoDataBuffer} describes a single frame of video.
32 */
33 public interface VideoDataBuffer {
34 /** Plane index used by all packed formats */
35 @Native public static final int PACKED_FORMAT_PLANE = 0;
36
37 /** Plane index for YCbCr luminance data */
38 @Native public static final int YCBCR_PLANE_LUMA = 0;
39 /** Plane index for YCbCr red chrominance data */
40 @Native public static final int YCBCR_PLANE_CR = 1;
41 /** Plane index for YCbCr blue chrominance data */
42 @Native public static final int YCBCR_PLANE_CB = 2;
43 /** Plane index for YCbCr alpha data, this plane is optional */
44 @Native public static final int YCBCR_PLANE_ALPHA = 3;
45
46 /**
47 * Retrieve the data buffer for the specified plane. For chunky formats,
48 * pass {@link PACKED_FORMAT_PLANE} as the plane index. If an invalid plane
49 * index is passed this method returns null.
50 *
51 * @param plane The numeric index of the plane
52 * @return the {@code ByteBuffer} containing video data for the specified
53 * plane or null for non-existent or invalid planes
54 */
55 public ByteBuffer getBufferForPlane(int plane);
56
57 /**
58 * Retrieve the timestamp of the buffer.
59 *
60 * @return The buffer's timestamp.
61 */
62 public double getTimestamp();
63
64 /**
|