Package org.red5.server.messaging

Examples of org.red5.server.messaging.OOBControlMessage


         * 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<Object, Object> paramMap = new HashMap<Object, Object>();
      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<Object, Object> paramMap = new HashMap<Object, Object>();
      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
     */
    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() {
      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;
      }
    }
View Full Code Here

         * to have received.
         *
         * @return          Written bytes and number of bytes the client received
         */
    private Long[] getWriteDelta() {
      OOBControlMessage pendingRequest = new OOBControlMessage();
      pendingRequest.setTarget("ConnectionConsumer");
      pendingRequest.setServiceName("writeDelta");
      msgOut.sendOOBControlMessage(this, pendingRequest);
      if (pendingRequest.getResult() != null) {
        return (Long[]) pendingRequest.getResult();
      } else {
        return new Long[]{Long.valueOf(0), Long.valueOf(0)};
      }
    }
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());
      }
      setChunkSize.getServiceParamMap().put("chunkSize", chunkSize);
      livePipe.sendOOBControlMessage(getProvider(), setChunkSize);
    }
  }
View Full Code Here

                bs.getPublishedName());
        if (scope == null) {
          continue;
        }

        OOBControlMessage setChunkSize = new OOBControlMessage();
        setChunkSize.setTarget("ClientBroadcastStream");
        setChunkSize.setServiceName("chunkSize");
        if (setChunkSize.getServiceParamMap() == null) {
          setChunkSize.setServiceParamMap(new HashMap());
        }
        setChunkSize.getServiceParamMap().put("chunkSize",
            chunkSize.getSize());
        scope.sendOOBControlMessage((IConsumer) null, setChunkSize);
        if (log.isDebugEnabled()) {
          log.debug("Sending chunksize " + chunkSize + " to "
              + bs.getProvider());
View Full Code Here

     * @param msgIn            Message input
     * @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<Object, Object> paramMap = new HashMap<Object, 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<Object, Object> paramMap = new HashMap<Object, 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

            if ( !( event instanceof IRTMPEvent ) ) {
                logger.debug( "skipping non rtmp event: " + event );
                return;
            }

            IRTMPEvent rtmpEvent = (IRTMPEvent) event;

            if ( logger.isDebugEnabled() ) {
                // logger.debug("rtmp event: " + rtmpEvent.getHeader() + ", " +
                // rtmpEvent.getClass().getSimpleName());
            }

            if ( !( rtmpEvent instanceof IStreamData ) ) {
                logger.debug( "skipping non stream data" );
                return;
            }

            if ( rtmpEvent.getHeader().getSize() == 0 ) {
                logger.debug( "skipping event where size == 0" );
                return;
            }

            if ( rtmpEvent instanceof VideoData ) {
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.