server: add frame marker update.
authorVic Lee <llyzs@163.com>
Thu, 15 Dec 2011 23:26:32 +0000 (07:26 +0800)
committerVic Lee <llyzs@163.com>
Thu, 15 Dec 2011 23:26:32 +0000 (07:26 +0800)
libfreerdp-core/fastpath.c
libfreerdp-core/update.c

index 6f6d9df..64abadd 100644 (file)
@@ -576,22 +576,6 @@ boolean fastpath_send_update_pdu(rdpFastPath* fastpath, uint8 updateCode, STREAM
        return result;
 }
 
-boolean fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, uint16 frameAction, uint32 frameId)
-{
-       STREAM* s;
-       s = transport_send_stream_init(fastpath->rdp->transport, 127);
-       stream_write_uint8(s, 0); /* fpOutputHeader (1 byte) */
-       stream_write_uint8(s, 5 + SURFCMD_FRAME_MARKER_LENGTH); /* length1 */
-       stream_write_uint8(s, FASTPATH_UPDATETYPE_SURFCMDS); /* updateHeader (1 byte) */
-       stream_write_uint16(s, SURFCMD_FRAME_MARKER_LENGTH); /* size (2 bytes) */
-       update_write_surfcmd_frame_marker(s, frameAction, frameId);
-
-       if (transport_write(fastpath->rdp->transport, s) < 0)
-               return false;
-
-       return true;
-}
-
 rdpFastPath* fastpath_new(rdpRdp* rdp)
 {
        rdpFastPath* fastpath;
index 089ac9b..49c4ebf 100644 (file)
@@ -409,6 +409,16 @@ static void update_send_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND*
        fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, s);
 }
 
+static void update_send_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
+{
+       STREAM* s;
+       rdpRdp* rdp = context->rdp;
+
+       s = fastpath_update_pdu_init(rdp->fastpath);
+       update_write_surfcmd_frame_marker(s, surface_frame_marker->frameAction, surface_frame_marker->frameId);
+       fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, s);
+}
+
 static void update_send_synchronize(rdpContext* context)
 {
        STREAM* s;
@@ -517,6 +527,7 @@ void update_register_server_callbacks(rdpUpdate* update)
        update->RefreshRect = update_send_refresh_rect;
        update->SuppressOutput = update_send_suppress_output;
        update->SurfaceBits = update_send_surface_bits;
+       update->SurfaceFrameMarker = update_send_surface_frame_marker;
        update->SurfaceCommand = update_send_surface_command;
        update->primary->ScrBlt = update_send_scrblt;
        update->pointer->PointerSystem = update_send_pointer_system;