public class SurfaceTextureSource extends Filter
A filter that converts textures from a SurfaceTexture object into frames for processing in the filter framework.
To use, connect up the sourceListener callback, and then when executing the graph, use the SurfaceTexture object passed to the callback to feed frames into the filter graph. For example, pass the SurfaceTexture into {#link android.hardware.Camera.setPreviewTexture(android.graphics.SurfaceTexture)}. This filter is intended for applications that need for flexibility than the CameraSource and MediaSource provide. Note that the application needs to provide width and height information for the SurfaceTextureSource, which it should obtain from wherever the SurfaceTexture data is coming from to avoid unnecessary resampling.
Modifier and Type | Class and Description |
---|---|
static interface |
SurfaceTextureSource.SurfaceTextureSourceListener
The callback interface for the sourceListener parameter
|
Constructor and Description |
---|
SurfaceTextureSource(String name) |
Modifier and Type | Method and Description |
---|---|
void |
close(FilterContext context) |
void |
fieldPortValueUpdated(String name,
FilterContext context) |
void |
open(FilterContext context) |
protected void |
prepare(FilterContext context) |
void |
process(FilterContext context) |
void |
setupPorts() |
void |
tearDown(FilterContext context) |
addFieldPort, addInputPort, addMaskedInputPort, addOutputBasedOnInput, addOutputPort, addProgramPort, closeOutputPort, delayNextProcess, getFilterClassName, getInputFormat, getInputPort, getName, getNumberOfConnectedInputs, getNumberOfConnectedOutputs, getNumberOfInputs, getNumberOfOutputs, getOutputFormat, getOutputPort, getSleepDelay, init, initProgramInputs, initWithAssignmentList, initWithAssignmentString, initWithValueMap, isAvailable, isOpen, parametersUpdated, pullInput, pushOutput, setInputFrame, setInputValue, setWaitsOnInputPort, setWaitsOnOutputPort, toString, transferInputPortFrame
public SurfaceTextureSource(String name)
public void setupPorts()
setupPorts
in class Filter
protected void prepare(FilterContext context)
public void open(FilterContext context)
public void process(FilterContext context)
public void close(FilterContext context)
public void tearDown(FilterContext context)
public void fieldPortValueUpdated(String name, FilterContext context)
fieldPortValueUpdated
in class Filter