本文整理匯總了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);
}
}