Package org.red5.server.api.stream

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


        stream.setBroadcastStreamPublishName(name);
        stream.start();
        created = true;
      }
      if (stream != null && stream instanceof ISubscriberStream) {
        ISubscriberStream subscriberStream = (ISubscriberStream) stream;
        IPlayItem item = simplePlayback.get() ? SimplePlayItem.build(name, start, length) : DynamicPlayItem.build(name, start, 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
          log.warn("Stream instance type: {} is not supported", subscriberStream.getClass().getName());
          return;
        }
        try {
          subscriberStream.play();
        } catch (IOException err) {
          if (created) {
            stream.close();
            streamConn.deleteStreamById(streamId);
          }
View Full Code Here


    if (conn instanceof IStreamCapableConnection) {
      IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
      int streamId = conn.getStreamId();
      IClientStream stream = streamConn.getStreamById(streamId);
      if (stream != null && stream instanceof ISubscriberStream) {
        ISubscriberStream subscriberStream = (ISubscriberStream) stream;
        try {
          subscriberStream.seek(position);
        } catch (OperationNotSupportedException err) {
          sendNSFailed(streamConn, StatusCodes.NS_SEEK_FAILED, "The stream doesn't support seeking.", stream.getName(), streamId);
        }
      }
    }
View Full Code Here

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

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

    int streamId = getCurrentStreamId();
    IClientStream stream = streamConn.getStreamById(streamId);
    if (stream == null || !(stream instanceof ISubscriberStream)) {
      return;
    }
    ISubscriberStream subscriberStream = (ISubscriberStream) stream;
    // pausePlayback can be "null" if "pause" is called without any parameters from flash
    if (pausePlayback == null) {
      pausePlayback = !subscriberStream.isPaused();
    }
    if (pausePlayback) {
      subscriberStream.pause(position);
    } else {
      subscriberStream.resume(position);
    }
  }
View Full Code Here

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

    int streamId = getCurrentStreamId();
    IClientStream stream = streamConn.getStreamById(streamId);
    if (stream == null || !(stream instanceof ISubscriberStream)) {
      return;
    }
    ISubscriberStream subscriberStream = (ISubscriberStream) stream;
    try {
      subscriberStream.seek(position);
    } catch (OperationNotSupportedException err) {
      Status seekFailed = new Status(StatusCodes.NS_SEEK_FAILED);
      seekFailed.setClientid(streamId);
      seekFailed.setDesciption("The stream doesn't support seeking.");
      seekFailed.setLevel("error");
View Full Code Here

    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

    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 ( !( 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.api.stream.ISubscriberStream

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.