Loading

Swapping GStreamer source

  1. FinishDeviceFunc finish_func = () => {
  2.     _source = new_source;
  3.     _pipeline.add(_source);
  4.     _source.link(_convert1);
  5.     _source.sync_state_with_parent();
  6. };
  7.  
  8. if (_source != null) {
  9.     var pad = _source.get_static_pad("src");
  10.     pad.add_probe(BLOCK_DOWNSTREAM, (pad, probe) => {
  11.         pad.remove_probe(probe.id);
  12.  
  13.         _pipeline.remove(_source);
  14.         finish_func();
  15.  
  16.         return OK;
  17.     });
  18. } else {
  19.     finish_func();
  20. }