Package org.red5.server.api.stream

Examples of org.red5.server.api.stream.IClientStream


  public void startNewObjectSyncProcess(String object_id, boolean isStarting){
    try {
     
      log.debug("startNewObjectSyncprocess: "+object_id);
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();
     
      WhiteboardSyncLockObject wSyncLockObject = new WhiteboardSyncLockObject();
      wSyncLockObject.setAddtime(new Date());
      wSyncLockObject.setPublicSID(currentClient.getPublicSID());
      wSyncLockObject.setStarttime(new Date());
     
      Map<String,WhiteboardSyncLockObject> syncListImage = this.whiteBoardObjectListManager.getWhiteBoardObjectSyncListByRoomAndObjectId(room_id,object_id);
      syncListImage.put(currentClient.getPublicSID(), wSyncLockObject);
      this.whiteBoardObjectListManager.setWhiteBoardImagesSyncListByRoomAndObjectId(room_id, object_id, syncListImage);
     
      //Do only send the Token to show the Loading Splash for the initial-Request that starts the loading
      if (isStarting) {
        Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
        for (Set<IConnection> conset : conCollection) {
          for (IConnection conn : conset) {
            if (conn != null) {
              if (conn instanceof IServiceCapableConnection) {
                RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
View Full Code Here


          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = ScopeApplicationAdapter.getInstance()
              .getRoomScope(scopeName);
          ScopeApplicationAdapter.getInstance().roomLeaveByScope(rcl,
              currentScope);

          HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
View Full Code Here

        String scopeName = "hibernate";
        if (rcl.getRoom_id() != null) {
          scopeName = rcl.getRoom_id().toString();
        }
        IScope currentScope = ScopeApplicationAdapter.getInstance()
            .getRoomScope(scopeName);
        ScopeApplicationAdapter.getInstance().roomLeaveByScope(rcl,
            currentScope);

        HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
View Full Code Here

         }
         String scopeName = "hibernate";
         if (rcl.getRoom_id() != null) {
           scopeName = rcl.getRoom_id().toString();
         }
         IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         this.scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope);
        
        
         HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
         messageObj.put(0, "kick");
View Full Code Here

          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         
          HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
          messageObj.put(0, "kick");
         
          this.scopeApplicationAdapter.sendMessageById(messageObj, rcl.getStreamid(), currentScope);
View Full Code Here

    // ------------------------------------------------------------------------

    private void createPlayStream( IPendingServiceCallback callback ) {

        logger.debug( "create play stream" );
        IPendingServiceCallback wrapper = new CreatePlayStreamCallBack( callback );
        invoke( "createStream", null, wrapper );
    }
View Full Code Here

   *
   * @param event          Event data
   */
  public void write(IRTMPEvent event) {
    if (!connection.isClosed()) {
      final IClientStream stream = connection.getStreamByChannelId(id);
      if (id > 3 && stream == null) {
        log.warn("Non-existant stream for channel id: {}, connection id: {} discarding: {}", id, connection.getSessionId());
      }
      // if the stream is non-existant, the event will go out with stream id == 0
      final int streamId = (stream == null) ? 0 : stream.getStreamId();
      write(event, streamId);
    } else {
      log.debug("Associated connection {} is closed, cannot write to channel: {}", connection.getSessionId(), id);
    }
  }
View Full Code Here

        if (lastPingTime > 0) {
          tardiness -= lastPingTime;
        }
        //subtract the buffer time
        int streamId = conn.getStreamIdForChannel(channelId);
        IClientStream stream = conn.getStreamById(streamId);
        if (stream != null) {
          int clientBufferDuration = stream.getClientBufferDuration();
          if (clientBufferDuration > 0) {
            //two times the buffer duration seems to work best with vod
            if (isLive) {
              tardiness -= clientBufferDuration;
            } else {
View Full Code Here

      try {
        message = packet.getMessage();
        final Header header = packet.getHeader();
        final int streamId = header.getStreamId();
        final Channel channel = conn.getChannel(header.getChannelId());
        final IClientStream stream = conn.getStreamById(streamId);
        log.trace("Message received - stream id: {} channel: {} header: {}", streamId, channel.getId(), header);
        // set stream id on the connection
        conn.setStreamId(streamId);
        // increase number of received messages
        conn.messageReceived();
View Full Code Here

      String serviceName = oobCtrlMsg.getServiceName();
      log.trace("Service name: {}", serviceName);
      if ("pendingCount".equals(serviceName)) {
        oobCtrlMsg.setResult(conn.getPendingMessages());
      } else if ("pendingVideoCount".equals(serviceName)) {
        IClientStream stream = conn.getStreamByChannelId(video.getId());
        if (stream != null) {
          oobCtrlMsg.setResult(conn.getPendingVideoMessages(stream.getStreamId()));
        } else {
          oobCtrlMsg.setResult(0L);
        }
      } else if ("writeDelta".equals(serviceName)) {
        //TODO: Revisit the max stream value later
View Full Code Here

TOP

Related Classes of org.red5.server.api.stream.IClientStream

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.