Search in sources :

Example 1 with FrameBranch

use of android.filterpacks.base.FrameBranch in project android_frameworks_base by ParanoidAndroid.

the class FilterGraph method connectPorts.

private void connectPorts() {
    int branchId = 1;
    for (Entry<OutputPort, LinkedList<InputPort>> connection : mPreconnections.entrySet()) {
        OutputPort outputPort = connection.getKey();
        LinkedList<InputPort> inputPorts = connection.getValue();
        if (inputPorts.size() == 1) {
            outputPort.connectTo(inputPorts.get(0));
        } else if (mAutoBranchMode == AUTOBRANCH_OFF) {
            throw new RuntimeException("Attempting to connect " + outputPort + " to multiple " + "filter ports! Enable auto-branching to allow this.");
        } else {
            if (mLogVerbose)
                Log.v(TAG, "Creating branch for " + outputPort + "!");
            FrameBranch branch = null;
            if (mAutoBranchMode == AUTOBRANCH_SYNCED) {
                branch = new FrameBranch("branch" + branchId++);
            } else {
                throw new RuntimeException("TODO: Unsynced branches not implemented yet!");
            }
            KeyValueMap branchParams = new KeyValueMap();
            branch.initWithAssignmentList("outputs", inputPorts.size());
            addFilter(branch);
            outputPort.connectTo(branch.getInputPort("in"));
            Iterator<InputPort> inputPortIter = inputPorts.iterator();
            for (OutputPort branchOutPort : ((Filter) branch).getOutputPorts()) {
                branchOutPort.connectTo(inputPortIter.next());
            }
        }
    }
    mPreconnections.clear();
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap) Iterator(java.util.Iterator) FrameBranch(android.filterpacks.base.FrameBranch) LinkedList(java.util.LinkedList)

Example 2 with FrameBranch

use of android.filterpacks.base.FrameBranch in project platform_frameworks_base by android.

the class FilterGraph method connectPorts.

private void connectPorts() {
    int branchId = 1;
    for (Entry<OutputPort, LinkedList<InputPort>> connection : mPreconnections.entrySet()) {
        OutputPort outputPort = connection.getKey();
        LinkedList<InputPort> inputPorts = connection.getValue();
        if (inputPorts.size() == 1) {
            outputPort.connectTo(inputPorts.get(0));
        } else if (mAutoBranchMode == AUTOBRANCH_OFF) {
            throw new RuntimeException("Attempting to connect " + outputPort + " to multiple " + "filter ports! Enable auto-branching to allow this.");
        } else {
            if (mLogVerbose)
                Log.v(TAG, "Creating branch for " + outputPort + "!");
            FrameBranch branch = null;
            if (mAutoBranchMode == AUTOBRANCH_SYNCED) {
                branch = new FrameBranch("branch" + branchId++);
            } else {
                throw new RuntimeException("TODO: Unsynced branches not implemented yet!");
            }
            KeyValueMap branchParams = new KeyValueMap();
            branch.initWithAssignmentList("outputs", inputPorts.size());
            addFilter(branch);
            outputPort.connectTo(branch.getInputPort("in"));
            Iterator<InputPort> inputPortIter = inputPorts.iterator();
            for (OutputPort branchOutPort : ((Filter) branch).getOutputPorts()) {
                branchOutPort.connectTo(inputPortIter.next());
            }
        }
    }
    mPreconnections.clear();
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap) Iterator(java.util.Iterator) FrameBranch(android.filterpacks.base.FrameBranch) LinkedList(java.util.LinkedList)

Example 3 with FrameBranch

use of android.filterpacks.base.FrameBranch in project android_frameworks_base by AOSPA.

the class FilterGraph method connectPorts.

private void connectPorts() {
    int branchId = 1;
    for (Entry<OutputPort, LinkedList<InputPort>> connection : mPreconnections.entrySet()) {
        OutputPort outputPort = connection.getKey();
        LinkedList<InputPort> inputPorts = connection.getValue();
        if (inputPorts.size() == 1) {
            outputPort.connectTo(inputPorts.get(0));
        } else if (mAutoBranchMode == AUTOBRANCH_OFF) {
            throw new RuntimeException("Attempting to connect " + outputPort + " to multiple " + "filter ports! Enable auto-branching to allow this.");
        } else {
            if (mLogVerbose)
                Log.v(TAG, "Creating branch for " + outputPort + "!");
            FrameBranch branch = null;
            if (mAutoBranchMode == AUTOBRANCH_SYNCED) {
                branch = new FrameBranch("branch" + branchId++);
            } else {
                throw new RuntimeException("TODO: Unsynced branches not implemented yet!");
            }
            KeyValueMap branchParams = new KeyValueMap();
            branch.initWithAssignmentList("outputs", inputPorts.size());
            addFilter(branch);
            outputPort.connectTo(branch.getInputPort("in"));
            Iterator<InputPort> inputPortIter = inputPorts.iterator();
            for (OutputPort branchOutPort : ((Filter) branch).getOutputPorts()) {
                branchOutPort.connectTo(inputPortIter.next());
            }
        }
    }
    mPreconnections.clear();
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap) Iterator(java.util.Iterator) FrameBranch(android.filterpacks.base.FrameBranch) LinkedList(java.util.LinkedList)

Example 4 with FrameBranch

use of android.filterpacks.base.FrameBranch in project android_frameworks_base by ResurrectionRemix.

the class FilterGraph method connectPorts.

private void connectPorts() {
    int branchId = 1;
    for (Entry<OutputPort, LinkedList<InputPort>> connection : mPreconnections.entrySet()) {
        OutputPort outputPort = connection.getKey();
        LinkedList<InputPort> inputPorts = connection.getValue();
        if (inputPorts.size() == 1) {
            outputPort.connectTo(inputPorts.get(0));
        } else if (mAutoBranchMode == AUTOBRANCH_OFF) {
            throw new RuntimeException("Attempting to connect " + outputPort + " to multiple " + "filter ports! Enable auto-branching to allow this.");
        } else {
            if (mLogVerbose)
                Log.v(TAG, "Creating branch for " + outputPort + "!");
            FrameBranch branch = null;
            if (mAutoBranchMode == AUTOBRANCH_SYNCED) {
                branch = new FrameBranch("branch" + branchId++);
            } else {
                throw new RuntimeException("TODO: Unsynced branches not implemented yet!");
            }
            KeyValueMap branchParams = new KeyValueMap();
            branch.initWithAssignmentList("outputs", inputPorts.size());
            addFilter(branch);
            outputPort.connectTo(branch.getInputPort("in"));
            Iterator<InputPort> inputPortIter = inputPorts.iterator();
            for (OutputPort branchOutPort : ((Filter) branch).getOutputPorts()) {
                branchOutPort.connectTo(inputPortIter.next());
            }
        }
    }
    mPreconnections.clear();
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap) Iterator(java.util.Iterator) FrameBranch(android.filterpacks.base.FrameBranch) LinkedList(java.util.LinkedList)

Example 5 with FrameBranch

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

the class FilterGraph method connectPorts.

private void connectPorts() {
    int branchId = 1;
    for (Entry<OutputPort, LinkedList<InputPort>> connection : mPreconnections.entrySet()) {
        OutputPort outputPort = connection.getKey();
        LinkedList<InputPort> inputPorts = connection.getValue();
        if (inputPorts.size() == 1) {
            outputPort.connectTo(inputPorts.get(0));
        } else if (mAutoBranchMode == AUTOBRANCH_OFF) {
            throw new RuntimeException("Attempting to connect " + outputPort + " to multiple " + "filter ports! Enable auto-branching to allow this.");
        } else {
            if (mLogVerbose)
                Log.v(TAG, "Creating branch for " + outputPort + "!");
            FrameBranch branch = null;
            if (mAutoBranchMode == AUTOBRANCH_SYNCED) {
                branch = new FrameBranch("branch" + branchId++);
            } else {
                throw new RuntimeException("TODO: Unsynced branches not implemented yet!");
            }
            KeyValueMap branchParams = new KeyValueMap();
            branch.initWithAssignmentList("outputs", inputPorts.size());
            addFilter(branch);
            outputPort.connectTo(branch.getInputPort("in"));
            Iterator<InputPort> inputPortIter = inputPorts.iterator();
            for (OutputPort branchOutPort : ((Filter) branch).getOutputPorts()) {
                branchOutPort.connectTo(inputPortIter.next());
            }
        }
    }
    mPreconnections.clear();
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap) Iterator(java.util.Iterator) FrameBranch(android.filterpacks.base.FrameBranch) LinkedList(java.util.LinkedList)

Aggregations

KeyValueMap (android.filterfw.core.KeyValueMap)6 FrameBranch (android.filterpacks.base.FrameBranch)6 Iterator (java.util.Iterator)6 LinkedList (java.util.LinkedList)6