Package org.red5.server.api.stream

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


    if (!(conn instanceof IStreamCapableConnection)) {
      return;
    }
    IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
    int streamId = getCurrentStreamId();
    IClientStream stream = streamConn.getStreamById(streamId);
    if (stream == null || !(stream instanceof ISubscriberStream)) {
      return;
    }
    ISubscriberStream subscriberStream = (ISubscriberStream) stream;
    try {
View Full Code Here


    if (!(conn instanceof IStreamCapableConnection)) {
      return;
    }
    IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
    int streamId = getCurrentStreamId();
    IClientStream stream = streamConn.getStreamById(streamId);
    if (stream == null || !(stream instanceof ISubscriberStream)) {
      return;
    }
    ISubscriberStream subscriberStream = (ISubscriberStream) stream;
    subscriberStream.receiveVideo(receive);
View Full Code Here

    if (!(conn instanceof IStreamCapableConnection)) {
      return;
    }
    IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
    int streamId = getCurrentStreamId();
    IClientStream stream = streamConn.getStreamById(streamId);
    if (stream == null || !(stream instanceof ISubscriberStream)) {
      return;
    }
    ISubscriberStream subscriberStream = (ISubscriberStream) stream;
    subscriberStream.receiveAudio(receive);
View Full Code Here

    }

    if ("pendingCount".equals(oobCtrlMsg.getServiceName())) {
      oobCtrlMsg.setResult(conn.getPendingMessages());
    } else if ("pendingVideoCount".equals(oobCtrlMsg.getServiceName())) {
      IClientStream stream = conn.getStreamByChannelId(video.getId());
      if (stream != null) {
        oobCtrlMsg.setResult(conn.getPendingVideoMessages(stream
            .getStreamId()));
      } else {
        oobCtrlMsg.setResult((long) 0);
      }
    } else if ("writeDelta".equals(oobCtrlMsg.getServiceName())) {
View Full Code Here

      final Packet packet = (Packet) in;
      message = packet.getMessage();
      final Header header = packet.getHeader();
      final Channel channel = conn.getChannel(header.getChannelId());
      final IClientStream stream = conn.getStreamById(header
          .getStreamId());

      if (log.isDebugEnabled()) {
        log.debug("Message recieved");
        log.debug("Stream Id: " + header);
View Full Code Here

    // Increase number of sent messages
    conn.messageSent((Packet) message);

    Packet sent = (Packet) message;
    final int channelId = sent.getHeader().getChannelId();
    final IClientStream stream = conn.getStreamByChannelId(channelId);
    // XXX we'd better use new event model for notification
    if (stream != null && (stream instanceof PlaylistSubscriberStream)) {
      ((PlaylistSubscriberStream) stream).written(sent.getMessage());
    }
  }
View Full Code Here

        IStreamService.class, StreamService.class);
    if (streamService != null) {
      synchronized (streams) {
        for (Map.Entry<Integer, IClientStream> entry : streams
            .entrySet()) {
          IClientStream stream = entry.getValue();
          if (stream != null) {
            if (log.isDebugEnabled()) {
              log.debug("Closing stream: {}", stream.getStreamId());
            }
            streamService.deleteStream(this, stream.getStreamId());
            usedStreams--;
          }
        }
        streams.clear();
      }
View Full Code Here

     * Writes packet from event data to RTMP connection.
   *
     * @param event          Event data
     */
    public void write(IRTMPEvent event) {
    final IClientStream stream = connection.getStreamByChannelId(id);
    if (id > 3 && stream == null) {
      log.info("Stream doesn't exist any longer, discarding message "
          + event);
      return;
    }

    final int streamId = (stream == null) ? 0 : stream.getStreamId();
    write(event, streamId);
  }
View Full Code Here

      lock.readLock().unlock();
    }
    if (conn != null) {
      MRTMPPacket.RTMPBody rtmpBody = (MRTMPPacket.RTMPBody) body;
      final int channelId = rtmpBody.getRtmpPacket().getHeader().getChannelId();
      final IClientStream stream = conn.getStreamByChannelId(channelId);
      // XXX we'd better use new event model for notification
      if (stream != null && (stream instanceof PlaylistSubscriberStream)) {
        ((PlaylistSubscriberStream) stream).written(rtmpBody.getRtmpPacket().getMessage());
      }
    } else {
View Full Code Here

      Ping ping) {
    switch (ping.getValue1()) {
      case Ping.CLIENT_BUFFER:
        if (ping.getValue2() != 0) {
          // The client wants to set the buffer time
          IClientStream stream = conn.getStreamById(ping.getValue2());
          int buffer = ping.getValue3();
          if (stream != null) {
            stream.setClientBufferDuration(buffer);
              log.info("Setting client buffer on stream: {}", buffer);
          } else {
            // Remember buffer time to set until stream will be
            // created
            conn.rememberStreamBufferDuration(ping.getValue2(),
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.