Examples of IClientStream


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

          return;
        }
      }
    }
   
    IClientStream stream = streamConn.getStreamById(streamId);
    boolean created = false;
    if (stream == null) {
      stream = streamConn.newPlaylistSubscriberStream(streamId);
      stream.start();
      created = true;
    }
    if (!(stream instanceof ISubscriberStream)) {
      return;
    }
    ISubscriberStream subscriberStream = (ISubscriberStream) stream;
    SimplePlayItem item = new SimplePlayItem();
    item.setName(name);
    item.setStart(start);
    item.setLength(length);
    if (subscriberStream instanceof IPlaylistSubscriberStream) {
      IPlaylistSubscriberStream playlistStream = (IPlaylistSubscriberStream) subscriberStream;
      if (flushPlaylist) {
        playlistStream.removeAllItems();
      }
      playlistStream.addItem(item);
    } else if (subscriberStream instanceof ISingleItemSubscriberStream) {
      ISingleItemSubscriberStream singleStream = (ISingleItemSubscriberStream) subscriberStream;
      singleStream.setPlayItem(item);
    } else {
      // not supported by this stream service
      return;
    }
    try {
      subscriberStream.play();
    } catch (IOException err) {
      if (created) {
        stream.close();
        streamConn.deleteStreamById(streamId);
      }
      sendNSFailed((RTMPConnection) streamConn, err.getMessage(), name, streamId);
    }
  }
View Full Code Here

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.stop();
      }
    }
  }
View Full Code Here

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 instanceof IBroadcastStream)) {
        return;
      }
      IBroadcastStream bs = (IBroadcastStream) stream;
      if (bs.getPublishedName() == null) {
View Full Code Here

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

      Channel channel = ((RTMPConnection) streamConn).getChannel((byte) (4 + ((streamId-1) * 5)));
      channel.sendStatus(badName);
      return;
    }

    IClientStream stream = streamConn.getStreamById(streamId);
    if (stream != null && !(stream instanceof IClientBroadcastStream)) {
      return;
    }
    boolean created = false;
    if (stream == null) {
View Full Code Here

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

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;
    subscriberStream.receiveVideo(receive);
View Full Code Here

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;
    subscriberStream.receiveAudio(receive);
View Full Code Here

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

    }

    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

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

      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

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

    // 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
TOP
Copyright © 2018 www.massapi.com. 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.