Search in sources :

Example 6 with NullFilter

use of android.filterpacks.base.NullFilter in project android_frameworks_base by crdroidandroid.

the class FilterGraph method discardUnconnectedOutputs.

private void discardUnconnectedOutputs() {
    // Connect unconnected ports to Null filters
    LinkedList<Filter> addedFilters = new LinkedList<Filter>();
    for (Filter filter : mFilters) {
        int id = 0;
        for (OutputPort port : filter.getOutputPorts()) {
            if (!port.isConnected()) {
                if (mLogVerbose)
                    Log.v(TAG, "Autoconnecting unconnected " + port + " to Null filter.");
                NullFilter nullFilter = new NullFilter(filter.getName() + "ToNull" + id);
                nullFilter.init();
                addedFilters.add(nullFilter);
                port.connectTo(nullFilter.getInputPort("frame"));
                ++id;
            }
        }
    }
    // Add all added filters to this graph
    for (Filter filter : addedFilters) {
        addFilter(filter);
    }
}
Also used : NullFilter(android.filterpacks.base.NullFilter) NullFilter(android.filterpacks.base.NullFilter) LinkedList(java.util.LinkedList)

Aggregations

NullFilter (android.filterpacks.base.NullFilter)6 LinkedList (java.util.LinkedList)6