SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.quicktime
Class CVPixelBuffer

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.quicktime.CVImageBuffer
      extended by net.java.sip.communicator.impl.neomedia.quicktime.CVPixelBuffer

public class CVPixelBuffer
extends CVImageBuffer

Represents a CoreVideo CVPixelBufferRef.

Author:
Lubomir Marinov

Constructor Summary
CVPixelBuffer(long ptr)
          Initializes a new CVPixelBuffer instance which is to represent a specific CoreVideo CVPixelBufferRef.
 
Method Summary
 int getByteCount()
          Gets the number of bytes which represent the pixels of the associated CoreVideo CVPixelBufferRef.
 byte[] getBytes()
          Gets a byte array which represents the pixels of the associated CoreVideo CVPixelBufferRef.
 int getBytes(long buf, int bufLength)
          Gets the bytes which represent the pixels of the associated CVPixelBufferRef into a specific native byte buffer with a specific capacity.
 int getHeight()
          Gets the height in pixels of this CVPixelBuffer.
 int getWidth()
          Gets the width in pixels of this CVPixelBuffer.
static void memcpy(byte[] dst, int dstOffset, int dstLength, long src)
          Native copy from native pointer src to byte array dst.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.quicktime.CVImageBuffer
getPtr, setPtr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CVPixelBuffer

public CVPixelBuffer(long ptr)
Initializes a new CVPixelBuffer instance which is to represent a specific CoreVideo CVPixelBufferRef.

Parameters:
ptr - the CoreVideo CVPixelBufferRef to be represented by the new instance
Method Detail

getByteCount

public int getByteCount()
Gets the number of bytes which represent the pixels of the associated CoreVideo CVPixelBufferRef.

Returns:
the number of bytes which represent the pixels of the associated CoreVideo CVPixelBufferRef

getBytes

public byte[] getBytes()
Gets a byte array which represents the pixels of the associated CoreVideo CVPixelBufferRef.

Returns:
a byte array which represents the pixels of the associated CoreVideo CVPixelBufferRef

getBytes

public int getBytes(long buf,
                    int bufLength)
Gets the bytes which represent the pixels of the associated CVPixelBufferRef into a specific native byte buffer with a specific capacity.

Parameters:
buf - the native byte buffer to return the bytes into
bufLength - the capacity in bytes of buf
Returns:
the number of bytes written into buf

getHeight

public int getHeight()
Gets the height in pixels of this CVPixelBuffer.

Returns:
the height in pixels of this CVPixelBuffer

getWidth

public int getWidth()
Gets the width in pixels of this CVPixelBuffer.

Returns:
the width in pixels of this CVPixelBuffer

memcpy

public static void memcpy(byte[] dst,
                          int dstOffset,
                          int dstLength,
                          long src)
Native copy from native pointer src to byte array dst.

Parameters:
dst - destination array
dstOffset - offset of dst to copy data to
dstLength - length of dst
src - native pointer source

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.