Hi, sorry if I am missing something available from the documentation. 

I looked at gpac's nodejs doc, at the test/gpac.js, at several filter's source code and documentation, at the doxygen as well as the general filter documentation.  

I'm trying to write a custom source that feeds data into a filter session using the nodejs API.

I have been testing 2 options: 


###  1. using a custom filter

This is my preferred solution, however I keep failing at building a simple graph. 
Here's my code:
```
const process = require("process");
const GPAC_NODEJS = process.env["GPAC_NODEJS"] || "share/nodejs/build/Debug/gpac";
const gpac = require(GPAC_NODEJS);

gpac.init();
gpac.set_logs("all@debug");

const fs = new gpac.FilterSession();
const custom_filter = fs.new_filter("mysource");
custom_filter.set_max_pids(-1);
custom_filter.pids = [];
custom_filter.push_cap('StreamType', 'Visual', gpac.GF_CAPS_OUTPUT);

custom_filter.process = function() 
{
    console.log(`custom_filter.process()`);
    return gpac.GF_OK;
}

custom_filter.configure_pid = function(pid, is_remove) 
{
    console.log(`custom_filter.configure_pid(${pid}, ${is_remove})`);
    return gpac.GF_OK;
}

custom_filter.process_event = function(evt)
{
    console.log(`custom_filter.process_event(${evt})`);
    return true;
}

custom_filter.reconfigure_output = function(pid){
    console.log(`custom_filter.reconfigure_output(${pid})`);
    return gpac.GF_OK;
}

// const f1 = fs.load("pout");
// const f1 = fs.load("fout:force_null");
// const f1 = fs.load_dst("test.mp4");
const f1 = fs.load("inspect:full");
f1.set_source(custom_filter);

fs.run();
fs.print_graph()
```

The custom filter implementation obviously does nothing useful but logging calls, which never happens as the filter is never connected. What am I missing ? 

Do I need to supply a specific argument to the `set_source(...)` function in order to explicitly connect these 2 filters ? 
```
f1.set_source(custom_filter, ARG);
```
I tried several options there, but couldn't figure it out.


### 2. using FIO wrapping

FIO wrapping seems like it could also achieve my goal:

```
const fs = new gpac.FilterSession();
const URL = "myuri"
const fio_wrapper = new gpac.FileIO(url, fio_factory);
const f1 = fs.load_src(fio_wrapper.url);
const f2 = fs.load('inspect');

f2.set_source(f1);
fs.run();
fs.print_graph();
```

My understanding is that gpac first reads the file in an attempt to probe it, then resolves a graph based on the result, is that correct ? Is the ressource url actually involved in the graph resolution (eg. graph resolver inferring the source type from a file extension) ?

At this point I have to log each of the FileIO API functions to figure out what happens in different contexts. Is there additional documentation to understand how the FileIO API works internally in different contexts ?

Finally, is there a case for which the FileIO API solution be favoured over the custom filter when trying to create a source ?

Thanks in advance for any help on this. 
Implementing a custom source using the nodejs API
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Implementing a custom source using the nodejs API
Issue date:

--- start body ---
Hi, sorry if I am missing something available from the documentation. 

I looked at gpac's nodejs doc, at the test/gpac.js, at several filter's source code and documentation, at the doxygen as well as the general filter documentation.  

I'm trying to write a custom source that feeds data into a filter session using the nodejs API.

I have been testing 2 options: 


###  1. using a custom filter

This is my preferred solution, however I keep failing at building a simple graph. 
Here's my code:
```
const process = require("process");
const GPAC_NODEJS = process.env["GPAC_NODEJS"] || "share/nodejs/build/Debug/gpac";
const gpac = require(GPAC_NODEJS);

gpac.init();
gpac.set_logs("all@debug");

const fs = new gpac.FilterSession();
const custom_filter = fs.new_filter("mysource");
custom_filter.set_max_pids(-1);
custom_filter.pids = [];
custom_filter.push_cap('StreamType', 'Visual', gpac.GF_CAPS_OUTPUT);

custom_filter.process = function() 
{
    console.log(`custom_filter.process()`);
    return gpac.GF_OK;
}

custom_filter.configure_pid = function(pid, is_remove) 
{
    console.log(`custom_filter.configure_pid(${pid}, ${is_remove})`);
    return gpac.GF_OK;
}

custom_filter.process_event = function(evt)
{
    console.log(`custom_filter.process_event(${evt})`);
    return true;
}

custom_filter.reconfigure_output = function(pid){
    console.log(`custom_filter.reconfigure_output(${pid})`);
    return gpac.GF_OK;
}

// const f1 = fs.load("pout");
// const f1 = fs.load("fout:force_null");
// const f1 = fs.load_dst("test.mp4");
const f1 = fs.load("inspect:full");
f1.set_source(custom_filter);

fs.run();
fs.print_graph()
```

The custom filter implementation obviously does nothing useful but logging calls, which never happens as the filter is never connected. What am I missing ? 

Do I need to supply a specific argument to the `set_source(...)` function in order to explicitly connect these 2 filters ? 
```
f1.set_source(custom_filter, ARG);
```
I tried several options there, but couldn't figure it out.


### 2. using FIO wrapping

FIO wrapping seems like it could also achieve my goal:

```
const fs = new gpac.FilterSession();
const URL = "myuri"
const fio_wrapper = new gpac.FileIO(url, fio_factory);
const f1 = fs.load_src(fio_wrapper.url);
const f2 = fs.load('inspect');

f2.set_source(f1);
fs.run();
fs.print_graph();
```

My understanding is that gpac first reads the file in an attempt to probe it, then resolves a graph based on the result, is that correct ? Is the ressource url actually involved in the graph resolution (eg. graph resolver inferring the source type from a file extension) ?

At this point I have to log each of the FileIO API functions to figure out what happens in different contexts. Is there additional documentation to understand how the FileIO API works internally in different contexts ?

Finally, is there a case for which the FileIO API solution be favoured over the custom filter when trying to create a source ?

Thanks in advance for any help on this. 
--- end body ---
