Class ThincVideoFormat

java.lang.Object
  extended by ThincVideoFormat
Direct Known Subclasses:
ThincVideoFormatUYVY, ThincVideoFormatYUY2, ThincVideoFormatYV12

public abstract class ThincVideoFormat
extends java.lang.Object

abstract class for video format used in ThinSMsgVideo.

Author:
Young Jin Yoon

Field Summary
private static int[] clientFormats
           
private static int current
           
static int[] finalFormats
           
static int MAX_FORMAT
           
private static int[] serverFormats
           
static int UYVY
           
static int YUY2
           
static int YV12
           
 
Constructor Summary
ThincVideoFormat()
           
 
Method Summary
static int[] getFormat()
          setFormat() gets an array of final format which both server and client accepted from ThincVideoFormat class.
abstract  java.nio.IntBuffer process(int width, int height, int size)
          process() receives YUV image and converts it into ARGB images. it is used in ThinSMsgVideo to draw ARGB image into frame buffer.
static void setFormat(int id)
          setFormat() sets the format from the server into ThincVideoFormat class.
private  short unsigned(byte src)
           
protected  int yuvToRgb(byte y, byte u, byte v)
          yuvToRgb primitive method which converts YUV pixel into ARGB pixel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YV12

public static final int YV12
See Also:
Constant Field Values

YUY2

public static final int YUY2
See Also:
Constant Field Values

UYVY

public static final int UYVY
See Also:
Constant Field Values

MAX_FORMAT

public static final int MAX_FORMAT
See Also:
Constant Field Values

clientFormats

private static final int[] clientFormats

serverFormats

private static int[] serverFormats

finalFormats

public static int[] finalFormats

current

private static int current
Constructor Detail

ThincVideoFormat

public ThincVideoFormat()
Method Detail

setFormat

public static void setFormat(int id)
setFormat() sets the format from the server into ThincVideoFormat class.

Parameters:
id - format id to set

getFormat

public static int[] getFormat()
setFormat() gets an array of final format which both server and client accepted from ThincVideoFormat class.

Returns:
int array for final format.

process

public abstract java.nio.IntBuffer process(int width,
                                           int height,
                                           int size)
                                    throws ThincException
process() receives YUV image and converts it into ARGB images. it is used in ThinSMsgVideo to draw ARGB image into frame buffer.

Parameters:
width - width of YUV image
height - height of YUV image
size - size of YUV image
Returns:
ARGB image represented as IntBuffer object
Throws:
ThincException

yuvToRgb

protected int yuvToRgb(byte y,
                       byte u,
                       byte v)
yuvToRgb primitive method which converts YUV pixel into ARGB pixel

Parameters:
y - y value for source pixel
u - u value for source pixel
v - v value for source pixel
Returns:
ARGB pixel

unsigned

private short unsigned(byte src)