Package org.red5.server.messaging

Examples of org.red5.server.messaging.OOBControlMessage


   * @param start            Start timestamp
   */
  private void sendVODInitCM(IMessageInput msgIn, int start) {
    if (msgIn != null) {
      // Create new out-of-band control message
      OOBControlMessage oobCtrlMsg = new OOBControlMessage();
      // Set passive type
      oobCtrlMsg.setTarget(IPassive.KEY);
      // Set service name of init
      oobCtrlMsg.setServiceName("init");
      // Create map for parameters
      Map<String, Object> paramMap = new HashMap<String, Object>(1);
      // Put start timestamp into Map of params
      paramMap.put("startTS", start);
      // Attach to OOB control message and send it
      oobCtrlMsg.setServiceParamMap(paramMap);
      msgIn.sendOOBControlMessage(this, oobCtrlMsg);
    }
  }
View Full Code Here


   *
   * @param msgIn        Message input
   * @param position      New timestamp to play from
   */
  private void sendVODSeekCM(IMessageInput msgIn, int position) {
    OOBControlMessage oobCtrlMsg = new OOBControlMessage();
    oobCtrlMsg.setTarget(ISeekableProvider.KEY);
    oobCtrlMsg.setServiceName("seek");
    Map<String, Object> paramMap = new HashMap<String, Object>(1);
    paramMap.put("position", Integer.valueOf(position));
    oobCtrlMsg.setServiceParamMap(paramMap);
    msgIn.sendOOBControlMessage(this, oobCtrlMsg);
    // Reset properties
    vodStartTS = 0;
    serverStartTS = System.currentTimeMillis();
    if (nextRTMPMessage != null) {
View Full Code Here

  /**
   * Send OOB control message with chunk size
   */
  private void notifyChunkSize() {
    if (chunkSize > 0 && livePipe != null) {
      OOBControlMessage setChunkSize = new OOBControlMessage();
      setChunkSize.setTarget("ConnectionConsumer");
      setChunkSize.setServiceName("chunkSize");
      if (setChunkSize.getServiceParamMap() == null) {
        setChunkSize.setServiceParamMap(new HashMap<String, Object>());
      }
      setChunkSize.getServiceParamMap().put("chunkSize", chunkSize);
      livePipe.sendOOBControlMessage(getProvider(), setChunkSize);
    }
  }
View Full Code Here

   * @param start
   *                Start timestamp
   */
  private void sendVODInitCM(IMessageInput msgIn, int start) {
    // Create new out-of-band control message
    OOBControlMessage oobCtrlMsg = new OOBControlMessage();
    // Set passive type
    oobCtrlMsg.setTarget(IPassive.KEY);
    // Set service name of init
    oobCtrlMsg.setServiceName("init");
    // Create map for parameters
    Map<String, Object> paramMap = new HashMap<String, Object>();
    // Put start timestamp into Map of params
    paramMap.put("startTS", start);
    // Attach to OOB control message and send it
    oobCtrlMsg.setServiceParamMap(paramMap);
    msgIn.sendOOBControlMessage(this, oobCtrlMsg);
  }
View Full Code Here

   *
   * @param msgIn        Message input
   * @param position      New timestamp to play from
   */
  private void sendVODSeekCM(IMessageInput msgIn, int position) {
    OOBControlMessage oobCtrlMsg = new OOBControlMessage();
    oobCtrlMsg.setTarget(ISeekableProvider.KEY);
    oobCtrlMsg.setServiceName("seek");
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("position", new Integer(position));
    oobCtrlMsg.setServiceParamMap(paramMap);
    msgIn.sendOOBControlMessage(this, oobCtrlMsg);
    synchronized (this) {
      // Reset properties
      vodStartTS = 0;
      serverStartTS = System.currentTimeMillis();
View Full Code Here

   * Send VOD init control message
   * @param msgIn           Message input
   * @param item            Playlist item
   */
  private void sendVODInitCM(IMessageInput msgIn, IPlayItem item) {
    OOBControlMessage oobCtrlMsg = new OOBControlMessage();
    oobCtrlMsg.setTarget(IPassive.KEY);
    oobCtrlMsg.setServiceName("init");
    Map<String, Object> paramMap = new HashMap<String, Object>(1);
    paramMap.put("startTS", (int) item.getStart());
    oobCtrlMsg.setServiceParamMap(paramMap);
    msgIn.sendOOBControlMessage(this, oobCtrlMsg);
  }
View Full Code Here

   * @param msgIn            Message input
   * @param position         Playlist item
   * @return                 Out-of-band control message call result or -1 on failure
   */
  private int sendVODSeekCM(IMessageInput msgIn, int position) {
    OOBControlMessage oobCtrlMsg = new OOBControlMessage();
    oobCtrlMsg.setTarget(ISeekableProvider.KEY);
    oobCtrlMsg.setServiceName("seek");
    Map<String, Object> paramMap = new HashMap<String, Object>(1);
    paramMap.put("position", position);
    oobCtrlMsg.setServiceParamMap(paramMap);
    msgIn.sendOOBControlMessage(this, oobCtrlMsg);
    if (oobCtrlMsg.getResult() instanceof Integer) {
      return (Integer) oobCtrlMsg.getResult();
    } else {
      return -1;
    }
  }
View Full Code Here

   *
   * @param msgIn
   * @return result of oob control message
   */
  private boolean sendCheckVideoCM(IMessageInput msgIn) {
    OOBControlMessage oobCtrlMsg = new OOBControlMessage();
    oobCtrlMsg.setTarget(IStreamTypeAwareProvider.KEY);
    oobCtrlMsg.setServiceName("hasVideo");
    msgIn.sendOOBControlMessage(this, oobCtrlMsg);
    if (oobCtrlMsg.getResult() instanceof Boolean) {
      return (Boolean) oobCtrlMsg.getResult();
    } else {
      return false;
    }
  }
View Full Code Here

   * Get number of pending video messages
   * @return          Number of pending video messages
   */
  private long pendingVideoMessages() {
    if (msgOut != null) {
      OOBControlMessage pendingRequest = new OOBControlMessage();
      pendingRequest.setTarget("ConnectionConsumer");
      pendingRequest.setServiceName("pendingVideoCount");
      msgOut.sendOOBControlMessage(this, pendingRequest);
      if (pendingRequest.getResult() != null) {
        return (Long) pendingRequest.getResult();
      } else {
        return 0;
      }
    }
    return 0;
View Full Code Here

        IClientBroadcastStream bs = (IClientBroadcastStream) stream;
        IBroadcastScope scope = bs.getScope().getBroadcastScope(bs.getPublishedName());
        if (scope == null) {
          continue;
        }
        OOBControlMessage setChunkSize = new OOBControlMessage();
        setChunkSize.setTarget("ClientBroadcastStream");
        setChunkSize.setServiceName("chunkSize");
        if (setChunkSize.getServiceParamMap() == null) {
          setChunkSize.setServiceParamMap(new HashMap<String, Object>());
        }
        setChunkSize.getServiceParamMap().put("chunkSize", requestedChunkSize);
        scope.sendOOBControlMessage((IConsumer) null, setChunkSize);
        log.debug("Sending chunksize {} to {}", chunkSize, bs.getProvider());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.red5.server.messaging.OOBControlMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.