Package org.red5.io.object

Examples of org.red5.io.object.Serializer


     *
     * @param output               Output object
     * @throws IOException
     */
    public void serialize(Output output) throws IOException {
    Serializer serializer = new Serializer();
    Map<String, Object> persistentAttributes = new HashMap<String, Object>();
    for (Map.Entry<String, Object> entry : getAttributes().entrySet()) {
      final String name = entry.getKey();
      if (name.startsWith(IPersistable.TRANSIENT_PREFIX)) {
        continue;
      }

      persistentAttributes.put(name, entry.getValue());
    }
    serializer.serialize(output, persistentAttributes);
  }
View Full Code Here


public class SimpleClient implements IRTMPHandler {
 
  public static void main(String[] args) {
    RTMPCodecFactory codecFactory=new RTMPCodecFactory();
    codecFactory.setDeserializer(new Deserializer());
    codecFactory.setSerializer(new Serializer());
    codecFactory.init();
   
    RTMPMinaIoHandler ioHandler=new RTMPMinaIoHandler();
    ioHandler.setCodecFactory(codecFactory);
    ioHandler.setMode(RTMP.MODE_CLIENT);
View Full Code Here

  /** Constructs a new RTMPClient. */
    public RTMPClient() {
    RTMPCodecFactory codecFactory = new RTMPCodecFactory();
    codecFactory.setDeserializer(new Deserializer());
    codecFactory.setSerializer(new Serializer());
    codecFactory.init();
   
    ioHandler = new RTMPMinaIoHandler();
    ioHandler.setCodecFactory(codecFactory);
    ioHandler.setMode(RTMP.MODE_CLIENT);
View Full Code Here

    props.put("audiocodecid", IoConstants.FLAG_FORMAT_MP3);
    if (dataRate > 0) {
      props.put("audiodatarate", dataRate);
    }
    props.put("canSeekToEnd", true);
    out.writeMap(props, new Serializer());
    buf.flip();

    ITag result = new Tag(IoConstants.TYPE_METADATA, 0, buf.limit(), null,
        prevSize);
    result.setBody(buf);
View Full Code Here

    ByteBuffer bb = ByteBuffer.allocate(1000);
    bb.setAutoExpand(true);

    Output out = new Output(bb);
    Serializer ser = new Serializer();
    ser.serialize(out, "onMetaData");
    ser.serialize(out, meta);

    ByteBuffer tmpBody = out.buf().flip();
    int tmpBodySize = out.buf().limit();
    int tmpPreviousTagSize = tag.getPreviousTagSize();
    byte tmpDataType = IoConstants.TYPE_METADATA;
View Full Code Here

   */
  private ITag injectMetaCue(IMetaCue meta, ITag tag) {

    // IMeta meta = (MetaCue) cue;
    Output out = new Output(ByteBuffer.allocate(1000));
    Serializer ser = new Serializer();
    ser.serialize(out, "onCuePoint");
    ser.serialize(out, meta);

    ByteBuffer tmpBody = out.buf().flip();
    int tmpBodySize = out.buf().limit();
    int tmpPreviousTagSize = tag.getPreviousTagSize();
    byte tmpDataType = IoConstants.TYPE_METADATA;
View Full Code Here

            // Audio codec id
            props.put("audiocodecid", (frametype & MASK_SOUND_FORMAT) >> 4);
      setCurrentPosition(old);
    }
    props.put("canSeekToEnd", true);
    out.writeMap(props, new Serializer());
    buf.flip();

    ITag result = new Tag(IoConstants.TYPE_METADATA, 0, buf.limit(), null,
        0);
    result.setBody(buf);
View Full Code Here

    }
  }

  /** {@inheritDoc} */
    public void serialize(Output output) throws IOException {
    Serializer ser = new Serializer();
    ser.serialize(output, getName());
    ser.serialize(output, getAttributes());
  }
View Full Code Here

      result.put(header.required ? (byte) 0x01 : (byte) 0x00);

      ByteBuffer tmp = ByteBuffer.allocate(1024);
      tmp.setAutoExpand(true);
      Output tmpOut = new Output(tmp);
      Serializer tmpSer = new Serializer();
      tmpSer.serialize(tmpOut, header.data);
      tmp.flip();
      // Size of header data
      result.putInt(tmp.limit());
      // Header data
      result.put(tmp);
      tmp.release();
      tmp = null;
    }
    // One body
    result.putShort((short) 1);

    // Method name
    Output.putString(result, method);

    // Client callback for response
    Output.putString(result, "");

    // Serialize parameters
    ByteBuffer tmp = ByteBuffer.allocate(1024);
    tmp.setAutoExpand(true);
    Output tmpOut = new Output(tmp);
    tmpOut.writeArray(params, new Serializer());
    tmp.flip();

    // Store size and parameters
    result.putInt(tmp.limit());
    result.put(tmp);
View Full Code Here

  /**
   * Create internal objects used for reading and writing.
   */
  protected void prepareIO() {
    dataInput = new DataInput(new Input(data), new Deserializer());
    dataOutput = new DataOutput(new Output(data), new Serializer());
  }
View Full Code Here

TOP

Related Classes of org.red5.io.object.Serializer

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.