Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.codec.video
Class AVFrameFormat

java.lang.Object
  extended by javax.media.Format
      extended by javax.media.format.VideoFormat
          extended by net.java.sip.communicator.impl.neomedia.codec.video.AVFrameFormat
All Implemented Interfaces:
Serializable, Cloneable

public class AVFrameFormat
extends javax.media.format.VideoFormat

Implements a VideoFormat for a Buffer carrying AVFrame as its data. While the AVFrameFormat class is not strictly necessary and VideoFormat could have be directly used, it is conceived as an appropriate way to avoid possible matching with other VideoFormats and a very obvious one.

Author:
Lyubomir Marinov, Sebastien Vincent
See Also:
Serialized Form

Field Summary
static String AVFRAME
          The encoding of the AVFrameFormat instances.
 
Fields inherited from class javax.media.format.VideoFormat
CINEPAK, frameRate, H261, H261_RTP, H263, H263_1998_RTP, H263_RTP, INDEO32, INDEO41, INDEO50, IRGB, JPEG, JPEG_RTP, maxDataLength, MJPEGA, MJPEGB, MJPG, MPEG, MPEG_RTP, RGB, RLE, RPZA, size, SMC, YUV
 
Fields inherited from class javax.media.Format
byteArray, clz, dataType, encoding, FALSE, formatArray, intArray, NOT_SPECIFIED, shortArray, TRUE
 
Constructor Summary
AVFrameFormat()
          Initializes a new AVFrameFormat instance with unspecified size, frame rate and FFmpeg colorspace.
AVFrameFormat(Dimension size, float frameRate, int pixFmt, int devicePixFmt)
          Initializes a new AVFrameFormat instance with specific size, frame rate and FFmpeg colorspace.
AVFrameFormat(int pixFmt)
          Initializes a new AVFrameFormat instance with a specific FFmpeg colorspace and unspecified size and frame rate.
AVFrameFormat(int pixFmt, int devicePixFmt)
          Initializes a new AVFrameFormat instance with a specific FFmpeg colorspace and unspecified size and frame rate.
 
Method Summary
 Object clone()
          Initializes a new AVFrameFormat instance which has the same properties as this instance.
protected  void copy(javax.media.Format f)
          Copies the properties of the specified Format into this instance.
 boolean equals(Object obj)
          Determines whether a specific Object represents a value that is equal to the value represented by this instance.
 int getDevicePixFmt()
          Gets the native capture device format represented by this instance.
 int getPixFmt()
          Gets the native FFmpeg format represented by this instance.
 int hashCode()
           
 javax.media.Format intersects(javax.media.Format format)
          Finds the attributes shared by two matching Formats.
 boolean matches(javax.media.Format format)
          Determines whether a specific format matches this instance i.e.
 String toString()
           
 
Methods inherited from class javax.media.format.VideoFormat
getFrameRate, getMaxDataLength, getSize, relax
 
Methods inherited from class javax.media.Format
getDataType, getEncoding, isSameEncoding, isSameEncoding
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AVFRAME

public static final String AVFRAME
The encoding of the AVFrameFormat instances.

See Also:
Constant Field Values
Constructor Detail

AVFrameFormat

public AVFrameFormat()
Initializes a new AVFrameFormat instance with unspecified size, frame rate and FFmpeg colorspace.


AVFrameFormat

public AVFrameFormat(int pixFmt)
Initializes a new AVFrameFormat instance with a specific FFmpeg colorspace and unspecified size and frame rate.

Parameters:
pixFmt - the FFmpeg colorspace to be represented by the new instance

AVFrameFormat

public AVFrameFormat(int pixFmt,
                     int devicePixFmt)
Initializes a new AVFrameFormat instance with a specific FFmpeg colorspace and unspecified size and frame rate.

Parameters:
pixFmt - the FFmpeg colorspace to be represented by the new instance
devicePixFmt - the capture device colorspace to be represented by the new instance

AVFrameFormat

public AVFrameFormat(Dimension size,
                     float frameRate,
                     int pixFmt,
                     int devicePixFmt)
Initializes a new AVFrameFormat instance with specific size, frame rate and FFmpeg colorspace.

Parameters:
size - the Dimension of the new instance
frameRate - the frame rate of the new instance
pixFmt - the FFmpeg colorspace to be represented by the new instance
devicePixFmt - the capture device colorspace to be represented by the new instance
Method Detail

clone

public Object clone()
Initializes a new AVFrameFormat instance which has the same properties as this instance.

Overrides:
clone in class javax.media.format.VideoFormat
Returns:
a new AVFrameFormat instance which has the same properties as this instance

copy

protected void copy(javax.media.Format f)
Copies the properties of the specified Format into this instance.

Overrides:
copy in class javax.media.format.VideoFormat
Parameters:
f - the Format the properties of which are to be copied into this instance

equals

public boolean equals(Object obj)
Determines whether a specific Object represents a value that is equal to the value represented by this instance.

Overrides:
equals in class javax.media.format.VideoFormat
Parameters:
obj - the Object to be determined whether it represents a value that is equal to the value represented by this instance
Returns:
true if the specified obj represents a value that is equal to the value represented by this instance; otherwise, false

getPixFmt

public int getPixFmt()
Gets the native FFmpeg format represented by this instance.

Returns:
the native FFmpeg format represented by this instance

getDevicePixFmt

public int getDevicePixFmt()
Gets the native capture device format represented by this instance.

Returns:
native capture device format represented by this instance

hashCode

public int hashCode()
Overrides:
hashCode in class Object

intersects

public javax.media.Format intersects(javax.media.Format format)
Finds the attributes shared by two matching Formats. If the specified Format does not match this one, the result is undefined.

Overrides:
intersects in class javax.media.format.VideoFormat
Parameters:
format - the matching Format to intersect with this one
Returns:
a Format with its attributes set to the attributes common to this instance and the specified format

matches

public boolean matches(javax.media.Format format)
Determines whether a specific format matches this instance i.e. whether their attributes match according to the definition of "match" given by Format.matches(Format).

Overrides:
matches in class javax.media.format.VideoFormat
Parameters:
format - the Format to compare to this instance
Returns:
true if the specified format matches this one; otherwise, false

toString

public String toString()
Overrides:
toString in class javax.media.format.VideoFormat

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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