Package org.red5.server.stream.message

Examples of org.red5.server.stream.message.RTMPMessage


   * Take a message from this buffer. The message count decreases.
   *
   * @return <tt>null</tt> if buffer is empty.
   */
  public RTMPMessage takeMessage() {
    RTMPMessage message = messageQueue.poll();
    if (message != null) {
      IRTMPEvent body = message.getBody();
      if (!(body instanceof IStreamData)) {
        throw new RuntimeException("expected IStreamData but got "
            + body);
      }

View Full Code Here


      streamTracker.reset();
    } else if (message instanceof StatusMessage) {
      StatusMessage statusMsg = (StatusMessage) message;
      data.sendStatus(statusMsg.getBody());
    } else if (message instanceof RTMPMessage) {
      RTMPMessage rtmpMsg = (RTMPMessage) message;
      IRTMPEvent msg = rtmpMsg.getBody();
      Header header = new Header();
      int timestamp = streamTracker.add(msg);
      if (timestamp < 0) {
        log.warn("Skipping message with negative timestamp.");
        return;
View Full Code Here

    // Notify event listeners
    checkSendNotifications(event);

    // Create new RTMP message, initialize it and push through pipe
    RTMPMessage msg = new RTMPMessage();
    msg.setBody(rtmpEvent);
    msg.getBody().setTimestamp(eventTime);
    try {
      if (livePipe != null) {
        livePipe.pushMessage(msg);
      }
      recordPipe.pushMessage(msg);
View Full Code Here

        log.warn("Unexpected type? " + tag.getDataType());
        msg = new Unknown(tag.getDataType(), tag.getBody());
        break;
    }
    msg.setTimestamp(timestamp);
    RTMPMessage rtmpMsg = new RTMPMessage();
    rtmpMsg.setBody(msg);
    return rtmpMsg;
  }
View Full Code Here

    //      log.trace("dispatchEvent(event:{})", event);
    //      System.out.println("dispatchEvent(event:)" + event);
    if (event instanceof IRTMPEvent) {
      IRTMPEvent rtmpEvent = (IRTMPEvent) event;
      if (livePipe != null) {
        RTMPMessage msg = RTMPMessage.build(rtmpEvent);
        //RTMPMessage msg = new RTMPMessage();
        //msg.setBody(rtmpEvent);
       
        if (creationTime == null)
          creationTime = (long)rtmpEvent.getTimestamp();
View Full Code Here

  public void dispatchEvent(IEvent event) {
//    log.trace("dispatchEvent(event:{})", event);
    if (event instanceof IRTMPEvent) {
      IRTMPEvent rtmpEvent = (IRTMPEvent) event;
      if (livePipe != null) {
        RTMPMessage msg = RTMPMessage.build(rtmpEvent);
        //RTMPMessage msg = new RTMPMessage();
        //msg.setBody(rtmpEvent);
         
        if (creationTime == null)
          creationTime = (long)rtmpEvent.getTimestamp();
View Full Code Here

      buffer.clear();
      buffer.put(video);
      buffer.flip();
 
      log.trace("Video frame sent :: " + ts);
      RTMPMessage rtmpMsg = RTMPMessage.build(new VideoData(buffer), ts);
      client.publishStreamData(streamId, rtmpMsg);
    }
  }
View Full Code Here

      //      log.trace("dispatchEvent(event:{})", event);
      //      System.out.println("dispatchEvent(event:screenVideo)");
      if (event instanceof IRTMPEvent) {
        IRTMPEvent rtmpEvent = (IRTMPEvent) event;
        if (livePipe != null) {
          RTMPMessage msg = RTMPMessage.build(rtmpEvent);
         
          if (creationTime == null)
            creationTime = (long)rtmpEvent.getTimestamp();
         
          try {
View Full Code Here

    buffer.flip();

    VideoData videoData = new VideoData(buffer);
    videoData.setTimestamp((int) ts);

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

          proxy.start(id, "live", null);
          streamingProxyMap.put(publishName, proxy);
          stream.addStreamListener(new IStreamListener() {
        public void packetReceived(IBroadcastStream stream, IStreamPacket packet) {
          try {
            RTMPMessage m = RTMPMessage.build((IRTMPEvent)packet, packet.getTimestamp());
                proxy.pushMessage(null, m);
          } catch (Exception e) {
            log.error("Exception while sending proxy message", e);
          }
        }
View Full Code Here

TOP

Related Classes of org.red5.server.stream.message.RTMPMessage

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.