示例#1
0
  /** {@inheritDoc} */
  public void closeSession(StreamSession ss) {

    Recorder r = getRecorder();
    if (r != null) {

      r.stopStreaming();
    }
  }
示例#2
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);
  }
示例#3
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);
  }