All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.antstreaming.rtsp.protocol.RtspEncoder Maven / Gradle / Ivy

Go to download

Ant Media Server supports RTMP, RTSP, MP4, HLS, WebRTC, Adaptive Streaming, etc.

There is a newer version: 2.10.0
Show newest version
package com.antstreaming.rtsp.protocol;

import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;

public class RtspEncoder extends ProtocolEncoderAdapter {
  public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception {
    String request = message.toString();
    byte[] bs = request.getBytes();
    IoBuffer buffer = IoBuffer.allocate(bs.length, false);
    buffer.put(bs);
    buffer.flip();
    out.write(buffer);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy