Package org.red5.server.net.rtmp.event

Examples of org.red5.server.net.rtmp.event.AudioData


    if (reader.hasMoreTags()) {
      ITag tag = reader.readTag();
      IRTMPEvent msg;
      switch (tag.getDataType()) {
        case TYPE_AUDIO_DATA:
          msg = new AudioData(tag.getBody());
          break;
        case TYPE_VIDEO_DATA:
          msg = new VideoData(tag.getBody());
          break;
        case TYPE_INVOKE:
View Full Code Here


        startPullPushThread = true;
      }
     
      if (!messageSent) {
        // Send blank audio packet to notify client about new position
        AudioData audio = new AudioData();
        audio.setTimestamp(seekPos);
        audio.setHeader(new Header());
        audio.getHeader().setTimer(seekPos);
        audio.getHeader().setTimerRelative(false);
        RTMPMessage audioMessage = new RTMPMessage();
        audioMessage.setBody(audio);
        lastMessage = audio;
        doPushMessage(audioMessage);
      }
View Full Code Here

                  // The user doesn't want to get audio packets
                  ((IStreamData) body).getData().release();
                  if (sendBlankAudio) {
                    // Send reset audio packet
                    sendBlankAudio = false;
                    body = new AudioData();
                    // We need a zero timestamp
                    if (lastMessage != null) {
                      body.setTimestamp(lastMessage.getTimestamp()-timestampOffset);
                    } else {
                      body.setTimestamp(-timestampOffset);
View Full Code Here

          }
        } else if (body instanceof AudioData) {
          if (!receiveAudio && sendBlankAudio) {
            // Send blank audio packet to reset player
            sendBlankAudio = false;
            body = new AudioData();
            if (lastMessage != null) {
              body.setTimestamp(lastMessage.getTimestamp());
            } else {
              body.setTimestamp(0);
            }
View Full Code Here

    ITag tag = reader.readTag();

    IRTMPEvent msg;
    switch (tag.getDataType()) {
      case TYPE_AUDIO_DATA:
        msg = new AudioData(tag.getBody());
        break;
      case TYPE_VIDEO_DATA:
        msg = new VideoData(tag.getBody());
        break;
      case TYPE_INVOKE:
View Full Code Here

          videoData.setHeader(header);
          videoData.setTimestamp(header.getTimer());
          video.write(videoData);
          break;
        case Constants.TYPE_AUDIO_DATA:
          AudioData audioData = new AudioData(((AudioData) msg)
              .getData().asReadOnlyBuffer());
          audioData.setHeader(header);
          audioData.setTimestamp(header.getTimer());
          audio.write(audioData);
          break;
        case Constants.TYPE_PING:
          Ping ping = new Ping(((Ping) msg).getValue1(), ((Ping) msg)
              .getValue2(), ((Ping) msg).getValue3(),
View Full Code Here

    ITag tag = reader.readTag();
    IRTMPEvent msg = null;
    int timestamp = tag.getTimestamp();
    switch (tag.getDataType()) {
      case Constants.TYPE_AUDIO_DATA:
        msg = new AudioData(tag.getBody());
        break;
      case Constants.TYPE_VIDEO_DATA:
        msg = new VideoData(tag.getBody());
        break;
      case Constants.TYPE_INVOKE:
View Full Code Here

    return new BytesRead(in.getInt());
  }

  /** {@inheritDoc} */
  public AudioData decodeAudioData(ByteBuffer in) {
    return new AudioData(in.asReadOnlyBuffer());
  }
View Full Code Here

    rtpStreamReceiver = new RtpStreamReceiver(socket, transcoder.getIncomingEncodedFrameSize());
    rtpStreamReceiver.setRtpStreamReceiverListener(this);
    listenStreamName = "speaker_" + System.currentTimeMillis();   
    mBuffer = IoBuffer.allocate(1024);
    mBuffer = mBuffer.setAutoExpand(true);
        audioData = new AudioData();
    transcoder.setTranscodedAudioListener(this);
  }
View Full Code Here

      System.arraycopy(audio, 0, copy, 0, audio.length );
       
        buffer.put(copy);       
        buffer.flip();

        AudioData audioData = new AudioData(buffer);
        audioData.setTimestamp((int)(System.currentTimeMillis() - start) );
        listener.handleTranscodedAudioData(audioData);
    }   
View Full Code Here

TOP

Related Classes of org.red5.server.net.rtmp.event.AudioData

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.