Package org.red5.server.api.stream

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


        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

          if (msgIn instanceof IBroadcastScope) {
            // Send initial keyframe
            IClientBroadcastStream stream = (IClientBroadcastStream) ((IBroadcastScope) msgIn)
                .getAttribute(IBroadcastScope.STREAM_ATTRIBUTE);
            if (stream != null && stream.getCodecInfo() != null) {
              IVideoStreamCodec videoCodec = stream
                  .getCodecInfo().getVideoCodec();
              if (videoCodec != null) {
                ByteBuffer keyFrame = videoCodec.getKeyframe();
                if (keyFrame != null) {
                  VideoData video = new VideoData(keyFrame);
                  try {
                    if (withReset) {
                      sendReset();
View Full Code Here

              + body.getClass() + " (type " + body.getDataType() + ")");
        }

        int size = ((IStreamData) body).getData().limit();
        if (body instanceof VideoData) {
          IVideoStreamCodec videoCodec = null;
          if (msgIn instanceof IBroadcastScope) {
            IClientBroadcastStream stream = (IClientBroadcastStream) ((IBroadcastScope) msgIn)
                .getAttribute(IBroadcastScope.STREAM_ATTRIBUTE);
            if (stream != null && stream.getCodecInfo() != null) {
              videoCodec = stream.getCodecInfo().getVideoCodec();
            }
          }

          if (videoCodec == null || videoCodec.canDropFrames()) {
            if (state == State.PAUSED) {
              // The subscriber paused the video
              videoFrameDropper.dropPacket(rtmpMessage);
              return;
            }
View Full Code Here

     * Create and return new video codec applicable for byte buffer data
     * @param data                 Byte buffer data
     * @return                     Video codec
     */
  public IVideoStreamCodec getVideoCodec(ByteBuffer data) {
    IVideoStreamCodec result = null;
    for (IVideoStreamCodec storedCodec: codecs) {
      IVideoStreamCodec codec;
      // XXX: this is a bit of a hack to create new instances of the
      // configured
      //      video codec for each stream
      try {
        codec = storedCodec.getClass().newInstance();
      } catch (Exception e) {
        log.error("Could not create video codec instance.", e);
        continue;
      }

      log.info("Trying codec " + codec);
      if (codec.canHandleData(data)) {
        result = codec;
        break;
      }
    }

View Full Code Here

      } else {
        audioTime = rtmpEvent.getTimestamp();
      }
      eventTime = audioTime;
    } else if (rtmpEvent instanceof VideoData) {
      IVideoStreamCodec videoStreamCodec = null;
      if (videoCodecFactory != null && checkVideoCodec) {
        videoStreamCodec = videoCodecFactory
            .getVideoCodec(((VideoData) rtmpEvent).getData());
        if (codecInfo instanceof StreamCodecInfo) {
          ((StreamCodecInfo) codecInfo)
              .setVideoCodec(videoStreamCodec);
        }
        checkVideoCodec = false;
      } else if (codecInfo != null) {
        videoStreamCodec = codecInfo.getVideoCodec();
      }

      if (videoStreamCodec != null) {
        videoStreamCodec.addData(((VideoData) rtmpEvent).getData());
      }

      if (info != null) {
        info.setHasVideo(true);
      }
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.IVideoStreamCodec

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.