本文整理汇总了Java中javax.media.format.VideoFormat.JPEG属性的典型用法代码示例。如果您正苦于以下问题:Java VideoFormat.JPEG属性的具体用法?Java VideoFormat.JPEG怎么用?Java VideoFormat.JPEG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.media.format.VideoFormat
的用法示例。
在下文中一共展示了VideoFormat.JPEG属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ImageSourceStream
public ImageSourceStream(int width, int height, int frameRate, Vector images) {
this.width = width;
this.height = height;
this.images = images;
format = new VideoFormat(VideoFormat.JPEG,
new Dimension(width, height),
Format.NOT_SPECIFIED,
Format.byteArray,
(float)frameRate);
}
示例2: setJPEGQuality
/**
* Setting the encoding quality to the specified value on the JPEG encoder.
* 0.5 is a good default.
*/
void setJPEGQuality(Player p, float val) {
Control cs[] = p.getControls();
QualityControl qc = null;
VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG);
// Loop through the controls to find the Quality control for
// the JPEG encoder.
for (int i = 0; i < cs.length; i++) {
if (cs[i] instanceof QualityControl &&
cs[i] instanceof Owned) {
Object owner = ((Owned)cs[i]).getOwner();
// Check to see if the owner is a Codec.
// Then check for the output format.
if (owner instanceof Codec) {
Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
for (int j = 0; j < fmts.length; j++) {
if (fmts[j].matches(jpegFmt)) {
qc = (QualityControl)cs[i];
qc.setQuality(val);
System.err.println("- Setting quality to " +
val + " on " + qc);
break;
}
}
}
if (qc != null)
break;
}
}
}
示例3: PlayerSourceStream
public PlayerSourceStream(String screenRecordingFileName) throws IOException {
inStream = new FileInputStream(screenRecordingFileName);
recordingStream = new RecordingStream(inStream);
width = (int) recordingStream.getArea().getWidth();
height = (int) recordingStream.getArea().getHeight();
frameRate = 5;
format = new VideoFormat(VideoFormat.JPEG, new Dimension(width, height),
Format.NOT_SPECIFIED, Format.byteArray, (float) frameRate);
}
示例4: JpegSourceStream
public JpegSourceStream(int width, int height, int frameRate, File[] jpegFiles) {
this.width = width;
this.height = height;
this.jpegFiles = jpegFiles;
this.videoFormat = new VideoFormat(VideoFormat.JPEG,
new Dimension(width, height),
Format.NOT_SPECIFIED,
Format.byteArray,
(float) frameRate);
}
示例5: ImageSourceStream
public ImageSourceStream(int width, int height, int frameRate, DataList data) {
this.width = width;
this.height = height;
this.frameRate = (float) frameRate;
this.JPGImages = data;
/* The commented out code below is remains from a
* failed attempt to include avi output. The code is
* left in the source like this as a reminder to the
* author
*/
// format = new VideoFormat(VideoFormat.JPEG,
// new Dimension(width, height),
// Format.NOT_SPECIFIED,
// Format.byteArray,
// (float)frameRate);
format = new VideoFormat(VideoFormat.JPEG,
new Dimension(width, height),
Format.NOT_SPECIFIED,
Format.byteArray,
(float) frameRate);
/* The commented out code below is remains from a
* failed attempt to include avi output. The code is
* left in the source like this as a reminder to the
* author
*/
// final int rMask = 0x00ff0000;
// final int gMask = 0x0000FF00;
// final int bMask = 0x000000ff;
// format =
// new javax.media.format.RGBFormat(
// new Dimension(width, height),
// Format.NOT_SPECIFIED,
// Format.intArray,
// frameRate,
// 24,
// rMask,
// gMask,
// bMask);
}