You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
777 B
27 lines
777 B
package com.jme3.newvideo;
|
|
|
|
import com.jme3.texture.Image;
|
|
import com.jme3.texture.Image.Format;
|
|
import com.jme3.texture.Texture2D;
|
|
import com.jme3.util.BufferUtils;
|
|
import java.util.concurrent.BlockingQueue;
|
|
|
|
public final class VideoTexture extends Texture2D {
|
|
|
|
private BlockingQueue<VideoTexture> ownerQueue;
|
|
|
|
public VideoTexture(int width, int height, Format format, BlockingQueue<VideoTexture> ownerQueue){
|
|
super(new Image(format, width, height,
|
|
BufferUtils.createByteBuffer(width*height*format.getBitsPerPixel()/8)));
|
|
this.ownerQueue = ownerQueue;
|
|
}
|
|
|
|
public void free(){
|
|
try {
|
|
ownerQueue.put(this);
|
|
} catch (InterruptedException ex) {
|
|
ex.printStackTrace();
|
|
}
|
|
}
|
|
|
|
}
|
|
|