4 #include <VP_Api/vp_api.h>
5 #include <VP_Api/vp_api_thread_helper.h>
6 #include <VP_Api/vp_api_error.h>
7 #include <VP_Stages/vp_stages_configs.h>
8 #include <VP_Stages/vp_stages_io_console.h>
9 #include <VP_Stages/vp_stages_o_sdl.h>
10 #include <VP_Stages/vp_stages_io_com.h>
11 #include <VP_Stages/vp_stages_io_file.h>
12 #include <VP_Os/vp_os_print.h>
13 #include <VP_Os/vp_os_malloc.h>
19 static PIPELINE_HANDLE pipeline_handle;
22 PROTO_THREAD_ROUTINE(escaper,nomParams);
23 PROTO_THREAD_ROUTINE(app,nomParams);
27 THREAD_TABLE_ENTRY(escaper,20)
28 THREAD_TABLE_ENTRY(app,20)
33 main(int argc, char **argv)
35 START_THREAD(escaper, NO_PARAM);
36 START_THREAD(app, argv);
45 PROTO_THREAD_ROUTINE(app,argv)
47 vp_api_io_pipeline_t pipeline;
49 vp_api_io_stage_t stages[NB_STAGES];
51 vp_stages_input_com_config_t icc;
52 vp_stages_output_sdl_config_t osc;
55 vp_com_bluetooth_connection_t connection;
56 vp_com_bluetooth_config_t config;
58 vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) );
59 vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) );
60 vp_com_str_to_address("00:01:48:03:70:54",&connection.address);
61 vp_stages_fill_default_config(BLUETOOTH_COM_CONFIG, &config, sizeof(config));
62 vp_os_memset(&com, 0, sizeof(vp_com_t));
63 vp_stages_fill_default_config(SDL_DECODING_QCIF_CONFIG, &osc, sizeof(osc));
65 com.type = VP_COM_BLUETOOTH;
67 icc.config = (vp_com_config_t*)&config;
68 icc.connection = (vp_com_connection_t*)&connection;
69 icc.socket.type = VP_COM_CLIENT;
70 icc.socket.protocol = VP_COM_TCP;
71 icc.socket.port = 5555;
72 icc.buffer_size = 6400;
74 strcpy(icc.socket.serverHost,"192.168.2.23");
76 stages[0].type = VP_API_INPUT_SOCKET;
77 stages[0].cfg = (void *)&icc;
78 stages[0].funcs = vp_stages_input_com_funcs;
80 stages[1].type = VP_API_OUTPUT_SDL;
81 stages[1].cfg = (void *)&osc;
82 stages[1].funcs = vp_stages_output_sdl_funcs;
84 pipeline.nb_stages = NB_STAGES;
85 pipeline.stages = &stages[0];
87 vp_api_open(&pipeline, &pipeline_handle);
88 out.status = VP_API_STATUS_PROCESSING;
89 while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING));
90 vp_api_close(&pipeline, &pipeline_handle);