use of androidx.media.filterfw.OutputPort in project android_frameworks_base by crdroidandroid.
the class AvgBrightnessFilter method onProcess.
@Override
protected void onProcess() {
FrameImage2D inputImage = getConnectedInputPort("image").pullFrame().asFrameImage2D();
float brightness;
ByteBuffer inputBuffer = inputImage.lockBytes(Frame.MODE_READ);
brightness = brightnessOperator(inputImage.getWidth(), inputImage.getHeight(), inputBuffer);
inputImage.unlock();
if (mLogVerbose)
Log.v(TAG, "contrastRatio: " + brightness);
OutputPort brightnessPort = getConnectedOutputPort("brightnessRating");
FrameValue brightnessOutFrame = brightnessPort.fetchAvailableFrame(null).asFrameValue();
brightnessOutFrame.setValue(brightness);
brightnessPort.pushFrame(brightnessOutFrame);
}
use of androidx.media.filterfw.OutputPort in project android_frameworks_base by crdroidandroid.
the class ToStringFilter method onProcess.
@Override
protected void onProcess() {
FrameValue objectFrame = getConnectedInputPort("object").pullFrame().asFrameValue();
String outStr = objectFrame.getValue().toString();
OutputPort outPort = getConnectedOutputPort("string");
FrameValue stringFrame = outPort.fetchAvailableFrame(null).asFrameValue();
stringFrame.setValue(outStr);
outPort.pushFrame(stringFrame);
}
Aggregations