本文整理汇总了Java中org.bytedeco.javacv.FrameFilter类的典型用法代码示例。如果您正苦于以下问题:Java FrameFilter类的具体用法?Java FrameFilter怎么用?Java FrameFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FrameFilter类属于org.bytedeco.javacv包,在下文中一共展示了FrameFilter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FilterImageTransform
import org.bytedeco.javacv.FrameFilter; //导入依赖的package包/类
/**
* Constructs a filtergraph out of the filter specification.
*
* @param filters to use
* @param width of the input images
* @param height of the input images
* @param channels of the input images
*/
public FilterImageTransform(@JsonProperty("filters") String filters, @JsonProperty("width") int width,
@JsonProperty("height") int height, @JsonProperty("channels") int channels) {
super(null);
this.filters = filters;
this.width = width;
this.height = height;
this.channels = channels;
int pixelFormat = channels == 1 ? AV_PIX_FMT_GRAY8
: channels == 3 ? AV_PIX_FMT_BGR24 : channels == 4 ? AV_PIX_FMT_RGBA : AV_PIX_FMT_NONE;
if (pixelFormat == AV_PIX_FMT_NONE) {
throw new IllegalArgumentException("Unsupported number of channels: " + channels);
}
try {
filter = new FFmpegFrameFilter(filters, width, height);
filter.setPixelFormat(pixelFormat);
filter.start();
} catch (FrameFilter.Exception e) {
throw new RuntimeException(e);
}
}
示例2: releaseFrameFilter
import org.bytedeco.javacv.FrameFilter; //导入依赖的package包/类
private void releaseFrameFilter()
{
if (frameFilter != null)
{
try
{
frameFilter.release();
}
catch (FrameFilter.Exception e)
{
e.printStackTrace();
}
}
frameFilter = null;
}
示例3: releaseFrameFilter
import org.bytedeco.javacv.FrameFilter; //导入依赖的package包/类
/**
* 释放帧过滤器
*/
private void releaseFrameFilter() {
if (null != mFrameFilter) {
try {
mFrameFilter.release();
} catch (FrameFilter.Exception e) {
e.printStackTrace();
}
}
mFrameFilter = null;
}
示例4: recordFrame
import org.bytedeco.javacv.FrameFilter; //导入依赖的package包/类
/**
* 录制帧
* @throws FrameRecorder.Exception
*/
private void recordFrame(Frame frame) throws FrameRecorder.Exception, FrameFilter.Exception {
mFrameFilter.push(frame);
Frame filteredFrame;
while ((filteredFrame = mFrameFilter.pull()) != null) {
recorder.record(filteredFrame);
}
}