server/tests/test_display_streaming: update to create sized frames

This commit is contained in:
Alon Levy 2012-04-19 13:48:43 +03:00 committed by Yonit Halperin
parent 8778b8eb2c
commit 3373cda434

View File

@ -5,14 +5,37 @@
*/
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include "test_display_base.h"
int simple_commands[] = {
SIMPLE_DRAW,
SIMPLE_UPDATE,
PATH_PROGRESS,
SIMPLE_CREATE_SURFACE,
SIMPLE_DESTROY_SURFACE,
static int sized;
void create_update(Command *command)
{
static int count = 0;
CommandDrawSolid *cmd = &command->solid;
cmd->surface_id = 0;
cmd->bbox.left = 0;
cmd->bbox.right = test_get_width();
cmd->bbox.top = 0;
cmd->color = 0xffff00 + ((count * 10) % 256);
assert(test_get_height() > 50);
cmd->bbox.bottom = test_get_height() - 50;
if (count < 20) {
} else if (sized && count % 5 == 0) {
cmd->bbox.bottom = test_get_height();
cmd->color = 0xff;
}
count++;
printf("%d %d\n", count, cmd->bbox.bottom);
}
static Command commands[] = {
{SIMPLE_DRAW_SOLID, create_update},
};
SpiceCoreInterface *core;
@ -20,12 +43,19 @@ SpiceServer *server;
int main(int argc, char **argv)
{
int i;
spice_test_config_parse_args(argc, argv);
sized = 0;
for (i = 1 ; i < argc; ++i) {
if (strcmp(argv[i], "sized") == 0) {
sized = 1;
}
}
core = basic_event_loop_init();
server = test_init(core);
spice_server_set_streaming_video(server, SPICE_STREAM_VIDEO_ALL);
test_add_display_interface(server);
test_set_simple_command_list(simple_commands, COUNT(simple_commands));
test_set_command_list(commands, COUNT(commands));
basic_event_loop_mainloop();
return 0;
}