Search in sources :

Example 16 with Input

use of com.google.cloud.video.livestream.v1.Input in project red5-io by Red5.

the class AMF3IOTest method testVectorUIntInput.

@Test
public void testVectorUIntInput() {
    log.debug("\n Testing Vector<uint>");
    // 0E090000000002000007D0FFFFFFFF00000000
    byte[] v = new byte[] { (byte) 0x0E, (byte) 0x09, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x07, (byte) 0xD0, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 };
    in = new Input(IoBuffer.wrap(v));
    List<Object> vectorOut = Deserializer.deserialize(in, null);
    // [2, 2000, 4294967295, 0]
    assertNotNull(vectorOut);
    assertEquals(vectorOut.size(), 4);
    for (int i = 0; i < vectorOut.size(); i++) {
        System.err.println("Vector: " + vectorOut.get(i));
    }
    resetOutput();
}
Also used : Input(org.red5.io.amf3.Input) Test(org.junit.Test)

Example 17 with Input

use of com.google.cloud.video.livestream.v1.Input in project red5-io by Red5.

the class AMF3IOTest method testVectorStringInput.

@SuppressWarnings("unused")
@Test
public void testVectorStringInput() {
    log.debug("\n Testing Vector<String>");
    // [Paul, ]
    byte[] v = new byte[] { (byte) 0x10, (byte) 0x05, (byte) 0x00, (byte) 0x01, (byte) 0x06, (byte) 0x09, (byte) 0x50, (byte) 0x61, (byte) 0x75, (byte) 0x6c, (byte) 0x06, (byte) 0x01 };
    // [Paul, Paul]
    byte[] v1 = new byte[] { (byte) 0x10, (byte) 0x05, (byte) 0x00, (byte) 0x01, (byte) 0x06, (byte) 0x09, (byte) 0x50, (byte) 0x61, (byte) 0x75, (byte) 0x6c, (byte) 0x06, (byte) 0x00 };
    // [Paul, Paul, Paul]
    byte[] v2 = new byte[] { (byte) 0x10, (byte) 0x07, (byte) 0x00, (byte) 0x01, (byte) 0x06, (byte) 0x09, (byte) 0x50, (byte) 0x61, (byte) 0x75, (byte) 0x6c, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x00 };
    // [Paul, Tawnya]
    byte[] v3 = new byte[] { (byte) 0x10, (byte) 0x05, (byte) 0x00, (byte) 0x01, (byte) 0x06, (byte) 0x09, (byte) 0x50, (byte) 0x61, (byte) 0x75, (byte) 0x6c, (byte) 0x06, (byte) 0x0d, (byte) 0x54, (byte) 0x61, (byte) 0x77, (byte) 0x6e, (byte) 0x79, (byte) 0x61 };
    // [1.0, 3.0, aaa, 5.0, aaa, aaa, 5.0, bb, bb]
    byte[] v4 = new byte[] { (byte) 0x10, (byte) 0x13, (byte) 0x00, (byte) 0x01, (byte) 0x04, (byte) 0x01, (byte) 0x04, (byte) 0x03, (byte) 0x06, (byte) 0x07, (byte) 0x61, (byte) 0x61, (byte) 0x61, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x05, (byte) 0x62, (byte) 0x62, (byte) 0x06, (byte) 0x02 };
    // [1.0, 3.0, aaa, [1, 2]]
    byte[] v5 = new byte[] { (byte) 0x10, (byte) 0x09, (byte) 0x00, (byte) 0x01, (byte) 0x04, (byte) 0x01, (byte) 0x04, (byte) 0x03, (byte) 0x06, (byte) 0x07, (byte) 0x61, (byte) 0x61, (byte) 0x61, (byte) 0x0d, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02 };
    in = new Input(IoBuffer.wrap(v5));
    List<Object> vectorOut = Deserializer.deserialize(in, null);
    // [Paul, ]
    assertNotNull(vectorOut);
    // assertEquals(vectorOut.size(), 4);
    for (int i = 0; i < vectorOut.size(); i++) {
        System.err.println("Vector: " + vectorOut.get(i));
    }
    resetOutput();
}
Also used : Input(org.red5.io.amf3.Input) Test(org.junit.Test)

Example 18 with Input

use of com.google.cloud.video.livestream.v1.Input in project red5-io by Red5.

the class AMF3IOTest method testVectorNumberInput.

@Test
public void testVectorNumberInput() {
    log.debug("\n Testing Vector<Number>");
    // 0F0F003FF199999999999ABFF199999999999A7FEFFFFFFFFFFFFF0000000000000001FFF8000000000000FFF00000000000007FF0000000000000
    byte[] v = new byte[] { (byte) 0x0F, (byte) 0x0F, (byte) 0x00, (byte) 0x3F, (byte) 0xF1, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x9A, (byte) 0xBF, (byte) 0xF1, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x99, (byte) 0x9A, (byte) 0x7F, (byte) 0xEF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0xFF, (byte) 0xF8, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xFF, (byte) 0xF0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x7F, (byte) 0xF0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 };
    in = new Input(IoBuffer.wrap(v));
    List<Double> vectorOut = Deserializer.deserialize(in, null);
    // [1.1, -1.1, 1.7976931348623157E308, 4.9E-324, NaN, -Infinity, Infinity]
    assertNotNull(vectorOut);
    assertEquals(vectorOut.size(), 7);
    for (int i = 0; i < vectorOut.size(); i++) {
        System.err.println("Vector: " + vectorOut.get(i));
    }
    resetOutput();
}
Also used : Input(org.red5.io.amf3.Input) Test(org.junit.Test)

Aggregations

LivestreamServiceClient (com.google.cloud.video.livestream.v1.LivestreamServiceClient)9 Input (org.red5.io.amf3.Input)9 Input (com.google.cloud.video.livestream.v1.Input)5 Test (org.junit.Test)5 Channel (com.google.cloud.video.livestream.v1.Channel)3 AudioStream (com.google.cloud.video.livestream.v1.AudioStream)2 VideoStream (com.google.cloud.video.livestream.v1.VideoStream)2 Output (org.red5.io.amf3.Output)2 NotFoundException (com.google.api.gax.rpc.NotFoundException)1 InputName (com.google.cloud.video.livestream.v1.InputName)1 IOException (java.io.IOException)1 Map (java.util.Map)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 IoBuffer (org.apache.mina.core.buffer.IoBuffer)1 ObjectMap (org.red5.io.utils.ObjectMap)1 RemotingHeader (org.red5.server.net.remoting.RemotingHeader)1