Package org.red5.server.stream.codec

Examples of org.red5.server.stream.codec.StreamCodecInfo


    log.debug("Name of CLient and Stream to be recorded: "+broadcastid);   
    //log.debug("Application.getInstance()"+Application.getInstance());
    log.debug("Scope "+conn);
    log.debug("Scope "+conn.getScope());
    // Get a reference to the current broadcast stream.
    ClientBroadcastStream stream = (ClientBroadcastStream) ScopeApplicationAdapter.getInstance()
        .getBroadcastStream(conn.getScope(), broadcastid);
    try {
      // Save the stream to disk.
      stream.saveAs(streamName, false);
    } catch (Exception e) {
      log.error("Error while saving stream: " + streamName, e);
    }
  }
View Full Code Here


      log.debug("Name of CLient and Stream to be recorded: "+broadcastid);   
      //log.debug("Application.getInstance()"+Application.getInstance());
      log.debug("Scope "+conn);
      log.debug("Scope "+conn.getScope());
      // Get a reference to the current broadcast stream.
      ClientBroadcastStream stream = (ClientBroadcastStream) ScopeApplicationAdapter.getInstance()
          .getBroadcastStream(conn.getScope(), broadcastid);
   
     
      // Save the stream to disk.
      if (isScreenData) {
        stream.addStreamListener(new StreamScreenListener(streamName, conn.getScope(), flvRecordingMetaDataId, isScreenData, isInterview));
      } else {
          
        log.debug("### stream "+stream);
        log.debug("### streamName "+streamName);
        log.debug("### conn.getScope() "+conn.getScope());
        log.debug("### flvRecordingMetaDataId "+flvRecordingMetaDataId);
        log.debug("### isScreenData "+isScreenData);
        log.debug("### isInterview "+isInterview);
       
        if (isInterview) {
         
          //Additionally record the Video Signal
          stream.addStreamListener(new StreamScreenListener("AV_"+streamName, conn.getScope(), flvRecordingMetaDataId, isScreenData, isInterview));
        }
       
        stream.addStreamListener(new StreamAudioListener(streamName, conn.getScope(), flvRecordingMetaDataId, isScreenData, isInterview));
      }
      //Just for Debug Purpose
      //stream.saveAs(streamName+"_DEBUG", false);
    } catch (Exception e) {
      log.error("Error while saving stream: " + streamName, e);
View Full Code Here

     
      if (streamToClose == null) {
        log.debug("Could not aquire Stream, maybe already closed");
      }
     
      ClientBroadcastStream stream = (ClientBroadcastStream) streamToClose;
      // Stop recording.
      stream.stopRecording();
     
    } catch (Exception err) {
      log.error("[stopRecordingShow]",err);
    }
  }
View Full Code Here

     
      if (streamToClose == null) {
        log.debug("Could not aquire Stream, maybe already closed");
      }
     
      ClientBroadcastStream stream = (ClientBroadcastStream) streamToClose;

      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);
         
          if (listenerAdapter.getFlvRecordingMetaDataId().equals(flvRecordingMetaDataId)) {
            log.debug("Stream Closing :: "+flvRecordingMetaDataId);
            listenerAdapter.closeStream();
          }
         
        }
       
        for (IStreamListener iStreamListener : stream.getStreamListeners()) {
          stream.removeStreamListener(iStreamListener);
        }
     
      }
     
      // Just for Debugging
View Full Code Here

    log.debug("Name of CLient and Stream to be recorded: "+broadcastid);   
    //log.debug("Application.getInstance()"+Application.getInstance());
    log.debug("Scope "+conn);
    log.debug("Scope "+conn.getScope());
    // Get a reference to the current broadcast stream.
    ClientBroadcastStream stream = (ClientBroadcastStream) ScopeApplicationAdapter.getInstance()
        .getBroadcastStream(conn.getScope(), Long.valueOf(broadcastid).toString());
    try {
      // Save the stream to disk.
      stream.saveAs(streamName, false);
    } catch (Exception e) {
      log.error("Error while saving stream: " + streamName, e);
    }
  }
View Full Code Here

   * @param conn
   */
  public static void stopRecordingShow(IConnection conn, long broadcastId) throws Exception {
    log.debug("** stopRecordingShow: "+conn);
    log.debug("### Stop recording show for broadcastId: "+ broadcastId + " || " + conn.getScope().getContextPath());
    ClientBroadcastStream stream = (ClientBroadcastStream) ScopeApplicationAdapter.getInstance().
                        getBroadcastStream(conn.getScope(), Long.valueOf(broadcastId).toString());
    // Stop recording.
    stream.stopRecording();
  }
View Full Code Here

      return;
    }

    // Get stream codec
    IStreamCodecInfo codecInfo = getCodecInfo();
    StreamCodecInfo info = null;
    if (codecInfo instanceof StreamCodecInfo) {
      info = (StreamCodecInfo) codecInfo;
    }

    IRTMPEvent rtmpEvent;
    try {
      rtmpEvent = (IRTMPEvent) event;
    } catch (ClassCastException e) {
      log.error("Class cast exception in event dispatch", e);
      return;
    }
    int eventTime = -1;
    // If this is first packet save it's timestamp
    if (firstPacketTime == -1) {
      firstPacketTime = rtmpEvent.getTimestamp();
    }
    if (rtmpEvent instanceof AudioData) {
      if (info != null) {
        info.setHasAudio(true);
      }
      if (rtmpEvent.getHeader().isTimerRelative()) {
        audioTime += rtmpEvent.getTimestamp();
      } 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);
      }
      if (rtmpEvent.getHeader().isTimerRelative()) {
        videoTime += rtmpEvent.getTimestamp();
      } else {
        videoTime = rtmpEvent.getTimestamp();
View Full Code Here

    // Clear record flag
    recordParamMap.put("record", null);
    recordPipe.subscribe((IProvider) this, recordParamMap);
    recording = false;
    recordingFilename = null;
    setCodecInfo(new StreamCodecInfo());
    closed = false;
    bytesReceived = 0;
    creationTime = System.currentTimeMillis();
  }
View Full Code Here

//        if ( kt < 10 ) {
//            logger.debug( "+++ " + videoData );
//            System.out.println( "+++ " + videoData);
//        }

        RTMPMessage rtmpMsg = new RTMPMessage();
        rtmpMsg.setBody( videoData );
        publishStreamData( publishStreamId, rtmpMsg );
    }
View Full Code Here

//        if ( kt < 10 ) {
//            logger.debug( "+++ " + videoData );
//            System.out.println( "+++ " + videoData);
//        }

        RTMPMessage rtmpMsg = new RTMPMessage();
        rtmpMsg.setBody( videoData );
        publishStreamData( publishStreamId, rtmpMsg );
    }
View Full Code Here

TOP

Related Classes of org.red5.server.stream.codec.StreamCodecInfo

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.