Example #1
0
  /** {@inheritDoc} */
  public Recorder getRecorder() {

    Recorder result = null;

    String source = getConfiguredRecorderSource();
    NMS n = getNMS();
    LogUtil.log(LogUtil.DEBUG, "getRecorder: source <" + source + ">");
    LogUtil.log(LogUtil.DEBUG, "getRecorder: n <" + n + ">");
    if ((source != null) && (n != null)) {

      String device = source.substring(source.lastIndexOf(" "));
      device = device.trim();
      LogUtil.log(LogUtil.DEBUG, "getRecorder: device <" + device + ">");
      result = n.getRecorderByDevice(device);
      LogUtil.log(LogUtil.DEBUG, "getRecorder: result <" + result + ">");
      if (result != null) {
        LogUtil.log(LogUtil.DEBUG, "getRecorder: result <" + result.getDevice() + ">");
      }
    }

    return (result);
  }
Example #2
0
  /** {@inheritDoc} */
  public StreamSession openSession(String host, int port) {

    StreamSession result = null;

    LogUtil.log(LogUtil.DEBUG, "openSession: title " + getTitle());
    LogUtil.log(LogUtil.DEBUG, "openSession: host " + host);
    LogUtil.log(LogUtil.DEBUG, "openSession: port " + port);
    if (host != null) {

      Recorder r = getRecorder();
      NMS n = getNMS();
      LogUtil.log(LogUtil.DEBUG, "openSession: recorder " + r);
      if ((n != null) && (r != null) && (!r.isRecording())) {

        result = new StreamSession(getTitle(), n.getHost() + ":" + n.getPort());

        r.startStreaming(null, host, port);
      }
    }

    return (result);
  }