Complex links

The `@` link directive is just a quick shortcut to set the following filter arguments:  

- FID=name: assigns an identifier to the filter  
- SID=name1[,name2...]: sets a list of filter identifiers, or _sourceIDs_, restricting the list of possible inputs for a filter.  

  
Example
```
fA fB @1 fC
```
  
This is equivalent to `fA:FID=1 fB fC:SID=1`.  
Example
```
fA:FID=1 fB fC:SID=1
```
  
This indicates that `fC` only accepts input from `fA`, but `fB` might accept inputs from `fA`.  
Example
```
fA:FID=1 fB:FID=2 fC:SID=1 fD:SID=1,2
```
  
This indicates that `fD` only accepts input from `fA` and `fB` and `fC` only from `fA`  
_Note: A filter with sourceID set cannot get input from filters with no IDs._  
  
A sourceID name can be further extended using fragment identifier (`#` by default):  

- name#PIDNAME: accepts only PID(s) with name `PIDNAME`  
- name#TYPE: accepts only PIDs of matching media type. TYPE can be `audio`, `video`, `scene`, `text`, `font`, `meta`  
- name#TYPEN: accepts only `N` (1-based index) PID of matching type from source (e.g. `video2` to only accept second video PID)  
- name#TAG=VAL: accepts the PID if its parent filter has no tag or a tag matching `VAL`  
- name#ITAG=VAL: accepts the PID if its parent filter has no inherited tag or an inherited tag matching `VAL`  
- name#P4CC=VAL: accepts only PIDs with builtin property of type `P4CC` and value `VAL`.  
- name#PName=VAL: same as above, using the builtin name corresponding to the property.  
- name#AnyName=VAL: same as above, using the name of a non built-in property.  
- name#Name=OtherPropName: compares the value with the value of another property of the PID. The matching will fail if the value to compare to is not present or different from the value to check. The property to compare with shall be a built-in property.  

If the property is not defined on the PID, the property is matched. Otherwise, its value is checked against the given value.  
  
The following modifiers for comparisons are allowed (for any fragment format using `=`):  

- name#P4CC=!VAL: accepts only PIDs with property NOT matching `VAL`.  
- name#P4CC-VAL: accepts only PIDs with property strictly less than `VAL` (only for 1-dimension number properties).  
- name#P4CC+VAL: accepts only PIDs with property strictly greater than `VAL` (only for 1-dimension number properties).  

  
A sourceID name can also use wildcard or be empty to match a property regardless of the source filter.  
Example
```
fA fB:SID=*#ServiceID=2  
fA fB:SID=#ServiceID=2
```
  
This indicates to match connection between `fA` and `fB` only for PIDs with a `ServiceID` property of `2`.  
These extensions also work with the _LINK_ `@` shortcut.  
Example
```
fA fB @1#video fC
```
  
This indicates that `fC` only accepts inputs from `fA`, and of type video.  
Example
```
gpac -i img.heif @#ItemID=200 vout
```
  
This indicates to connect to `vout` only PIDs with `ItemID` property equal to `200`.  
Example
```
gpac -i vid.mp4 @#PID=1 vout
```
  
This indicates to connect to `vout` only PIDs with `ID` property equal to `1`.  
Example
```
gpac -i vid.mp4 @#Width=640 vout
```
  
This indicates to connect to `vout` only PIDs with `Width` property equal to `640`.  
Example
```
gpac -i vid.mp4 @#Width-640 vout
```
  
This indicates to connect to `vout` only PIDs with `Width` property less than `640`  
Example
```
gpac -i vid.mp4 @#ID=ItemID#ItemNumber=1 vout
```
  
This will connect to `vout` only PID with an ID property equal to ItemID property (keep items, discard tracks) and an Item number of 1 (first item).  
  
Multiple fragment can be specified to check for multiple PID properties.  
Example
```
gpac -i vid.mp4 @#Width=640#Height+380 vout
```
  
This indicates to connect to `vout` only PIDs with `Width` property equal to `640` and `Height` greater than `380`.  
  
__Warning: If a PID directly connects to one or more explicitly loaded filters, no further dynamic link resolution will be done to connect it to other filters with no sourceID set. Link directives should be carefully setup.__  
  
Example
```
fA @ reframer fB
```
  
If `fB` accepts inputs provided by `fA` but `reframer` does not, this will link `fA` PID to `fB` filter since `fB` has no sourceID.  
Since the PID is connected, the filter engine will not try to solve a link between `fA` and `reframer`.  
  
An exception is made for local files: by default, a local file destination will force a remultiplex of input PIDs from a local file.  
Example
```
gpac -i file.mp4 -o dump.mp4
```
  
This will prevent direct connection of PID of type `file` to dst `file.mp4`, remultiplexing the file.  
  
The special option `nomux` is used to allow direct connections (ignored for non-sink filters).  
Example
```
gpac -i file.mp4 -o dump.mp4:nomux
```
  
This will result in a direct file copy.  
  
This only applies to local files destination. For pipes, sockets or other file outputs (HTTP, ROUTE):  

- direct copy is enabled by default  
- `nomux=0` can be used to force remultiplex