public class SwScale
extends net.sf.fmj.media.AbstractCodec
Modifier and Type | Field and Description |
---|---|
static int |
MIN_SWS_SCALE_HEIGHT_OR_WIDTH
The minimum height and/or width of the input and/or output to be passed
to sws_scale in order to prevent its crashing.
|
Constructor and Description |
---|
SwScale()
Initializes a new SwScale instance which doesn't have an output
size and will use a default one when it becomes necessary unless an
explicit one is specified in the meantime.
|
SwScale(boolean fixOddYuv420Size)
Initializes a new SwScale instance which can optionally attempt
to keep the width and height of YUV 420 output even.
|
SwScale(boolean fixOddYuv420Size,
boolean preserveAspectRatio)
Initializes a new SwScale instance which can optionally attempt
to keep the width and height of YUV 420 output even and to preserve the
aspect ratio of the video frames provided to the instance as input to be
processed.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close codec.
|
javax.media.Format |
getInputFormat()
Gets the Format in which this Codec is currently
configured to accept input media data.
|
java.awt.Dimension |
getOutputSize()
Gets the output size.
|
javax.media.Format[] |
getSupportedOutputFormats(javax.media.Format input)
Gets the supported output formats for an input one.
|
int |
process(javax.media.Buffer in,
javax.media.Buffer out)
Processes (converts color space and/or scales) an input Buffer
into an output Buffer.
|
javax.media.Format |
setInputFormat(javax.media.Format format)
Sets the input format.
|
javax.media.Format |
setOutputFormat(javax.media.Format format)
Sets the Format in which this Codec is to output media
data.
|
void |
setOutputSize(java.awt.Dimension size)
Sets the output size.
|
checkInputBuffer, dump, getOutputFormat, getSupportedInputFormats, isEOM, propagateEOM
addControl, getControl, getControls, removeControl
public static final int MIN_SWS_SCALE_HEIGHT_OR_WIDTH
public SwScale()
public SwScale(boolean fixOddYuv420Size)
fixOddYuv420Size
- true to have the new instance keep the
width and height of YUV 420 output even; otherwise, falsepublic SwScale(boolean fixOddYuv420Size, boolean preserveAspectRatio)
fixOddYuv420Size
- true to have the new instance keep the
width and height of YUV 420 output even; otherwise, falsepreserveAspectRatio
- true to have the new instance
preserve the aspect ratio of the video frames provided to it as input to
be processed; otherwise, falsepublic void close()
close
in interface javax.media.PlugIn
close
in class net.sf.fmj.media.AbstractPlugIn
public javax.media.Format getInputFormat()
Makes the protected super implementation public.
getInputFormat
in class net.sf.fmj.media.AbstractCodec
AbstractCodec.getInputFormat()
public java.awt.Dimension getOutputSize()
public javax.media.Format[] getSupportedOutputFormats(javax.media.Format input)
getSupportedOutputFormats
in interface javax.media.Codec
getSupportedOutputFormats
in class net.sf.fmj.media.AbstractCodec
input
- input format to get supported output ones forpublic int process(javax.media.Buffer in, javax.media.Buffer out)
process
in interface javax.media.Codec
process
in class net.sf.fmj.media.AbstractCodec
in
- the input Buffer to process (from)out
- the output Buffer to process intopublic javax.media.Format setInputFormat(javax.media.Format format)
setInputFormat
in interface javax.media.Codec
setInputFormat
in class net.sf.fmj.media.AbstractCodec
format
- format to setpublic javax.media.Format setOutputFormat(javax.media.Format format)
setOutputFormat
in interface javax.media.Codec
setOutputFormat
in class net.sf.fmj.media.AbstractCodec
format
- the Format in which this Codec is to
output media datapublic void setOutputSize(java.awt.Dimension size)
size
- the size to set as the output size
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.