Search in sources :

Example 1 with FakeSink

use of streamer.debug.FakeSink in project cloudstack by apache.

the class PipelineImpl method main.

/**
 * Example.
 */
public static void main(String[] args) {
    // System.setProperty("streamer.Link.debug", "true");
    // System.setProperty("streamer.Element.debug", "true");
    // System.setProperty("streamer.Pipeline.debug", "true");
    Pipeline pipeline = new PipelineImpl("main");
    // Create elements
    pipeline.add(new FakeSource("source") {

        {
            incommingBufLength = 3;
            numBuffers = 10;
            delay = 100;
        }
    });
    pipeline.add(new BaseElement("tee"));
    pipeline.add(new FakeSink("sink") {

        {
            verbose = true;
        }
    });
    pipeline.add(new FakeSink("sink2") {

        {
            verbose = true;
        }
    });
    // Link elements
    pipeline.link("source", "tee", "sink");
    pipeline.link("tee >out2", "sink2");
    // Run main loop
    pipeline.runMainLoop("source", STDOUT, false, false);
}
Also used : FakeSink(streamer.debug.FakeSink) FakeSource(streamer.debug.FakeSource)

Example 2 with FakeSink

use of streamer.debug.FakeSink in project cloudstack by apache.

the class ServerBitmapUpdate method main.

/**
 * Example.
 */
public static void main(String[] args) {
    ByteBuffer packet = new ByteBuffer(new byte[] { 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x00, 0x01, 0x04, 0x0a, 0x00, 0x0c, (byte) 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
    Element bitmap = new ServerBitmapUpdate("bitmap") {

        {
            verbose = true;
        }
    };
    FakeSink fakeSink = new FakeSink("sink") {

        {
            verbose = true;
        }
    };
    Pipeline pipeline = new PipelineImpl("test");
    // BufferedImageCanvas canvas = new BufferedImageCanvas(1024, 768);
    // Element adapter = new AwtRdpAdapter("test",canvas );
    // pipeline.addAndLink(bitmap, adapter);
    pipeline.addAndLink(bitmap, fakeSink);
    bitmap.handleData(packet, null);
}
Also used : FakeSink(streamer.debug.FakeSink) PipelineImpl(streamer.PipelineImpl) Element(streamer.Element) BaseElement(streamer.BaseElement) ByteBuffer(streamer.ByteBuffer) Pipeline(streamer.Pipeline)

Example 3 with FakeSink

use of streamer.debug.FakeSink in project cloudstack by apache.

the class InputStreamSource method main.

/**
 * Example.
 */
public static void main(String[] args) {
    InputStream is = new ByteArrayInputStream(new byte[] { 1, 2, 3 });
    InputStreamSource source = new InputStreamSource("source") {

        {
            verbose = true;
        }
    };
    Element fakeSink = new FakeSink("sink") {

        {
            verbose = true;
        }
    };
    Link link = new SyncLink() {

        {
            verbose = true;
        }
    };
    source.setLink(STDOUT, link, Direction.OUT);
    fakeSink.setLink(STDIN, link, Direction.IN);
    source.setInputStream(is);
    link.sendEvent(Event.STREAM_START, Direction.OUT);
    link.run();
}
Also used : FakeSink(streamer.debug.FakeSink) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream)

Example 4 with FakeSink

use of streamer.debug.FakeSink in project cloudstack by apache.

the class ServerDemandActivePDU method main.

/**
 * Example.
 */
public static void main(String[] args) {
    // System.setProperty("streamer.Link.debug", "true");
    System.setProperty("streamer.Element.debug", "true");
    // System.setProperty("streamer.Pipeline.debug", "true");
    /* @formatter:off */
    byte[] packet = new byte[] { // TS_SHARECONTROLHEADER::totalLength = 0x0167 = 359 bytes
    0x67, // TS_SHARECONTROLHEADER::totalLength = 0x0167 = 359 bytes
    0x01, // TS_SHARECONTROLHEADER::pduType = 0x0011 0x0011 = 0x0010 | 0x0001  = TS_PROTOCOL_VERSION | PDUTYPE_DEMANDACTIVEPDU
    0x11, // TS_SHARECONTROLHEADER::pduType = 0x0011 0x0011 = 0x0010 | 0x0001  = TS_PROTOCOL_VERSION | PDUTYPE_DEMANDACTIVEPDU
    0x00, // TS_SHARECONTROLHEADER::pduSource = 0x03ea (1002)
    (byte) 0xea, // TS_SHARECONTROLHEADER::pduSource = 0x03ea (1002)
    0x03, // TS_DEMAND_ACTIVE_PDU::shareId
    (byte) 0xea, // TS_DEMAND_ACTIVE_PDU::shareId
    0x03, // TS_DEMAND_ACTIVE_PDU::shareId
    0x01, // TS_DEMAND_ACTIVE_PDU::shareId
    0x00, // TS_DEMAND_ACTIVE_PDU::lengthSourceDescriptor = 4 bytes
    0x04, // TS_DEMAND_ACTIVE_PDU::lengthSourceDescriptor = 4 bytes
    0x00, // TS_DEMAND_ACTIVE_PDU::lengthCombinedCapabilities = 0x151 = 337 bytes
    0x51, // TS_DEMAND_ACTIVE_PDU::lengthCombinedCapabilities = 0x151 = 337 bytes
    0x01, // TS_DEMAND_ACTIVE_PDU::sourceDescriptor = "RDP"
    0x52, // TS_DEMAND_ACTIVE_PDU::sourceDescriptor = "RDP"
    0x44, // TS_DEMAND_ACTIVE_PDU::sourceDescriptor = "RDP"
    0x50, // TS_DEMAND_ACTIVE_PDU::sourceDescriptor = "RDP"
    0x00, // TS_DEMAND_ACTIVE_PDU::numberCapabilities = 13
    0x0d, // TS_DEMAND_ACTIVE_PDU::numberCapabilities = 13
    0x00, // TS_DEMAND_ACTIVE_PDU::pad2octets
    0x00, // TS_DEMAND_ACTIVE_PDU::pad2octets
    0x00, // TS_SHARE_CAPABILITYSET::capabilitySetType = CAPSTYPE_SHARE (9)
    0x09, // TS_SHARE_CAPABILITYSET::capabilitySetType = CAPSTYPE_SHARE (9)
    0x00, // TS_SHARE_CAPABILITYSET::lengthCapability = 8 bytes
    0x08, // TS_SHARE_CAPABILITYSET::lengthCapability = 8 bytes
    0x00, // TS_SHARE_CAPABILITYSET::nodeID = 0x03ea (1002)
    (byte) 0xea, // TS_SHARE_CAPABILITYSET::nodeID = 0x03ea (1002)
    0x03, // TS_SHARE_CAPABILITYSET::pad2octets
    (byte) 0xdc, // TS_SHARE_CAPABILITYSET::pad2octets
    (byte) 0xe2, // TS_GENERAL_CAPABILITYSET::capabilitySetType = CAPSTYPE_GENERAL (1)
    0x01, // TS_GENERAL_CAPABILITYSET::capabilitySetType = CAPSTYPE_GENERAL (1)
    0x00, // TS_GENERAL_CAPABILITYSET::lengthCapability = 24 bytes
    0x18, // TS_GENERAL_CAPABILITYSET::lengthCapability = 24 bytes
    0x00, // TS_GENERAL_CAPABILITYSET::osMajorType = TS_OSMAJORTYPE_WINDOWS (1)
    0x01, // TS_GENERAL_CAPABILITYSET::osMajorType = TS_OSMAJORTYPE_WINDOWS (1)
    0x00, // TS_GENERAL_CAPABILITYSET::osMinorType = TS_OSMINORTYPE_WINDOWS_NT (3)
    0x03, // TS_GENERAL_CAPABILITYSET::osMinorType = TS_OSMINORTYPE_WINDOWS_NT (3)
    0x00, // TS_GENERAL_CAPABILITYSET::protocolVersion = TS_CAPS_PROTOCOLVERSION (0x0200)
    0x00, // TS_GENERAL_CAPABILITYSET::protocolVersion = TS_CAPS_PROTOCOLVERSION (0x0200)
    0x02, // TS_GENERAL_CAPABILITYSET::pad2octetsA
    0x00, // TS_GENERAL_CAPABILITYSET::pad2octetsA
    0x00, // TS_GENERAL_CAPABILITYSET::generalCompressionTypes = 0
    0x00, // TS_GENERAL_CAPABILITYSET::generalCompressionTypes = 0
    0x00, // TS_GENERAL_CAPABILITYSET::extraFlags = 0x041d = 0x0400 | 0x0010 | 0x0008 | 0x0004 | 0x0001 = NO_BITMAP_COMPRESSION_HDR | ENC_SALTED_CHECKSUM | AUTORECONNECT_SUPPORTED | LONG_CREDENTIALS_SUPPORTED | FASTPATH_OUTPUT_SUPPORTED
    0x1d, // TS_GENERAL_CAPABILITYSET::extraFlags = 0x041d = 0x0400 | 0x0010 | 0x0008 | 0x0004 | 0x0001 = NO_BITMAP_COMPRESSION_HDR | ENC_SALTED_CHECKSUM | AUTORECONNECT_SUPPORTED | LONG_CREDENTIALS_SUPPORTED | FASTPATH_OUTPUT_SUPPORTED
    0x04, // TS_GENERAL_CAPABILITYSET::updateCapabilityFlag = 0
    0x00, // TS_GENERAL_CAPABILITYSET::updateCapabilityFlag = 0
    0x00, // TS_GENERAL_CAPABILITYSET::remoteUnshareFlag = 0
    0x00, // TS_GENERAL_CAPABILITYSET::remoteUnshareFlag = 0
    0x00, // TS_GENERAL_CAPABILITYSET::generalCompressionLevel = 0
    0x00, // TS_GENERAL_CAPABILITYSET::generalCompressionLevel = 0
    0x00, // TS_GENERAL_CAPABILITYSET::refreshRectSupport = TRUE
    0x01, // TS_GENERAL_CAPABILITYSET::suppressOutputSupport = TRUE
    0x01, // TS_VIRTUALCHANNEL_CAPABILITYSET::capabilitySetType = CAPSTYPE_VIRTUALCHANNEL (20)
    0x14, // TS_VIRTUALCHANNEL_CAPABILITYSET::capabilitySetType = CAPSTYPE_VIRTUALCHANNEL (20)
    0x00, // TS_VIRTUALCHANNEL_CAPABILITYSET::lengthCapability = 8 bytes
    0x08, // TS_VIRTUALCHANNEL_CAPABILITYSET::lengthCapability = 8 bytes
    0x00, // TS_VIRTUALCHANNEL_CAPABILITYSET::vccaps1 = 0x00000002 = VCCAPS_COMPR_CS_8K
    0x02, // TS_VIRTUALCHANNEL_CAPABILITYSET::vccaps1 = 0x00000002 = VCCAPS_COMPR_CS_8K
    0x00, // TS_VIRTUALCHANNEL_CAPABILITYSET::vccaps1 = 0x00000002 = VCCAPS_COMPR_CS_8K
    0x00, // TS_VIRTUALCHANNEL_CAPABILITYSET::vccaps1 = 0x00000002 = VCCAPS_COMPR_CS_8K
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::capabilitySetType = CAPSTYPE_DRAWGDIPLUS (22)
    0x16, // TS_DRAW_GDIPLUS_CAPABILITYSET::capabilitySetType = CAPSTYPE_DRAWGDIPLUS (22)
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::lengthCapability = 40 bytes
    0x28, // TS_DRAW_GDIPLUS_CAPABILITYSET::lengthCapability = 40 bytes
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusSupportLevel = TS_DRAW_GDIPLUS_DEFAULT (0)
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusSupportLevel = TS_DRAW_GDIPLUS_DEFAULT (0)
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusSupportLevel = TS_DRAW_GDIPLUS_DEFAULT (0)
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusSupportLevel = TS_DRAW_GDIPLUS_DEFAULT (0)
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::GdipVersion (not initialized by server)
    0x70, // TS_DRAW_GDIPLUS_CAPABILITYSET::GdipVersion (not initialized by server)
    (byte) 0xf6, // TS_DRAW_GDIPLUS_CAPABILITYSET::GdipVersion (not initialized by server)
    0x13, // TS_DRAW_GDIPLUS_CAPABILITYSET::GdipVersion (not initialized by server)
    (byte) 0xf3, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusCacheLevel  = TS_DRAW_GDIPLUS_CACHE_LEVEL_ONE (1)
    0x01, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusCacheLevel  = TS_DRAW_GDIPLUS_CACHE_LEVEL_ONE (1)
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusCacheLevel  = TS_DRAW_GDIPLUS_CACHE_LEVEL_ONE (1)
    0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusCacheLevel  = TS_DRAW_GDIPLUS_CACHE_LEVEL_ONE (1)
    0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipGraphicsCacheEntries  (not initialized by server)
    0x01, // TS_GDIPLUS_CACHE_ENTRIES::GdipGraphicsCacheEntries  (not initialized by server)
    0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectBrushCacheEntries (not initialized by server)
    0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectBrushCacheEntries (not initialized by server)
    0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectPenCacheEntries (not initialized by server)
    0x18, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectPenCacheEntries (not initialized by server)
    0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectImageCacheEntries (not initialized by server)
    0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectImageCacheEntries (not initialized by server)
    0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectImageAttributesCacheEntries (not initialized by server)
    (byte) 0x9c, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectImageAttributesCacheEntries (not initialized by server)
    (byte) 0xf6, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipGraphicsCacheChunkSize  (not initialized by server)
    0x13, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipGraphicsCacheChunkSize  (not initialized by server)
    (byte) 0xf3, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectBrushCacheChunkSize (not initialized by server)
    0x61, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectBrushCacheChunkSize (not initialized by server)
    (byte) 0xa6, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectPenCacheChunkSize (not initialized by server)
    (byte) 0x82, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectPenCacheChunkSize (not initialized by server)
    (byte) 0x80, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectImageAttributesCacheChunkSize (not initialized by server)
    0x00, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectImageAttributesCacheChunkSize (not initialized by server)
    0x00, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheChunkSize  (not initialized by server)
    0x00, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheChunkSize  (not initialized by server)
    0x00, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheTotalSize  (not initialized by server)
    0x00, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheTotalSize  (not initialized by server)
    0x50, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheMaxSize (not initialized by server)
    (byte) 0x91, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheMaxSize (not initialized by server)
    (byte) 0xbf, // TS_FONT_CAPABILITYSET::capabilitySetType = CAPSTYPE_FONT (14)
    0x0e, // TS_FONT_CAPABILITYSET::capabilitySetType = CAPSTYPE_FONT (14)
    0x00, // TS_FONT_CAPABILITYSET::lengthCapability = 4 bytes
    0x04, // TS_FONT_CAPABILITYSET::lengthCapability = 4 bytes
    0x00, // TS_BITMAP_CAPABILITYSET::capabilitySetType = CAPSTYPE_BITMAP (2)
    0x02, // TS_BITMAP_CAPABILITYSET::capabilitySetType = CAPSTYPE_BITMAP (2)
    0x00, // TS_BITMAP_CAPABILITYSET::lengthCapability = 28 bytes
    0x1c, // TS_BITMAP_CAPABILITYSET::lengthCapability = 28 bytes
    0x00, // TS_BITMAP_CAPABILITYSET::preferredBitsPerPixel = 24 bpp
    0x18, // TS_BITMAP_CAPABILITYSET::preferredBitsPerPixel = 24 bpp
    0x00, // TS_BITMAP_CAPABILITYSET::receive1BitPerPixel = TRUE
    0x01, // TS_BITMAP_CAPABILITYSET::receive1BitPerPixel = TRUE
    0x00, // TS_BITMAP_CAPABILITYSET::receive4BitsPerPixel = TRUE
    0x01, // TS_BITMAP_CAPABILITYSET::receive4BitsPerPixel = TRUE
    0x00, // TS_BITMAP_CAPABILITYSET::receive8BitsPerPixel = TRUE
    0x01, // TS_BITMAP_CAPABILITYSET::receive8BitsPerPixel = TRUE
    0x00, // TS_BITMAP_CAPABILITYSET::desktopWidth = 1280 pixels
    0x00, // TS_BITMAP_CAPABILITYSET::desktopWidth = 1280 pixels
    0x05, // TS_BITMAP_CAPABILITYSET::desktopHeight = 1024 pixels
    0x00, // TS_BITMAP_CAPABILITYSET::desktopHeight = 1024 pixels
    0x04, // TS_BITMAP_CAPABILITYSET::pad2octets
    0x00, // TS_BITMAP_CAPABILITYSET::pad2octets
    0x00, // TS_BITMAP_CAPABILITYSET::desktopResizeFlag = TRUE
    0x01, // TS_BITMAP_CAPABILITYSET::desktopResizeFlag = TRUE
    0x00, // TS_BITMAP_CAPABILITYSET::bitmapCompressionFlag = TRUE
    0x01, // TS_BITMAP_CAPABILITYSET::bitmapCompressionFlag = TRUE
    0x00, // TS_BITMAP_CAPABILITYSET::highColorFlags = 0
    0x00, // TS_BITMAP_CAPABILITYSET::pad1octet
    0x00, // TS_BITMAP_CAPABILITYSET::multipleRectangleSupport = TRUE
    0x01, // TS_BITMAP_CAPABILITYSET::multipleRectangleSupport = TRUE
    0x00, // TS_BITMAP_CAPABILITYSET::pad2octetsB
    0x00, // TS_BITMAP_CAPABILITYSET::pad2octetsB
    0x00, // TS_ORDER_CAPABILITYSET::capabilitySetType = CAPSTYPE_ORDER (3)
    0x03, // TS_ORDER_CAPABILITYSET::capabilitySetType = CAPSTYPE_ORDER (3)
    0x00, // TS_ORDER_CAPABILITYSET::lengthCapability = 88 bytes
    0x58, // TS_ORDER_CAPABILITYSET::lengthCapability = 88 bytes
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = ""
    0x00, // TS_ORDER_CAPABILITYSET::pad4octetsA
    0x40, // TS_ORDER_CAPABILITYSET::pad4octetsA
    0x42, // TS_ORDER_CAPABILITYSET::pad4octetsA
    0x0f, // TS_ORDER_CAPABILITYSET::pad4octetsA
    0x00, // TS_ORDER_CAPABILITYSET::desktopSaveXGranularity = 1
    0x01, // TS_ORDER_CAPABILITYSET::desktopSaveXGranularity = 1
    0x00, // TS_ORDER_CAPABILITYSET::desktopSaveYGranularity = 20
    0x14, // TS_ORDER_CAPABILITYSET::desktopSaveYGranularity = 20
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsA
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsA
    0x00, // TS_ORDER_CAPABILITYSET::maximumOrderLevel = ORD_LEVEL_1_ORDERS (1)
    0x01, // TS_ORDER_CAPABILITYSET::maximumOrderLevel = ORD_LEVEL_1_ORDERS (1)
    0x00, // TS_ORDER_CAPABILITYSET::numberFonts = 0
    0x00, // TS_ORDER_CAPABILITYSET::numberFonts = 0
    0x00, // TS_ORDER_CAPABILITYSET::orderFlags = 0x0022 = 0x0020 | 0x0002 = COLORINDEXSUPPORT | NEGOTIATEORDERSUPPORT
    0x22, // TS_ORDER_CAPABILITYSET::orderFlags = 0x0022 = 0x0020 | 0x0002 = COLORINDEXSUPPORT | NEGOTIATEORDERSUPPORT
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_DSTBLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_PATBLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_SCRBLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEMBLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEM3BLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_ATEXTOUT_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_AEXTTEXTOUT_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_DRAWNINEGRID_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_LINETO_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTI_DRAWNINEGRID_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_OPAQUERECT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_SAVEBITMAP_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WTEXTOUT_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEMBLT_R2_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEM3BLT_R2_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTIDSTBLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTIPATBLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTISCRBLT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTIOPAQUERECT_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_FAST_INDEX_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_POLYGON_SC_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_POLYGON_CB_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_POLYLINE_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[23] = 0
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_FAST_GLYPH_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_ELLIPSE_SC_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_ELLIPSE_CB_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_INDEX_INDEX] = TRUE
    0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WEXTTEXTOUT_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WLONGTEXTOUT_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WLONGEXTTEXTOUT_INDEX] = FALSE
    0x00, // TS_ORDER_CAPABILITYSET::orderSupport[24] = 0
    0x00, // TS_ORDER_CAPABILITYSET::textFlags = 0x06a1
    (byte) 0xa1, // TS_ORDER_CAPABILITYSET::textFlags = 0x06a1
    0x06, // TS_ORDER_CAPABILITYSET::pad2octetsB
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsB
    0x00, // TS_ORDER_CAPABILITYSET::pad4octetsB
    0x40, // TS_ORDER_CAPABILITYSET::pad4octetsB
    0x42, // TS_ORDER_CAPABILITYSET::pad4octetsB
    0x0f, // TS_ORDER_CAPABILITYSET::pad4octetsB
    0x00, // TS_ORDER_CAPABILITYSET::desktopSaveSize = 0xf4240 = 1000000
    0x40, // TS_ORDER_CAPABILITYSET::desktopSaveSize = 0xf4240 = 1000000
    0x42, // TS_ORDER_CAPABILITYSET::desktopSaveSize = 0xf4240 = 1000000
    0x0f, // TS_ORDER_CAPABILITYSET::desktopSaveSize = 0xf4240 = 1000000
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsC
    0x01, // TS_ORDER_CAPABILITYSET::pad2octetsC
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsD
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsD
    0x00, // TS_ORDER_CAPABILITYSET::textANSICodePage
    0x00, // TS_ORDER_CAPABILITYSET::textANSICodePage
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsE
    0x00, // TS_ORDER_CAPABILITYSET::pad2octetsE
    0x00, // TS_COLORTABLECACHE_CAPABILITYSET::capabilitySetType = CAPSTYPE_COLORCACHE (10)
    0x0a, // TS_COLORTABLECACHE_CAPABILITYSET::capabilitySetType = CAPSTYPE_COLORCACHE (10)
    0x00, // TS_COLORTABLECACHE_CAPABILITYSET::lengthCapability = 8 bytes
    0x08, // TS_COLORTABLECACHE_CAPABILITYSET::lengthCapability = 8 bytes
    0x00, // TS_COLORTABLECACHE_CAPABILITYSET::colorTableCacheSize = 6
    0x06, // TS_COLORTABLECACHE_CAPABILITYSET::colorTableCacheSize = 6
    0x00, // TS_COLORTABLECACHE_CAPABILITYSET::pad2octets
    0x00, // TS_COLORTABLECACHE_CAPABILITYSET::pad2octets
    0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::capabilitySetType  = CAPSTYPE_BITMAPCACHE_HOSTSUPPORT (18)
    0x12, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::capabilitySetType  = CAPSTYPE_BITMAPCACHE_HOSTSUPPORT (18)
    0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::lengthCapability  = 8 bytes
    0x08, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::lengthCapability  = 8 bytes
    0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::CacheVersion = 1  (corresponds to rev. 2 capabilities)
    0x01, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::Pad1
    0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::Pad2
    0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::Pad2
    0x00, // TS_POINTER_CAPABILITYSET::capabilitySetType = CAPSTYPE_POINTER (8)
    0x08, // TS_POINTER_CAPABILITYSET::capabilitySetType = CAPSTYPE_POINTER (8)
    0x00, // TS_POINTER_CAPABILITYSET::lengthCapability = 10 bytes
    0x0a, // TS_POINTER_CAPABILITYSET::lengthCapability = 10 bytes
    0x00, // TS_POINTER_CAPABILITYSET::colorPointerFlag = TRUE
    0x01, // TS_POINTER_CAPABILITYSET::colorPointerFlag = TRUE
    0x00, // TS_POINTER_CAPABILITYSET::colorPointerCacheSize = 25
    0x19, // TS_POINTER_CAPABILITYSET::colorPointerCacheSize = 25
    0x00, // TS_POINTER_CAPABILITYSET::pointerCacheSize = 25
    0x19, // TS_POINTER_CAPABILITYSET::pointerCacheSize = 25
    0x00, // TS_INPUT_CAPABILITYSET::capabilitySetType = CAPSTYPE_INPUT (13)
    0x0d, // TS_INPUT_CAPABILITYSET::capabilitySetType = CAPSTYPE_INPUT (13)
    0x00, // TS_INPUT_CAPABILITYSET::lengthCapability = 88 bytes
    0x58, // TS_INPUT_CAPABILITYSET::lengthCapability = 88 bytes
    0x00, // TS_INPUT_CAPABILITYSET::inputFlags = 0x0035 = 0x0020 | 0x0010 | 0x0004 | 0x0001 = INPUT_FLAG_FASTPATH_INPUT2 | INPUT_FLAG_VKPACKET | INPUT_FLAG_MOUSEX | INPUT_FLAG_SCANCODES
    0x35, // TS_INPUT_CAPABILITYSET::inputFlags = 0x0035 = 0x0020 | 0x0010 | 0x0004 | 0x0001 = INPUT_FLAG_FASTPATH_INPUT2 | INPUT_FLAG_VKPACKET | INPUT_FLAG_MOUSEX | INPUT_FLAG_SCANCODES
    0x00, // TS_INPUT_CAPABILITYSET::pad2octetsA
    0x00, // TS_INPUT_CAPABILITYSET::pad2octetsA
    0x00, // TS_INPUT_CAPABILITYSET::keyboardLayout (not initialized by server)
    (byte) 0xa1, // TS_INPUT_CAPABILITYSET::keyboardLayout (not initialized by server)
    0x06, // TS_INPUT_CAPABILITYSET::keyboardLayout (not initialized by server)
    0x00, // TS_INPUT_CAPABILITYSET::keyboardLayout (not initialized by server)
    0x00, // TS_INPUT_CAPABILITYSET::keyboardType (not initialized by server)
    0x40, // TS_INPUT_CAPABILITYSET::keyboardType (not initialized by server)
    0x42, // TS_INPUT_CAPABILITYSET::keyboardType (not initialized by server)
    0x0f, // TS_INPUT_CAPABILITYSET::keyboardType (not initialized by server)
    0x00, // TS_INPUT_CAPABILITYSET::keyboardSubType  (not initialized by server)
    0x0c, // TS_INPUT_CAPABILITYSET::keyboardSubType  (not initialized by server)
    (byte) 0xf6, // TS_INPUT_CAPABILITYSET::keyboardSubType  (not initialized by server)
    0x13, // TS_INPUT_CAPABILITYSET::keyboardSubType  (not initialized by server)
    (byte) 0xf3, // TS_INPUT_CAPABILITYSET::keyboardFunctionKey (not initialized by server)
    (byte) 0x93, // TS_INPUT_CAPABILITYSET::keyboardFunctionKey (not initialized by server)
    0x5a, // TS_INPUT_CAPABILITYSET::keyboardFunctionKey (not initialized by server)
    0x37, // TS_INPUT_CAPABILITYSET::keyboardFunctionKey (not initialized by server)
    (byte) 0xf3, // TS_INPUT_CAPABILITYSET::imeFileName (not initialized by server)
    0x00, (byte) 0x90, 0x30, (byte) 0xe1, 0x34, 0x1c, 0x38, (byte) 0xf3, 0x40, (byte) 0xf6, 0x13, (byte) 0xf3, 0x04, 0x00, 0x00, 0x00, 0x4c, 0x54, (byte) 0xdc, (byte) 0xe2, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, 0x01, 0x00, 0x00, 0x00, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, 0x00, 0x00, 0x00, 0x00, 0x38, (byte) 0xf6, 0x13, (byte) 0xf3, 0x2e, 0x05, 0x38, (byte) 0xf3, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, 0x2c, (byte) 0xf6, 0x13, (byte) 0xf3, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x19, 0x00, // TS_RAIL_CAPABILITYSET::capabilitySetType = CAPSTYPE_RAIL (23)
    0x17, // TS_RAIL_CAPABILITYSET::capabilitySetType = CAPSTYPE_RAIL (23)
    0x00, // TS_RAIL_CAPABILITYSET::lengthCapability = 8 bytes
    0x08, // TS_RAIL_CAPABILITYSET::lengthCapability = 8 bytes
    0x00, // TS_RAIL_CAPABILITYSET::railSupportLevel = TS_RAIL_LEVEL_DEFAULT (0)
    0x00, // TS_RAIL_CAPABILITYSET::railSupportLevel = TS_RAIL_LEVEL_DEFAULT (0)
    0x00, // TS_RAIL_CAPABILITYSET::railSupportLevel = TS_RAIL_LEVEL_DEFAULT (0)
    0x00, // TS_RAIL_CAPABILITYSET::railSupportLevel = TS_RAIL_LEVEL_DEFAULT (0)
    0x00, // TS_WINDOW_CAPABILITYSET::capabilitySetType =  CAPSTYPE_WINDOW (24)
    0x18, // TS_WINDOW_CAPABILITYSET::capabilitySetType =  CAPSTYPE_WINDOW (24)
    0x00, // TS_WINDOW_CAPABILITYSET::lengthCapability = 11 bytes
    0x0b, // TS_WINDOW_CAPABILITYSET::lengthCapability = 11 bytes
    0x00, // TS_WINDOW_CAPABILITYSET::wndSupportLevel = TS_WINDOW_LEVEL_DEFAULT (0)
    0x00, // TS_WINDOW_CAPABILITYSET::wndSupportLevel = TS_WINDOW_LEVEL_DEFAULT (0)
    0x00, // TS_WINDOW_CAPABILITYSET::wndSupportLevel = TS_WINDOW_LEVEL_DEFAULT (0)
    0x00, // TS_WINDOW_CAPABILITYSET::wndSupportLevel = TS_WINDOW_LEVEL_DEFAULT (0)
    0x00, // TS_WINDOW_CAPABILITYSET::nIconCaches = 0
    0x00, // TS_WINDOW_CAPABILITYSET::nIconCacheEntries = 0
    0x00, // TS_WINDOW_CAPABILITYSET::nIconCacheEntries = 0
    0x00, // TS_DEMAND_ACTIVE_PDU::sessionId = 0
    0x00, // TS_DEMAND_ACTIVE_PDU::sessionId = 0
    0x00, // TS_DEMAND_ACTIVE_PDU::sessionId = 0
    0x00, // TS_DEMAND_ACTIVE_PDU::sessionId = 0
    0x00 };
    /* @formatter:on */
    RdpState rdpState = new RdpState();
    ScreenDescription screenDescription = new ScreenDescription();
    MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet));
    Element demandActive = new ServerDemandActivePDU("demand_active", screenDescription, rdpState);
    Element sink = new FakeSink("sink");
    Pipeline pipeline = new PipelineImpl("test");
    pipeline.add(source, demandActive, sink);
    pipeline.link("source", "demand_active", "sink");
    pipeline.runMainLoop("source", STDOUT, false, false);
}
Also used : MockSource(streamer.debug.MockSource) FakeSink(streamer.debug.FakeSink) PipelineImpl(streamer.PipelineImpl) ScreenDescription(common.ScreenDescription) Element(streamer.Element) BaseElement(streamer.BaseElement) Pipeline(streamer.Pipeline)

Example 5 with FakeSink

use of streamer.debug.FakeSink in project cloudstack by apache.

the class Queue method main.

/**
 * Example.
 */
public static void main(String[] args) {
    // System.setProperty("streamer.Link.debug", "true");
    System.setProperty("streamer.Element.debug", "true");
    Element source1 = new FakeSource("source1") {

        {
            delay = 100;
            numBuffers = 10;
            incommingBufLength = 10;
        }
    };
    Element source2 = new FakeSource("source2") {

        {
            delay = 100;
            numBuffers = 10;
            incommingBufLength = 10;
        }
    };
    Pipeline pipeline = new PipelineImpl("test");
    pipeline.add(source1);
    pipeline.add(source2);
    pipeline.add(new Queue("queue"));
    pipeline.add(new FakeSink("sink"));
    // Main flow
    pipeline.link("source1", "in1< queue");
    pipeline.link("source2", "in2< queue");
    pipeline.link("queue", "sink");
    new Thread(pipeline.getLink("source1", STDOUT)).start();
    new Thread(pipeline.getLink("source2", STDOUT)).start();
    pipeline.getLink("sink", STDIN).run();
}
Also used : FakeSink(streamer.debug.FakeSink) FakeSource(streamer.debug.FakeSource) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue)

Aggregations

FakeSink (streamer.debug.FakeSink)6 Element (streamer.Element)3 Pipeline (streamer.Pipeline)3 PipelineImpl (streamer.PipelineImpl)3 BaseElement (streamer.BaseElement)2 ByteBuffer (streamer.ByteBuffer)2 FakeSource (streamer.debug.FakeSource)2 MockSource (streamer.debug.MockSource)2 ScreenDescription (common.ScreenDescription)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 MockSink (streamer.debug.MockSink)1