use of android.filterfw.core.Frame in project android_frameworks_base by ResurrectionRemix.
the class FrameManager method duplicateFrameToTarget.
public Frame duplicateFrameToTarget(Frame frame, int newTarget) {
MutableFrameFormat newFormat = frame.getFormat().mutableCopy();
newFormat.setTarget(newTarget);
Frame result = newFrame(newFormat);
result.setDataFromFrame(frame);
return result;
}
use of android.filterfw.core.Frame in project android_frameworks_base by ResurrectionRemix.
the class CachedFrameManager method findAvailableFrame.
private Frame findAvailableFrame(FrameFormat format, int bindingType, long bindingId) {
// Look for a frame that is compatible with the requested format
synchronized (mAvailableFrames) {
for (Map.Entry<Integer, Frame> entry : mAvailableFrames.entrySet()) {
Frame frame = entry.getValue();
// Check that format is compatible
if (frame.getFormat().isReplaceableBy(format)) {
// Check that binding is compatible (if frame is bound)
if ((bindingType == frame.getBindingType()) && (bindingType == Frame.NO_BINDING || bindingId == frame.getBindingId())) {
// We found one! Take it out of the set of available frames and attach the
// requested format to it.
super.retainFrame(frame);
mAvailableFrames.remove(entry.getKey());
frame.onFrameFetch();
frame.reset(format);
mStorageSize -= format.getSize();
return frame;
}
}
}
}
return null;
}
use of android.filterfw.core.Frame in project android_frameworks_base by ResurrectionRemix.
the class CachedFrameManager method newFrame.
@Override
public Frame newFrame(FrameFormat format) {
Frame result = findAvailableFrame(format, Frame.NO_BINDING, 0);
if (result == null) {
result = super.newFrame(format);
}
result.setTimestamp(Frame.TIMESTAMP_NOT_SET);
return result;
}
use of android.filterfw.core.Frame in project android_frameworks_base by ResurrectionRemix.
the class CachedFrameManager method newBoundFrame.
@Override
public Frame newBoundFrame(FrameFormat format, int bindingType, long bindingId) {
Frame result = findAvailableFrame(format, bindingType, bindingId);
if (result == null) {
result = super.newBoundFrame(format, bindingType, bindingId);
}
result.setTimestamp(Frame.TIMESTAMP_NOT_SET);
return result;
}
use of android.filterfw.core.Frame in project android_frameworks_base by ResurrectionRemix.
the class FilterContext method tearDown.
public synchronized void tearDown() {
// Release stored frames
for (Frame frame : mStoredFrames.values()) {
frame.release();
}
mStoredFrames.clear();
// Release graphs
for (FilterGraph graph : mGraphs) {
graph.tearDown(this);
}
mGraphs.clear();
// Release frame manager
if (mFrameManager != null) {
mFrameManager.tearDown();
mFrameManager = null;
}
// Release GL context
if (mGLEnvironment != null) {
mGLEnvironment.tearDown();
mGLEnvironment = null;
}
}
Aggregations