Search in sources :

Example 41 with KeyValueMap

use of android.filterfw.core.KeyValueMap in project android_frameworks_base by AOSPA.

the class Filter method initWithAssignmentList.

public final void initWithAssignmentList(Object... keyValues) {
    KeyValueMap valueMap = new KeyValueMap();
    valueMap.setKeyValues(keyValues);
    initWithValueMap(valueMap);
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap)

Example 42 with KeyValueMap

use of android.filterfw.core.KeyValueMap in project android_frameworks_base by ResurrectionRemix.

the class FrameFormat method mutableCopy.

public MutableFrameFormat mutableCopy() {
    MutableFrameFormat result = new MutableFrameFormat();
    result.setBaseType(getBaseType());
    result.setTarget(getTarget());
    result.setBytesPerSample(getBytesPerSample());
    result.setDimensions(getDimensions());
    result.setObjectClass(getObjectClass());
    result.mMetaData = mMetaData == null ? null : (KeyValueMap) mMetaData.clone();
    return result;
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap) MutableFrameFormat(android.filterfw.core.MutableFrameFormat)

Example 43 with KeyValueMap

use of android.filterfw.core.KeyValueMap in project android_frameworks_base by ResurrectionRemix.

the class Filter method init.

public final void init() throws ProtocolException {
    KeyValueMap valueMap = new KeyValueMap();
    initWithValueMap(valueMap);
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap)

Example 44 with KeyValueMap

use of android.filterfw.core.KeyValueMap in project android_frameworks_base by ResurrectionRemix.

the class Filter method initWithAssignmentList.

public final void initWithAssignmentList(Object... keyValues) {
    KeyValueMap valueMap = new KeyValueMap();
    valueMap.setKeyValues(keyValues);
    initWithValueMap(valueMap);
}
Also used : KeyValueMap(android.filterfw.core.KeyValueMap)

Example 45 with KeyValueMap

use of android.filterfw.core.KeyValueMap in project android_frameworks_base by DirtyUnicorns.

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)48 GraphIOException (android.filterfw.io.GraphIOException)18 String (java.lang.String)12 Pattern (java.util.regex.Pattern)12 FilterFactory (android.filterfw.core.FilterFactory)6 MutableFrameFormat (android.filterfw.core.MutableFrameFormat)6 PatternScanner (android.filterfw.io.PatternScanner)6 TextGraphReader (android.filterfw.io.TextGraphReader)6 FrameBranch (android.filterpacks.base.FrameBranch)6 Iterator (java.util.Iterator)6 LinkedList (java.util.LinkedList)6