Package org.red5.server.net.protocol

Examples of org.red5.server.net.protocol.ProtocolException


        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

      if (stream.getStreamListeners() != null) {
       
        for (Iterator<IStreamListener> iter = stream.getStreamListeners().iterator();iter.hasNext();) {
         
          IStreamListener iStreamListener = iter.next();
         
          ListenerAdapter listenerAdapter = (ListenerAdapter) iStreamListener;
         
          log.debug("Stream Closing ?? "+listenerAdapter.getFlvRecordingMetaDataId()+ " " +flvRecordingMetaDataId);
         
View Full Code Here

      }
    } catch (ProtocolException pe) {
      // raise to caller unmodified
      throw pe;
    } catch (RuntimeException e) {
      throw new ProtocolException("Error during decoding", e);
    } finally {
      if (log.isTraceEnabled()) {
        log.trace("Decoding finished for {}", conn.getSessionId());
      }
    }
View Full Code Here

      headerValue = headerByte & 0xff;
      byteCount = 1;
    }
    final int channelId = RTMPUtils.decodeChannelId(headerValue, byteCount);
    if (channelId < 0) {
      throw new ProtocolException("Bad channel id: " + channelId);
    }
    RTMP rtmp = conn.getState();
    // Get the header size and length
    byte headerSize = RTMPUtils.decodeHeaderSize(headerValue, byteCount);
    int headerLength = RTMPUtils.getHeaderLength(headerSize);
    Header lastHeader = rtmp.getLastReadHeader(channelId);
    headerLength += byteCount - 1;
    switch (headerSize) {
      case HEADER_NEW:
      case HEADER_SAME_SOURCE:
      case HEADER_TIMER_CHANGE:
        if (remaining >= headerLength) {
          int timeValue = RTMPUtils.readUnsignedMediumInt(in);
          if (timeValue == 0xffffff) {
            headerLength += 4;
          }
        }
        break;
      case HEADER_CONTINUE:
        if (lastHeader != null && lastHeader.getExtendedTimestamp() != 0) {
          headerLength += 4;
        }
        break;
      default:
        throw new ProtocolException("Unexpected header size " + headerSize + " check for error");
    }
    if (remaining < headerLength) {
      log.trace("Header too small (hlen: {}), buffering. remaining: {}", headerLength, remaining);
      in.position(position);
      state.bufferDecoding(headerLength);
      return null;
    }
    // Move the position back to the start
    in.position(position);
    final Header header = decodeHeader(in, lastHeader);
    if (header == null) {
      throw new ProtocolException("Header is null, check for error");
    }
    rtmp.setLastReadHeader(channelId, header);
    // check to see if this is a new packets or continue decoding an existing one
    Packet packet = rtmp.getLastReadPacket(channelId);
    if (packet == null) {
View Full Code Here

      }
    } catch (ProtocolException pe) {
      // Raise to caller unmodified
      throw pe;
    } catch (RuntimeException e) {
      throw new ProtocolException("Error during decoding", e);
    }
  }
View Full Code Here

      byteCount = 1;
    }
    final int channelId = RTMPUtils.decodeChannelId(headerValue, byteCount);

    if (channelId < 0) {
      throw new ProtocolException("Bad channel id: " + channelId);
    }

    // Get the header size and length
    int headerLength = RTMPUtils.getHeaderLength(RTMPUtils.decodeHeaderSize(headerValue, byteCount));
    headerLength += byteCount - 1;

    if (headerLength > remaining) {
      if (log.isDebugEnabled()) {
        log.debug("Header too small, buffering. remaining: " + remaining);
      }
      in.position(position);
      rtmp.bufferDecoding(headerLength);
      return null;
    }

    // Move the position back to the start
    in.position(position);

    final Header header = decodeHeader(in, rtmp
        .getLastReadHeader(channelId));

    if (header == null) {
      throw new ProtocolException("Header is null, check for error");
    }

    // Save the header
    rtmp.setLastReadHeader(channelId, header);
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.net.protocol.ProtocolException

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.