Package org.red5.server.api.stream

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


         }
         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

        }
        subscriberStream.onChange(StreamState.STOPPED, currentItem);
        clearWaitJobs();
        cancelDeferredStop();
        if (subscriberStream instanceof IPlaylistSubscriberStream) {
          IPlaylistSubscriberStream pss = (IPlaylistSubscriberStream) subscriberStream;
          if (!pss.hasMoreItems()) {
            releasePendingMessage();
            sendCompleteStatus();
            bytesSent.set(0);
            sendClearPing();
            sendStopStatus(currentItem);
          } else {
            if (lastMessageTs > 0) {
              // remember last timestamp so we can generate correct headers in playlists.
              timestampOffset = lastMessageTs;
            }
            pss.nextItem();
          }
        }
        break;
      case CLOSED:
        clearWaitJobs();
View Full Code Here

        int value = (Integer) reset;
        switch (value) {
          case 0:
            //adds the stream to a playlist
            IStreamCapableConnection streamConn = (IStreamCapableConnection) Red5.getConnectionLocal();
            IPlaylistSubscriberStream playlistStream = (IPlaylistSubscriberStream) streamConn.getStreamById(streamConn.getStreamId());
            IPlayItem item = SimplePlayItem.build(name);
            playlistStream.addItem(item);
            play(name, start, length, false);
            break;
          case 2:
            //maintains the playlist and returns all stream messages at once, rather than at intervals
View Full Code Here

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

        } finally {
          // clean up
          simplePlayback.remove();
        }
      } else if ("append".equals(transition) || "appendAndWait".equals(transition)) {
        IPlaylistSubscriberStream playlistStream = (IPlaylistSubscriberStream) streamConn.getStreamById(streamId);
        IPlayItem item = SimplePlayItem.build(streamName);
        playlistStream.addItem(item);
        if ("append".equals(transition)) {
          play(streamName, start, length, false);
        }
      } else if ("swap".equals(transition)) {
        IPlaylistSubscriberStream playlistStream = (IPlaylistSubscriberStream) streamConn.getStreamById(streamId);
        IPlayItem item = SimplePlayItem.build(streamName);
        int itemCount = playlistStream.getItemSize();
        for (int i = 0; i < itemCount; i++) {
          IPlayItem tmpItem = playlistStream.getItem(i);
          if (tmpItem.getName().equals(oldStreamName)) {
            if (!playlistStream.replace(tmpItem, item)) {
              log.warn("Playlist item replacement failed");
              sendNSFailed(streamConn, StatusCodes.NS_PLAY_FAILED, "Playlist swap failed.", streamName, streamId);
            }
            break;
          }
View Full Code Here

    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
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

            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.IPlaylistSubscriberStream

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.