From 74084a5bb3a435891b4f6f9f37dfef02138b8d80 Mon Sep 17 00:00:00 2001 From: Mani Monajjemi Date: Tue, 15 May 2012 15:12:43 -0700 Subject: [PATCH] Original ardrone_brown from: http://brown-ros-pkg.googlecode.com/svn/trunk/experimental/ardrone_brown [revision 2797] --- ARDroneLib/Soft/Build/Makefile | 107 ++ ARDroneLib/Soft/Build/check_dependencies.sh | 64 + ARDroneLib/Soft/Build/config.makefile | 171 ++ ARDroneLib/Soft/Build/custom.makefile | 67 + .../Maths/filter.c.d | 17 + .../Maths/maths.c.d | 16 + .../Maths/matrices.c.d | 18 + .../Maths/matrix3d.c.d | 27 + .../Maths/quaternions.c.d | 19 + .../Maths/time.c.d | 13 + .../Maths/vision_math.c.d | 22 + .../ardrone_tool/AT/ardrone_at_mutex.c.d | 71 + .../ardrone_tool/Com/config_wifi.c.d | 44 + .../ardrone_tool/Control/ardrone_control.c.d | 91 + .../Control/ardrone_control_ack.c.d | 69 + .../Control/ardrone_control_configuration.c.d | 74 + .../Control/ardrone_control_soft_update.c.d | 67 + .../Control/ardrone_navdata_control.c.d | 71 + .../Navdata/ardrone_general_navdata.c.d | 80 + .../Navdata/ardrone_navdata_client.c.d | 88 + .../Navdata/ardrone_navdata_file.c.d | 74 + .../ardrone_tool/Navdata/navdata.c.d | 64 + .../ardrone_tool/UI/ardrone_input.c.d | 68 + .../ardrone_tool/UI/ardrone_tool_ui.c.d | 68 + .../ardrone_tool/Video/video_com_stage.c.d | 50 + .../ardrone_tool/Video/video_stage.c.d | 79 + .../Video/video_stage_ffmpeg_recorder.c.d | 64 + .../Video/video_stage_recorder.c.d | 55 + .../ardrone_tool/ardrone_api.c.d | 66 + .../ardrone_tool/ardrone_time.c.d | 22 + .../ardrone_tool/ardrone_tool.c.d | 86 + .../ardrone_tool_configuration.c.d | 77 + .../ardrone_tool/config_keys.c.d | 53 + .../build.log | 34 + .../iniparser3.0b/src/dictionary.c.d | 24 + .../iniparser3.0b/src/iniparser.c.d | 57 + .../utils/ardrone_crc_32.c.d | 12 + .../utils/ardrone_ftp.c.d | 48 + .../utils/ardrone_gen_ids.c.d | 26 + .../P263/p263_codec.c.d | 61 + .../P263/p263_gob_layer.c.d | 53 + .../P263/p263_huffman.c.d | 51 + .../P263/p263_mb_layer.c.d | 52 + .../P263/p263_picture_layer.c.d | 53 + .../P264/p264.c.d | 54 + .../P264/p264_Qp.c.d | 11 + .../P264/p264_codec.c.d | 60 + .../P264/p264_gob_layer.c.d | 52 + .../P264/p264_inter_mc.c.d | 23 + .../P264/p264_intra_pred.c.d | 27 + .../P264/p264_mb_layer.c.d | 58 + .../P264/p264_merge.c.d | 12 + .../P264/p264_picture_layer.c.d | 53 + .../P264/p264_transform.c.d | 12 + .../P264/p264_zigzag.c.d | 12 + .../P264/video_p264.c.d | 58 + .../Platform/x86/UVLC/uvlc_codec.c.d | 60 + .../Platform/x86/video_utils.c.d | 52 + .../Stages/vlib_stage_decode.c.d | 56 + .../Stages/vlib_stage_encode.c.d | 57 + .../UVLC/uvlc.c.d | 54 + .../UVLC/uvlc_codec.c.d | 59 + .../UVLC/uvlc_gob_layer.c.d | 52 + .../UVLC/uvlc_mb_layer.c.d | 57 + .../UVLC/uvlc_picture_layer.c.d | 52 + .../build.log | 35 + .../video_codec.c.d | 58 + .../video_controller.c.d | 53 + .../video_dct.c.d | 51 + .../video_huffman.c.d | 56 + .../video_macroblock.c.d | 49 + .../video_mem32.c.d | 13 + .../video_packetizer.c.d | 57 + .../video_picture.c.d | 48 + .../video_quantizer.c.d | 54 + .../ATcodec/ATcodec.c.d | 29 + .../ATcodec/ATcodec_Buffer.c.d | 23 + .../ATcodec/ATcodec_Memory.c.d | 5 + .../ATcodec/ATcodec_Sorted_List.c.d | 23 + .../ATcodec/ATcodec_Tree.c.d | 32 + .../ATcodec/ATcodec_api.c.d | 34 + .../VP_Api/vp_api.c.d | 31 + .../VP_Api/vp_api_error.c.d | 12 + .../VP_Api/vp_api_io_multi_stage.c.d | 21 + .../VP_Api/vp_api_stage.c.d | 72 + .../VP_Api/vp_api_supervisor.c.d | 31 + .../VP_Api/vp_api_thread_helper.c.d | 27 + .../VP_Com/linux/vp_com.c.d | 34 + .../VP_Com/linux/vp_com_config_itf.c.d | 42 + .../VP_Com/linux/vp_com_serial.c.d | 41 + .../VP_Com/linux/vp_com_wifi.c.d | 40 + .../VP_Com/linux/vp_com_wired.c.d | 39 + .../VP_Com/vp_com_error.c.d | 12 + .../VP_Com/vp_com_socket.c.d | 50 + .../VP_Com/vp_com_socket_utils.c.d | 50 + .../VP_Os/linux/vp_os_delay.c.d | 13 + .../VP_Os/linux/vp_os_signal.c.d | 21 + .../VP_Os/linux/vp_os_thread.c.d | 30 + .../VP_Os/vp_os_error_handling.c.d | 22 + .../VP_Os/vp_os_malloc.c.d | 21 + .../VP_Stages/vp_stages_buffer_to_picture.c.d | 53 + .../VP_Stages/vp_stages_configs.c.d | 69 + .../VP_Stages/vp_stages_frame_pipe.c.d | 51 + .../VP_Stages/vp_stages_io_buffer.c.d | 33 + .../VP_Stages/vp_stages_io_com.c.d | 35 + .../VP_Stages/vp_stages_io_console.c.d | 25 + .../VP_Stages/vp_stages_io_file.c.d | 34 + .../VP_Stages/vp_stages_o_sdl.c.d | 69 + .../VP_Stages/vp_stages_yuv2rgb.c.d | 54 + .../build.log | 34 + ARDroneLib/Soft/Common/ardrone_api.h | 762 ++++++++ .../Soft/Common/ardrone_common_config.h | 52 + ARDroneLib/Soft/Common/at_msgs.h | 60 + ARDroneLib/Soft/Common/at_msgs_ids.h | 26 + ARDroneLib/Soft/Common/autoconf.h | 49 + ARDroneLib/Soft/Common/config.h | 319 ++++ ARDroneLib/Soft/Common/config_keys.h | 304 +++ ARDroneLib/Soft/Common/control_states.h | 191 ++ ARDroneLib/Soft/Common/generated_custom.h | 24 + ARDroneLib/Soft/Common/led_animation.h | 47 + ARDroneLib/Soft/Common/navdata_common.h | 590 ++++++ ARDroneLib/Soft/Common/navdata_keys.h | 40 + ARDroneLib/Soft/Common/vision_common.h | 38 + ARDroneLib/Soft/Lib/Build/Makefile | 153 ++ ARDroneLib/Soft/Lib/Maths/filter.c | 126 ++ ARDroneLib/Soft/Lib/Maths/filter.h | 188 ++ ARDroneLib/Soft/Lib/Maths/maths.c | 149 ++ ARDroneLib/Soft/Lib/Maths/maths.h | 120 ++ ARDroneLib/Soft/Lib/Maths/matrices.c | 164 ++ ARDroneLib/Soft/Lib/Maths/matrices.h | 93 + ARDroneLib/Soft/Lib/Maths/matrix3d.c | 313 ++++ ARDroneLib/Soft/Lib/Maths/matrix3d.h | 59 + ARDroneLib/Soft/Lib/Maths/point3d.h | 11 + ARDroneLib/Soft/Lib/Maths/quaternions.c | 129 ++ ARDroneLib/Soft/Lib/Maths/quaternions.h | 56 + ARDroneLib/Soft/Lib/Maths/time.c | 34 + ARDroneLib/Soft/Lib/Maths/time.h | 8 + ARDroneLib/Soft/Lib/Maths/vision_math.c | 255 +++ ARDroneLib/Soft/Lib/Maths/vision_math.h | 74 + .../Lib/ardrone_tool/AT/ardrone_at_mutex.c | 882 +++++++++ .../Soft/Lib/ardrone_tool/Com/config_com.h | 12 + .../Soft/Lib/ardrone_tool/Com/config_serial.c | 108 ++ .../Soft/Lib/ardrone_tool/Com/config_serial.h | 53 + .../Soft/Lib/ardrone_tool/Com/config_wifi.c | 226 +++ .../Soft/Lib/ardrone_tool/Com/config_wifi.h | 59 + .../ardrone_tool/Control/ardrone_control.c | 323 ++++ .../ardrone_tool/Control/ardrone_control.h | 46 + .../Control/ardrone_control_ack.c | 35 + .../Control/ardrone_control_ack.h | 26 + .../Control/ardrone_control_configuration.c | 376 ++++ .../Control/ardrone_control_configuration.h | 39 + .../Control/ardrone_control_soft_update.c | 58 + .../Control/ardrone_control_soft_update.h | 34 + .../Control/ardrone_navdata_control.c | 21 + .../Control/ardrone_navdata_control.h | 14 + .../Navdata/ardrone_general_navdata.c | 423 +++++ .../Navdata/ardrone_general_navdata.h | 31 + .../Navdata/ardrone_navdata_client.c | 257 +++ .../Navdata/ardrone_navdata_client.h | 59 + .../Navdata/ardrone_navdata_file.c | 462 +++++ .../Navdata/ardrone_navdata_file.h | 17 + .../Soft/Lib/ardrone_tool/Navdata/navdata.c | 145 ++ .../Soft/Lib/ardrone_tool/UI/ardrone_input.c | 237 +++ .../Soft/Lib/ardrone_tool/UI/ardrone_input.h | 60 + .../Lib/ardrone_tool/UI/ardrone_tool_ui.c | 230 +++ .../Lib/ardrone_tool/UI/ardrone_tool_ui.h | 29 + .../Video/buffer_to_picture_stage.c | 142 ++ .../Video/buffer_to_picture_stage.h | 35 + .../ardrone_tool/Video/mjpeg_stage_decode.c | 98 + .../ardrone_tool/Video/mjpeg_stage_decode.h | 24 + .../Lib/ardrone_tool/Video/video_com_stage.c | 156 ++ .../Lib/ardrone_tool/Video/video_com_stage.h | 33 + .../Soft/Lib/ardrone_tool/Video/video_stage.c | 239 +++ .../Soft/Lib/ardrone_tool/Video/video_stage.h | 56 + .../Video/video_stage_ffmpeg_recorder.c | 700 +++++++ .../Video/video_stage_ffmpeg_recorder.h | 51 + .../ardrone_tool/Video/video_stage_recorder.c | 255 +++ .../ardrone_tool/Video/video_stage_recorder.h | 35 + .../ardrone_tool/Video/vlib_stage_decode.c | 84 + .../ardrone_tool/Video/vlib_stage_decode.h | 20 + .../Soft/Lib/ardrone_tool/ardrone_api.c | 8 + .../Soft/Lib/ardrone_tool/ardrone_time.c | 108 ++ .../Soft/Lib/ardrone_tool/ardrone_time.h | 25 + .../Soft/Lib/ardrone_tool/ardrone_tool.c | 441 +++++ .../Soft/Lib/ardrone_tool/ardrone_tool.h | 256 +++ .../ardrone_tool/ardrone_tool_configuration.c | 374 ++++ .../ardrone_tool/ardrone_tool_configuration.h | 68 + .../Soft/Lib/ardrone_tool/config_keys.c | 70 + ARDroneLib/Soft/Lib/iniparser3.0b/AUTHORS | 4 + ARDroneLib/Soft/Lib/iniparser3.0b/INSTALL | 15 + ARDroneLib/Soft/Lib/iniparser3.0b/LICENSE | 21 + ARDroneLib/Soft/Lib/iniparser3.0b/Makefile | 62 + ARDroneLib/Soft/Lib/iniparser3.0b/README | 12 + .../Soft/Lib/iniparser3.0b/html/doxygen.css | 358 ++++ .../Soft/Lib/iniparser3.0b/html/doxygen.png | Bin 0 -> 1281 bytes .../Lib/iniparser3.0b/html/globals_func.html | 48 + .../Soft/Lib/iniparser3.0b/html/index.html | 96 + .../Lib/iniparser3.0b/html/iniparser_8h.html | 582 ++++++ .../iniparser3.0b/html/iniparser_8main.html | 15 + .../Soft/Lib/iniparser3.0b/html/tab_b.gif | Bin 0 -> 35 bytes .../Soft/Lib/iniparser3.0b/html/tab_l.gif | Bin 0 -> 706 bytes .../Soft/Lib/iniparser3.0b/html/tab_r.gif | Bin 0 -> 2585 bytes .../Soft/Lib/iniparser3.0b/html/tabs.css | 102 + .../Soft/Lib/iniparser3.0b/src/dictionary.c | 418 +++++ .../Soft/Lib/iniparser3.0b/src/dictionary.h | 197 ++ .../Soft/Lib/iniparser3.0b/src/iniparser.c | 1083 +++++++++++ .../Soft/Lib/iniparser3.0b/src/iniparser.h | 325 ++++ .../Soft/Lib/iniparser3.0b/test/Makefile | 27 + .../Soft/Lib/iniparser3.0b/test/iniexample.c | 103 ++ .../Soft/Lib/iniparser3.0b/test/parse.c | 24 + .../Lib/iniparser3.0b/test/twisted-errors.ini | 9 + .../Lib/iniparser3.0b/test/twisted-genhuge.py | 12 + .../Lib/iniparser3.0b/test/twisted-ofkey.ini | 66 + .../Lib/iniparser3.0b/test/twisted-ofval.ini | 56 + .../Soft/Lib/iniparser3.0b/test/twisted.ini | 131 ++ ARDroneLib/Soft/Lib/utils/ardrone_crc_32.c | 58 + ARDroneLib/Soft/Lib/utils/ardrone_crc_32.h | 8 + ARDroneLib/Soft/Lib/utils/ardrone_ftp.c | 1638 +++++++++++++++++ ARDroneLib/Soft/Lib/utils/ardrone_ftp.h | 246 +++ ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.c | 45 + ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.h | 10 + ARDroneLib/Soft/log | 4 + ARDroneLib/VLIB/Docs/uvlc.txt | 92 + ARDroneLib/VLIB/P263/p263_codec.c | 399 ++++ ARDroneLib/VLIB/P263/p263_codec.h | 29 + ARDroneLib/VLIB/P263/p263_gob_layer.c | 29 + ARDroneLib/VLIB/P263/p263_huffman.c | 495 +++++ ARDroneLib/VLIB/P263/p263_huffman.h | 87 + ARDroneLib/VLIB/P263/p263_layers.h | 109 ++ ARDroneLib/VLIB/P263/p263_mb_layer.c | 180 ++ ARDroneLib/VLIB/P263/p263_picture_layer.c | 215 +++ ARDroneLib/VLIB/P264/p264.c | 249 +++ ARDroneLib/VLIB/P264/p264.h | 13 + ARDroneLib/VLIB/P264/p264_Qp.c | 126 ++ ARDroneLib/VLIB/P264/p264_Qp.h | 6 + ARDroneLib/VLIB/P264/p264_codec.c | 683 +++++++ ARDroneLib/VLIB/P264/p264_codec.h | 32 + ARDroneLib/VLIB/P264/p264_common.h | 97 + ARDroneLib/VLIB/P264/p264_gob_layer.c | 21 + ARDroneLib/VLIB/P264/p264_inter_mc.c | 242 +++ ARDroneLib/VLIB/P264/p264_inter_mc.h | 8 + ARDroneLib/VLIB/P264/p264_intra_pred.c | 1128 ++++++++++++ ARDroneLib/VLIB/P264/p264_intra_pred.h | 82 + ARDroneLib/VLIB/P264/p264_layers.h | 47 + ARDroneLib/VLIB/P264/p264_mb_layer.c | 644 +++++++ ARDroneLib/VLIB/P264/p264_merge.c | 42 + ARDroneLib/VLIB/P264/p264_merge.h | 4 + ARDroneLib/VLIB/P264/p264_picture_layer.c | 83 + ARDroneLib/VLIB/P264/p264_transform.c | 108 ++ ARDroneLib/VLIB/P264/p264_transform.h | 6 + ARDroneLib/VLIB/P264/p264_zigzag.c | 21 + ARDroneLib/VLIB/P264/p264_zigzag.h | 6 + ARDroneLib/VLIB/P264/video_p264.c | 673 +++++++ ARDroneLib/VLIB/P264/video_p264.h | 33 + .../VLIB/Platform/arm11/UVLC/uvlc_codec.c | 215 +++ ARDroneLib/VLIB/Platform/arm11/video_config.h | 18 + ARDroneLib/VLIB/Platform/arm11/video_utils.c | 37 + ARDroneLib/VLIB/Platform/arm11/video_utils.h | 16 + .../VLIB/Platform/arm11/video_utils_iphone.h | 7 + .../Platform/arm9/UVLC/uvlc_mb_layer_p5p.S | 146 ++ .../Platform/arm9/UVLC/uvlc_mb_layer_p5p.h | 8 + ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.S | 68 + ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.h | 10 + ARDroneLib/VLIB/Platform/arm9/video_config.h | 33 + ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.c | 254 +++ ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.h | 66 + ARDroneLib/VLIB/Platform/arm9/video_gen_sad.c | 167 ++ ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h | 46 + .../VLIB/Platform/arm9/video_packetizer_p5p.S | 51 + .../VLIB/Platform/arm9/video_packetizer_p5p.h | 8 + .../VLIB/Platform/arm9/video_picture_p5p.S | 330 ++++ .../VLIB/Platform/arm9/video_quantizer_p5p.S | 88 + .../VLIB/Platform/arm9/video_quantizer_p5p.h | 8 + ARDroneLib/VLIB/Platform/arm9/video_utils.c | 74 + ARDroneLib/VLIB/Platform/arm9/video_utils.h | 19 + .../VLIB/Platform/arm9/video_utils_p5p.h | 12 + .../VLIB/Platform/arm9_P6/P6_h264_reg.h | 118 ++ .../Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.S | 146 ++ .../Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.c | 30 + .../Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.h | 8 + .../VLIB/Platform/arm9_P6/UVLC/uvlc_p6.S | 68 + .../VLIB/Platform/arm9_P6/UVLC/uvlc_p6.h | 10 + .../VLIB/Platform/arm9_P6/video_config.h | 40 + .../VLIB/Platform/arm9_P6/video_dct_p6.c | 181 ++ .../VLIB/Platform/arm9_P6/video_dct_p6.h | 75 + .../VLIB/Platform/arm9_P6/video_p264_p6.c | 335 ++++ .../VLIB/Platform/arm9_P6/video_p264_p6.h | 16 + .../Platform/arm9_P6/video_packetizer_p6.S | 51 + .../Platform/arm9_P6/video_packetizer_p6.h | 8 + .../Platform/arm9_P6/video_quantizer_p6.c | 47 + .../Platform/arm9_P6/video_quantizer_p6.h | 8 + .../VLIB/Platform/arm9_P6/video_utils.c | 85 + .../VLIB/Platform/arm9_P6/video_utils.h | 19 + .../VLIB/Platform/arm9_P6/video_utils_p6.h | 26 + ARDroneLib/VLIB/Platform/video_config.h | 38 + ARDroneLib/VLIB/Platform/video_utils.h | 35 + .../VLIB/Platform/x86/UVLC/uvlc_codec.c | 234 +++ ARDroneLib/VLIB/Platform/x86/video_config.h | 18 + ARDroneLib/VLIB/Platform/x86/video_utils.c | 37 + ARDroneLib/VLIB/Platform/x86/video_utils.h | 12 + .../VLIB/Platform/x86/video_utils_x86.h | 6 + ARDroneLib/VLIB/Stages/vlib_stage_decode.c | 119 ++ ARDroneLib/VLIB/Stages/vlib_stage_decode.h | 27 + ARDroneLib/VLIB/Stages/vlib_stage_encode.c | 115 ++ ARDroneLib/VLIB/Stages/vlib_stage_encode.h | 78 + ARDroneLib/VLIB/UVLC/uvlc.c | 155 ++ ARDroneLib/VLIB/UVLC/uvlc.h | 12 + ARDroneLib/VLIB/UVLC/uvlc_codec.c | 529 ++++++ ARDroneLib/VLIB/UVLC/uvlc_codec.h | 31 + ARDroneLib/VLIB/UVLC/uvlc_gob_layer.c | 21 + ARDroneLib/VLIB/UVLC/uvlc_layers.h | 47 + ARDroneLib/VLIB/UVLC/uvlc_mb_layer.c | 211 +++ ARDroneLib/VLIB/UVLC/uvlc_picture_layer.c | 82 + ARDroneLib/VLIB/Utils/video_bin_dct.c | 190 ++ ARDroneLib/VLIB/Utils/video_bin_dct.h | 8 + ARDroneLib/VLIB/video_codec.c | 260 +++ ARDroneLib/VLIB/video_codec.h | 40 + ARDroneLib/VLIB/video_controller.c | 180 ++ ARDroneLib/VLIB/video_controller.h | 125 ++ ARDroneLib/VLIB/video_dct.c | 462 +++++ ARDroneLib/VLIB/video_dct.h | 16 + ARDroneLib/VLIB/video_gob.h | 17 + ARDroneLib/VLIB/video_huffman.c | 128 ++ ARDroneLib/VLIB/video_huffman.h | 44 + ARDroneLib/VLIB/video_macroblock.c | 12 + ARDroneLib/VLIB/video_macroblock.h | 36 + ARDroneLib/VLIB/video_mem32.c | 43 + ARDroneLib/VLIB/video_mem32.h | 13 + ARDroneLib/VLIB/video_packetizer.c | 174 ++ ARDroneLib/VLIB/video_packetizer.h | 39 + ARDroneLib/VLIB/video_picture.c | 722 ++++++++ ARDroneLib/VLIB/video_picture.h | 30 + ARDroneLib/VLIB/video_picture_defines.h | 16 + ARDroneLib/VLIB/video_quantizer.c | 295 +++ ARDroneLib/VLIB/video_quantizer.h | 26 + ARDroneLib/VP_SDK/ATcodec/ATcodec.c | 611 ++++++ ARDroneLib/VP_SDK/ATcodec/ATcodec.h | 220 +++ ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.c | 145 ++ ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.h | 51 + ARDroneLib/VP_SDK/ATcodec/ATcodec_Error.h | 52 + ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.c | 234 +++ ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.h | 68 + .../VP_SDK/ATcodec/ATcodec_Messages_ex.h | 95 + .../VP_SDK/ATcodec/ATcodec_Sorted_List.c | 182 ++ .../VP_SDK/ATcodec/ATcodec_Sorted_List.h | 52 + ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.c | 419 +++++ ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.h | 139 ++ ARDroneLib/VP_SDK/ATcodec/ATcodec_api.c | 780 ++++++++ ARDroneLib/VP_SDK/ATcodec/ATcodec_api.h | 272 +++ ARDroneLib/VP_SDK/Build/Makefile | 242 +++ .../linux/api_ethernet_raw_sdl | Bin 0 -> 64944 bytes .../linux/api_serial_raw_sdl | Bin 0 -> 65340 bytes .../linux/api_wifiClientTCP_raw_sdl | Bin 0 -> 65340 bytes .../linux/sym_api_ethernet_raw_sdl | Bin 0 -> 84977 bytes .../linux/sym_api_serial_raw_sdl | Bin 0 -> 85705 bytes .../linux/sym_api_wifiClientTCP_raw_sdl | Bin 0 -> 85505 bytes ARDroneLib/VP_SDK/Build/app.makefile | 34 + ARDroneLib/VP_SDK/Build/common.makefile | 318 ++++ ARDroneLib/VP_SDK/Build/do.sh | 256 +++ ARDroneLib/VP_SDK/Build/elinux.makefile | 35 + ARDroneLib/VP_SDK/Build/generic.makefile | 220 +++ ARDroneLib/VP_SDK/Build/lib.makefile | 25 + ARDroneLib/VP_SDK/Build/libplf.makefile | 38 + .../VP_SDK/Build/parrotOS_codec.makefile | 44 + .../VP_SDK/Build/parrotOS_core.makefile | 56 + .../VP_SDK/Build/parrotOS_devs.makefile | 45 + .../VP_SDK/Build/parrotOS_drivers.makefile | 47 + .../VP_SDK/Build/parrotOS_utils.makefile | 55 + ARDroneLib/VP_SDK/Build/sdk.makefile | 267 +++ ARDroneLib/VP_SDK/Build/sysvar.makefile | 378 ++++ ARDroneLib/VP_SDK/Build/varcontrol.makefile | 236 +++ ARDroneLib/VP_SDK/Build/vlib.makefile | 105 ++ .../VP_SDK/Examples/common/atcodec_client.c | 258 +++ .../VP_SDK/Examples/common/atcodec_client.h | 33 + .../VP_SDK/Examples/common/atcodec_server.c | 277 +++ .../VP_SDK/Examples/common/atcodec_server.h | 21 + .../VP_SDK/Examples/common/com_client.c | 74 + .../VP_SDK/Examples/common/com_client.h | 23 + .../VP_SDK/Examples/common/com_server.c | 82 + .../VP_SDK/Examples/common/com_server.h | 23 + ARDroneLib/VP_SDK/Examples/common/common.c | 13 + ARDroneLib/VP_SDK/Examples/common/common.h | 37 + .../elinux/api_bluetoothClientTCP_console.c | 66 + .../elinux/api_bluetoothClientTCP_ofile.c | 71 + .../Examples/elinux/api_ifile_upper_ofile.c | 115 ++ .../VP_SDK/Examples/elinux/api_serial_ofile.c | 76 + .../VP_SDK/Examples/elinux/api_threads.c | 82 + .../Examples/elinux/api_v4l_raw_ethernet.c | 243 +++ .../Examples/elinux/api_v4l_vlib_ethernet.c | 244 +++ .../elinux/api_wifiClientTCP_console.c | 66 + .../VP_SDK/Examples/elinux/atcodec_client.c | 78 + .../VP_SDK/Examples/elinux/atcodec_server.c | 41 + .../Examples/elinux/atcodec_sorted_list.c | 71 + ARDroneLib/VP_SDK/Examples/elinux/v4l_stage.c | 256 +++ .../linux/api_BTclientTCP_MJPEG_sdl.c | 707 +++++++ .../linux/api_bluetoothClientTCP_console.c | 66 + .../api_bluetoothClientTCP_decoder_sdl.c | 105 ++ .../linux/api_bluetoothClientTCP_ofile.c | 71 + .../linux/api_bluetoothClientTCP_raw_sdl.c | 93 + ARDroneLib/VP_SDK/Examples/linux/api_config.c | 12 + .../VP_SDK/Examples/linux/api_encode_decode.c | 1019 ++++++++++ .../Examples/linux/api_ethernet_raw_sdl.c | 204 ++ .../Examples/linux/api_ethernet_vlib_sdl.c | 199 ++ .../Examples/linux/api_ifile_MJPEG_sdl.c | 690 +++++++ .../VP_SDK/Examples/linux/api_ifile_raw_sdl.c | 185 ++ .../Examples/linux/api_ifile_upper_ofile.c | 115 ++ .../Examples/linux/api_serial_MJPEG_sdl.c | 746 ++++++++ .../Examples/linux/api_serial_decoder_sdl.c | 105 ++ .../VP_SDK/Examples/linux/api_serial_ofile.c | 76 + .../Examples/linux/api_serial_raw_sdl.c | 175 ++ .../VP_SDK/Examples/linux/api_threads.c | 82 + .../Examples/linux/api_v4l_raw_ethernet.c | 167 ++ .../Examples/linux/api_v4l_vlib_ethernet.c | 183 ++ .../linux/api_wifiClientTCP_MJPEG_sdl.c | 751 ++++++++ .../linux/api_wifiClientTCP_console.c | 66 + .../linux/api_wifiClientTCP_decoder_sdl.c | 106 ++ .../linux/api_wifiClientTCP_raw_sdl.c | 92 + .../VP_SDK/Examples/linux/atcodec_client.c | 78 + .../VP_SDK/Examples/linux/atcodec_server.c | 41 + .../Examples/linux/atcodec_sorted_list.c | 71 + ARDroneLib/VP_SDK/Examples/linux/client.c | 47 + ARDroneLib/VP_SDK/Examples/linux/com.c | 103 ++ ARDroneLib/VP_SDK/Examples/linux/server.c | 47 + ARDroneLib/VP_SDK/Examples/linux/wifi.c | 116 ++ .../VP_SDK/Examples/nds/atcodec_client.c | 136 ++ ARDroneLib/VP_SDK/Examples/nds/hello_world.c | 70 + .../VP_SDK/Examples/win32/api_ifile_raw_sdl.c | 184 ++ .../VP_SDK/Examples/win32/mjpeg_decoder.c | 977 ++++++++++ .../VP_SDK/Examples/win32/mjpeg_encoder.c | 979 ++++++++++ ARDroneLib/VP_SDK/VP_Api/vp_api.c | 217 +++ ARDroneLib/VP_SDK/VP_Api/vp_api.h | 177 ++ ARDroneLib/VP_SDK/VP_Api/vp_api_config.h | 91 + ARDroneLib/VP_SDK/VP_Api/vp_api_error.c | 57 + ARDroneLib/VP_SDK/VP_Api/vp_api_error.h | 53 + .../VP_SDK/VP_Api/vp_api_io_multi_stage.c | 70 + .../VP_SDK/VP_Api/vp_api_io_multi_stage.h | 69 + .../VP_SDK/VP_Api/vp_api_io_stage_selector.h | 34 + ARDroneLib/VP_SDK/VP_Api/vp_api_picture.h | 142 ++ ARDroneLib/VP_SDK/VP_Api/vp_api_stage.c | 137 ++ ARDroneLib/VP_SDK/VP_Api/vp_api_stage.h | 110 ++ ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.c | 203 ++ ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.h | 193 ++ .../VP_SDK/VP_Api/vp_api_thread_helper.c | 143 ++ .../VP_SDK/VP_Api/vp_api_thread_helper.h | 109 ++ ARDroneLib/VP_SDK/VP_Com/elinux/vp_com.c | 385 ++++ .../VP_SDK/VP_Com/elinux/vp_com_config_itf.c | 105 ++ .../VP_SDK/VP_Com/elinux/vp_com_config_itf.h | 6 + .../VP_SDK/VP_Com/elinux/vp_com_interface.c | 34 + .../VP_SDK/VP_Com/elinux/vp_com_interface.h | 58 + .../VP_SDK/VP_Com/elinux/vp_com_serial.c | 304 +++ ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wifi.c | 472 +++++ .../VP_SDK/VP_Com/elinux/vp_com_wired.c | 65 + ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.c | 485 +++++ ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.h | 155 ++ ARDroneLib/VP_SDK/VP_Com/linux/bluez.c | 547 ++++++ ARDroneLib/VP_SDK/VP_Com/linux/bluez.h | 36 + ARDroneLib/VP_SDK/VP_Com/linux/vp_com.c | 360 ++++ .../VP_SDK/VP_Com/linux/vp_com_bluetooth.c | 254 +++ .../VP_SDK/VP_Com/linux/vp_com_config_itf.c | 124 ++ .../VP_SDK/VP_Com/linux/vp_com_config_itf.h | 6 + .../VP_SDK/VP_Com/linux/vp_com_serial.c | 308 ++++ ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wifi.c | 223 +++ ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wired.c | 65 + ARDroneLib/VP_SDK/VP_Com/nds/vp_com.c | 347 ++++ ARDroneLib/VP_SDK/VP_Com/vp_com.h | 446 +++++ ARDroneLib/VP_SDK/VP_Com/vp_com_bluetooth.h | 34 + ARDroneLib/VP_SDK/VP_Com/vp_com_error.c | 28 + ARDroneLib/VP_SDK/VP_Com/vp_com_error.h | 34 + ARDroneLib/VP_SDK/VP_Com/vp_com_serial.h | 41 + ARDroneLib/VP_SDK/VP_Com/vp_com_socket.c | 678 +++++++ ARDroneLib/VP_SDK/VP_Com/vp_com_socket.h | 25 + .../VP_SDK/VP_Com/vp_com_socket_utils.c | 223 +++ ARDroneLib/VP_SDK/VP_Com/vp_com_wifi.h | 38 + ARDroneLib/VP_SDK/VP_Com/vp_com_wired.h | 35 + ARDroneLib/VP_SDK/VP_Com/win32/vp_com.c | 347 ++++ .../VP_SDK/VP_Com/win32/vp_com_config_itf.c | 131 ++ .../VP_SDK/VP_Com/win32/vp_com_config_itf.h | 10 + .../VP_SDK/VP_Com/win32/vp_com_serial.c | 294 +++ .../VP_SDK/VP_Com/win32/vp_com_socket.c | 659 +++++++ .../VP_SDK/VP_Com/win32/vp_com_socket_utils.c | 129 ++ ARDroneLib/VP_SDK/VP_Com/win32/vp_com_wifi.c | 233 +++ ARDroneLib/VP_SDK/VP_Os/elinux/intrin.h | 8 + ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_delay.c | 20 + ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.c | 3 + ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.h | 22 + ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_serial.h | 52 + ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal.c | 95 + .../VP_SDK/VP_Os/elinux/vp_os_signal_dep.h | 25 + ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread.c | 231 +++ .../VP_SDK/VP_Os/elinux/vp_os_thread_dep.h | 22 + ARDroneLib/VP_SDK/VP_Os/linux/intrin.h | 96 + ARDroneLib/VP_SDK/VP_Os/linux/vp_os_delay.c | 20 + ARDroneLib/VP_SDK/VP_Os/linux/vp_os_serial.h | 52 + ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal.c | 104 ++ .../VP_SDK/VP_Os/linux/vp_os_signal_dep.h | 25 + ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread.c | 219 +++ .../VP_SDK/VP_Os/linux/vp_os_thread_dep.h | 22 + ARDroneLib/VP_SDK/VP_Os/nds/vp_os_delay.c | 24 + ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal.c | 56 + .../VP_SDK/VP_Os/nds/vp_os_signal_dep.h | 17 + ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread.c | 41 + .../VP_SDK/VP_Os/nds/vp_os_thread_dep.h | 18 + .../VP_SDK/VP_Os/parrotos/default_config.h | 27 + ARDroneLib/VP_SDK/VP_Os/parrotos/intrin.h | 8 + .../VP_SDK/VP_Os/parrotos/vp_os_delay.c | 16 + .../VP_SDK/VP_Os/parrotos/vp_os_serial.h | 52 + .../VP_SDK/VP_Os/parrotos/vp_os_signal.c | 60 + .../VP_SDK/VP_Os/parrotos/vp_os_signal_dep.h | 22 + .../VP_SDK/VP_Os/parrotos/vp_os_thread.c | 140 ++ .../VP_SDK/VP_Os/parrotos/vp_os_thread_dep.h | 24 + ARDroneLib/VP_SDK/VP_Os/syslog.h | 11 + ARDroneLib/VP_SDK/VP_Os/vp_os.h | 139 ++ ARDroneLib/VP_SDK/VP_Os/vp_os_assert.h | 21 + ARDroneLib/VP_SDK/VP_Os/vp_os_delay.h | 40 + .../VP_SDK/VP_Os/vp_os_error_handling.c | 59 + .../VP_SDK/VP_Os/vp_os_error_handling.h | 40 + ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.c | 176 ++ ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.h | 128 ++ ARDroneLib/VP_SDK/VP_Os/vp_os_print.h | 44 + ARDroneLib/VP_SDK/VP_Os/vp_os_rtmon.h | 96 + ARDroneLib/VP_SDK/VP_Os/vp_os_signal.h | 119 ++ ARDroneLib/VP_SDK/VP_Os/vp_os_thread.h | 61 + ARDroneLib/VP_SDK/VP_Os/vp_os_types.h | 147 ++ ARDroneLib/VP_SDK/VP_Os/win32/intrin.h | 56 + ARDroneLib/VP_SDK/VP_Os/win32/vp_os_delay.c | 21 + ARDroneLib/VP_SDK/VP_Os/win32/vp_os_serial.h | 32 + ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal.c | 145 ++ .../VP_SDK/VP_Os/win32/vp_os_signal_dep.h | 59 + ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread.c | 60 + .../VP_SDK/VP_Os/win32/vp_os_thread_dep.h | 21 + .../VP_Stages/vp_stages_buffer_to_picture.c | 266 +++ .../VP_Stages/vp_stages_buffer_to_picture.h | 66 + .../VP_SDK/VP_Stages/vp_stages_configs.c | 251 +++ .../VP_SDK/VP_Stages/vp_stages_configs.h | 54 + .../VP_SDK/VP_Stages/vp_stages_frame_pipe.c | 135 ++ .../VP_SDK/VP_Stages/vp_stages_frame_pipe.h | 63 + .../VP_SDK/VP_Stages/vp_stages_i_camif.h | 70 + .../VP_SDK/VP_Stages/vp_stages_io_buffer.c | 116 ++ .../VP_SDK/VP_Stages/vp_stages_io_buffer.h | 123 ++ .../VP_SDK/VP_Stages/vp_stages_io_com.c | 190 ++ .../VP_SDK/VP_Stages/vp_stages_io_com.h | 141 ++ .../VP_SDK/VP_Stages/vp_stages_io_console.c | 49 + .../VP_SDK/VP_Stages/vp_stages_io_console.h | 79 + .../VP_SDK/VP_Stages/vp_stages_io_file.c | 136 ++ .../VP_SDK/VP_Stages/vp_stages_io_file.h | 122 ++ ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.c | 378 ++++ ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.h | 156 ++ .../VP_SDK/VP_Stages/vp_stages_yuv2rgb.c | 1055 +++++++++++ .../VP_SDK/VP_Stages/vp_stages_yuv2rgb.h | 121 ++ ARDroneLib/VP_SDK/VP_Stages/yuv2rgb.S | 66 + CMakeLists.txt | 35 + ParrotCopyrightAndDisclaimer.txt | 4 + ParrotLicense.txt | 230 +++ build_sdk.sh | 4 + mainpage.dox | 26 + manifest.xml | 19 + msg/Navdata.msg | 29 + rosdep.yaml | 2 + src/ardrone_driver.cpp | 134 ++ src/ardrone_driver.h | 39 + src/ardrone_sdk.cpp | 48 + src/ardrone_sdk.h | 42 + src/teleop_twist.cpp | 124 ++ src/teleop_twist.h | 21 + src/video.cpp | 125 ++ src/video.h | 16 + 566 files changed, 70378 insertions(+) create mode 100644 ARDroneLib/Soft/Build/Makefile create mode 100755 ARDroneLib/Soft/Build/check_dependencies.sh create mode 100644 ARDroneLib/Soft/Build/config.makefile create mode 100644 ARDroneLib/Soft/Build/custom.makefile create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/filter.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/maths.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrices.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrix3d.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/quaternions.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/time.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/vision_math.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/AT/ardrone_at_mutex.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Com/config_wifi.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_ack.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_configuration.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_soft_update.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_navdata_control.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_general_navdata.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_client.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_file.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/navdata.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_input.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_tool_ui.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_com_stage.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_ffmpeg_recorder.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_recorder.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_api.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_time.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool_configuration.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/config_keys.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/dictionary.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/iniparser.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_crc_32.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_ftp.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_gen_ids.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_codec.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_gob_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_huffman.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_mb_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_picture_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_Qp.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_codec.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_gob_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_inter_mc.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_intra_pred.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_mb_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_merge.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_picture_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_transform.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_zigzag.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/video_p264.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/UVLC/uvlc_codec.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/video_utils.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_decode.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_encode.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_codec.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_gob_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_mb_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_picture_layer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_codec.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_controller.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_dct.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_huffman.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_macroblock.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_mem32.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_packetizer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_picture.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_quantizer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Buffer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Memory.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Sorted_List.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Tree.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_api.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_error.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_io_multi_stage.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_stage.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_supervisor.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_thread_helper.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_config_itf.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_serial.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wifi.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wired.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_error.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket_utils.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_delay.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_signal.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_thread.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_error_handling.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_malloc.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_buffer_to_picture.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_configs.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_frame_pipe.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_buffer.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_com.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_console.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_file.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_o_sdl.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_yuv2rgb.c.d create mode 100644 ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log create mode 100644 ARDroneLib/Soft/Common/ardrone_api.h create mode 100644 ARDroneLib/Soft/Common/ardrone_common_config.h create mode 100644 ARDroneLib/Soft/Common/at_msgs.h create mode 100644 ARDroneLib/Soft/Common/at_msgs_ids.h create mode 100644 ARDroneLib/Soft/Common/autoconf.h create mode 100644 ARDroneLib/Soft/Common/config.h create mode 100644 ARDroneLib/Soft/Common/config_keys.h create mode 100644 ARDroneLib/Soft/Common/control_states.h create mode 100644 ARDroneLib/Soft/Common/generated_custom.h create mode 100644 ARDroneLib/Soft/Common/led_animation.h create mode 100644 ARDroneLib/Soft/Common/navdata_common.h create mode 100644 ARDroneLib/Soft/Common/navdata_keys.h create mode 100644 ARDroneLib/Soft/Common/vision_common.h create mode 100644 ARDroneLib/Soft/Lib/Build/Makefile create mode 100644 ARDroneLib/Soft/Lib/Maths/filter.c create mode 100644 ARDroneLib/Soft/Lib/Maths/filter.h create mode 100644 ARDroneLib/Soft/Lib/Maths/maths.c create mode 100644 ARDroneLib/Soft/Lib/Maths/maths.h create mode 100644 ARDroneLib/Soft/Lib/Maths/matrices.c create mode 100644 ARDroneLib/Soft/Lib/Maths/matrices.h create mode 100644 ARDroneLib/Soft/Lib/Maths/matrix3d.c create mode 100644 ARDroneLib/Soft/Lib/Maths/matrix3d.h create mode 100644 ARDroneLib/Soft/Lib/Maths/point3d.h create mode 100644 ARDroneLib/Soft/Lib/Maths/quaternions.c create mode 100644 ARDroneLib/Soft/Lib/Maths/quaternions.h create mode 100644 ARDroneLib/Soft/Lib/Maths/time.c create mode 100644 ARDroneLib/Soft/Lib/Maths/time.h create mode 100644 ARDroneLib/Soft/Lib/Maths/vision_math.c create mode 100644 ARDroneLib/Soft/Lib/Maths/vision_math.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/AT/ardrone_at_mutex.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Com/config_com.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Navdata/navdata.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/ardrone_api.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.c create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.h create mode 100644 ARDroneLib/Soft/Lib/ardrone_tool/config_keys.c create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/AUTHORS create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/INSTALL create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/LICENSE create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/Makefile create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/README create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/doxygen.css create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/doxygen.png create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/globals_func.html create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/index.html create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8h.html create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8main.html create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_b.gif create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_l.gif create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_r.gif create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/html/tabs.css create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.c create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.h create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.c create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.h create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/Makefile create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/iniexample.c create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/parse.c create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-errors.ini create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-genhuge.py create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofkey.ini create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofval.ini create mode 100644 ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted.ini create mode 100644 ARDroneLib/Soft/Lib/utils/ardrone_crc_32.c create mode 100644 ARDroneLib/Soft/Lib/utils/ardrone_crc_32.h create mode 100644 ARDroneLib/Soft/Lib/utils/ardrone_ftp.c create mode 100644 ARDroneLib/Soft/Lib/utils/ardrone_ftp.h create mode 100644 ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.c create mode 100644 ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.h create mode 100644 ARDroneLib/Soft/log create mode 100644 ARDroneLib/VLIB/Docs/uvlc.txt create mode 100644 ARDroneLib/VLIB/P263/p263_codec.c create mode 100644 ARDroneLib/VLIB/P263/p263_codec.h create mode 100644 ARDroneLib/VLIB/P263/p263_gob_layer.c create mode 100644 ARDroneLib/VLIB/P263/p263_huffman.c create mode 100644 ARDroneLib/VLIB/P263/p263_huffman.h create mode 100644 ARDroneLib/VLIB/P263/p263_layers.h create mode 100644 ARDroneLib/VLIB/P263/p263_mb_layer.c create mode 100644 ARDroneLib/VLIB/P263/p263_picture_layer.c create mode 100644 ARDroneLib/VLIB/P264/p264.c create mode 100644 ARDroneLib/VLIB/P264/p264.h create mode 100644 ARDroneLib/VLIB/P264/p264_Qp.c create mode 100644 ARDroneLib/VLIB/P264/p264_Qp.h create mode 100644 ARDroneLib/VLIB/P264/p264_codec.c create mode 100644 ARDroneLib/VLIB/P264/p264_codec.h create mode 100644 ARDroneLib/VLIB/P264/p264_common.h create mode 100644 ARDroneLib/VLIB/P264/p264_gob_layer.c create mode 100644 ARDroneLib/VLIB/P264/p264_inter_mc.c create mode 100644 ARDroneLib/VLIB/P264/p264_inter_mc.h create mode 100644 ARDroneLib/VLIB/P264/p264_intra_pred.c create mode 100644 ARDroneLib/VLIB/P264/p264_intra_pred.h create mode 100644 ARDroneLib/VLIB/P264/p264_layers.h create mode 100644 ARDroneLib/VLIB/P264/p264_mb_layer.c create mode 100644 ARDroneLib/VLIB/P264/p264_merge.c create mode 100644 ARDroneLib/VLIB/P264/p264_merge.h create mode 100644 ARDroneLib/VLIB/P264/p264_picture_layer.c create mode 100644 ARDroneLib/VLIB/P264/p264_transform.c create mode 100644 ARDroneLib/VLIB/P264/p264_transform.h create mode 100644 ARDroneLib/VLIB/P264/p264_zigzag.c create mode 100644 ARDroneLib/VLIB/P264/p264_zigzag.h create mode 100644 ARDroneLib/VLIB/P264/video_p264.c create mode 100644 ARDroneLib/VLIB/P264/video_p264.h create mode 100644 ARDroneLib/VLIB/Platform/arm11/UVLC/uvlc_codec.c create mode 100644 ARDroneLib/VLIB/Platform/arm11/video_config.h create mode 100644 ARDroneLib/VLIB/Platform/arm11/video_utils.c create mode 100644 ARDroneLib/VLIB/Platform/arm11/video_utils.h create mode 100644 ARDroneLib/VLIB/Platform/arm11/video_utils_iphone.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.S create mode 100644 ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.S create mode 100644 ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_config.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.c create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_gen_sad.c create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.S create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_picture_p5p.S create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.S create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_utils.c create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_utils.h create mode 100644 ARDroneLib/VLIB/Platform/arm9/video_utils_p5p.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/P6_h264_reg.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.S create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.c create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.S create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_config.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.c create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.c create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.S create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.c create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_utils.c create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_utils.h create mode 100644 ARDroneLib/VLIB/Platform/arm9_P6/video_utils_p6.h create mode 100644 ARDroneLib/VLIB/Platform/video_config.h create mode 100644 ARDroneLib/VLIB/Platform/video_utils.h create mode 100644 ARDroneLib/VLIB/Platform/x86/UVLC/uvlc_codec.c create mode 100644 ARDroneLib/VLIB/Platform/x86/video_config.h create mode 100644 ARDroneLib/VLIB/Platform/x86/video_utils.c create mode 100644 ARDroneLib/VLIB/Platform/x86/video_utils.h create mode 100644 ARDroneLib/VLIB/Platform/x86/video_utils_x86.h create mode 100644 ARDroneLib/VLIB/Stages/vlib_stage_decode.c create mode 100644 ARDroneLib/VLIB/Stages/vlib_stage_decode.h create mode 100644 ARDroneLib/VLIB/Stages/vlib_stage_encode.c create mode 100644 ARDroneLib/VLIB/Stages/vlib_stage_encode.h create mode 100644 ARDroneLib/VLIB/UVLC/uvlc.c create mode 100644 ARDroneLib/VLIB/UVLC/uvlc.h create mode 100644 ARDroneLib/VLIB/UVLC/uvlc_codec.c create mode 100644 ARDroneLib/VLIB/UVLC/uvlc_codec.h create mode 100644 ARDroneLib/VLIB/UVLC/uvlc_gob_layer.c create mode 100644 ARDroneLib/VLIB/UVLC/uvlc_layers.h create mode 100644 ARDroneLib/VLIB/UVLC/uvlc_mb_layer.c create mode 100644 ARDroneLib/VLIB/UVLC/uvlc_picture_layer.c create mode 100644 ARDroneLib/VLIB/Utils/video_bin_dct.c create mode 100644 ARDroneLib/VLIB/Utils/video_bin_dct.h create mode 100644 ARDroneLib/VLIB/video_codec.c create mode 100644 ARDroneLib/VLIB/video_codec.h create mode 100644 ARDroneLib/VLIB/video_controller.c create mode 100644 ARDroneLib/VLIB/video_controller.h create mode 100644 ARDroneLib/VLIB/video_dct.c create mode 100644 ARDroneLib/VLIB/video_dct.h create mode 100644 ARDroneLib/VLIB/video_gob.h create mode 100644 ARDroneLib/VLIB/video_huffman.c create mode 100644 ARDroneLib/VLIB/video_huffman.h create mode 100644 ARDroneLib/VLIB/video_macroblock.c create mode 100644 ARDroneLib/VLIB/video_macroblock.h create mode 100644 ARDroneLib/VLIB/video_mem32.c create mode 100644 ARDroneLib/VLIB/video_mem32.h create mode 100644 ARDroneLib/VLIB/video_packetizer.c create mode 100644 ARDroneLib/VLIB/video_packetizer.h create mode 100644 ARDroneLib/VLIB/video_picture.c create mode 100644 ARDroneLib/VLIB/video_picture.h create mode 100644 ARDroneLib/VLIB/video_picture_defines.h create mode 100644 ARDroneLib/VLIB/video_quantizer.c create mode 100644 ARDroneLib/VLIB/video_quantizer.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec.c create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.c create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Error.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.c create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Messages_ex.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.c create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.c create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.h create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_api.c create mode 100644 ARDroneLib/VP_SDK/ATcodec/ATcodec_api.h create mode 100644 ARDroneLib/VP_SDK/Build/Makefile create mode 100755 ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/api_ethernet_raw_sdl create mode 100755 ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/api_serial_raw_sdl create mode 100755 ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/api_wifiClientTCP_raw_sdl create mode 100755 ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/sym_api_ethernet_raw_sdl create mode 100755 ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/sym_api_serial_raw_sdl create mode 100755 ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/sym_api_wifiClientTCP_raw_sdl create mode 100644 ARDroneLib/VP_SDK/Build/app.makefile create mode 100644 ARDroneLib/VP_SDK/Build/common.makefile create mode 100755 ARDroneLib/VP_SDK/Build/do.sh create mode 100644 ARDroneLib/VP_SDK/Build/elinux.makefile create mode 100644 ARDroneLib/VP_SDK/Build/generic.makefile create mode 100644 ARDroneLib/VP_SDK/Build/lib.makefile create mode 100644 ARDroneLib/VP_SDK/Build/libplf.makefile create mode 100644 ARDroneLib/VP_SDK/Build/parrotOS_codec.makefile create mode 100644 ARDroneLib/VP_SDK/Build/parrotOS_core.makefile create mode 100644 ARDroneLib/VP_SDK/Build/parrotOS_devs.makefile create mode 100644 ARDroneLib/VP_SDK/Build/parrotOS_drivers.makefile create mode 100644 ARDroneLib/VP_SDK/Build/parrotOS_utils.makefile create mode 100644 ARDroneLib/VP_SDK/Build/sdk.makefile create mode 100644 ARDroneLib/VP_SDK/Build/sysvar.makefile create mode 100644 ARDroneLib/VP_SDK/Build/varcontrol.makefile create mode 100644 ARDroneLib/VP_SDK/Build/vlib.makefile create mode 100644 ARDroneLib/VP_SDK/Examples/common/atcodec_client.c create mode 100644 ARDroneLib/VP_SDK/Examples/common/atcodec_client.h create mode 100644 ARDroneLib/VP_SDK/Examples/common/atcodec_server.c create mode 100644 ARDroneLib/VP_SDK/Examples/common/atcodec_server.h create mode 100644 ARDroneLib/VP_SDK/Examples/common/com_client.c create mode 100644 ARDroneLib/VP_SDK/Examples/common/com_client.h create mode 100644 ARDroneLib/VP_SDK/Examples/common/com_server.c create mode 100644 ARDroneLib/VP_SDK/Examples/common/com_server.h create mode 100644 ARDroneLib/VP_SDK/Examples/common/common.c create mode 100644 ARDroneLib/VP_SDK/Examples/common/common.h create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_console.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_ofile.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_ifile_upper_ofile.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_serial_ofile.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_threads.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_v4l_raw_ethernet.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_v4l_vlib_ethernet.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/api_wifiClientTCP_console.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/atcodec_client.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/atcodec_server.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/atcodec_sorted_list.c create mode 100644 ARDroneLib/VP_SDK/Examples/elinux/v4l_stage.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_BTclientTCP_MJPEG_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_console.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_decoder_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_ofile.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_raw_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_config.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_encode_decode.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_ethernet_raw_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_ethernet_vlib_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_ifile_MJPEG_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_ifile_raw_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_ifile_upper_ofile.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_serial_MJPEG_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_serial_decoder_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_serial_ofile.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_serial_raw_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_threads.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_v4l_raw_ethernet.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_v4l_vlib_ethernet.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_MJPEG_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_console.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_decoder_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_raw_sdl.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/atcodec_client.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/atcodec_server.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/atcodec_sorted_list.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/client.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/com.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/server.c create mode 100644 ARDroneLib/VP_SDK/Examples/linux/wifi.c create mode 100644 ARDroneLib/VP_SDK/Examples/nds/atcodec_client.c create mode 100644 ARDroneLib/VP_SDK/Examples/nds/hello_world.c create mode 100755 ARDroneLib/VP_SDK/Examples/win32/api_ifile_raw_sdl.c create mode 100755 ARDroneLib/VP_SDK/Examples/win32/mjpeg_decoder.c create mode 100755 ARDroneLib/VP_SDK/Examples/win32/mjpeg_encoder.c create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api.c create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_config.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_error.c create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_error.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.c create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_io_stage_selector.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_picture.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_stage.c create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_stage.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.c create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.h create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.c create mode 100644 ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_serial.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wifi.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wired.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/bluez.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/bluez.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/vp_com.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/vp_com_bluetooth.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/vp_com_serial.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wifi.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wired.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/nds/vp_com.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_bluetooth.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_error.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_error.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_serial.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_socket.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_socket.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_socket_utils.c create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_wifi.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/vp_com_wired.h create mode 100755 ARDroneLib/VP_SDK/VP_Com/win32/vp_com.c create mode 100755 ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.c create mode 100755 ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.h create mode 100644 ARDroneLib/VP_SDK/VP_Com/win32/vp_com_serial.c create mode 100755 ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket.c create mode 100755 ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket_utils.c create mode 100755 ARDroneLib/VP_SDK/VP_Com/win32/vp_com_wifi.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/intrin.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_delay.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_serial.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/linux/intrin.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/linux/vp_os_delay.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/linux/vp_os_serial.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/nds/vp_os_delay.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/default_config.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/intrin.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_delay.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_serial.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/syslog.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_assert.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_delay.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_print.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_rtmon.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_signal.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_thread.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/vp_os_types.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/win32/intrin.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/win32/vp_os_delay.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/win32/vp_os_serial.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread.c create mode 100644 ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread_dep.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_i_camif.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.c create mode 100644 ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.h create mode 100644 ARDroneLib/VP_SDK/VP_Stages/yuv2rgb.S create mode 100644 CMakeLists.txt create mode 100644 ParrotCopyrightAndDisclaimer.txt create mode 100644 ParrotLicense.txt create mode 100755 build_sdk.sh create mode 100644 mainpage.dox create mode 100644 manifest.xml create mode 100644 msg/Navdata.msg create mode 100644 rosdep.yaml create mode 100644 src/ardrone_driver.cpp create mode 100644 src/ardrone_driver.h create mode 100644 src/ardrone_sdk.cpp create mode 100644 src/ardrone_sdk.h create mode 100644 src/teleop_twist.cpp create mode 100644 src/teleop_twist.h create mode 100644 src/video.cpp create mode 100644 src/video.h diff --git a/ARDroneLib/Soft/Build/Makefile b/ARDroneLib/Soft/Build/Makefile new file mode 100644 index 0000000..12ad8da --- /dev/null +++ b/ARDroneLib/Soft/Build/Makefile @@ -0,0 +1,107 @@ + +GEN_CUSTOM_HEADER:=../Common/generated_custom.h + +include custom.makefile +include config.makefile + +GNUTOOLS_PATH=/usr/local/$(GNUTOOLS_VERSION)/bin +ifeq ("$(QUIET_BUILD)","yes") + MAKE:=@PATH=$(GNUTOOLS_PATH):$(PATH) make -s +else + MAKE:=PATH=$(GNUTOOLS_PATH):$(PATH) make +endif + +define ADD_RULE_TEMPLATE + TO_BUILD+=build_$(1) +endef + +# Add rule for each target +$(foreach target,$(TARGETS),$(eval $(call ADD_RULE_TEMPLATE,$(target)))) + +.PHONY: linux_sample svn_update $(TO_BUILD) build_libs $(MAKECMDGOALS) + +all: $(GEN_CUSTOM_HEADER) build_libs $(TO_BUILD) + +$(GEN_CUSTOM_HEADER): custom.makefile + @echo "#ifndef _GENERATED_CUSTOM_CONFIGURATION_H_" > $@ + @echo "#define _GENERATED_CUSTOM_CONFIGURATION_H_" >> $@ + @echo >> $@ + @echo "#if defined(BR2_PACKAGE_BCM4318_AP)" >> $@ + @echo "# define AP" >> $@ + @echo "#else" >> $@ + @echo "# define STA" >> $@ + @echo "#endif" >> $@ + @echo "#define CURRENT_NUM_VERSION_SOFT \"$(MAJOR_VERSION).$(MINOR_VERSION).$(MODIF_VERSION)\"" >> $@ + @echo "#define CURRENT_BUILD_DATE \"$(shell date +%F\ %H:%M)\"" >> $@ + @echo >> $@ +ifeq ("$(VIDEO_YUV)","yes") + @echo "#define USE_VIDEO_YUV" >> $@ +endif +ifeq ("$(RECORD_VISION_DATA)","yes") + @echo "#define RECORD_VISION_DATA" >> $@ +endif + @echo >> $@ + @echo "#define WIFI_NETWORK_NAME \"$(WIFI_NETWORK_NAME)\"" >> $@ + @echo "#define WIFI_BROADCAST \"$(WIFI_BROADCAST)\"" >> $@ + @echo "#define WIFI_ARDRONE_IP \"$(WIFI_ARDRONE_IP)\"" >> $@ + @echo >> $@ + @echo "#if defined(__linux__) || defined(USE_MINGW32)" >> $@ + @echo "# define WIFI_MOBILE_IP \"$(WIFI_MOBILE_IP)\"" >> $@ + @echo "# define WIRED_ITFNAME \"$(WIRED_ITFNAME)\"" >> $@ + @echo "#endif // ! __linux__" >> $@ + @echo >> $@ + @echo >> $@ + @echo "#endif // ! _GENERATED_CUSTOM_CONFIGURATION_H_" >> $@ + +ifneq "$(MAKECMDGOALS)" "" + ifneq "$(MAKECMDGOALS)" "clean" + ifneq "$(MAKECMDGOALS)" "update" + $(MAKECMDGOALS): + @echo -e "\nCannot make what you ask me to do :-(" + else + $(MAKECMDGOALS): svn_update + endif + endif +endif + +$(MAKECMDGOALS): build_libs $(TO_BUILD) + +checkpackages: + sh ./check_dependencies.sh + +define GENERIC_RULES_TEMPLATE +build_$(1): + @$(MAKE) -C $(1) $(MAKECMDGOALS) +endef + +$(foreach target,$(TARGETS),$(eval $(call GENERIC_RULES_TEMPLATE,$(target)))) + +build_libs: checkpackages + @$(MAKE) PC_TARGET=yes USE_ARDRONE_TOOL=yes TARGET=pc_ USE_MINGW32=no -C ../Lib/Build $(MAKECMDGOALS) + +ifeq ("$(MINGW32_MODE)","yes") +ifeq ($(shell which i586-mingw32msvc-gcc 2> /dev/null),) + $(warning You need MinGW32 to compile My Ardrone lib for Windows if you want. (under Debian: apt-get install mingw32)) +else +# @$(MAKE) PC_TARGET=yes TARGET=mingw32_ USE_MINGW32=yes TMP_SDK_FLAGS="USE_MINGW32=yes NO_COM=yes USE_BLUEZ=no" -C ../Lib/Build $(MAKECMDGOALS) +# @$(MAKE) PC_TARGET=yes TARGET=emb_mingw32_ USE_MINGW32=yes CONTROL_DLL=yes TMP_SDK_FLAGS="USE_MINGW32=yes NO_COM=yes USE_BLUEZ=no" -C ../Lib/Build $(MAKECMDGOALS) +endif +endif +ifeq ($(WIIMOTE_SUPPORT),yes) +# @$(MAKE) PC_TARGET=yes TARGET=pc_ TMP_SDK_FLAGS="USE_BLUEZ=yes" -C ../Lib/libcwiid $(MAKECMDGOALS) +endif + +define svn_update_template + cd ../.. ; \ + echo "Checking out tag $(1) of $(2) ..." ; \ + if [ $(1) != head ] ; then \ + svn co -r $(1) https://svn.ardrone.org/repo/ARDrone_API/$(2) ; \ + else \ + svn co https://svn.ardrone.org/repo/ARDrone_API/$(2) ; \ + fi ; \ + cd Soft/Build ; +endef + +svn_update: + @-$(call svn_update_template,$(SDK_VERSION),ARDroneLib) + diff --git a/ARDroneLib/Soft/Build/check_dependencies.sh b/ARDroneLib/Soft/Build/check_dependencies.sh new file mode 100755 index 0000000..134f2bc --- /dev/null +++ b/ARDroneLib/Soft/Build/check_dependencies.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +## Author : stephane.piskorski@parrot.com +## Date : 19th,Oct. 2010 + + +check() +{ + if [ `cat ./temporary_file | grep $1 | wc -l` -eq 0 ] ; then + echo " $1"; + fi +} + +verify() +{ + packages="$packages$(check $1)"; +} + + +packages=""; + +if [ `which uname` ] ; then + if [ `uname -a | grep Ubuntu | wc -l` ] ; then + + echo "\033[31mChecking required Ubuntu packages ...\033[0m"; + + if [ ! -e ./temporary_file ] ; then # check that the temp file does not exist + + dpkg -l > ./temporary_file; + + #To use FFMPEG recording + verify "libavformat-dev"; + verify "libavcodec-dev"; + verify "libavutil-dev"; + verify "libswscale-dev"; + verify "libavfilter-dev"; + + #To use the Wiimote in Navigation + verify "libcwiid1-dev"; + verify "libbluetooth-dev"; + + #To compile Navigation + verify "libsdl1.2-dev"; + verify "libgtk2.0-dev"; + verify "libxml2-dev"; + verify "libudev-dev"; + verify "libiw-dev"; + + if [ "$packages" != "" ] ; then + echo "You should install the following packages to compile the Mykonos project with Ubuntu:\n $packages"; + echo "Do you want to install them now [y/n] ?"; + read user_answer ; + if [ "$user_answer" = "y" ]; then + sudo apt-get install $packages; + fi + else + echo "ok."; + fi + + rm ./temporary_file; + fi + fi +fi + diff --git a/ARDroneLib/Soft/Build/config.makefile b/ARDroneLib/Soft/Build/config.makefile new file mode 100644 index 0000000..e86e7b3 --- /dev/null +++ b/ARDroneLib/Soft/Build/config.makefile @@ -0,0 +1,171 @@ + +######################################################### +# Common build definitions (CUSTOM) +######################################################### + +RELEASE_BUILD = yes +QUIET_BUILD = yes + +######################################################### +# System utility definitions (STATIC) +######################################################### +define CHECK_UNDEFINITION + ifdef $(1) + $$(warning ERROR : $(1) defined $(2)) + ERROR=1 + endif +endef + +define EXIT_IF_ERROR + ifeq "$$(ERROR)" "1" + $$(error There has been some errors) + endif +endef + + +######################################################### +# Validity control (STATIC) +######################################################### + +ifdef PC_TARGET + $(eval $(call CHECK_UNDEFINITION,CONSOLE_TARGET,(should not be defined when PC_TARGET is defined))) +endif + +$(eval $(call EXIT_IF_ERROR)) + + +######################################################### +# Common definitions (STATIC) +######################################################### + +ifeq "$(QUIET_BUILD)" "yes" + MAKE=@make -s +else + MAKE=make +endif + +COMMON_DIR:=../Common + +SDK_FLAGS:="NO_EXAMPLES=yes" +SDK_FLAGS+="USE_SDK=yes" +SDK_FLAGS+="QUIET_BUILD=$(QUIET_BUILD)" +SDK_FLAGS+="RELEASE_BUILD=$(RELEASE_BUILD)" +SDK_FLAGS+="SDK_VERSION=$(SDK_VERSION)" + +ifeq ($(filter NO_COM=%,$(TMP_SDK_FLAGS)),) + SDK_FLAGS+="NO_COM=no" +endif + +######################################################### +# PC_TARGET specific definitions (STATIC) +######################################################### +ifdef PC_TARGET + SDK_FLAGS+="NO_COM=no" + + ifeq ($(ARDRONE_TARGET_OS),Linux) + OS_DEFINE=GNU_LINUX + else + ifeq ($(ARDRONE_TARGET_OS),iphoneos) + OS_DEFINE=GNU_LINUX + else + ifeq ($(ARDRONE_TARGET_OS),iphonesimulator) + OS_DEFINE=GNU_LINUX + else + TARGET:=$(TARGET).exe + OS_DEFINE=WINDOW + endif + endif + endif + + GENERIC_CFLAGS+=-D_MOBILE + + ifeq ("$(PC_USE_TABLE_PILOTAGE)","yes") + GENERIC_CFLAGS+=-DUSE_TABLE_PILOTAGE + endif + + ifeq ("$(RECORD_VIDEO)","yes") + GENERIC_CFLAGS+=-DRECORD_VIDEO + endif + + GENERIC_CFLAGS+=-D$(OS_DEFINE) + ifeq ($(IPHONE_MODE),yes) + ifeq ($(ARDRONE_TARGET_OS),iphoneos) + GENERIC_CFLAGS+=-DTARGET_OS_IPHONE + else + GENERIC_CFLAGS+=-DTARGET_IPHONE_SIMULATOR + endif + endif + + ifneq ("$(USE_MINGW32)","yes") + GENERIC_CFLAGS+=$(shell pkg-config --cflags gtk+-2.0) + GENERIC_LIBS+=$(shell pkg-config --libs gtk+-2.0) + endif + + ifeq ("$(USE_LINUX)","yes") + SDK_FLAGS+="USE_LINUX=yes" + else + SDK_FLAGS+="USE_LINUX=no" + endif + + SDK_FLAGS+="USE_ELINUX=no" + + ifneq ($(findstring iphone,$(ARDRONE_TARGET_OS)),) + SDK_FLAGS+="USE_IPHONE=yes" + SDK_FLAGS+="IPHONE_PLATFORM=$(ARDRONE_TARGET_OS)" + SDK_FLAGS+="IPHONE_SDK_PATH=$(IPHONE_SDK_PATH)" + else + SDK_FLAGS+="USE_IPHONE=no" + endif + + SDK_FLAGS+="ARDRONE_TARGET_ARCH=$(ARDRONE_TARGET_ARCH)" + + ifeq ("$(USE_NDS)","yes") + SDK_FLAGS+="USE_NDS=yes" + SDK_FLAGS+="NDS_CPU=ARM7" + else + SDK_FLAGS+="USE_NDS=no" + endif + + ifeq ("$(USE_ANDROID)","yes") + SDK_FLAGS+="USE_ANDROID=yes" + SDK_FLAGS+="TOOLCHAIN_VERSION=arm-eabi-4.4.0" + SDK_FLAGS+="NDK_PLATFORM_VERSION=android-5" + else + SDK_FLAGS+="USE_ANDROID=no" + endif + + ifeq ($(FFMPEG_RECORDING_SUPPORT),yes) + ifeq ($(USE_LINUX),yes) + SDK_FLAGS+="USE_FFMPEG=yes" + GENERIC_CFLAGS+=-DUSE_FFMPEG + endif + endif + + ifeq ($(filter USE_BLUEZ=%,$(TMP_SDK_FLAGS)),) + SDK_FLAGS+="USE_BLUEZ=no" + endif + + SDK_FLAGS+="USE_VLIB=yes" + SDK_FLAGS+="USE_BONJOUR=no" + SDK_FLAGS+="USE_WIFI=yes" + + SDK_FLAGS+="USE_BROADCOM=no" + SDK_FLAGS+="USE_IWLIB=no" + + SDK_FLAGS+="FF_ARCH=Intel" + + SDK_FLAGS+="USE_PARROTOS_CORE=no" + SDK_FLAGS+="USE_PARROTOS_DRIVERS=no" + SDK_FLAGS+="USE_PARROTOS_DEVS=no" + SDK_FLAGS+="USE_PARROTOS_CODEC=no" + + + SDK_FLAGS+="USE_ARDRONELIB=yes" + SDK_FLAGS+="USE_ARDRONE_VISION=yes" + SDK_FLAGS+="USE_ARDRONE_POLARIS=no" + SDK_FLAGS+="USE_ARDRONE_VICON=no" + SDK_FLAGS+="USE_ARDRONE_TEST_BENCHS=no" + SDK_FLAGS+="USE_ARDRONE_CALIBRATION=no" + +endif + diff --git a/ARDroneLib/Soft/Build/custom.makefile b/ARDroneLib/Soft/Build/custom.makefile new file mode 100644 index 0000000..fbf0e2a --- /dev/null +++ b/ARDroneLib/Soft/Build/custom.makefile @@ -0,0 +1,67 @@ +######################################################### +# Common definitions (CUSTOM) +######################################################### +ifndef IPHONE_MODE +IPHONE_MODE = no +endif +ifndef MINGW32_MODE +MINGW32_MODE = no +endif +ifndef USE_NDS +USE_NDS = no +endif +ifndef USE_ANDROID +USE_ANDROID = no +endif +ifndef USE_LINUX +USE_LINUX = yes +endif +MAJOR_VERSION = 0 +MINOR_VERSION = 0 +MODIF_VERSION = 0 + +######################################################### +# ARDroneTool options definitions +######################################################### +USE_ARDRONE_MAINLOOP=yes +USE_CHECK_WIFI_CONFIG=no + +ifeq ($(IPHONE_MODE),yes) +USE_ARDRONE_MAINLOOP=no +IPHONE_SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0 +# iphoneos or iphonesimulator +ARDRONE_TARGET_OS=iphoneos +ARDRONE_TARGET_ARCH=armv6 +else + ifeq ($(USE_ANDROID),yes) + USE_ARDRONE_MAINLOOP=no + endif +ARDRONE_TARGET_OS=Linux +endif + +################## Wifi Options ################## +# Name of the network you want to join or create +WIFI_NETWORK_NAME = "ardronenetwork" +WIFI_BROADCAST = "192.168.1.255" + +################## Video Options ################## +# Tells if we want to record video on pc side +RECORD_VIDEO = yes +FFMPEG_RECORDING_SUPPORT = yes +# Tells if we want to add vision data to video stream (in raw mode) +# Vision data are saved into file only if we define RECORD_VIDEO too +RECORD_VISION_DATA = no +# If the yuv mode is choosen then video is displayed & recorded in color +# Otherwise only luminances are displayed & recorded +VIDEO_YUV = yes + +######################################################### +# Embedded definitions (CUSTOM) +######################################################### +WIFI_ARDRONE_IP = "192.168.1.1" + +######################################################### +# Linux definitions (CUSTOM) +######################################################### +WIFI_MOBILE_IP = "192.168.1.2" + diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/filter.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/filter.c.d new file mode 100644 index 0000000..d9e3087 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/filter.c.d @@ -0,0 +1,17 @@ +filter.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/filter.c.d: ../..//Soft/Lib/Maths/filter.c ../..//Soft/Lib/Maths/maths.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/filter.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/maths.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/maths.c.d new file mode 100644 index 0000000..e6022e0 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/maths.c.d @@ -0,0 +1,16 @@ +maths.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/maths.c.d: ../..//Soft/Lib/Maths/maths.c ../..//Soft/Lib/Maths/maths.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrices.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrices.c.d new file mode 100644 index 0000000..e9068fa --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrices.c.d @@ -0,0 +1,18 @@ +matrices.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrices.c.d: ../..//Soft/Lib/Maths/matrices.c ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../..//Soft/Lib/Maths/matrices.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrix3d.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrix3d.c.d new file mode 100644 index 0000000..25ab9ab --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrix3d.c.d @@ -0,0 +1,27 @@ +matrix3d.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrix3d.c.d: ../..//Soft/Lib/Maths/matrix3d.c \ + ../..//Soft/Lib/Maths/matrix3d.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Lib/Maths/matrices.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/quaternions.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/quaternions.c.d new file mode 100644 index 0000000..6e91ad8 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/quaternions.c.d @@ -0,0 +1,19 @@ +quaternions.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/quaternions.c.d: ../..//Soft/Lib/Maths/quaternions.c \ + ../VP_Os/vp_os_assert.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../..//Soft/Lib/Maths/quaternions.h \ + ../..//Soft/Lib/Maths/matrices.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/time.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/time.c.d new file mode 100644 index 0000000..7616987 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/time.c.d @@ -0,0 +1,13 @@ +time.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/time.c.d: ../..//Soft/Lib/Maths/time.c ../..//Soft/Lib/Maths/time.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h /usr/include/sys/time.h /usr/include/time.h \ + /usr/include/bits/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/vision_math.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/vision_math.c.d new file mode 100644 index 0000000..66584e6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/vision_math.c.d @@ -0,0 +1,22 @@ +vision_math.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/vision_math.c.d: ../..//Soft/Lib/Maths/vision_math.c ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../..//Soft/Lib/Maths/vision_math.h ../..//Soft/Lib/Maths/maths.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/AT/ardrone_at_mutex.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/AT/ardrone_at_mutex.c.d new file mode 100644 index 0000000..d0888bd --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/AT/ardrone_at_mutex.c.d @@ -0,0 +1,71 @@ +ardrone_at_mutex.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/AT/ardrone_at_mutex.c.d: ../..//Soft/Lib/ardrone_tool/AT/ardrone_at_mutex.c \ + ../VP_Os/vp_os_assert.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_com.h \ + ../..//Soft/Common/config.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_serial.h ../VP_Com/vp_com.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_wifi.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Error.h ../ATcodec/ATcodec_Tree.h \ + ../ATcodec/ATcodec_Buffer.h ../..//Soft/Common/navdata_common.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/string.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../..//Soft/Common/at_msgs_ids.h \ + ../..//Soft/Common/at_msgs.h ../VP_Com/vp_com_socket.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Com/config_wifi.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Com/config_wifi.c.d new file mode 100644 index 0000000..5b72eb9 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Com/config_wifi.c.d @@ -0,0 +1,44 @@ +config_wifi.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Com/config_wifi.c.d: ../..//Soft/Lib/ardrone_tool/Com/config_wifi.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Common/config.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_com.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_serial.h ../VP_Com/vp_com.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_wifi.h ../VP_Com/vp_com_socket.h \ + /usr/include/arpa/inet.h /usr/include/netinet/in.h \ + /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/bits/socket2.h /usr/include/bits/in.h \ + /usr/include/ifaddrs.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control.c.d new file mode 100644 index 0000000..f62cd14 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control.c.d @@ -0,0 +1,91 @@ +ardrone_control.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control.c.d: ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.c \ + ../..//Soft/Common/config.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h ../VP_Com/vp_com.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Error.h ../ATcodec/ATcodec_Tree.h \ + ../ATcodec/ATcodec_Buffer.h ../..//Soft/Common/navdata_common.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../..//Soft/Lib/Maths/quaternions.h \ + ../..//Soft/Common/led_animation.h ../..//Soft/Common/config_keys.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h \ + ../..//Soft/Lib/iniparser3.0b/src/iniparser.h \ + ../..//Soft/Lib/iniparser3.0b/src/dictionary.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_com.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_serial.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_wifi.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/bits/socket2.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ + /usr/include/bits/ioctl-types.h /usr/include/netinet/in.h \ + /usr/include/bits/in.h /usr/include/netinet/tcp.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_ack.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_ack.c.d new file mode 100644 index 0000000..007b9a6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_ack.c.d @@ -0,0 +1,69 @@ +ardrone_control_ack.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_ack.c.d: \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_ack.c \ + ../..//Soft/Common/config.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/vision_common.h \ + ../..//Soft/Lib/Maths/maths.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../..//Soft/Lib/Maths/quaternions.h \ + ../..//Soft/Common/led_animation.h ../..//Soft/Common/config_keys.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h \ + ../VP_Api/vp_api_thread_helper.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_configuration.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_configuration.c.d new file mode 100644 index 0000000..e3159a4 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_configuration.c.d @@ -0,0 +1,74 @@ +ardrone_control_configuration.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_configuration.c.d: \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/config.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h \ + ../..//Soft/Lib/iniparser3.0b/src/iniparser.h \ + ../..//Soft/Lib/iniparser3.0b/src/dictionary.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h \ + ../VP_Api/vp_api_thread_helper.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_soft_update.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_soft_update.c.d new file mode 100644 index 0000000..f5379f2 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_soft_update.c.d @@ -0,0 +1,67 @@ +ardrone_control_soft_update.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_soft_update.c.d: \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Common/config.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/vision_common.h \ + ../..//Soft/Lib/Maths/maths.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h \ + ../VP_Api/vp_api_thread_helper.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_navdata_control.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_navdata_control.c.d new file mode 100644 index 0000000..7d46d12 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_navdata_control.c.d @@ -0,0 +1,71 @@ +ardrone_navdata_control.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_navdata_control.c.d: \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.c \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../ATcodec/ATcodec.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/config.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../..//Soft/Lib/Maths/quaternions.h \ + ../..//Soft/Common/led_animation.h ../..//Soft/Common/config_keys.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_general_navdata.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_general_navdata.c.d new file mode 100644 index 0000000..bf59efa --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_general_navdata.c.d @@ -0,0 +1,80 @@ +ardrone_general_navdata.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_general_navdata.c.d: \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.c \ + /usr/include/stdio.h /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h \ + /usr/include/bits/sched.h /usr/include/xlocale.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/setjmp.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Error.h ../ATcodec/ATcodec_Tree.h \ + ../ATcodec/ATcodec_Buffer.h ../..//Soft/Common/navdata_common.h \ + ../..//Soft/Common/config.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../..//Soft/Common/vision_common.h \ + ../..//Soft/Lib/Maths/maths.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/sysmacros.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool_configuration.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + ../VP_Api/vp_api_thread_helper.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h \ + ../..//Soft/Lib/iniparser3.0b/src/iniparser.h \ + ../..//Soft/Lib/iniparser3.0b/src/dictionary.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h \ + ../..//Soft/Lib/utils/ardrone_gen_ids.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_client.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_client.c.d new file mode 100644 index 0000000..6a535e2 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_client.c.d @@ -0,0 +1,88 @@ +ardrone_navdata_client.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_client.c.d: \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.c \ + /usr/include/errno.h /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + ../..//Soft/Common/config.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h ../VP_Com/vp_com.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/setjmp.h \ + ../VP_Api/vp_api_thread_helper.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Error.h ../ATcodec/ATcodec_Tree.h \ + ../ATcodec/ATcodec_Buffer.h ../..//Soft/Common/navdata_common.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../..//Soft/Lib/Maths/quaternions.h \ + ../..//Soft/Common/led_animation.h ../..//Soft/Common/config_keys.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_com.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_serial.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_wifi.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/bits/socket2.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ + /usr/include/bits/ioctl-types.h /usr/include/netinet/in.h \ + /usr/include/bits/in.h /usr/include/netinet/tcp.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_file.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_file.c.d new file mode 100644 index 0000000..cb5f331 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_file.c.d @@ -0,0 +1,74 @@ +ardrone_navdata_file.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_file.c.d: \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.c \ + /usr/include/time.h /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/time.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/xlocale.h \ + /usr/include/sys/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/sys/types.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + /usr/include/string.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/bits/string3.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/config.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h \ + ../VP_Api/vp_api_thread_helper.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h \ + ../..//Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.h \ + ../..//Soft/Lib/ardrone_tool/UI/ardrone_input.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/navdata.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/navdata.c.d new file mode 100644 index 0000000..a86ca9a --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/navdata.c.d @@ -0,0 +1,64 @@ +navdata.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/navdata.c.d: ../..//Soft/Lib/ardrone_tool/Navdata/navdata.c \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + /usr/include/string.h /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/config.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_input.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_input.c.d new file mode 100644 index 0000000..5867f75 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_input.c.d @@ -0,0 +1,68 @@ +ardrone_input.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_input.c.d: ../..//Soft/Lib/ardrone_tool/UI/ardrone_input.c \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_assert.h /usr/include/assert.h \ + ../..//Soft/Lib/ardrone_tool/UI/ardrone_input.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/config.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/string.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_tool_ui.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_tool_ui.c.d new file mode 100644 index 0000000..9b965e3 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_tool_ui.c.d @@ -0,0 +1,68 @@ +ardrone_tool_ui.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_tool_ui.c.d: ../..//Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.c \ + ../..//Soft/Common/config.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/vision_common.h \ + ../..//Soft/Lib/Maths/maths.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../..//Soft/Lib/Maths/quaternions.h \ + ../..//Soft/Common/led_animation.h ../..//Soft/Common/config_keys.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/UI/ardrone_input.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_com_stage.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_com_stage.c.d new file mode 100644 index 0000000..7e140e3 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_com_stage.c.d @@ -0,0 +1,50 @@ +video_com_stage.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_com_stage.c.d: ../..//Soft/Lib/ardrone_tool/Video/video_com_stage.c \ + ../..//Soft/Common/config.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_delay.h \ + ../..//Soft/Lib/ardrone_tool/Video/video_com_stage.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Com/vp_com.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../VP_Com/vp_com_socket.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/bits/socket2.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ + /usr/include/bits/ioctl-types.h /usr/include/netinet/in.h \ + /usr/include/bits/in.h /usr/include/netinet/tcp.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage.c.d new file mode 100644 index 0000000..3ace8f6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage.c.d @@ -0,0 +1,79 @@ +video_stage.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage.c.d: ../..//Soft/Lib/ardrone_tool/Video/video_stage.c \ + ../..//Soft/Lib/ardrone_tool/Video/video_stage.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../VP_Os/vp_os_print.h ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + ../../VLIB/../VLIB/Stages/vlib_stage_decode.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../VP_Stages/vp_stages_yuv2rgb.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Error.h ../ATcodec/ATcodec_Tree.h \ + ../ATcodec/ATcodec_Buffer.h ../..//Soft/Common/navdata_common.h \ + ../..//Soft/Common/config.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../..//Soft/Common/vision_common.h \ + ../..//Soft/Lib/Maths/maths.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_com.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_serial.h ../VP_Com/vp_com.h \ + ../VP_Api/vp_api_thread_helper.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_wifi.h \ + ../..//Soft/Lib/ardrone_tool/Video/video_com_stage.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_ffmpeg_recorder.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_ffmpeg_recorder.c.d new file mode 100644 index 0000000..b12d682 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_ffmpeg_recorder.c.d @@ -0,0 +1,64 @@ +video_stage_ffmpeg_recorder.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_ffmpeg_recorder.c.d: \ + ../..//Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.c \ + ../..//Soft/Common/generated_custom.h /usr/include/stdlib.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sys/types.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/string.h /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/bits/string3.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/libavformat/avformat.h \ + /usr/include/libavcodec/avcodec.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/inttypes.h /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavformat/avio.h /usr/include/libavutil/common.h \ + /usr/include/libswscale/swscale.h /usr/include/libavfilter/avfilter.h \ + /usr/include/libavcodec/opt.h /usr/include/libavutil/rational.h \ + /usr/include/libavcodec/avcodec.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ + /usr/include/bits/fcntl2.h /usr/include/sys/time.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h ../VP_Os/linux/intrin.h \ + ../VP_Api/vp_api_picture.h ../..//Soft/Common/config.h \ + ../..//Soft/Common/autoconf.h \ + ../..//Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.h \ + ../VP_Api/vp_api.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../..//Soft/Lib/ardrone_tool/Video/video_stage_recorder.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_recorder.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_recorder.c.d new file mode 100644 index 0000000..ec90794 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_recorder.c.d @@ -0,0 +1,55 @@ +video_stage_recorder.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_recorder.c.d: \ + ../..//Soft/Lib/ardrone_tool/Video/video_stage_recorder.c \ + /usr/include/time.h /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/time.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/xlocale.h \ + /usr/include/sys/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../..//Soft/Common/config.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h \ + ../..//Soft/Lib/ardrone_tool/Video/video_stage_recorder.h \ + ../VP_Api/vp_api.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_api.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_api.c.d new file mode 100644 index 0000000..9f171a9 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_api.c.d @@ -0,0 +1,66 @@ +ardrone_api.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_api.c.d: ../..//Soft/Lib/ardrone_tool/ardrone_api.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Common/config.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../..//Soft/Common/at_msgs_ids.h \ + ../ATcodec/ATcodec_api.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h /usr/include/pthread.h \ + /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/at_msgs.h ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/vision_common.h \ + ../..//Soft/Lib/Maths/maths.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_time.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_time.c.d new file mode 100644 index 0000000..33a8db6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_time.c.d @@ -0,0 +1,22 @@ +ardrone_time.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_time.c.d: ../..//Soft/Lib/ardrone_tool/ardrone_time.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_time.h /usr/include/sys/time.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool.c.d new file mode 100644 index 0000000..498347d --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool.c.d @@ -0,0 +1,86 @@ +ardrone_tool.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool.c.d: ../..//Soft/Lib/ardrone_tool/ardrone_tool.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Api/vp_api_thread_helper.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h /usr/include/pthread.h \ + /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../..//Soft/Lib/ardrone_tool/ardrone_tool.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Error.h ../ATcodec/ATcodec_Tree.h \ + ../ATcodec/ATcodec_Buffer.h ../..//Soft/Common/navdata_common.h \ + ../..//Soft/Common/config.h ../..//Soft/Common/generated_custom.h \ + ../..//Soft/Common/autoconf.h ../..//Soft/Common/vision_common.h \ + ../..//Soft/Lib/Maths/maths.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../..//Soft/Lib/Maths/quaternions.h ../..//Soft/Common/led_animation.h \ + ../..//Soft/Common/config_keys.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_time.h /usr/include/sys/time.h \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool_configuration.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h \ + ../..//Soft/Lib/iniparser3.0b/src/iniparser.h \ + ../..//Soft/Lib/iniparser3.0b/src/dictionary.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h \ + ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h \ + ../..//Soft/Lib/ardrone_tool/UI/ardrone_input.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_com.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_serial.h ../VP_Com/vp_com.h \ + ../..//Soft/Lib/ardrone_tool/Com/config_wifi.h \ + ../..//Soft/Lib/utils/ardrone_gen_ids.h /usr/include/locale.h \ + /usr/include/bits/locale.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool_configuration.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool_configuration.c.d new file mode 100644 index 0000000..2065de2 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool_configuration.c.d @@ -0,0 +1,77 @@ +ardrone_tool_configuration.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool_configuration.c.d: \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool_configuration.c \ + ../..//Soft/Lib/ardrone_tool/ardrone_tool_configuration.h \ + ../..//Soft/Common/ardrone_api.h \ + ../..//Soft/Common/ardrone_common_config.h ../ATcodec/ATcodec_api.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + ../ATcodec/ATcodec_Memory.h ../ATcodec/ATcodec_Error.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../..//Soft/Common/navdata_common.h ../..//Soft/Common/config.h \ + ../..//Soft/Common/generated_custom.h ../..//Soft/Common/autoconf.h \ + ../..//Soft/Common/vision_common.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/navdata_keys.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../..//Soft/Lib/Maths/quaternions.h \ + ../..//Soft/Common/led_animation.h ../..//Soft/Common/config_keys.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h ../VP_Api/vp_api_thread_helper.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.h \ + ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h \ + ../..//Soft/Lib/iniparser3.0b/src/iniparser.h \ + ../..//Soft/Lib/iniparser3.0b/src/dictionary.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h ../..//Soft/Lib/ardrone_tool/ardrone_tool.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/config_keys.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/config_keys.c.d new file mode 100644 index 0000000..4099427 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/config_keys.c.d @@ -0,0 +1,53 @@ +config_keys.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/config_keys.c.d: ../..//Soft/Lib/ardrone_tool/config_keys.c \ + ../..//Soft/Lib/Maths/maths.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../..//Soft/Lib/Maths/matrices.h ../..//Soft/Common/config_keys.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log new file mode 100644 index 0000000..81c712d --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log @@ -0,0 +1,34 @@ +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/iniparser.o ../..//Soft/Lib/iniparser3.0b/src/iniparser.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/dictionary.o ../..//Soft/Lib/iniparser3.0b/src/dictionary.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/filter.o ../..//Soft/Lib/Maths/filter.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/maths.o ../..//Soft/Lib/Maths/maths.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrices.o ../..//Soft/Lib/Maths/matrices.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/matrix3d.o ../..//Soft/Lib/Maths/matrix3d.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/quaternions.o ../..//Soft/Lib/Maths/quaternions.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/time.o ../..//Soft/Lib/Maths/time.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Maths/vision_math.o ../..//Soft/Lib/Maths/vision_math.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/navdata.o ../..//Soft/Lib/ardrone_tool/Navdata/navdata.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/config_keys.o ../..//Soft/Lib/ardrone_tool/config_keys.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_crc_32.o ../..//Soft/Lib/utils/ardrone_crc_32.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_gen_ids.o ../..//Soft/Lib/utils/ardrone_gen_ids.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_ftp.o ../..//Soft/Lib/utils/ardrone_ftp.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/AT/ardrone_at_mutex.o ../..//Soft/Lib/ardrone_tool/AT/ardrone_at_mutex.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_soft_update.o ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_configuration.o ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control_ack.o ../..//Soft/Lib/ardrone_tool/Control/ardrone_control_ack.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_file.o ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_general_navdata.o ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_input.o ../..//Soft/Lib/ardrone_tool/UI/ardrone_input.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/UI/ardrone_tool_ui.o ../..//Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_time.o ../..//Soft/Lib/ardrone_tool/ardrone_time.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_api.o ../..//Soft/Lib/ardrone_tool/ardrone_api.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool_configuration.o ../..//Soft/Lib/ardrone_tool/ardrone_tool_configuration.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/ardrone_tool.o ../..//Soft/Lib/ardrone_tool/ardrone_tool.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Com/config_wifi.o ../..//Soft/Lib/ardrone_tool/Com/config_wifi.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage.o ../..//Soft/Lib/ardrone_tool/Video/video_stage.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_com_stage.o ../..//Soft/Lib/ardrone_tool/Video/video_com_stage.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_control.o ../..//Soft/Lib/ardrone_tool/Control/ardrone_control.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Control/ardrone_navdata_control.o ../..//Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Navdata/ardrone_navdata_client.o ../..//Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_recorder.o ../..//Soft/Lib/ardrone_tool/Video/video_stage_recorder.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ardrone_tool/Video/video_stage_ffmpeg_recorder.o ../..//Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.c diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/dictionary.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/dictionary.c.d new file mode 100644 index 0000000..5c1a717 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/dictionary.c.d @@ -0,0 +1,24 @@ +dictionary.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/dictionary.c.d: ../..//Soft/Lib/iniparser3.0b/src/dictionary.c \ + ../..//Soft/Lib/iniparser3.0b/src/dictionary.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/iniparser.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/iniparser.c.d new file mode 100644 index 0000000..9a96cce --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/iniparser.c.d @@ -0,0 +1,57 @@ +iniparser.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/iniparser3.0b/src/iniparser.c.d: ../..//Soft/Lib/iniparser3.0b/src/iniparser.c \ + /usr/include/ctype.h /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h \ + ../..//Soft/Lib/iniparser3.0b/src/iniparser.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h \ + ../..//Soft/Lib/iniparser3.0b/src/dictionary.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h ../VP_Os/vp_os_print.h \ + ../..//Soft/Lib/Maths/matrices.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../..//Soft/Common/config_keys.h ../..//Soft/Lib/Maths/maths.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/float.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_crc_32.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_crc_32.c.d new file mode 100644 index 0000000..8a6c243 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_crc_32.c.d @@ -0,0 +1,12 @@ +ardrone_crc_32.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_crc_32.c.d: ../..//Soft/Lib/utils/ardrone_crc_32.c \ + ../..//Soft/Lib/utils/ardrone_crc_32.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_ftp.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_ftp.c.d new file mode 100644 index 0000000..27ccad6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_ftp.c.d @@ -0,0 +1,48 @@ +ardrone_ftp.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_ftp.c.d: ../..//Soft/Lib/utils/ardrone_ftp.c \ + ../..//Soft/Lib/utils/ardrone_ftp.h ../VP_Com/vp_com_socket.h \ + ../VP_Com/vp_com.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/netdb.h /usr/include/netinet/in.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/sys/types.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/uio.h /usr/include/bits/socket.h \ + /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ + /usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/bits/socket2.h \ + /usr/include/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/bits/siginfo.h /usr/include/bits/netdb.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/bits/unistd.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ + /usr/include/bits/fcntl2.h ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + /usr/include/string.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_gen_ids.c.d b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_gen_ids.c.d new file mode 100644 index 0000000..83fb6de --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_gen_ids.c.d @@ -0,0 +1,26 @@ +ardrone_gen_ids.o ../../Soft/Build/targets_versions/ardrone_lib_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/utils/ardrone_gen_ids.c.d: ../..//Soft/Lib/utils/ardrone_gen_ids.c \ + ../..//Soft/Lib/utils/ardrone_gen_ids.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../..//Soft/Lib/utils/ardrone_crc_32.h \ + /usr/include/string.h /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_codec.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_codec.c.d new file mode 100644 index 0000000..525e854 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_codec.c.d @@ -0,0 +1,61 @@ +p263_codec.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_codec.c.d: ../../VLIB/P263/p263_codec.c \ + ../../VLIB/../VLIB/Platform/video_utils.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/x86/video_utils.h \ + ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/Platform/video_config.h \ + ../../VLIB/../VLIB/Platform/x86/video_config.h \ + ../../VLIB/../VLIB/video_quantizer.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../../VLIB/../VLIB/video_dct.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/../VLIB/video_mem32.h \ + ../../VLIB/P263/p263_codec.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/P263/p263_layers.h ../../VLIB/P263/p263_huffman.h \ + ../../VLIB/../VLIB/video_huffman.h ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h ../VP_Os/vp_os_assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_gob_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_gob_layer.c.d new file mode 100644 index 0000000..5e3c32a --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_gob_layer.c.d @@ -0,0 +1,53 @@ +p263_gob_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_gob_layer.c.d: ../../VLIB/P263/p263_gob_layer.c \ + ../../VLIB/../VLIB/video_packetizer.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../../VLIB/P263/p263_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/P263/p263_layers.h \ + ../../VLIB/P263/p263_huffman.h ../../VLIB/../VLIB/video_huffman.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_huffman.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_huffman.c.d new file mode 100644 index 0000000..c6d802b --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_huffman.c.d @@ -0,0 +1,51 @@ +p263_huffman.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_huffman.c.d: ../../VLIB/P263/p263_huffman.c \ + ../../VLIB/P263/p263_huffman.h ../../VLIB/../VLIB/video_huffman.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_mb_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_mb_layer.c.d new file mode 100644 index 0000000..72e2bf8 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_mb_layer.c.d @@ -0,0 +1,52 @@ +p263_mb_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_mb_layer.c.d: ../../VLIB/P263/p263_mb_layer.c ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../../VLIB/../VLIB/video_packetizer.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../../VLIB/P263/p263_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/P263/p263_layers.h \ + ../../VLIB/P263/p263_huffman.h ../../VLIB/../VLIB/video_huffman.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_picture_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_picture_layer.c.d new file mode 100644 index 0000000..ee25d1d --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_picture_layer.c.d @@ -0,0 +1,53 @@ +p263_picture_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_picture_layer.c.d: ../../VLIB/P263/p263_picture_layer.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/P263/p263_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/P263/p263_layers.h \ + ../../VLIB/P263/p263_huffman.h ../../VLIB/../VLIB/video_huffman.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264.c.d new file mode 100644 index 0000000..52b29c1 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264.c.d @@ -0,0 +1,54 @@ +p264.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264.c.d: ../../VLIB/P264/p264.c ../../VLIB/../VLIB/Platform/video_utils.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/x86/video_utils.h \ + ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/video_packetizer.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h ../../VLIB/../VLIB/P264/p264.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_Qp.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_Qp.c.d new file mode 100644 index 0000000..1b5fda5 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_Qp.c.d @@ -0,0 +1,11 @@ +p264_Qp.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_Qp.c.d: ../../VLIB/P264/p264_Qp.c ../../VLIB/../VLIB/P264/p264_Qp.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_codec.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_codec.c.d new file mode 100644 index 0000000..205c565 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_codec.c.d @@ -0,0 +1,60 @@ +p264_codec.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_codec.c.d: ../../VLIB/P264/p264_codec.c \ + ../../VLIB/../VLIB/Platform/video_utils.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/x86/video_utils.h \ + ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/Platform/video_config.h \ + ../../VLIB/../VLIB/Platform/x86/video_config.h \ + ../../VLIB/P264/video_p264.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/video_picture.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_controller.h ../../VLIB/../VLIB/video_gob.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/P264/p264_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/P264/p264_layers.h \ + ../../VLIB/../VLIB/video_quantizer.h ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h ../VP_Os/vp_os_assert.h \ + ../VP_Os/elinux/vp_os_ltt.h ../VP_Os/vp_os_print.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_gob_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_gob_layer.c.d new file mode 100644 index 0000000..34839a7 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_gob_layer.c.d @@ -0,0 +1,52 @@ +p264_gob_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_gob_layer.c.d: ../../VLIB/P264/p264_gob_layer.c \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/P264/p264_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/P264/p264_layers.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_inter_mc.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_inter_mc.c.d new file mode 100644 index 0000000..0599da2 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_inter_mc.c.d @@ -0,0 +1,23 @@ +p264_inter_mc.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_inter_mc.c.d: ../../VLIB/P264/p264_inter_mc.c \ + ../../VLIB/../VLIB/P264/p264_inter_mc.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/P264/p264_common.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_intra_pred.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_intra_pred.c.d new file mode 100644 index 0000000..9662add --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_intra_pred.c.d @@ -0,0 +1,27 @@ +p264_intra_pred.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_intra_pred.c.d: ../../VLIB/P264/p264_intra_pred.c \ + ../../VLIB/../VLIB/P264/p264_intra_pred.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/P264/p264_common.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_mb_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_mb_layer.c.d new file mode 100644 index 0000000..92601c4 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_mb_layer.c.d @@ -0,0 +1,58 @@ +p264_mb_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_mb_layer.c.d: ../../VLIB/P264/p264_mb_layer.c \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h \ + ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h ../VP_Os/vp_os_assert.h \ + ../../VLIB/P264/p264_codec.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/P264/p264_layers.h ../../VLIB/P264/p264.h \ + ../../VLIB/P264/p264_common.h ../VP_Os/vp_os_print.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_merge.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_merge.c.d new file mode 100644 index 0000000..0cc23ed --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_merge.c.d @@ -0,0 +1,12 @@ +p264_merge.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_merge.c.d: ../../VLIB/P264/p264_merge.c \ + ../../VLIB/../VLIB/P264/p264_merge.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_picture_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_picture_layer.c.d new file mode 100644 index 0000000..9a37d82 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_picture_layer.c.d @@ -0,0 +1,53 @@ +p264_picture_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_picture_layer.c.d: ../../VLIB/P264/p264_picture_layer.c \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/P264/p264_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/P264/p264_layers.h \ + ../VP_Os/vp_os_print.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_transform.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_transform.c.d new file mode 100644 index 0000000..3ed73f8 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_transform.c.d @@ -0,0 +1,12 @@ +p264_transform.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_transform.c.d: ../../VLIB/P264/p264_transform.c \ + ../../VLIB/../VLIB/P264/p264_transform.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_zigzag.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_zigzag.c.d new file mode 100644 index 0000000..980d177 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_zigzag.c.d @@ -0,0 +1,12 @@ +p264_zigzag.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_zigzag.c.d: ../../VLIB/P264/p264_zigzag.c \ + ../../VLIB/../VLIB/P264/p264_zigzag.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/video_p264.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/video_p264.c.d new file mode 100644 index 0000000..04aef0c --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/video_p264.c.d @@ -0,0 +1,58 @@ +video_p264.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/video_p264.c.d: ../../VLIB/P264/video_p264.c \ + ../../VLIB/../VLIB/P264/video_p264.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/video_picture.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_controller.h ../../VLIB/../VLIB/video_gob.h \ + ../../VLIB/../VLIB/P264/p264_transform.h \ + ../../VLIB/../VLIB/P264/p264_merge.h \ + ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/P264/p264_inter_mc.h ../../VLIB/P264/p264_common.h \ + ../../VLIB/P264/p264_intra_pred.h ../../VLIB/P264/p264_zigzag.h \ + ../../VLIB/P264/p264_Qp.h ../VP_Os/vp_os_print.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/UVLC/uvlc_codec.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/UVLC/uvlc_codec.c.d new file mode 100644 index 0000000..057d258 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/UVLC/uvlc_codec.c.d @@ -0,0 +1,60 @@ +uvlc_codec.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/UVLC/uvlc_codec.c.d: ../../VLIB/Platform/x86/UVLC/uvlc_codec.c \ + ../../VLIB/../VLIB/Platform/video_utils.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/x86/video_utils.h \ + ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/Platform/video_config.h \ + ../../VLIB/../VLIB/Platform/x86/video_config.h \ + ../../VLIB/../VLIB/video_quantizer.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../../VLIB/../VLIB/video_dct.h \ + ../../VLIB/../VLIB/video_mem32.h ../../VLIB/../VLIB/video_packetizer.h \ + ../../VLIB/../VLIB/UVLC/uvlc_codec.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/UVLC/uvlc_layers.h ../../VLIB/../VLIB/UVLC/uvlc.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h ../VP_Os/vp_os_assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/video_utils.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/video_utils.c.d new file mode 100644 index 0000000..4ff376e --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/video_utils.c.d @@ -0,0 +1,52 @@ +video_utils.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/video_utils.c.d: ../../VLIB/Platform/x86/video_utils.c \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/Platform/x86/video_utils_x86.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_decode.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_decode.c.d new file mode 100644 index 0000000..cfcd5e5 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_decode.c.d @@ -0,0 +1,56 @@ +vlib_stage_decode.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_decode.c.d: ../../VLIB/Stages/vlib_stage_decode.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../../VLIB/../VLIB/Stages/vlib_stage_decode.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_encode.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_encode.c.d new file mode 100644 index 0000000..61a0162 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_encode.c.d @@ -0,0 +1,57 @@ +vlib_stage_encode.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_encode.c.d: ../../VLIB/Stages/vlib_stage_encode.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../../VLIB/../VLIB/Stages/vlib_stage_encode.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc.c.d new file mode 100644 index 0000000..40110d4 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc.c.d @@ -0,0 +1,54 @@ +uvlc.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc.c.d: ../../VLIB/UVLC/uvlc.c ../../VLIB/../VLIB/Platform/video_utils.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/x86/video_utils.h \ + ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/video_packetizer.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h ../../VLIB/../VLIB/UVLC/uvlc.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_codec.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_codec.c.d new file mode 100644 index 0000000..ef06085 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_codec.c.d @@ -0,0 +1,59 @@ +uvlc_codec.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_codec.c.d: ../../VLIB/UVLC/uvlc_codec.c \ + ../../VLIB/../VLIB/Platform/video_utils.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/x86/video_utils.h \ + ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/Platform/video_config.h \ + ../../VLIB/../VLIB/Platform/x86/video_config.h \ + ../../VLIB/../VLIB/video_quantizer.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../../VLIB/../VLIB/video_dct.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/UVLC/uvlc_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/UVLC/uvlc_layers.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h ../VP_Os/vp_os_assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_gob_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_gob_layer.c.d new file mode 100644 index 0000000..b4771cb --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_gob_layer.c.d @@ -0,0 +1,52 @@ +uvlc_gob_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_gob_layer.c.d: ../../VLIB/UVLC/uvlc_gob_layer.c \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/UVLC/uvlc_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/UVLC/uvlc_layers.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_mb_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_mb_layer.c.d new file mode 100644 index 0000000..e5f0aa4 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_mb_layer.c.d @@ -0,0 +1,57 @@ +uvlc_mb_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_mb_layer.c.d: ../../VLIB/UVLC/uvlc_mb_layer.c \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h \ + ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h ../VP_Os/vp_os_assert.h \ + ../../VLIB/UVLC/uvlc_codec.h ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/UVLC/uvlc_layers.h ../../VLIB/UVLC/uvlc.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_picture_layer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_picture_layer.c.d new file mode 100644 index 0000000..74a4705 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_picture_layer.c.d @@ -0,0 +1,52 @@ +uvlc_picture_layer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_picture_layer.c.d: ../../VLIB/UVLC/uvlc_picture_layer.c \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h ../../VLIB/UVLC/uvlc_codec.h \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/UVLC/uvlc_layers.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log new file mode 100644 index 0000000..82e4c9b --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log @@ -0,0 +1,35 @@ +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_codec.o ../../VLIB/video_codec.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_controller.o ../../VLIB/video_controller.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_mem32.o ../../VLIB/video_mem32.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_dct.o ../../VLIB/video_dct.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_huffman.o ../../VLIB/video_huffman.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_macroblock.o ../../VLIB/video_macroblock.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_packetizer.o ../../VLIB/video_packetizer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_picture.o ../../VLIB/video_picture.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_quantizer.o ../../VLIB/video_quantizer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_codec.o ../../VLIB/P263/p263_codec.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_huffman.o ../../VLIB/P263/p263_huffman.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_mb_layer.o ../../VLIB/P263/p263_mb_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_gob_layer.o ../../VLIB/P263/p263_gob_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P263/p263_picture_layer.o ../../VLIB/P263/p263_picture_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_zigzag.o ../../VLIB/P264/p264_zigzag.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_transform.o ../../VLIB/P264/p264_transform.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_Qp.o ../../VLIB/P264/p264_Qp.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_intra_pred.o ../../VLIB/P264/p264_intra_pred.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_inter_mc.o ../../VLIB/P264/p264_inter_mc.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_merge.o ../../VLIB/P264/p264_merge.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_codec.o ../../VLIB/P264/p264_codec.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264.o ../../VLIB/P264/p264.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_gob_layer.o ../../VLIB/P264/p264_gob_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_mb_layer.o ../../VLIB/P264/p264_mb_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/p264_picture_layer.o ../../VLIB/P264/p264_picture_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/P264/video_p264.o ../../VLIB/P264/video_p264.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_decode.o ../../VLIB/Stages/vlib_stage_decode.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Stages/vlib_stage_encode.o ../../VLIB/Stages/vlib_stage_encode.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_codec.o ../../VLIB/UVLC/uvlc_codec.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc.o ../../VLIB/UVLC/uvlc.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_gob_layer.o ../../VLIB/UVLC/uvlc_gob_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_mb_layer.o ../../VLIB/UVLC/uvlc_mb_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/UVLC/uvlc_picture_layer.o ../../VLIB/UVLC/uvlc_picture_layer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/video_utils.o ../../VLIB/Platform/x86/video_utils.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/Platform/x86/UVLC/uvlc_codec.o ../../VLIB/Platform/x86/UVLC/uvlc_codec.c diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_codec.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_codec.c.d new file mode 100644 index 0000000..48364aa --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_codec.c.d @@ -0,0 +1,58 @@ +video_codec.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_codec.c.d: ../../VLIB/video_codec.c ../../VLIB/../VLIB/video_codec.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_quantizer.h \ + ../../VLIB/../VLIB/video_packetizer.h \ + ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/Platform/video_config.h \ + ../../VLIB/../VLIB/Platform/x86/video_config.h ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h ../VP_Os/vp_os_print.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_controller.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_controller.c.d new file mode 100644 index 0000000..84f61d6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_controller.c.d @@ -0,0 +1,53 @@ +video_controller.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_controller.c.d: ../../VLIB/video_controller.c ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../VP_Os/vp_os_assert.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h ../../VLIB/../VLIB/video_codec.h \ + ../VP_Os/vp_os_print.h ../../VLIB/../VLIB/Platform/video_config.h \ + ../../VLIB/../VLIB/Platform/x86/video_config.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_dct.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_dct.c.d new file mode 100644 index 0000000..d5c7279 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_dct.c.d @@ -0,0 +1,51 @@ +video_dct.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_dct.c.d: ../../VLIB/video_dct.c ../../VLIB/../VLIB/video_dct.h \ + ../../VLIB/../VLIB/video_picture.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_huffman.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_huffman.c.d new file mode 100644 index 0000000..e44961e --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_huffman.c.d @@ -0,0 +1,56 @@ +video_huffman.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_huffman.c.d: ../../VLIB/video_huffman.c \ + ../../VLIB/../VLIB/Platform/video_utils.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/x86/video_utils.h \ + ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../../VLIB/../VLIB/video_huffman.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_macroblock.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_macroblock.c.d new file mode 100644 index 0000000..9a4a50b --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_macroblock.c.d @@ -0,0 +1,49 @@ +video_macroblock.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_macroblock.c.d: ../../VLIB/video_macroblock.c \ + ../../VLIB/../VLIB/video_macroblock.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/video_picture.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/P264/p264_common.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_mem32.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_mem32.c.d new file mode 100644 index 0000000..c80a9eb --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_mem32.c.d @@ -0,0 +1,13 @@ +video_mem32.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_mem32.c.d: ../../VLIB/video_mem32.c ../../VLIB/../VLIB/video_mem32.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_packetizer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_packetizer.c.d new file mode 100644 index 0000000..24444d7 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_packetizer.c.d @@ -0,0 +1,57 @@ +video_packetizer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_packetizer.c.d: ../../VLIB/video_packetizer.c \ + ../../VLIB/../VLIB/video_codec.h ../../VLIB/../VLIB/video_controller.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/video_packetizer.h \ + ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/Platform/video_config.h \ + ../../VLIB/../VLIB/Platform/x86/video_config.h ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_picture.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_picture.c.d new file mode 100644 index 0000000..f2f1190 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_picture.c.d @@ -0,0 +1,48 @@ +video_picture.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_picture.c.d: ../../VLIB/video_picture.c ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../../VLIB/../VLIB/Platform/video_utils.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h \ + ../../VLIB/../VLIB/video_picture.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture_defines.h ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_quantizer.c.d b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_quantizer.c.d new file mode 100644 index 0000000..74448c6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_quantizer.c.d @@ -0,0 +1,54 @@ +video_quantizer.o ../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/video_quantizer.c.d: ../../VLIB/video_quantizer.c \ + ../../VLIB/../VLIB/video_quantizer.h \ + ../../VLIB/../VLIB/video_controller.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../../VLIB/../VLIB/video_picture.h \ + ../../VLIB/../VLIB/video_picture_defines.h \ + ../../VLIB/../VLIB/video_gob.h ../../VLIB/../VLIB/video_macroblock.h \ + ../../VLIB/../VLIB/P264/p264_common.h \ + ../../VLIB/../VLIB/Platform/video_utils.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils.h ..//VP_Os/linux/intrin.h \ + ../../VLIB/../VLIB/Platform/x86/video_utils_x86.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec.c.d new file mode 100644 index 0000000..d9b3c6b --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec.c.d @@ -0,0 +1,29 @@ +ATcodec.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec.c.d: ..//ATcodec/ATcodec.c ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../VP_Os/vp_os_malloc.h \ + /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Buffer.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Buffer.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Buffer.c.d new file mode 100644 index 0000000..f5f0f94 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Buffer.c.d @@ -0,0 +1,23 @@ +ATcodec_Buffer.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Buffer.c.d: ..//ATcodec/ATcodec_Buffer.c ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../VP_Os/vp_os_malloc.h \ + /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ..//ATcodec/ATcodec_Buffer.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Memory.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Memory.c.d new file mode 100644 index 0000000..2ba01b9 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Memory.c.d @@ -0,0 +1,5 @@ +ATcodec_Memory.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Memory.c.d: ..//ATcodec/ATcodec_Memory.c ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../ATcodec/ATcodec_Memory.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Sorted_List.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Sorted_List.c.d new file mode 100644 index 0000000..a2f1598 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Sorted_List.c.d @@ -0,0 +1,23 @@ +ATcodec_Sorted_List.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Sorted_List.c.d: ..//ATcodec/ATcodec_Sorted_List.c \ + ../VP_Os/vp_os_assert.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h ../VP_Os/vp_os_malloc.h \ + /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ..//ATcodec/ATcodec_Sorted_List.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Tree.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Tree.c.d new file mode 100644 index 0000000..48679e9 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Tree.c.d @@ -0,0 +1,32 @@ +ATcodec_Tree.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Tree.c.d: ..//ATcodec/ATcodec_Tree.c ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_assert.h /usr/include/assert.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_malloc.h /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h \ + ../ATcodec/ATcodec_Tree.h ../ATcodec/ATcodec_Buffer.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_api.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h /usr/include/pthread.h \ + /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../ATcodec/ATcodec_Error.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_api.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_api.c.d new file mode 100644 index 0000000..3299428 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_api.c.d @@ -0,0 +1,34 @@ +ATcodec_api.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_api.c.d: ..//ATcodec/ATcodec_api.c ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_delay.h ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h ../VP_Os/vp_os_malloc.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Api/vp_api_thread_helper.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h ../ATcodec/ATcodec_api.h \ + ../ATcodec/ATcodec.h ../ATcodec/ATcodec_Memory.h \ + ../ATcodec/ATcodec_Error.h ../ATcodec/ATcodec_Tree.h \ + ../ATcodec/ATcodec_Buffer.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api.c.d new file mode 100644 index 0000000..8730505 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api.c.d @@ -0,0 +1,31 @@ +vp_api.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api.c.d: ..//VP_Api/vp_api.c ../VP_Api/vp_api.h ../VP_Os/vp_os_signal.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_assert.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_error.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_error.c.d new file mode 100644 index 0000000..4aeea48 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_error.c.d @@ -0,0 +1,12 @@ +vp_api_error.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_error.c.d: ..//VP_Api/vp_api_error.c ../VP_Api/vp_api_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_io_multi_stage.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_io_multi_stage.c.d new file mode 100644 index 0000000..6223f7a --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_io_multi_stage.c.d @@ -0,0 +1,21 @@ +vp_api_io_multi_stage.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_io_multi_stage.c.d: ..//VP_Api/vp_api_io_multi_stage.c \ + ../VP_Api/vp_api_io_multi_stage.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_assert.h /usr/include/assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_stage.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_stage.c.d new file mode 100644 index 0000000..4fda6b1 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_stage.c.d @@ -0,0 +1,72 @@ +vp_api_stage.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_stage.c.d: ..//VP_Api/vp_api_stage.c ../VP_Api/vp_api_stage.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_supervisor.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Stages/vp_stages_io_file.h \ + ../VP_Api/vp_api.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Stages/vp_stages_io_buffer.h ../VP_Stages/vp_stages_io_com.h \ + ../VP_Com/vp_com.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../VP_Stages/vp_stages_io_console.h ../VP_Stages/vp_stages_yuv2rgb.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../VP_Stages/vp_stages_buffer_to_picture.h \ + ../VP_Stages/vp_stages_frame_pipe.h ../VP_Stages/vp_stages_o_sdl.h \ + /usr/include/SDL/SDL.h /usr/include/SDL/SDL_main.h \ + /usr/include/SDL/SDL_stdinc.h /usr/include/SDL/SDL_config.h \ + /usr/include/SDL/SDL_platform.h /usr/include/strings.h \ + /usr/include/iconv.h /usr/include/SDL/begin_code.h \ + /usr/include/SDL/close_code.h /usr/include/SDL/SDL_audio.h \ + /usr/include/SDL/SDL_error.h /usr/include/SDL/SDL_endian.h \ + /usr/include/SDL/SDL_mutex.h /usr/include/SDL/SDL_thread.h \ + /usr/include/SDL/SDL_rwops.h /usr/include/SDL/SDL_cdrom.h \ + /usr/include/SDL/SDL_cpuinfo.h /usr/include/SDL/SDL_events.h \ + /usr/include/SDL/SDL_active.h /usr/include/SDL/SDL_keyboard.h \ + /usr/include/SDL/SDL_keysym.h /usr/include/SDL/SDL_mouse.h \ + /usr/include/SDL/SDL_video.h /usr/include/SDL/SDL_joystick.h \ + /usr/include/SDL/SDL_quit.h /usr/include/SDL/SDL_loadso.h \ + /usr/include/SDL/SDL_timer.h /usr/include/SDL/SDL_version.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_supervisor.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_supervisor.c.d new file mode 100644 index 0000000..68c242d --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_supervisor.c.d @@ -0,0 +1,31 @@ +vp_api_supervisor.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_supervisor.c.d: ..//VP_Api/vp_api_supervisor.c \ + ../VP_Api/vp_api_supervisor.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h ../VP_Api/vp_api.h \ + ../VP_Api/vp_api_stage.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_thread_helper.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_thread_helper.c.d new file mode 100644 index 0000000..0c1a1a9 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_thread_helper.c.d @@ -0,0 +1,27 @@ +vp_api_thread_helper.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_thread_helper.c.d: ..//VP_Api/vp_api_thread_helper.c \ + ../VP_Api/vp_api_thread_helper.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/string.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com.c.d new file mode 100644 index 0000000..8ee1f07 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com.c.d @@ -0,0 +1,34 @@ +vp_com.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com.c.d: ..//VP_Com/linux/vp_com.c ../VP_Com/vp_com.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../VP_Com/vp_com_socket.h ../VP_Com/vp_com_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Api/vp_api_error.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_assert.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ..//VP_Com/vp_com_wifi.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_config_itf.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_config_itf.c.d new file mode 100644 index 0000000..8f4bcde --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_config_itf.c.d @@ -0,0 +1,42 @@ +vp_com_config_itf.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_config_itf.c.d: ..//VP_Com/linux/vp_com_config_itf.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h ../VP_Os/vp_os_print.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Com/linux/vp_com_config_itf.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/bits/socket2.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ + /usr/include/bits/ioctl-types.h /usr/include/net/if.h \ + /usr/include/netinet/in.h /usr/include/bits/in.h /usr/include/fcntl.h \ + /usr/include/bits/fcntl.h /usr/include/bits/stat.h \ + /usr/include/bits/fcntl2.h /usr/include/arpa/inet.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/bits/unistd.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_serial.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_serial.c.d new file mode 100644 index 0000000..3f9d91c --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_serial.c.d @@ -0,0 +1,41 @@ +vp_com_serial.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_serial.c.d: ..//VP_Com/linux/vp_com_serial.c /usr/include/stdio.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/bits/unistd.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/fcntl.h \ + /usr/include/bits/fcntl.h /usr/include/bits/fcntl2.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + ../VP_Com/vp_com.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/xlocale.h /usr/include/bits/setjmp.h \ + ../VP_Api/vp_api_thread_helper.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h ../VP_Com/vp_com_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Os/vp_os_assert.h \ + /usr/include/assert.h ../VP_Os/vp_os_malloc.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h ../VP_Os/vp_os_print.h \ + ../VP_Os/vp_os_delay.h ../VP_Api/vp_api_error.h \ + ..//VP_Com/vp_com_serial.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wifi.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wifi.c.d new file mode 100644 index 0000000..0139ad1 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wifi.c.d @@ -0,0 +1,40 @@ +vp_com_wifi.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wifi.c.d: ..//VP_Com/linux/vp_com_wifi.c ../VP_Com/vp_com_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Com/vp_com_socket.h ../VP_Com/vp_com.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ..//VP_Com/vp_com_wifi.h ..//VP_Com/linux/vp_com_config_itf.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_delay.h /usr/include/netdb.h /usr/include/netinet/in.h \ + /usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/bits/socket2.h /usr/include/bits/in.h \ + /usr/include/rpc/netdb.h /usr/include/bits/siginfo.h \ + /usr/include/bits/netdb.h /usr/include/net/if.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wired.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wired.c.d new file mode 100644 index 0000000..a1ef345 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wired.c.d @@ -0,0 +1,39 @@ +vp_com_wired.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wired.c.d: ..//VP_Com/linux/vp_com_wired.c ../VP_Com/vp_com_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Com/vp_com_socket.h ../VP_Com/vp_com.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ..//VP_Com/linux/vp_com_config_itf.h ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h /usr/include/string.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/netdb.h \ + /usr/include/netinet/in.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/uio.h \ + /usr/include/bits/socket.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm-generic/socket.h \ + /usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \ + /usr/include/bits/socket2.h /usr/include/bits/in.h \ + /usr/include/rpc/netdb.h /usr/include/bits/siginfo.h \ + /usr/include/bits/netdb.h /usr/include/net/if.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_error.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_error.c.d new file mode 100644 index 0000000..3a602fc --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_error.c.d @@ -0,0 +1,12 @@ +vp_com_error.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_error.c.d: ..//VP_Com/vp_com_error.c ../VP_Com/vp_com_error.h \ + ../VP_Os/vp_os_error_handling.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket.c.d new file mode 100644 index 0000000..70a833c --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket.c.d @@ -0,0 +1,50 @@ +vp_com_socket.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket.c.d: ..//VP_Com/vp_com_socket.c ../VP_Com/vp_com_socket.h \ + ../VP_Com/vp_com.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../VP_Com/vp_com_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/uio.h \ + /usr/include/bits/stat.h /usr/include/bits/fcntl2.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/socket.h \ + /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ + /usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/bits/socket2.h \ + /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ + /usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \ + /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ + /usr/include/netinet/in.h /usr/include/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket_utils.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket_utils.c.d new file mode 100644 index 0000000..03f0e70 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket_utils.c.d @@ -0,0 +1,50 @@ +vp_com_socket_utils.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket_utils.c.d: ..//VP_Com/vp_com_socket_utils.c \ + ../VP_Com/vp_com_socket.h ../VP_Com/vp_com.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_signal.h \ + ..//VP_Os/linux/vp_os_signal_dep.h /usr/include/pthread.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../VP_Com/vp_com_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_print.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/uio.h \ + /usr/include/bits/stat.h /usr/include/bits/fcntl2.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h /usr/include/sys/socket.h \ + /usr/include/sys/uio.h /usr/include/bits/socket.h \ + /usr/include/bits/sockaddr.h /usr/include/asm/socket.h \ + /usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/bits/socket2.h \ + /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ + /usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \ + /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ + /usr/include/netinet/in.h /usr/include/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_delay.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_delay.c.d new file mode 100644 index 0000000..b389eec --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_delay.c.d @@ -0,0 +1,13 @@ +vp_os_delay.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_delay.c.d: ..//VP_Os/linux/vp_os_delay.c /usr/include/unistd.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/bits/unistd.h ../VP_Os/vp_os_delay.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_signal.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_signal.c.d new file mode 100644 index 0000000..bfc0a45 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_signal.c.d @@ -0,0 +1,21 @@ +vp_os_signal.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_signal.c.d: ..//VP_Os/linux/vp_os_signal.c ../VP_Os/vp_os_signal.h \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h /usr/include/sys/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ + /usr/include/asm-generic/errno-base.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_thread.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_thread.c.d new file mode 100644 index 0000000..20a9ddb --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_thread.c.d @@ -0,0 +1,30 @@ +vp_os_thread.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_thread.c.d: ..//VP_Os/linux/vp_os_thread.c \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/signal.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/sigset.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/signum.h /usr/include/time.h \ + /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ + /usr/include/bits/sigcontext.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/sigstack.h /usr/include/sys/ucontext.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h \ + /usr/include/sched.h /usr/include/bits/sched.h ../VP_Os/vp_os_types.h \ + ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/setjmp.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_error_handling.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_error_handling.c.d new file mode 100644 index 0000000..19b29cd --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_error_handling.c.d @@ -0,0 +1,22 @@ +vp_os_error_handling.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_error_handling.c.d: ..//VP_Os/vp_os_error_handling.c \ + ../VP_Os/vp_os_error_handling.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + /usr/include/string.h /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_malloc.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_malloc.c.d new file mode 100644 index 0000000..49aad59 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_malloc.c.d @@ -0,0 +1,21 @@ +vp_os_malloc.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_malloc.c.d: ..//VP_Os/vp_os_malloc.c ../VP_Os/vp_os_malloc.h \ + /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_buffer_to_picture.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_buffer_to_picture.c.d new file mode 100644 index 0000000..9dba896 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_buffer_to_picture.c.d @@ -0,0 +1,53 @@ +vp_stages_buffer_to_picture.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_buffer_to_picture.c.d: \ + ..//VP_Stages/vp_stages_buffer_to_picture.c /usr/include/stdio.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h ../VP_Os/vp_os_print.h \ + ../VP_Stages/vp_stages_buffer_to_picture.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../VP_Stages/vp_stages_i_camif.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_configs.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_configs.c.d new file mode 100644 index 0000000..2989ec6 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_configs.c.d @@ -0,0 +1,69 @@ +vp_stages_configs.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_configs.c.d: ..//VP_Stages/vp_stages_configs.c \ + ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h ../VP_Os/vp_os_rtmon.h \ + ..//VP_Os/linux/vp_os_serial.h /usr/include/termios.h \ + /usr/include/features.h /usr/include/bits/predefs.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ + /usr/include/stdint.h /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ../VP_Os/vp_os_assert.h /usr/include/assert.h \ + ../VP_Os/vp_os_malloc.h /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/stdlib.h \ + /usr/include/bits/string3.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/sys/types.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h /usr/include/bits/stdlib.h \ + ../VP_Stages/vp_stages_configs.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../VP_Stages/vp_stages_io_com.h ../VP_Com/vp_com.h \ + ../VP_Api/vp_api_thread_helper.h ../VP_Os/vp_os_thread.h \ + ..//VP_Os/linux/vp_os_thread_dep.h ../VP_Stages/vp_stages_o_sdl.h \ + /usr/include/SDL/SDL.h /usr/include/SDL/SDL_main.h \ + /usr/include/SDL/SDL_stdinc.h /usr/include/SDL/SDL_config.h \ + /usr/include/SDL/SDL_platform.h /usr/include/strings.h \ + /usr/include/iconv.h /usr/include/SDL/begin_code.h \ + /usr/include/SDL/close_code.h /usr/include/SDL/SDL_audio.h \ + /usr/include/SDL/SDL_error.h /usr/include/SDL/SDL_endian.h \ + /usr/include/SDL/SDL_mutex.h /usr/include/SDL/SDL_thread.h \ + /usr/include/SDL/SDL_rwops.h /usr/include/SDL/SDL_cdrom.h \ + /usr/include/SDL/SDL_cpuinfo.h /usr/include/SDL/SDL_events.h \ + /usr/include/SDL/SDL_active.h /usr/include/SDL/SDL_keyboard.h \ + /usr/include/SDL/SDL_keysym.h /usr/include/SDL/SDL_mouse.h \ + /usr/include/SDL/SDL_video.h /usr/include/SDL/SDL_joystick.h \ + /usr/include/SDL/SDL_quit.h /usr/include/SDL/SDL_loadso.h \ + /usr/include/SDL/SDL_timer.h /usr/include/SDL/SDL_version.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_frame_pipe.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_frame_pipe.c.d new file mode 100644 index 0000000..3b30efc --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_frame_pipe.c.d @@ -0,0 +1,51 @@ +vp_stages_frame_pipe.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_frame_pipe.c.d: ..//VP_Stages/vp_stages_frame_pipe.c \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + /usr/include/xlocale.h /usr/include/bits/string.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h ../VP_Os/linux/intrin.h \ + ../VP_Stages/vp_stages_frame_pipe.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/bits/sched.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_buffer.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_buffer.c.d new file mode 100644 index 0000000..0ba5381 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_buffer.c.d @@ -0,0 +1,33 @@ +vp_stages_io_buffer.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_buffer.c.d: ..//VP_Stages/vp_stages_io_buffer.c \ + ../VP_Stages/vp_stages_io_buffer.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_com.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_com.c.d new file mode 100644 index 0000000..56fd925 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_com.c.d @@ -0,0 +1,35 @@ +vp_stages_io_com.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_com.c.d: ..//VP_Stages/vp_stages_io_com.c \ + ../VP_Stages/vp_stages_io_com.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Com/vp_com.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Os/vp_os_malloc.h /usr/include/assert.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h ../VP_Os/vp_os_delay.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_console.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_console.c.d new file mode 100644 index 0000000..1bf28f7 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_console.c.d @@ -0,0 +1,25 @@ +vp_stages_io_console.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_console.c.d: ..//VP_Stages/vp_stages_io_console.c \ + ../VP_Stages/vp_stages_io_console.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_print.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_file.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_file.c.d new file mode 100644 index 0000000..8064c73 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_file.c.d @@ -0,0 +1,34 @@ +vp_stages_io_file.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_file.c.d: ..//VP_Stages/vp_stages_io_file.c \ + ../VP_Stages/vp_stages_io_file.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_assert.h /usr/include/assert.h ../VP_Os/vp_os_print.h \ + ../VP_Os/vp_os_delay.h ../VP_Os/vp_os_malloc.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/stdlib.h /usr/include/bits/string3.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_o_sdl.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_o_sdl.c.d new file mode 100644 index 0000000..f034f42 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_o_sdl.c.d @@ -0,0 +1,69 @@ +vp_stages_o_sdl.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_o_sdl.c.d: ..//VP_Stages/vp_stages_o_sdl.c \ + ../VP_Stages/vp_stages_o_sdl.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + /usr/include/SDL/SDL.h /usr/include/SDL/SDL_main.h \ + /usr/include/SDL/SDL_stdinc.h /usr/include/SDL/SDL_config.h \ + /usr/include/SDL/SDL_platform.h /usr/include/sys/types.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/bits/stdio2.h \ + /usr/include/stdlib.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/ctype.h /usr/include/iconv.h \ + /usr/include/SDL/begin_code.h /usr/include/SDL/close_code.h \ + /usr/include/SDL/SDL_audio.h /usr/include/SDL/SDL_error.h \ + /usr/include/SDL/SDL_endian.h /usr/include/SDL/SDL_mutex.h \ + /usr/include/SDL/SDL_thread.h /usr/include/SDL/SDL_rwops.h \ + /usr/include/SDL/SDL_cdrom.h /usr/include/SDL/SDL_cpuinfo.h \ + /usr/include/SDL/SDL_events.h /usr/include/SDL/SDL_active.h \ + /usr/include/SDL/SDL_keyboard.h /usr/include/SDL/SDL_keysym.h \ + /usr/include/SDL/SDL_mouse.h /usr/include/SDL/SDL_video.h \ + /usr/include/SDL/SDL_joystick.h /usr/include/SDL/SDL_quit.h \ + /usr/include/SDL/SDL_loadso.h /usr/include/SDL/SDL_timer.h \ + /usr/include/SDL/SDL_version.h ../VP_Api/vp_api_picture.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \ + /usr/include/bits/inf.h /usr/include/bits/nan.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/bits/mathinline.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../VP_Api/vp_api_error.h ../VP_Os/vp_os_error_handling.h \ + ../VP_Os/vp_os_print.h ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + ../VP_Os/vp_os_delay.h ../VP_Api/vp_api_thread_helper.h \ + ../VP_Os/vp_os_thread.h ..//VP_Os/linux/vp_os_thread_dep.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_yuv2rgb.c.d b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_yuv2rgb.c.d new file mode 100644 index 0000000..f5f42e1 --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_yuv2rgb.c.d @@ -0,0 +1,54 @@ +vp_stages_yuv2rgb.o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_yuv2rgb.c.d: ..//VP_Stages/vp_stages_yuv2rgb.c \ + ../VP_Stages/vp_stages_yuv2rgb.h ../VP_Api/vp_api.h \ + ../VP_Os/vp_os_signal.h ../VP_Os/vp_os_types.h ../VP_Os/vp_os.h \ + ../VP_Os/vp_os_rtmon.h ..//VP_Os/linux/vp_os_serial.h \ + /usr/include/termios.h /usr/include/features.h \ + /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/termios.h \ + /usr/include/sys/ttydefaults.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h \ + ../VP_Os/linux/intrin.h ..//VP_Os/linux/vp_os_signal_dep.h \ + /usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/setjmp.h ../VP_Api/vp_api_config.h \ + ../VP_Api/vp_api_stage.h ../VP_Api/vp_api_supervisor.h \ + ../VP_Api/vp_api_picture.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/ctype.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ + /usr/include/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \ + /usr/include/bits/huge_vall.h /usr/include/bits/inf.h \ + /usr/include/bits/nan.h /usr/include/bits/mathdef.h \ + /usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stdarg.h \ + /usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \ + /usr/include/bits/stdio2.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/sys/sysmacros.h /usr/include/alloca.h \ + /usr/include/bits/stdlib.h /usr/include/string.h \ + /usr/include/bits/string.h /usr/include/bits/string2.h \ + /usr/include/bits/string3.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/avconfig.h \ + ../VP_Os/vp_os_print.h ../VP_Os/vp_os_malloc.h /usr/include/assert.h \ + ../VP_Os/vp_os_assert.h diff --git a/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log new file mode 100644 index 0000000..1d94d2d --- /dev/null +++ b/ARDroneLib/Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/build.log @@ -0,0 +1,34 @@ +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_malloc.o ..//VP_Os/vp_os_malloc.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/vp_os_error_handling.o ..//VP_Os/vp_os_error_handling.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api.o ..//VP_Api/vp_api.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_error.o ..//VP_Api/vp_api_error.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_io_multi_stage.o ..//VP_Api/vp_api_io_multi_stage.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_stage.o ..//VP_Api/vp_api_stage.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_supervisor.o ..//VP_Api/vp_api_supervisor.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Api/vp_api_thread_helper.o ..//VP_Api/vp_api_thread_helper.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_frame_pipe.o ..//VP_Stages/vp_stages_frame_pipe.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_configs.o ..//VP_Stages/vp_stages_configs.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_buffer.o ..//VP_Stages/vp_stages_io_buffer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_console.o ..//VP_Stages/vp_stages_io_console.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_file.o ..//VP_Stages/vp_stages_io_file.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_yuv2rgb.o ..//VP_Stages/vp_stages_yuv2rgb.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_io_com.o ..//VP_Stages/vp_stages_io_com.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_buffer_to_picture.o ..//VP_Stages/vp_stages_buffer_to_picture.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Memory.o ..//ATcodec/ATcodec_Memory.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Buffer.o ..//ATcodec/ATcodec_Buffer.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Sorted_List.o ..//ATcodec/ATcodec_Sorted_List.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec.o ..//ATcodec/ATcodec.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_Tree.o ..//ATcodec/ATcodec_Tree.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/ATcodec/ATcodec_api.o ..//ATcodec/ATcodec_api.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com.o ..//VP_Com/linux/vp_com.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_error.o ..//VP_Com/vp_com_error.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_signal.o ..//VP_Os/linux/vp_os_signal.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_delay.o ..//VP_Os/linux/vp_os_delay.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Os/linux/vp_os_thread.o ..//VP_Os/linux/vp_os_thread.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Stages/vp_stages_o_sdl.o ..//VP_Stages/vp_stages_o_sdl.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_serial.o ..//VP_Com/linux/vp_com_serial.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wifi.o ..//VP_Com/linux/vp_com_wifi.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_wired.o ..//VP_Com/linux/vp_com_wired.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket.o ..//VP_Com/vp_com_socket.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/vp_com_socket_utils.o ..//VP_Com/vp_com_socket_utils.c +-E gcc -D_MOBILE -DRECORD_VIDEO -DGNU_LINUX -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DUSE_FFMPEG -DAT_MESSAGES_HEADER="../Common/at_msgs.h" -DUSE_NEW_ATCODEC -DUSE_FFMPEG_RECORDER -Wall -Wall -O3 -DCOMPIL_MODE_PROD -DNDEBUG -D__linux__ -D__LINUX__ -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB -DUSE_LINUX -I../..//Soft/Common -I../..//Soft/Lib -I../../VLIB/.. -I../../VLIB/P263 -I../../VLIB/Platform/x86 -I../../Soft/Build/targets_versions/_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/include -I../ -I..//VP_Com -I..//VP_Os/linux -I..//VP_Com/linux -I/specific -c -o ../../Soft/Build/targets_versions/sdk_PROD_MODE_ffmpeg_Intel_Linux_2.6.35-27-generic_GNU_Linux_gcc_4.4.5/VP_Com/linux/vp_com_config_itf.o ..//VP_Com/linux/vp_com_config_itf.c diff --git a/ARDroneLib/Soft/Common/ardrone_api.h b/ARDroneLib/Soft/Common/ardrone_api.h new file mode 100644 index 0000000..ba9a023 --- /dev/null +++ b/ARDroneLib/Soft/Common/ardrone_api.h @@ -0,0 +1,762 @@ +/****************************************************************************** + * COPYRIGHT PARROT 2010 + ****************************************************************************** + * PARROT A.R.Drone SDK + *---------------------------------------------------------------------------*/ +/** + * @file ardrone_api.h + * @brief Data types and functions to communicate with the drone. + * + ******************************************************************************/ + +#ifndef _ARDRONE_API_H_ +#define _ARDRONE_API_H_ + +/*--- Libraries --------------------------------------------------------------*/ + +#include +#include +#include +#include +#include +#include + +/** @def API_WEAK + * @brief Defines the API_WEAK attribute. + * It is used to define a function which + * can be redefined by the SDK user with a custom one, without generating + * a 'multiple definition' compilation error. This is a GCC specific feature. + **/ +#if defined(USE_LINUX) && defined(_EMBEDDED) && !defined(USE_MINGW32) +#define API_WEAK WEAK +#else +#define API_WEAK +#endif + +/** @def ARDRONE_CONFIGURATION_SET + * @brief Sets a drone configuration value. + * This is the main method that SDK users should use to change a setting on + * the drone. + * @def ARDRONE_CONFIGURATION_SET_FUNCTION + * @brief Used internally by ARDroneLib to build the name of a function + * changing a particular drone configuration value. + * @def ARDRONE_CONFIGURATION_PROTOTYPE + * @brief Used internally by ARDroneLib to define a function changing a + * particular drone configuration value. + * **/ +//Deprecated - no ack method - #define ARDRONE_CONFIGURATION_SET(NAME, VALUE) ARDRONE_CONFIGURATION_SET_FUNCTION(NAME)(VALUE) +#define ARDRONE_CONFIGURATION_SET_FUNCTION(NAME) ardrone_at_configuration_set_##NAME +#define ARDRONE_CONFIGURATION_PROTOTYPE(NAME) C_RESULT ARDRONE_CONFIGURATION_SET_FUNCTION(NAME)(void* value, char* ses_id, char* usr_id, char* app_id) + +/** + * @brief Used internally by ARDroneTool as an argument to the creation of + * a control event, when changing a configuration value. + * SDK users should not deal with this; see ARDRONE_CONFIGURATION_SET to change + * a drone setting. + */ + +typedef C_RESULT (*ardrone_at_configuration_set)(void* value, char* ses_id, char* usr_id, char* app_id); + +/** + * @brief Used internally by ARDroneTool as argument to the miscellaneous + * settings (see AT*MISC command). + */ +enum +{ + NO_CONTROL = 0, + ALTITUDE_CONTROL = 1, + ALTITUDE_VISION_CONTROL = 2, + ALTITUDE_VISION_CONTROL_TAKEOFF_TRIM = 3, + MULTICONFIGURATION = 1024 +}; + + +/** + * @brief Possible states of the drone 'control' thread. + */ +typedef enum +{ + NO_CONTROL_MODE = 0, /*>16) & 0x0FF ) +#define DETECTION_EXTRACT_TAG(type) ( (type) & 0x0FF ) + +/** + * @brief Video bitrate control mode. + */ +typedef enum +{ + VBC_MODE_DISABLED = 0, /* + #undef LED_ANIMATION + NUM_LED_ANIMATION +} LED_ANIMATION_IDS; + +typedef enum ARDRONE_PROGRESSIVE_CMD_FLAG_ +{ + ARDRONE_PROGRESSIVE_CMD_ENABLE, // 1: use progressive commands - 0: try hovering + ARDRONE_PROGRESSIVE_CMD_COMBINED_YAW_ACTIVE, // 1: activate combined yaw - 0: Deactivate combined yaw + ARDRONE_PROGRESSIVE_CMD_MAX +} ARDRONE_PROGRESSIVE_CMD_FLAG; + +/** + * @struct _euler_angles_t + * @brief Euler angles in float32_t format expressed in radians. + */ +typedef struct _euler_angles_t +{ + float32_t theta; /* + +} navdata_unpacked_t; + +/** + * @def ardrone_navdata_pack + * @brief Add an 'option' to the navdata network packet to be sent to a client. + * Used by the drone 'navdata' thread. +*/ +#define ardrone_navdata_pack( navdata_ptr, option ) (navdata_option_t*) navdata_pack_option( (uint8_t*) navdata_ptr, \ + (uint8_t*) &option, \ + option.size ) + +/** + * @def ardrone_navdata_unpack + * @brief Extract an'option' from the navdata network packet sent by the drone. + * Used by the client 'navdata' thread inside ARDroneTool. +*/ +#define ardrone_navdata_unpack( navdata_ptr, option ) (navdata_option_t*) navdata_unpack_option( (uint8_t*) navdata_ptr, \ + navdata_ptr->size, \ + (uint8_t*) &option, \ + sizeof (option) ) + +/** + * @brief Add an 'option' to the navdata network packet to be sent to a client. + * Used by the drone 'navdata' thread. + * @param navdata_ptr Pointer to the buffer containing packed navdata to be sent. +*/ +static INLINE uint8_t* navdata_pack_option( uint8_t* navdata_ptr, uint8_t* data, uint32_t size ) +{ + vp_os_memcpy(navdata_ptr, data, size); + return (navdata_ptr + size); +} + +/** + * @fn navdata_unpack_option + * @brief Extract an 'option' from the navdata network packet sent by the drone. + * Used by the client 'navdata' thread inside ARDroneTool. +*/ +static INLINE uint8_t* navdata_unpack_option( uint8_t* navdata_ptr, uint32_t ptrsize, uint8_t* data, uint32_t datasize ) +{ + uint32_t minSize = (ptrsize < datasize) ? ptrsize : datasize; + vp_os_memcpy(data, navdata_ptr, minSize); + return (navdata_ptr + ptrsize); +} + +/** + * @fn navdata_next_option + * @brief Jumps to the next 'option' inside the packed navdata. + * Used by the client 'navdata' thread inside ARDroneTool. +*/ +static INLINE navdata_option_t* navdata_next_option( navdata_option_t* navdata_options_ptr ) +{ + uint8_t* ptr; + + ptr = (uint8_t*) navdata_options_ptr; + ptr += navdata_options_ptr->size; + + return (navdata_option_t*) ptr; +} + +/** + * @brief Creates a checksum from a packed navdata packet. + * @param nv Data to calculate the checksum. + * @param size Size of data calculate as follow : size-sizeof(navdata_cks_t). + * @return Retrieves the checksum from the navdata nv. + */ +uint32_t ardrone_navdata_compute_cks( uint8_t* nv, int32_t size ) API_WEAK; + +/** + * @param navdata_unpacked navdata_unpacked in which to store the navdata. + * @param navdata One packet read from the port NAVDATA. + * @param Checksum of navdata + * @brief Disassembles a buffer of received navdata, and dispatches it inside 'navdata_unpacked' structure. + */ +C_RESULT ardrone_navdata_unpack_all(navdata_unpacked_t* navdata_unpacked, navdata_t* navdata, uint32_t* cks) API_WEAK; + +/*** + * @param navdata_options_ptr + * @param Tag ID of the bloc to search for. + * @brief Jumps to a specified 'option' (block of navdata) inside a navdata packed buffer. + */ +navdata_option_t* ardrone_navdata_search_option( navdata_option_t* navdata_options_ptr, navdata_tag_t tag ) API_WEAK; + +/******************************************************************** +* AT FUNCTIONS +********************************************************************/ + +/** + * @brief Initializes the AT Command managing thread of ARDroneTool. + * The AT Codec is initialized. + */ +void ardrone_at_init( const char* ip, size_t ip_len ) API_WEAK; + +/** + * @brief Initializes the AT Command managing thread of ARDroneTool, by + * providing it with custom functions for I/O from/to the drone. + */ +void ardrone_at_init_with_funcs ( const char* ip, size_t ip_len, AT_CODEC_FUNCTIONS_PTRS *funcs) API_WEAK; + +/** + * @fn ardrone_at_open + * @brief Opens the AT command socket. + */ +ATCODEC_RET ardrone_at_open ( void ) API_WEAK; + +/** + * @brief Makes ARDroneToll send all queued AT commands to the drone. + * ARDroneTool locally buffers AT commands sent by the client program + * until this function is called. + * Usually the client program GUI calls ardrone_at_xxx commands to + * pilot the drone; these commands are then queued by ARDroneTool. + * The ARDroneTool main thread calls this functions periodically + * (every 30ms for example) to actually send to queued commands to + * the drone. + */ +ATCODEC_RET ardrone_at_send ( void ) API_WEAK; + +/* + * @brief Sends input sequence number to avoid reception of old data + * @param value : sequence number + * @deprecated + * @return void + * Used on prototypes. + */ +//void ardrone_at_set_sequence( uint32_t sequence ) API_WEAK; + +/** + * @brief Set the flight status command. + * @param value Bit mask containing the desired commmand. + * The bit mask contains the bit controlling take-off/landing + * and the bit signaling /resuming from an emergency. + * This mask is periodically sent to the drone by ARDroneTool + * inside an AT*REF command. + */ +void ardrone_at_set_ui_value( uint32_t value ) API_WEAK; + +/** + * @brief Used internally by Parrot - send misc. config. data. + * @param data used to configure control + * @return void + */ +void ardrone_at_set_pmode( int32_t pmode ) API_WEAK; + +#ifndef DISABLE_DEPRECATED_CODE + /** + * @fn Tell to keep trim result + * @param yes or no + * @return C_RESULT + */ + void ardrone_at_keep_trim( bool_t keep ) API_WEAK; + + /** + * @fn Reset trim/misc0 related ack's + * @return void + */ + void ardrone_at_trim_ack_reset( void ) API_WEAK; +#endif + +/** + * @brief Used by Parrot - send misc. config. data for drone debugging. + * @param data are used to configure control (for instance) + * @return void + * This should not be used by SDK users. Parameters value do not have any fixed meaning. + */ +void ardrone_at_set_ui_misc( int32_t m1, int32_t m2, int32_t m3, int32_t m4 ) API_WEAK; + +/** + * @brief Makes the drone play a predefined movement + * @param type type of animation + * @param timeout duration of the animation in seconds + */ +void ardrone_at_set_anim( anim_mayday_t type, int32_t timeout ) API_WEAK; + +/** + * @brief Instructs the drone to use its current position + * as a reference for the horizontal plane. + */ +void ardrone_at_set_flat_trim( void ) API_WEAK; + +/** + * @brief Sets a manual trim (offset) on the drone commands + */ +void ardrone_at_set_manual_trims( float32_t trim_pitch, float32_t trim_roll, float32_t trim_yaw ) API_WEAK; + +/** + * @brief Changes PID gains of the drone control loop + * @param user_ctrl_gains gains to be set + */ +void ardrone_at_set_control_gains( api_control_gains_t* user_ctrl_gains ) API_WEAK; + +/** + * @brief Changes the tracking parameters (only in UE_IHM_PO mode) + * @param params : new params + */ +void ardrone_at_set_vision_track_params( api_vision_tracker_params_t* params ) API_WEAK; + +/** + * @fn Start a raw capture + */ +void ardrone_at_start_raw_capture(void) API_WEAK; + +/** + * @brief Changes the type of object to detect + */ +void ardrone_at_cad( CAD_TYPE type, float32_t tag_size ) API_WEAK; + +/** + * @brief Change the broadcasted video channel + */ +void ardrone_at_zap( ZAP_VIDEO_CHANNEL channel ) API_WEAK; + +/** + * @brief Plays a led animation + */ +void ardrone_at_set_led_animation ( LED_ANIMATION_IDS anim_id, float32_t freq, uint32_t duration_sec ) API_WEAK; + +/** + * @fn Set vision update options (only in UE_IHM_PO mode) + * @param user_vision_option : new option + */ +void ardrone_at_set_vision_update_options( int32_t user_vision_option ) API_WEAK; + +/** + * @brief Used internally at Parrot - sets the drones position as seen by polaris + * @param x_polaris : x of ardrone position seen by polaris + * @param y_polaris : y of ardrone position seen by polaris + * @param defined : tells if polaris data are valid or not + * @param time_us : time in us + */ +void ardrone_at_set_polaris_pos( float32_t x_polaris, float32_t y_polaris, float32_t psi_polaris, bool_t defined, int32_t time_us ) API_WEAK; + +/** + * @brief Used internally at Parrot - sets the drones position as seen by vicon + * @param time : vicon timestamp + * @param frame_number : vicon frame_number + * @param latency : vicon latency + * @param global_translation : vicon global translation + * @param global_rotation_euler : vicon global rotation (euler angles) + */ +void ardrone_at_set_vicon_data(struct timeval time, int32_t frame_number, float32_t latency, vector31_t global_translation, vector31_t global_rotation_euler); + +/** + * @brief Send to drone a identified configuration + * @param param : parameter to set or update + * @param ses_id : session id + * @param usr_id : user id + * @param app_id : application id + * @param value : value to apply to the parameter + */ +void ardrone_at_set_toy_configuration_ids(const char* param,char* ses_id, char* usr_id, char* app_id, const char* value) API_WEAK; + +/** + * @brief Asks the drone to reset the communication watchdog. + * If no command is received by the drone + */ +void ardrone_at_reset_com_watchdog( void ) API_WEAK; + +/** + * @brief Asks the drone to purge log files + */ +void ardrone_at_reset_logs( void ) API_WEAK; + +/** + * @brief Asks the drone we receive a plf with a size filesize + */ +void ardrone_at_update_control_mode( uint32_t what_to_do, uint32_t filesize ) API_WEAK; + +/** + * @brief Asks the drone to send control mode + */ +void ardrone_at_configuration_get_ctrl_mode( void ) API_WEAK; +void ardrone_at_custom_configuration_get_ctrl_mode(void) API_WEAK; + +/** + * @brief Tells the drone we received the control mode + */ +void ardrone_at_configuration_ack_ctrl_mode( void ) API_WEAK; + +void ardrone_at_set_autonomous_flight( int32_t isActive ); + +/** + * @brief Sets the drone motor command directly + * This is enables only on prototypes drones. + */ +void ardrone_at_set_pwm( int32_t p1, int32_t p2, int32_t p3, int32_t p4 ) API_WEAK; + +/** + * @fn ardrone_at_set_progress_cmd + * @brief Sends the drone progressive commands + * @param flag Use 1 << value of ARDRONE_PROGRESSIVE_CMD_FLAG_XXX to use a flag + * @param phi Left/right angle between -1 to +1 - negative values bend leftward. + * @param roll Front/back angle between -1 to +1 - negative values bend forward. + * @param gaz Vertical speed - negative values make the drone go down. + * @param yaw Angular speed - negative values make the drone spin left. + * This function allows the client program to control the drone by giving it a front/back + * and left/right bending order, a vertical speed order, and a rotation order. + * All values are given as a percentage of the maximum bending angles (in degrees), + * vertical speed (in millimeters per second) and angular speed (in degrees per second). + */ +void ardrone_at_set_progress_cmd( int32_t flag, float32_t phi, float32_t theta, float32_t gaz, float32_t yaw ); + + +/***************************************************************** +* AT CONFIG FUNCTIONS +*****************************************************************/ +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#include // must be included before to have types + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) ARDRONE_CONFIGURATION_PROTOTYPE(NAME); +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) ARDRONE_CONFIGURATION_PROTOTYPE(NAME); +#include // must be included before to have types + +/******************************************************************** +* CONFIG FUNCTIONS +********************************************************************/ +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#include // must be included before to have types + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ + C_TYPE get_##NAME(void) API_WEAK; \ + C_RESULT set_##NAME(C_TYPE val) API_WEAK; +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ + C_TYPE_PTR get_##NAME(void) API_WEAK; \ + C_RESULT set_##NAME(C_TYPE_PTR val) API_WEAK; +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ + C_TYPE_PTR get_##NAME(void) API_WEAK; \ + C_RESULT set_##NAME(C_TYPE_PTR val) API_WEAK; +// Generate all accessors functions prototypes +#include + + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#include // must be included before to have types + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) C_TYPE NAME; +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) C_TYPE NAME; +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) C_TYPE NAME; + +// Fill structure fields types +typedef struct _ardrone_config_t +{ +#include +} +ardrone_config_t; + +void reset_ardrone_config(void); + +/******************************************************************** + * USER FUNCTIONS + ********************************************************************/ +#define MULTICONFIG_ID_SIZE 9 +#define SESSION_NAME_SIZE 1024 +#define USER_NAME_SIZE 1024 +#define APPLI_NAME_SIZE 1024 + +typedef struct _ardrone_user_t +{ + char ident[MULTICONFIG_ID_SIZE]; + char description[USER_NAME_SIZE]; +} ardrone_user_t; + +typedef struct _ardrone_users_t +{ + int userCount; + ardrone_user_t *userList; +} ardrone_users_t; + +void ardrone_refresh_user_list(void); // Ask for a userlist refresh +void ardrone_switch_to_user(const char *new_user); // Can be used to create user +void ardrone_switch_to_user_id(const char *new_user_id); // Must be used only with existing users +ardrone_users_t *ardrone_get_user_list(void); // Get a list of users (MUST BE FREED BY A ardrone_free_user_list CALL) +void ardrone_free_user_list (ardrone_users_t **users); // Free an ardrone_users_t list allocated by ardrone_get_user_list + + +#endif // _ARDRONE_API_H_ diff --git a/ARDroneLib/Soft/Common/ardrone_common_config.h b/ARDroneLib/Soft/Common/ardrone_common_config.h new file mode 100644 index 0000000..36a71cf --- /dev/null +++ b/ARDroneLib/Soft/Common/ardrone_common_config.h @@ -0,0 +1,52 @@ +/** + * \file ardrone_common_config.h + * \brief Ardrone Specific data for configuration + * \author Sylvain Gaeremynck + * \version 1.0 + */ + +#ifndef _ARDRONE_COMMON_CONFIG_H_ +#define _ARDRONE_COMMON_CONFIG_H_ + +#define CURRENT_NUM_VERSION_CONFIG 1 + +#define CAMIF_NUM_BUFFERS 2 +#define COM_INPUT_LANDING_TIME (2) /* Time drone is waiting for input before landing */ + +/** + * \enum print_mask_t + * \brief mask to choose where to syslog +*/ +typedef enum { + UART_PRINT = 1, + WIFI_PRINT = 2, + FLASH_PRINT = 4 +} print_mask_t; + +/** + * \enum ADC_COMMANDS + * \brief ADC commands. +*/ +typedef enum +{ + ADC_CMD_STARTACQ = 1, /**< command to start acquisition with ADC **/ + ADC_CMD_STOPACQ = 2, /**< command to stop acquisition with ADC **/ + ADC_CMD_RESYNC = 3, /**< command to resync acquisition with ADC **/ + ADC_CMD_TEST = 4, /**< command to ADC send a test frame (123456) **/ + ADC_CMD_VERSION = 5, /**< command to ADC send his number : version (MSB) subversion (LSB) **/ + ADC_CMD_SELECT_ULTRASOUND_22Hz = 7, /**set the ultrasound at 22,22Hz **/ + ADC_CMD_SELECT_ULTRASOUND_25Hz = 8, /**set the ultrasound at 25Hz **/ + ADC_CMD_SEND_CALIBRE = 13, /**command to ADC to send the calibration **/ + ADC_CMD_RECEVED_CALIBRE = 14, /**command to ADC to receved a new calibration **/ + ADC_CMD_GET_HARD_VERSION = 15, /**get the hard version of the navboard **/ + ADC_CMD_ACTIVE_SEPARATION = 16, /**enabled the separation of sources ultrasound **/ + ADC_CMD_STOP_SEPARATION = 17, /**disables the ultrasound source separation **/ + ADC_CMD_RECEVED_PROD = 18, /**command to ADC to receved the prod data **/ + ADC_CMD_SEND_PROD = 19, /**command to ADC to send the prod data **/ + ADC_CMD_ACTIVE_ETALONAGE = 20, /**command to ADC to send PWM ultrasond in continue **/ + ADC_CMD_ACTIVE_ULTRASON = 21, /**command to ADC to stop send PWM ultrasond in continue **/ + ADC_CMD_ACTIVE_TEST_ULTRASON = 22, /**teste de la perturbation de l'ultrason par le wifi **/ +} ADC_COMMANDS; + + +#endif // _ARDRONE_COMMON_CONFIG_H_ diff --git a/ARDroneLib/Soft/Common/at_msgs.h b/ARDroneLib/Soft/Common/at_msgs.h new file mode 100644 index 0000000..d8fcd3f --- /dev/null +++ b/ARDroneLib/Soft/Common/at_msgs.h @@ -0,0 +1,60 @@ +/** + * \file at_msgs.h + * \brief ATCodec messages declaration + * \author Aurelien Morelle + * \date 2007/04/03 + * \version 1.0 + */ + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_RC_REF_EXE, "AT*REF=%d,%d\r", 0, at_rc_ref_exe, 3 ) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PMODE_EXE, "AT*PMODE=%d,%d\r", 0, at_pmode_exe, 3 ) +// old school +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_MISC_EXE, "AT*MISC=%d,%d,%d,%d,%d\r", 0, at_misc_exe, 3 ) +// gains +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_GAIN_EXE, "AT*GAIN=%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\r", 0, at_gain_exe, 3 ) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_ANIM_EXE, "AT*ANIM=%d,%d,%d\r", 0, at_anim_exe, 3 ) +// vision params +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_VISP_EXE, "AT*VISP=%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\r", 0, at_visp_exe, 3 ) +// vision params +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_VISO_EXE, "AT*VISO=%d,%d\r", 0, at_viso_exe, 3 ) +// capture params +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_RAWC_EXE, "AT*CAP=%d\r", 0, at_cap, 3 ) +// zapper +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_ZAP_EXE, "AT*ZAP=%d,%d\r", 0, at_zap, 3 ) +// Change camera for arwiz detection +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_CAD_EXE, "AT*CAD=%d,%d,%d\r", 0, at_cad, 3 ) +// flat trim +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_FTRIM_EXE, "AT*FTRIM=%d\r", 0, at_flat_trim_exe, 3 ) +// manual trims +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_MTRIM_EXE, "AT*MTRIM=%d,%d,%d,%d\r", 0, at_manual_trims_exe, 3 ) +// send attitude +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_POLARIS_EXE, "AT*POL=%d,%d,%d,%d,%d,%d\r", 0, at_pol_exe, 3 ) +// sends iphone command for all axes +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PCMD_EXE, "AT*PCMD=%d,%d,%d,%d,%d,%d\r", 0, at_pcmd_exe, 3 ) +// sends Radiocommand values for all 4 axis. +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_CONFIG_EXE, "AT*CONFIG=%d,\"%s\",\"%s\"\r", 0, at_toy_configuration_exe, 3) +// control command +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_CONFIG_IDS, "AT*CONFIG_IDS=%d,\"%s\",\"%s\",\"%s\"\r", 0, at_toy_configuration_ids, 4) +// control command +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_CTRL_EXE, "AT*CTRL=%d,%d,%d\r", 0, at_control_exe, 3) +// led animation command +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_LED_EXE, "AT*LED=%d,%d,%d,%d\r", 0, at_led_animation_exe, 3) +// reset com watchdog +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_RESET_COM_WATCHDOG,"AT*COMWDG=%d\r", 0, at_reset_com_watchdog, 3) + +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PWM_EXE, "AT*PWM=%d,%d,%d,%d,%d\r", 0, at_pwm, 3) + +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_AUTONOMOUS_FLIGHT_EXE, "AT*AFLIGHT=%d,%d\r", 0, at_autonomous_flight_exe, 3 ) + +// Vicon information +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_VICON_EXE, "AT*VICON=%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\r", 0, at_vicon_exe, 3 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Result messages +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_OK, "OK\r", AT_MSG_ATCMD_DEFAULT, atresu_ok) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_ERROR, "ERROR\r", AT_MSG_ATCMD_DEFAULT, atresu_error) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ARDroneLib/Soft/Common/at_msgs_ids.h b/ARDroneLib/Soft/Common/at_msgs_ids.h new file mode 100644 index 0000000..dbcd579 --- /dev/null +++ b/ARDroneLib/Soft/Common/at_msgs_ids.h @@ -0,0 +1,26 @@ +/** + * \file at_msgs_ids.h + * \brief ids for ATCodec + * \author Aurelien Morelle + * \version 1.0 + */ + +#ifndef _AT_MSGS_IDS_H_ +#define _AT_MSGS_IDS_H_ + +#include + +typedef struct _AT_CODEC_MSG_IDS_ +{ +# define ATCODEC_DEFINE_AT_CMD(ID,Str,From,Cb,Prio) AT_CODEC_MSG_ID ID; +# define ATCODEC_DEFINE_AT_RESU(ID,Str,From,Cb) AT_CODEC_MSG_ID ID; + + AT_CODEC_MSG_ID AT_MSG_ATCMD_DEFAULT; + +# include +} AT_CODEC_MSG_IDS; + + +extern AT_CODEC_MSG_IDS ids; + +#endif // _AT_MSGS_IDS_H_ diff --git a/ARDroneLib/Soft/Common/autoconf.h b/ARDroneLib/Soft/Common/autoconf.h new file mode 100644 index 0000000..0d516f1 --- /dev/null +++ b/ARDroneLib/Soft/Common/autoconf.h @@ -0,0 +1,49 @@ +/* + * Automatically generated C config: don't edit + * Linux kernel version: + * Thu Nov 5 18:06:01 2009 + */ +#define AUTOCONF_INCLUDED +#define PAL_TRACE_THREAD_VAL 0 +#define PAL_ASSERT 1 +#define MODIF_VERSION_NUMBER 0 +#define PAL_BUTTON_LONG_PRESS_TIME 2000 +#define PAL_BUTTON_DRIVER 1 +#define PAL_I2C_DRIVER 1 +#define MAJOR_VERSION_NUMBER 1 +#define PAL_TRACE_SEM_VAL 0 +#define MINOR_VERSION_NUMBER 0 +#define PAL_TRACE_SYS_VAL 0 +#define PAL_SUP_NB_TIMERS 18 +#define PAL_TRACE_HWALARM_VAL 0 +#define PAL_PWM_DRIVER 1 +#define PAL_I2C_DEVICES 1 +#define EXTENDED_VERSION_INFO RC0 +#define PAL_SUP_NB_MOD 32 +#define PAL_TRACE_FLAG_VAL 0 +#define PAL_TRACE_COND_VAL 0 +#define PAL_DEBUG_LEVEL 1 +#define PAL_TRACE_GPIO_VAL 0 +#define PAL_TRACE_TIME_VAL 0 +#define PAL_TRACE_MBOX_VAL 0 +#define PAL_TRACE_UART_VAL 0 +#define PAL_GPIO_DRIVER 1 +#define PAL_P6MU_ADC_DEVICE 1 +#define PAL_P6MU_CODEC_DEVICE 1 +#define BUILD_PAL 1 +#define PAL_SUP_PRIO_P1 18 +#define PAL_SUP_PRIO_P2 20 +#define PAL_SUP_PRIO_P3 22 +#define PAL_SUP_PRIO_P4 24 +#define PAL_SUP_PRIO_P5 26 +#define PAL_UARTS_COUNT 4 +#define PAL_LINUX_NOSMP 1 +#define PAL_TRACE_ALARM_VAL 0 +#define PAL_SUP_MAX_MES 60 +#define CONFIG_PAL_USER_ASSERT 1 +#define TRUC_POURRI_YMM 1 +#define UNAME_RELEASE 2.6.28-16-generic +#define PAL_BUTTON_MAX_HW_DRIVERS 1 +#define PAL_TRACE_MUTEX_VAL 0 +#define PAL_BUTTON_MAX_BUTTONS 32 +#define PAL_STACKSIZE 6144 diff --git a/ARDroneLib/Soft/Common/config.h b/ARDroneLib/Soft/Common/config.h new file mode 100644 index 0000000..faa381f --- /dev/null +++ b/ARDroneLib/Soft/Common/config.h @@ -0,0 +1,319 @@ +/** +*************************************************************************** +* +* Copyright (C) 2007 Parrot S.A. +* +*************************************************************************** +*/ + +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + +#include +#ifdef _WIN32 + #include +#else + #include + #include +#endif + +#undef ARDRONE_PIC_VERSION + +#define USE_NAVDATA_IP +#define USE_AT_IP +#define USE_VIDEO_IP + +/////////////////////////////////////////////// +// Video configuration +#define VIDEO_ENABLE 1 + +/////////////////////////////////////////////// +// Vision configuration + +#define VISION_ENABLE 1 +// #define VISION_TEST_MODE +#define ARDRONE_VISION_DETECT + +/////////////////////////////////////////////// +// Navdata configuration + +#define NAVDATA_ENABLE 1 +#define ND_WRITE_TO_FILE + +# define NAVDATA_SUBSAMPLING 13 /* 200 / 15 fps = 13.3333 */ + +#if defined(NAVDATA_ENABLE) + +# define NAVDATA_VISION_DETECT_INCLUDED +# define NAVDATA_TRIMS_INCLUDED +# define NAVDATA_WATCHDOG +# define NAVDATA_EULER_ANGLES_INCLUDED +# define NAVDATA_PHYS_MEASURES_INCLUDED +# define NAVDATA_TIME_INCLUDED +# define NAVDATA_RAW_MEASURES_INCLUDED +# define NAVDATA_GYROS_OFFSETS_INCLUDED +# define NAVDATA_REFERENCES_INCLUDED +# define NAVDATA_RC_REFERENCES_INCLUDED +# define NAVDATA_PWM_INCLUDED +# define NAVDATA_ALTITUDE_INCLUDED +# define NAVDATA_VISION_INCLUDED +# define NAVDATA_VISION_PERF_INCLUDED +# define NAVDATA_TRACKERS_SEND +# define NAVDATA_VIDEO_STREAM_INCLUDED + +#endif // ! NAVDATA_ENABLE + +#ifndef ARDRONE_VISION_DETECT +# undef NAVDATA_VISION_DETECT_INCLUDED +#endif // ! ARDRONE_VISION_DETECT + +/////////////////////////////////////////////// +// Wifi configuration + +#define USE_AUTOIP VP_COM_AUTOIP_DISABLE /* VP_COM_AUTOIP_ENABLE */ + +#define WIFI_NETMASK "255.255.255.0" +#define WIFI_GATEWAY WIFI_ARDRONE_IP +#define WIFI_SERVER WIFI_ARDRONE_IP +#define WIFI_SECURE 0 + +#define WIFI_BASE_ADDR 0xc0a80100 // 192.168.1.0 +#define MULTICAST_BASE_ADDR 0xe0010100 // 224.1.1.0 +#define WIFI_BROADCAST_ADDR (WIFI_BASE_ADDR | 0xff) //XXX.XXX.XXX.255 + +// Configure infrastructure mode given wifi driver compilation +#define WIFI_INFRASTRUCTURE 0 + +#define WIFI_PASSKEY "9F1C3EE11CBA230B27BF1C1B6F" + +#define FTP_PORT 5551 +#define AUTH_PORT 5552 +#define NAVDATA_PORT 5554 +#define VIDEO_PORT 5555 +#define AT_PORT 5556 +#define RAW_CAPTURE_PORT 5557 +#define PRINTF_PORT 5558 +#define CONTROL_PORT 5559 + +/////////////////////////////////////////////// +// Wired configuration + +#define WIRED_MOBILE_IP WIFI_MOBILE_IP + +/////////////////////////////////////////////// +// Serial link configuration + +#ifdef USE_ELINUX + +#define SERIAL_LINK_0 "/dev/ttyPA0" +#define SERIAL_LINK_1 "/dev/ttyPA1" +#define SERIAL_LINK_2 "/dev/ttyPA2" + +#endif + +#ifdef USE_LINUX + +#ifdef USE_MINGW32 + +#define SERIAL_LINK_0 "" +#define SERIAL_LINK_1 "" +#define SERIAL_LINK_2 "" + +#else + +// Only USE_LINUX is defined +#define SERIAL_LINK_0 "/dev/ttyUSB0" /* Serial link for navdata & ATCmd */ +#define SERIAL_LINK_1 "/dev/ttyUSB1" /* Serial link for video */ +#define SERIAL_LINK_2 "/dev/ser2" /* Serial link for adc */ + +#endif // USE_MINGW32 + +#endif // USE_LINUX + +#define SL0_BAUDRATE VP_COM_BAUDRATE_460800 /* baud rate for serial link 0 */ +#define SL1_BAUDRATE VP_COM_BAUDRATE_460800 /* baud rate for serial link 1 */ +#define SL2_BAUDRATE VP_COM_BAUDRATE_460800 /* baud rate for serial link 2 */ + +/////////////////////////////////////////////// +// Defines & types used in shared data + +#define ARDRONE_ORIENTATION_HISTORY_SIZE 256 + +#define TSECDEC 21 /* Defines used to format time ( seconds << 21 + useconds ) */ +#define TUSECMASK ((1 << TSECDEC) - 1) +#define TSECMASK (0xffffffff & ~TUSECMASK) +#define TIME_TO_USEC (0xffffffff & ~TUSECMASK) + +#define VBAT_POWERING_OFF 9000 /* Minimum Battery Voltage [mV] to prevent damaging */ + +/* Syslog Configuration */ +#define SYSLOG_NUM_BUFFERS 4 /* Number of actives buffers. When a buffer is full, it's dumped in file */ +#define SYSLOG_BUFFER_SIZE 2048 /* Max number of bytes in a syslog buffer */ +#define SYSLOG_BUFFER_DUMP_SIZE 128 /* Max number of bytes wrote at once during dump */ + + +#define DEFAULT_MISC1_VALUE 2 +#define DEFAULT_MISC2_VALUE 20 +#define DEFAULT_MISC3_VALUE 2000 +#define DEFAULT_MISC4_VALUE 3000 + + +typedef enum { + MISC_VAR1 = 0, + MISC_VAR2, + MISC_VAR3, + MISC_VAR4, + NB_MISC_VARS +} misc_var_t; + +// Mayday scenarii +typedef enum { + ARDRONE_ANIM_PHI_M30_DEG= 0, + ARDRONE_ANIM_PHI_30_DEG, + ARDRONE_ANIM_THETA_M30_DEG, + ARDRONE_ANIM_THETA_30_DEG, + ARDRONE_ANIM_THETA_20DEG_YAW_200DEG, + ARDRONE_ANIM_THETA_20DEG_YAW_M200DEG, + ARDRONE_ANIM_TURNAROUND, + ARDRONE_ANIM_TURNAROUND_GODOWN, + ARDRONE_ANIM_YAW_SHAKE, + ARDRONE_ANIM_YAW_DANCE, + ARDRONE_ANIM_PHI_DANCE, + ARDRONE_ANIM_THETA_DANCE, + ARDRONE_ANIM_VZ_DANCE, + ARDRONE_ANIM_WAVE, + ARDRONE_ANIM_PHI_THETA_MIXED, + ARDRONE_ANIM_DOUBLE_PHI_THETA_MIXED, + ARDRONE_NB_ANIM_MAYDAY +} anim_mayday_t; + +// Bitfield definition for user input + +typedef enum { + ARDRONE_UI_BIT_AG = 0, + ARDRONE_UI_BIT_AB = 1, + ARDRONE_UI_BIT_AD = 2, + ARDRONE_UI_BIT_AH = 3, + ARDRONE_UI_BIT_L1 = 4, + ARDRONE_UI_BIT_R1 = 5, + ARDRONE_UI_BIT_L2 = 6, + ARDRONE_UI_BIT_R2 = 7, + ARDRONE_UI_BIT_SELECT = 8, + ARDRONE_UI_BIT_START = 9, + ARDRONE_UI_BIT_TRIM_THETA = 18, + ARDRONE_UI_BIT_TRIM_PHI = 20, + ARDRONE_UI_BIT_TRIM_YAW = 22, + ARDRONE_UI_BIT_X = 24, + ARDRONE_UI_BIT_Y = 28, +} ardrone_ui_bitfield_t; + + +/// \enum def_ardrone_state_mask_t is a bit field representing ARDrone' state + + +// Define masks for ARDrone state +// 31 0 +// x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x -> state +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FLY MASK : (0) ardrone is landed, (1) ardrone is flying +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VIDEO MASK : (0) video disable, (1) video enable +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VISION MASK : (0) vision disable, (1) vision enable +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONTROL ALGO : (0) euler angles control, (1) angular speed control +// | | | | | | | | | | | | | | | | | | | | | | | | | | | ALTITUDE CONTROL ALGO : (0) altitude control inactive (1) altitude control active +// | | | | | | | | | | | | | | | | | | | | | | | | | | USER feedback : Start button state +// | | | | | | | | | | | | | | | | | | | | | | | | | Control command ACK : (0) None, (1) one received +// | | | | | | | | | | | | | | | | | | | | | | | | Trim command ACK : (0) None, (1) one received +// | | | | | | | | | | | | | | | | | | | | | | | Trim running : (0) none, (1) running +// | | | | | | | | | | | | | | | | | | | | | | Trim result : (0) failed, (1) succeeded +// | | | | | | | | | | | | | | | | | | | | | Navdata demo : (0) All navdata, (1) only navdata demo +// | | | | | | | | | | | | | | | | | | | | Navdata bootstrap : (0) options sent in all or demo mode, (1) no navdata options sent +// | | | | | | | | | | | | | | | | | | | | Motors status : (0) Ok, (1) Motors Com is down +// | | | | | | | | | | | | | | | | | | +// | | | | | | | | | | | | | | | | | Bit means that there's an hardware problem with gyrometers +// | | | | | | | | | | | | | | | | VBat low : (1) too low, (0) Ok +// | | | | | | | | | | | | | | | VBat high (US mad) : (1) too high, (0) Ok +// | | | | | | | | | | | | | | Timer elapsed : (1) elapsed, (0) not elapsed +// | | | | | | | | | | | | | Power : (0) Ok, (1) not enough to fly +// | | | | | | | | | | | | Angles : (0) Ok, (1) out of range +// | | | | | | | | | | | Wind : (0) Ok, (1) too much to fly +// | | | | | | | | | | Ultrasonic sensor : (0) Ok, (1) deaf +// | | | | | | | | | Cutout system detection : (0) Not detected, (1) detected +// | | | | | | | | PIC Version number OK : (0) a bad version number, (1) version number is OK +// | | | | | | | ATCodec thread ON : (0) thread OFF (1) thread ON +// | | | | | | Navdata thread ON : (0) thread OFF (1) thread ON +// | | | | | Video thread ON : (0) thread OFF (1) thread ON +// | | | | Acquisition thread ON : (0) thread OFF (1) thread ON +// | | | CTRL watchdog : (1) delay in control execution (> 5ms), (0) control is well scheduled // Check frequency of control loop +// | | ADC Watchdog : (1) delay in uart2 dsr (> 5ms), (0) uart2 is good // Check frequency of uart2 dsr (com with adc) +// | Communication Watchdog : (1) com problem, (0) Com is ok // Check if we have an active connection with a client +// Emergency landing : (0) no emergency, (1) emergency + +typedef enum { + ARDRONE_FLY_MASK = 1 << 0, /*!< FLY MASK : (0) ardrone is landed, (1) ardrone is flying */ + ARDRONE_VIDEO_MASK = 1 << 1, /*!< VIDEO MASK : (0) video disable, (1) video enable */ + ARDRONE_VISION_MASK = 1 << 2, /*!< VISION MASK : (0) vision disable, (1) vision enable */ + ARDRONE_CONTROL_MASK = 1 << 3, /*!< CONTROL ALGO : (0) euler angles control, (1) angular speed control */ + ARDRONE_ALTITUDE_MASK = 1 << 4, /*!< ALTITUDE CONTROL ALGO : (0) altitude control inactive (1) altitude control active */ + ARDRONE_USER_FEEDBACK_START = 1 << 5, /*!< USER feedback : Start button state */ + ARDRONE_COMMAND_MASK = 1 << 6, /*!< Control command ACK : (0) None, (1) one received */ + ARDRONE_FW_FILE_MASK = 1 << 7, /* Firmware file is good (1) */ + ARDRONE_FW_VER_MASK = 1 << 8, /* Firmware update is newer (1) */ +// ARDRONE_FW_UPD_MASK = 1 << 9, /* Firmware update is ongoing (1) */ + ARDRONE_NAVDATA_DEMO_MASK = 1 << 10, /*!< Navdata demo : (0) All navdata, (1) only navdata demo */ + ARDRONE_NAVDATA_BOOTSTRAP = 1 << 11, /*!< Navdata bootstrap : (0) options sent in all or demo mode, (1) no navdata options sent */ + ARDRONE_MOTORS_MASK = 1 << 12, /*!< Motors status : (0) Ok, (1) Motors problem */ + ARDRONE_COM_LOST_MASK = 1 << 13, /*!< Communication Lost : (1) com problem, (0) Com is ok */ + ARDRONE_VBAT_LOW = 1 << 15, /*!< VBat low : (1) too low, (0) Ok */ + ARDRONE_USER_EL = 1 << 16, /*!< User Emergency Landing : (1) User EL is ON, (0) User EL is OFF*/ + ARDRONE_TIMER_ELAPSED = 1 << 17, /*!< Timer elapsed : (1) elapsed, (0) not elapsed */ + ARDRONE_ANGLES_OUT_OF_RANGE = 1 << 19, /*!< Angles : (0) Ok, (1) out of range */ + ARDRONE_ULTRASOUND_MASK = 1 << 21, /*!< Ultrasonic sensor : (0) Ok, (1) deaf */ + ARDRONE_CUTOUT_MASK = 1 << 22, /*!< Cutout system detection : (0) Not detected, (1) detected */ + ARDRONE_PIC_VERSION_MASK = 1 << 23, /*!< PIC Version number OK : (0) a bad version number, (1) version number is OK */ + ARDRONE_ATCODEC_THREAD_ON = 1 << 24, /*!< ATCodec thread ON : (0) thread OFF (1) thread ON */ + ARDRONE_NAVDATA_THREAD_ON = 1 << 25, /*!< Navdata thread ON : (0) thread OFF (1) thread ON */ + ARDRONE_VIDEO_THREAD_ON = 1 << 26, /*!< Video thread ON : (0) thread OFF (1) thread ON */ + ARDRONE_ACQ_THREAD_ON = 1 << 27, /*!< Acquisition thread ON : (0) thread OFF (1) thread ON */ + ARDRONE_CTRL_WATCHDOG_MASK = 1 << 28, /*!< CTRL watchdog : (1) delay in control execution (> 5ms), (0) control is well scheduled */ + ARDRONE_ADC_WATCHDOG_MASK = 1 << 29, /*!< ADC Watchdog : (1) delay in uart2 dsr (> 5ms), (0) uart2 is good */ + ARDRONE_COM_WATCHDOG_MASK = 1 << 30, /*!< Communication Watchdog : (1) com problem, (0) Com is ok */ + ARDRONE_EMERGENCY_MASK = 1 << 31 /*!< Emergency landing : (0) no emergency, (1) emergency */ +} def_ardrone_state_mask_t; + +static INLINE uint32_t ardrone_set_state_with_mask( uint32_t state, uint32_t mask, bool_t value ) +{ + state &= ~mask; + if( value ) + state |= mask; + + return state; +} + +/** Returns a bit value of state from a mask + * This function is used to test bits from a bit field like def_ardrone_state_mask_t + * + * @param state a 32 bits word we want to test + * @param mask a mask that tells the bit to test + * @return TRUE if bit is set, FALSE otherwise + */ +static INLINE bool_t ardrone_get_mask_from_state( uint32_t state, uint32_t mask ) +{ + return state & mask ? TRUE : FALSE; +} + +/** Convert time value from proprietary format to (unsigned int) micro-second value + * + * @param time value in proprietary format + * @return time value in micro-second value (unsigned int) + */ +static INLINE uint32_t ardrone_time_to_usec( uint32_t time ) +{ + return ((uint32_t)(time >> TSECDEC) * 1000000 + (uint32_t)(time & TUSECMASK)); +} + + +#ifdef DEBUG_MODE +#define POSIX_DEBUG +#endif // DEBUG_MODE + +#endif // _CONFIG_H_ diff --git a/ARDroneLib/Soft/Common/config_keys.h b/ARDroneLib/Soft/Common/config_keys.h new file mode 100644 index 0000000..1b98872 --- /dev/null +++ b/ARDroneLib/Soft/Common/config_keys.h @@ -0,0 +1,304 @@ +/****************************************************************************** + * COPYRIGHT PARROT 2010 + ****************************************************************************** + * PARROT A.R.Drone SDK + *---------------------------------------------------------------------------*/ +/** + * @file config_keys.h + * @brief Definition of all the configuration values for the drone. + * + * This file mainly consists in a list of ARDRONE_CONFIG_KEY_xxx macros + * whose arguments describe the available configuration values. + * By redefining those macros and including this file anywhere else in the + * project, it is possible to build a set of C variables, functions or macros + * based on the configuration descriptions. + * + ******************************************************************************/ + + +#ifndef CFG_STRINGIFY + #define CFG_STRINGIFY(x) #x +#endif + + + +#ifndef CONFIG_KEYS_STRING_TYPE_DEFINED +#define CONFIG_KEYS_STRING_TYPE_DEFINED + #define STRING_T_SIZE 128 + typedef char string_t[STRING_T_SIZE+1]; +#endif // ! CONFIG_KEYS_STRING_TYPE_DEFINED +#include +#include + +#ifndef CONFIG_KEYS_RW_ENUM_DEFINED +#define CONFIG_KEYS_RW_ENUM_DEFINED + +/** + * @brief Describes the behaviour of a drone configuration variable. + */ + enum { + K_READ = 1, /*!< Value can be read by a remote client */ + K_WRITE = 1<<1, /*!< Value can be written by a remote client */ + K_NOBIND = 1<<2, /*!< Data are stored to the config.ini file, but not read from this file at startup.*/ + K_SHALLOW = 1<<3, /*!< Data will no be stored to the config.ini file, nor read from this file at startup.*/ + }; + + enum { + CAT_COMMON = 0, + CAT_APPLI , + CAT_USER , + CAT_SESSION, + NB_CONFIG_CATEGORIES + }; + + /* Stephane - multiconfiguration support */ + + /* Size of the hexadecimal ID representing a custom configuration - example : 1234abcd */ + #define CUSTOM_CONFIGURATION_ID_LENGTH 8 + + typedef struct{ + char id[CUSTOM_CONFIGURATION_ID_LENGTH+1]; + char description[1024]; + }custom_configuration_t; + + typedef struct + { + custom_configuration_t* list; + int nb_configurations; + }custom_configuration_list_t; + + extern const char * configuration_switching_commands[NB_CONFIG_CATEGORIES+1]; + extern const char * custom_configuration_headers[NB_CONFIG_CATEGORIES+1]; + extern const char * custom_configuration_id_keys[NB_CONFIG_CATEGORIES+1]; + extern custom_configuration_list_t available_configurations[NB_CONFIG_CATEGORIES]; + + /** + * \brief Checks if a character is valid in a custom configuration identifier. + * Currently it checks if the character is an hexadecimal digit. + */ + C_RESULT configuration_check_config_id_char(const char session_id_char); + /** + * \brief Checks if a string is a valid custom configuration identifier. + * Currently it checks if the string is made of 8 hexa. digits. + */ + C_RESULT configuration_check_config_id(const char * session_id); + + + /* Stephane - multiconfiguration support */ + + +#endif // ! CONFIG_KEYS_RW_ENUM_DEFINED + +#ifndef CONFIG_KEYS_DEFINES_DEFINED + +# ifdef INSIDE_FLIGHT +# define MAX_EULER_ANGLES_REF (12000.0f * MDEG_TO_RAD) /* EA control, maximum reference [rad] */ +# define MAX_OUTDOOR_EULER_ANGLES_REF (20000.0f * MDEG_TO_RAD) /* EA control, maximum reference [rad] */ +# else +# define MAX_EULER_ANGLES_REF (12000.0f * MDEG_TO_RAD) /* EA control, maximum reference [rad] */ +# define MAX_OUTDOOR_EULER_ANGLES_REF (20000.0f * MDEG_TO_RAD) /* EA control, maximum reference [rad] */ +# endif + +# define CONFIG_KEYS_DEFINES_DEFINED +//Calibration renvoye par le PIC dans le cas ou il n'en a pas recut +#define DEFAULT_PWM_REF_GYRO 500 +#define DEFAULT_GYRO_OFFSET_THR_X 4.0 +#define DEFAULT_GYRO_OFFSET_THR_Y 4.0 +#define DEFAULT_GYRO_OFFSET_THR_Z 0.5 +//#define default_accs_offset {{{ -2048.0f, 2048.0f, 2048.0f}}} +//#define default_accs_gain {1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f } +//#define default_gyros_offset {{{ 1662.5f, 1662.5f, 1662.5f}}} +//#define default_gyros_gains {{{ 395.0f * MDEG_TO_RAD, -395.0f * MDEG_TO_RAD, -207.5f * MDEG_TO_RAD }}} +//#define default_gyros110_offset {{ 1662.5f, 1662.5f}} +//#define default_gyros110_gains {{ 87.5f * MDEG_TO_RAD, -87.5f * MDEG_TO_RAD }} +#define default_motor_version "0.0" +#define NULL_MAC "00:00:00:00:00:00" + +/* Selection of navdata blocks sent when starting the 'demo' mode */ +#define default_navdata_options ( NAVDATA_OPTION_MASK(NAVDATA_DEMO_TAG)|NAVDATA_OPTION_MASK(NAVDATA_VISION_DETECT_TAG) ) + +#define COMPILE_TIME ( (2010-1970)*(365+(2010-1970)/4)*(24)*(3600) ) + +extern const vector31_t default_accs_offset; +extern const matrix33_t default_accs_gain; +extern const vector31_t default_gyros_offset; +extern const vector31_t default_gyros_gains; +extern const vector21_t default_gyros110_offset; +extern const vector21_t default_gyros110_gains; + +#define default_pwm_ref_gyro DEFAULT_PWM_REF_GYRO +#define default_gyro_offset_thr_x DEFAULT_GYRO_OFFSET_THR_X +#define default_gyro_offset_thr_y DEFAULT_GYRO_OFFSET_THR_Y +#define default_gyro_offset_thr_z DEFAULT_GYRO_OFFSET_THR_Z + +#define default_euler_angle_ref_max MAX_EULER_ANGLES_REF +#define default_outdoor_euler_angle_ref_max MAX_OUTDOOR_EULER_ANGLES_REF +# define default_altitude_max (3000) +# define default_altitude_min (50) +# define default_control_trim_z (0.0f * MDEG_TO_RAD) +# define default_control_iphone_tilt (20000.0f * MDEG_TO_RAD) +# define default_control_vz_max (700.0f) +# define default_outdoor_control_vz_max (1000.0f) +# define default_control_yaw (100000.0f * MDEG_TO_RAD) +# define default_outdoor_control_yaw (200000.0f * MDEG_TO_RAD) + +#define default_enemy_colors (ARDRONE_DETECTION_COLOR_ORANGE_GREEN) +#define default_groundstripe_colors (ARDRONE_DETECTION_COLOR_ARRACE_FINISH_LINE) +#define default_detect_type CAD_TYPE_NONE + +#define DEFAULT_APPLICATION_DESC "Default application configuration" +#define DEFAULT_PROFILE_DESC "Default profile configuration" +#define DEFAULT_SESSION_DESC "Default session configuration" + +#define CUSTOM_CONFIGURATION_DELETE_ALL_CMD "all" + +#ifndef CARD_VERSION +#define CARD_VERSION 0x00 +#endif + +#endif // ! CONFIG_KEYS_DEFINES_DEFINED + +/* ---- List of configuration properties - see the Developer Guide for a comprehensive description ---- */ + +/* Parameters attributes are : (KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK) + * Key : category of parameter, used by the ini file parser ; corresponds to a section inside the config.ini file. + * Name : name of the parameter as found in the AT*CONFIG command, and as expected by ARDRONE_TOOL_CONFIGURATION_ADDEVENT + + */ +#ifndef ARDRONE_CONFIG_KEY_IMM + #define ARDRONE_CONFIG_KEY_IMM(a,b,c,d,e,f,g,h) +#endif +#ifndef ARDRONE_CONFIG_KEY_STR + #define ARDRONE_CONFIG_KEY_STR(a,b,c,d,e,f,g,h) +#endif +#ifndef ARDRONE_CONFIG_KEY_REF + #define ARDRONE_CONFIG_KEY_REF(a,b,c,d,e,f,g,h) +#endif + +#ifndef ARDRONE_CONFIG_KEY_IMM_a10 +#define ARDRONE_CONFIG_KEY_IMM_a10(a,b,c,d,e,f,g,h,i,j) ARDRONE_CONFIG_KEY_IMM(a,b,c,d,e,f,h,i) +#endif +#ifndef ARDRONE_CONFIG_KEY_STR_a10 +#define ARDRONE_CONFIG_KEY_STR_a10(a,b,c,d,e,f,g,h,i,j) ARDRONE_CONFIG_KEY_STR(a,b,c,d,e,f,h,i) +#endif +#ifndef ARDRONE_CONFIG_KEY_REF_a10 +#define ARDRONE_CONFIG_KEY_REF_a10(a,b,c,d,e,f,g,h,i,j) ARDRONE_CONFIG_KEY_REF(a,b,c,d,e,f,h,i) +#endif + +ARDRONE_CONFIG_KEY_IMM_a10("general", num_version_config, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, CURRENT_NUM_VERSION_CONFIG, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("general", num_version_mb, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, CARD_VERSION, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", num_version_soft, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, CURRENT_NUM_VERSION_SOFT, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", soft_build_date, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, CURRENT_BUILD_DATE, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor1_soft, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor1_hard, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor1_supplier, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor2_soft, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor2_hard, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor2_supplier, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor3_soft, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor3_hard, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor3_supplier, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor4_soft, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor4_hard, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", motor4_supplier, INI_STRING, string_t, char*, (K_READ|K_NOBIND), 0, default_motor_version, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("general", ardrone_name, INI_STRING, string_t, char*, (K_READ|K_WRITE ), 0, "My ARDrone", default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("general", flying_time, INI_INT, uint32_t, uint32_t*, (K_READ) , 0, 0, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("general", navdata_demo, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE) , 0, FALSE, navdata_demo_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("general", navdata_options, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), default_navdata_options, navdata_options_config_callback, CAT_APPLI) +ARDRONE_CONFIG_KEY_IMM_a10("general", com_watchdog, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE) , 0, COM_INPUT_LANDING_TIME, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("general", video_enable, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE) , 0, TRUE, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("general", vision_enable, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE) , 0, TRUE, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("general", vbat_min, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, VBAT_POWERING_OFF, default_config_callback,CAT_COMMON) + +ARDRONE_CONFIG_KEY_REF_a10("control", accs_offset, INI_VECTOR, vector31_t, vector31_t*, (K_READ|K_NOBIND), 0, default_accs_offset, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_REF_a10("control", accs_gains, INI_MATRIX, matrix33_t, matrix33_t*, (K_READ|K_NOBIND), 0, default_accs_gain, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_REF_a10("control", gyros_offset, INI_VECTOR, vector31_t, vector31_t*, (K_READ|K_NOBIND), 0, default_gyros_offset, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_REF_a10("control", gyros_gains, INI_VECTOR, vector31_t, vector31_t*, (K_READ|K_NOBIND), 0, default_gyros_gains, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_REF_a10("control", gyros110_offset, INI_VECTOR21, vector21_t, vector21_t*, (K_READ|K_NOBIND), 0, default_gyros110_offset, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_REF_a10("control", gyros110_gains, INI_VECTOR21, vector21_t, vector21_t*, (K_READ|K_NOBIND), 0, default_gyros110_gains, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", gyro_offset_thr_x, INI_FLOAT, float32_t, float32_t*, (K_READ|K_NOBIND), 0, default_gyro_offset_thr_x, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", gyro_offset_thr_y, INI_FLOAT, float32_t, float32_t*, (K_READ|K_NOBIND), 0, default_gyro_offset_thr_y, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", gyro_offset_thr_z, INI_FLOAT, float32_t, float32_t*, (K_READ|K_NOBIND), 0, default_gyro_offset_thr_z, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", pwm_ref_gyros, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, default_pwm_ref_gyro, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", control_level, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE) , (K_READ|K_WRITE), 0, default_config_callback,CAT_APPLI) +ARDRONE_CONFIG_KEY_IMM_a10("control", shield_enable, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE) , 0, 1, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", euler_angle_max, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE) , (K_READ|K_WRITE), default_euler_angle_ref_max, control_changed_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", altitude_max, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE) , 0, default_altitude_max, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", altitude_min, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE) , 0, default_altitude_min, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", control_trim_z, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE) , (K_READ|K_WRITE), default_control_trim_z, default_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", control_iphone_tilt, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE) , (K_READ|K_WRITE), default_control_iphone_tilt, default_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", control_vz_max, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE) , (K_READ|K_WRITE), default_control_vz_max, control_changed_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", control_yaw, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE) , (K_READ|K_WRITE), default_control_yaw, control_changed_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", outdoor, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE) , 0, FALSE, control_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", flight_without_shell,INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE) , 0, FALSE, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", brushless, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE) , 0, TRUE, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", autonomous_flight, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE) , 0, FALSE, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("control", manual_trim, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), FALSE, default_config_callback,CAT_USER) + +ARDRONE_CONFIG_KEY_IMM_a10("control", indoor_euler_angle_max, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), default_euler_angle_ref_max,default_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", indoor_control_vz_max, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), default_control_vz_max, default_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", indoor_control_yaw, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), default_control_yaw, default_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", outdoor_euler_angle_max, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), default_outdoor_euler_angle_ref_max, default_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", outdoor_control_vz_max, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), default_outdoor_control_vz_max, default_config_callback,CAT_USER) +ARDRONE_CONFIG_KEY_IMM_a10("control", outdoor_control_yaw, INI_FLOAT, float32_t, float32_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), default_outdoor_control_yaw, default_config_callback,CAT_USER) + +ARDRONE_CONFIG_KEY_IMM_a10("control", flying_mode, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), (K_READ|K_WRITE), 0, flying_mode_config_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_STR_a10("control", flight_anim, INI_STRING, string_t, char*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), 0, "0,0", flight_animation_selection_callback,CAT_COMMON) + +ARDRONE_CONFIG_KEY_STR_a10("network", ssid_single_player, INI_STRING, string_t, char*, (K_READ|K_WRITE), 0, WIFI_NETWORK_NAME, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("network", ssid_multi_player, INI_STRING, string_t, char*, (K_READ|K_WRITE), 0, WIFI_NETWORK_NAME, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", wifi_mode, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, WIFI_MODE_INFRA, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", secure, INI_BOOLEAN, bool_t, bool_t*, (K_READ|K_WRITE), 0, 0, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("network", passkey, INI_STRING, string_t, char*, (K_READ|K_WRITE), 0, "", default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", navdata_port, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, NAVDATA_PORT, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", video_port, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, VIDEO_PORT, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", at_port, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, AT_PORT, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", cmd_port, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, CONTROL_PORT, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_STR_a10("network", owner_mac, INI_STRING, string_t, char*, (K_READ|K_WRITE), 0, NULL_MAC, owner_mac_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", owner_ip_address, INI_INT, uint32_t, uint32_t*, (K_READ|K_WRITE), 0, 0, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", local_ip_address, INI_INT, uint32_t, uint32_t*, (K_READ|K_WRITE), 0, 0, default_config_callback, CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("network", broadcast_address, INI_INT, uint32_t, uint32_t*, (K_READ|K_WRITE), 0, 0, default_config_callback, CAT_COMMON) + +ARDRONE_CONFIG_KEY_IMM_a10("pic", ultrasound_freq, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, ADC_CMD_SELECT_ULTRASOUND_25Hz, ultrasound_freq_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("pic", ultrasound_watchdog, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, 3, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("pic", pic_version , INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, 0x00040030, default_config_callback,CAT_COMMON) + +ARDRONE_CONFIG_KEY_IMM_a10("video", camif_fps, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, 15, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("video", camif_buffers, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, CAMIF_NUM_BUFFERS, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("video", num_trackers, INI_INT, int32_t, int32_t*, (K_READ|K_NOBIND), 0, 12, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("video", bitrate, INI_INT, int32_t, int32_t*, (K_READ|K_SHALLOW), (K_READ|K_WRITE), 0, default_config_callback,CAT_APPLI) +ARDRONE_CONFIG_KEY_IMM_a10("video", bitrate_ctrl_mode, INI_INT, int32_t, int32_t*, (K_READ|K_SHALLOW), (K_READ|K_WRITE), 0, default_config_callback,CAT_APPLI) +ARDRONE_CONFIG_KEY_IMM_a10("video", video_codec, INI_INT, int32_t, int32_t*, (K_READ|K_SHALLOW), (K_READ|K_WRITE), UVLC_CODEC, codec_config_callback, CAT_APPLI) +ARDRONE_CONFIG_KEY_IMM_a10("video", video_channel, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), (K_READ|K_WRITE), 0, video_channel_selection_callback,CAT_SESSION) + +ARDRONE_CONFIG_KEY_STR_a10("leds", leds_anim, INI_STRING, string_t, char*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), 0, "0,0,0", leds_animation_selection_callback,CAT_COMMON) + +ARDRONE_CONFIG_KEY_IMM_a10("detect", enemy_colors, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, default_enemy_colors, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("detect", groundstripe_colors, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), (K_READ|K_WRITE), default_groundstripe_colors, default_config_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_IMM_a10("detect", enemy_without_shell, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, 0, default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("detect", detect_type, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE|K_NOBIND), (K_READ|K_WRITE|K_NOBIND), default_detect_type, detect_type_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_IMM_a10("detect", detections_select_h, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE|K_NOBIND), (K_READ|K_WRITE), 0, detections_select_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_IMM_a10("detect", detections_select_v_hsync, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE|K_NOBIND), (K_READ|K_WRITE), 0, detections_select_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_IMM_a10("detect", detections_select_v, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE|K_NOBIND), (K_READ|K_WRITE), 0, detections_select_callback,CAT_SESSION) + +ARDRONE_CONFIG_KEY_IMM_a10("syslog", output, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, (UART_PRINT|WIFI_PRINT|FLASH_PRINT), default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("syslog", max_size, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, (100*1024), default_config_callback,CAT_COMMON) +ARDRONE_CONFIG_KEY_IMM_a10("syslog", nb_files, INI_INT, int32_t, int32_t*, (K_READ|K_WRITE), 0, 5, default_config_callback,CAT_COMMON) + +/*- Multi configuration management -*/ +ARDRONE_CONFIG_KEY_STR_a10("custom", application_id, INI_STRING, string_t, char*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), (K_READ|K_WRITE), "00000000", default_config_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_STR_a10("custom", application_desc, INI_STRING, string_t, char*, (K_READ|K_WRITE), (K_READ|K_WRITE), DEFAULT_APPLICATION_DESC, application_desc_callback,CAT_APPLI) + +ARDRONE_CONFIG_KEY_STR_a10("custom", profile_id, INI_STRING, string_t, char*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), (K_READ|K_WRITE), "00000000", default_config_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_STR_a10("custom", profile_desc, INI_STRING, string_t, char*, (K_READ|K_WRITE), (K_READ|K_WRITE), DEFAULT_PROFILE_DESC, profile_desc_callback,CAT_USER) + +ARDRONE_CONFIG_KEY_STR_a10("custom", session_id, INI_STRING, string_t, char*, (K_READ|K_WRITE|K_NOBIND|K_SHALLOW), (K_READ|K_WRITE), "00000000", default_config_callback,CAT_SESSION) +ARDRONE_CONFIG_KEY_STR_a10("custom", session_desc, INI_STRING, string_t, char*, (K_READ|K_WRITE), (K_READ|K_WRITE), DEFAULT_SESSION_DESC, session_desc_callback,CAT_SESSION) + +/* Prevents a further inclusion of config_keys from generating garbage code */ +#undef ARDRONE_CONFIG_KEY_IMM_a10 +#undef ARDRONE_CONFIG_KEY_REF_a10 +#undef ARDRONE_CONFIG_KEY_STR_a10 +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR diff --git a/ARDroneLib/Soft/Common/control_states.h b/ARDroneLib/Soft/Common/control_states.h new file mode 100644 index 0000000..360bc86 --- /dev/null +++ b/ARDroneLib/Soft/Common/control_states.h @@ -0,0 +1,191 @@ +/** + * \file control_states.h + * \brief Control states declaration for control loop & ihm display + * \author Sylvain Gaeremynck + * \version 1.0 + */ + +#ifndef _CONTROL_STATES_H_ +#define _CONTROL_STATES_H_ + +#ifdef CTRL_STATES_STRING +typedef char ctrl_string_t[32]; +#endif + +// Macros to customize preprocessing +// If this CTRL_STATES_STRING is not defined, this file declare several enumeration +// If user defines CTRL_STATES_STRING, this file will define several array of strings. +// Each string being equivalent to an enumeration entry + +#ifdef CTRL_STATES_STRING +#define CVAR(a) #a /* Using # causes the first argument after the # to be returned as a string in quotes */ +#define CVARZ(a) #a +#else +#define CVARZ(a) a = 0 +#define CVAR(a) a +#endif + +/** + * \enum CONTROL_STATE + * \brief control loop thread states. + * \brief this defines major states +*/ +#ifndef DO_NOT_INCLUDE_MAJOR_CTRL_STATES +#ifdef CTRL_STATES_STRING +static ctrl_string_t ctrl_states[] = { +#else +typedef enum { +#endif + CVARZ( CTRL_DEFAULT ), + CVAR( CTRL_INIT ), + CVAR( CTRL_LANDED ), + CVAR( CTRL_FLYING ), + CVAR( CTRL_HOVERING ), + CVAR( CTRL_TEST ), + CVAR( CTRL_TRANS_TAKEOFF ), + CVAR( CTRL_TRANS_GOTOFIX ), + CVAR( CTRL_TRANS_LANDING ), +#ifndef CTRL_STATES_STRING + CTRL_NUM_STATES +} CTRL_STATES; +#else +}; +#endif +#endif + +/** + * \enum FLYING_STATES + * \brief flying states. + * \brief this is one of the minor state +*/ +#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES +#ifdef CTRL_STATES_STRING +static ctrl_string_t flying_states[] = { +#else +typedef enum { +#endif + CVARZ( FLYING_OK ), + CVAR( FLYING_LOST_ALT ), + CVAR( FLYING_LOST_ALT_GO_DOWN ), + CVAR( FLYING_ALT_OUT_ZONE ), + CVAR( FLYING_COMBINED_YAW ) + #ifndef CTRL_STATES_STRING +} FLYING_STATES; +#else +}; +#endif +#endif + +/** + * \enum HOVERING_STATES + * \brief flying states. + * \brief this is one of the minor state +*/ +#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES +#ifdef CTRL_STATES_STRING +static ctrl_string_t hovering_states[] = { +#else +typedef enum { +#endif + CVARZ( HOVERING_OK ), + CVAR( HOVERING_YAW ), + CVAR( HOVERING_YAW_LOST_ALT), + CVAR( HOVERING_YAW_LOST_ALT_GO_DOWN), + CVAR( HOVERING_ALT_OUT_ZONE), + CVAR( HOVERING_YAW_ALT_OUT_ZONE), + CVAR( HOVERING_LOST_ALT ), + CVAR( HOVERING_LOST_ALT_GO_DOWN ), + CVAR( HOVERING_LOST_COM ), + CVAR( LOST_COM_LOST_ALT ), + CVAR( LOST_COM_LOST_ALT_TOO_LONG ), + CVAR( LOST_COM_ALT_OK ) +#ifndef CTRL_STATES_STRING +} HOVERING_STATES; +#else +}; +#endif +#endif + +/** + * \enum TAKEOFF_TRANS_STATES + * \brief take off states. + * \brief this is one of the minor state +*/ +#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES +#ifdef CTRL_STATES_STRING +static ctrl_string_t takeoff_trans_states[] = { +#else +typedef enum { +#endif + CVARZ( TAKEOFF_GROUND ), + CVAR( TAKEOFF_AUTO ), + #ifndef CTRL_STATES_STRING +} TAKEOFF_TRANS_STATES; +#else +}; +#endif +#endif + +/** + * \enum GOTOFIX_TRANS_STATES + * \brief gotofix substates. + * \brief this is one of the minor state +*/ +#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES +#ifdef CTRL_STATES_STRING +static ctrl_string_t gotofix_trans_states[] = { +#else +typedef enum { +#endif + CVARZ( GOTOFIX_OK ), + CVAR( GOTOFIX_LOST_ALT ), + CVAR( GOTOFIX_YAW ), + #ifndef CTRL_STATES_STRING +} GOTOFIX_TRANS_STATES; +#else +}; +#endif +#endif + +/** + * \enum LANDING_TRANS_STATES + * \brief landing states. + * \brief this is one of the minor state +*/ +#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES +#ifdef CTRL_STATES_STRING +static ctrl_string_t landing_trans_states[] = { +#else +typedef enum { +#endif + CVARZ( LANDING_CLOSED_LOOP ), + CVAR( LANDING_OPEN_LOOP ), + CVAR( LANDING_OPEN_LOOP_FAST ) +#ifndef CTRL_STATES_STRING +} LANDING_TRANS_STATES; +#else +}; +#endif +#endif + +#ifdef CTRL_STATES_STRING +#ifndef DO_NOT_INCLUDE_CTRL_STATES_LINK +/** + * control link tates + * \brief This array is used to link minor states & major state's strings +*/ +static ctrl_string_t* control_states_link[] = { + NULL, + NULL, + NULL, + flying_states, + hovering_states, + NULL, + takeoff_trans_states, + gotofix_trans_states, + landing_trans_states +}; +#endif +#endif + +#endif // _CONTROL_STATES_H_ diff --git a/ARDroneLib/Soft/Common/generated_custom.h b/ARDroneLib/Soft/Common/generated_custom.h new file mode 100644 index 0000000..a141905 --- /dev/null +++ b/ARDroneLib/Soft/Common/generated_custom.h @@ -0,0 +1,24 @@ +#ifndef _GENERATED_CUSTOM_CONFIGURATION_H_ +#define _GENERATED_CUSTOM_CONFIGURATION_H_ + +#if defined(BR2_PACKAGE_BCM4318_AP) +# define AP +#else +# define STA +#endif +#define CURRENT_NUM_VERSION_SOFT "0.0.0" +#define CURRENT_BUILD_DATE "2011-08-04 17:17" + +#define USE_VIDEO_YUV + +#define WIFI_NETWORK_NAME "ardronenetwork" +#define WIFI_BROADCAST "192.168.1.255" +#define WIFI_ARDRONE_IP "192.168.1.1" + +#if defined(__linux__) || defined(USE_MINGW32) +# define WIFI_MOBILE_IP "192.168.1.2" +# define WIRED_ITFNAME "" +#endif // ! __linux__ + + +#endif // ! _GENERATED_CUSTOM_CONFIGURATION_H_ diff --git a/ARDroneLib/Soft/Common/led_animation.h b/ARDroneLib/Soft/Common/led_animation.h new file mode 100644 index 0000000..00d8294 --- /dev/null +++ b/ARDroneLib/Soft/Common/led_animation.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * COPYRIGHT PARROT 2010 + ****************************************************************************** + * PARROT MODULES + *---------------------------------------------------------------------------*/ +/** + * @file leds_animation.h + * @date 25th February 2010 + * @brief Data types and functions to communicate with the drone. + * @author Pierre Eline + * + ******************************************************************************/ + +// LED_ANIMATION(#name, {#nb_cycle,#nb_state,{{#led_pattern1,#delay1},{#led_pattern2,#delay2},{...,...}}}) +// #name = name, example : BLINK +// #nb_cycle = number of times the animation is played (0 means infinite), example : 3 +// #nb_state = number of led patterns in the animation, example : 2 +// #led_pattern = led bitfield (G1 | R1 | G2 | R2 | G3 | R3 | G4 | R4), example : 0xAA all green led turned on +// #delay = delay in ms for the associated led pattern, example : 500 + +LED_ANIMATION(BLINK_GREEN_RED, { 0,2, { {0x55,500},{0xAA,500} } } ) +LED_ANIMATION(BLINK_GREEN, { 0,2, { {0x00,500},{0xAA,500} } } ) +LED_ANIMATION(BLINK_RED, { 0,2, { {0x55,500},{0x00,500} } } ) +LED_ANIMATION(BLINK_ORANGE, { 0,2, { {0xFF,500},{0x00,500} } } ) +LED_ANIMATION(SNAKE_GREEN_RED, { 0,8, { {0x90,200},{0x48,200},{0x24,200},{0x12,200},{0x9,200},{0x84,200},{0x42,200},{0x21,200}}}) +LED_ANIMATION(FIRE, { 0,2, { {0x35,50},{0xC5,50} } } ) +LED_ANIMATION(STANDARD, { 1,1, { {0xA5,100} } } ) +LED_ANIMATION(RED, { 1,1, { {0x55,100} } } ) +LED_ANIMATION(GREEN, { 1,1, { {0xAA,100} } } ) +LED_ANIMATION(RED_SNAKE, { 0,4, { {0x40,500},{0x10,500},{0x04,500},{0x01,500}}}) +LED_ANIMATION(BLANK, { 1,1, { {0x00,100} } } ) +LED_ANIMATION(RIGHT_MISSILE, { 1,5, { {0x00,500},{0x04,300},{0x1C,100},{0x30,300},{0x00,500}}}) +LED_ANIMATION(LEFT_MISSILE, { 1,5, { {0x00,500},{0x01,300},{0x43,100},{0xC0,300},{0x00,500}}}) +LED_ANIMATION(DOUBLE_MISSILE, { 1,5, { {0x00,500},{0x05,300},{0x5F,100},{0xF0,300},{0x00,500}}}) +LED_ANIMATION(FRONT_LEFT_GREEN_OTHERS_RED, { 1,1, { {0x95,100} } } ) +LED_ANIMATION(FRONT_RIGHT_GREEN_OTHERS_RED, { 1,1, { {0x65,100} } } ) +LED_ANIMATION(REAR_RIGHT_GREEN_OTHERS_RED, { 1,1, { {0x59,100} } } ) +LED_ANIMATION(REAR_LEFT_GREEN_OTHERS_RED, { 1,1, { {0x56,100} } } ) +LED_ANIMATION(LEFT_GREEN_RIGHT_RED, { 1,1, { {0x96,100} } } ) +LED_ANIMATION(LEFT_RED_RIGHT_GREEN, { 1,1, { {0x69,100} } } ) +LED_ANIMATION(BLINK_STANDARD, { 0,2, { {0x00,500},{0xA5,500} } } ) + + + + + + diff --git a/ARDroneLib/Soft/Common/navdata_common.h b/ARDroneLib/Soft/Common/navdata_common.h new file mode 100644 index 0000000..e000244 --- /dev/null +++ b/ARDroneLib/Soft/Common/navdata_common.h @@ -0,0 +1,590 @@ +/** + * \file navdata_common.h + * \brief Common navdata configuration + * \author Sylvain Gaeremynck + */ + +#ifndef _NAVDATA_COMMON_H_ +#define _NAVDATA_COMMON_H_ + +/*------------------------------------------ NAVDATA STRUCTURES DECLARATIONS ---------------------------------------------------------------*/ + +#include +#include + +#include +#include +#include + +#if defined(_MSC_VER) + #define _ATTRIBUTE_PACKED_ + /* Asks Visual C++ to pack structures from now on*/ + #pragma pack(1) +#else + #define _ATTRIBUTE_PACKED_ __attribute__ ((packed)) +#endif + +// Define constants for gyrometers handling +typedef enum { + GYRO_X = 0, + GYRO_Y = 1, + GYRO_Z = 2, + NB_GYROS = 3 +} def_gyro_t; + + +// Define constants for accelerometers handling +typedef enum { + ACC_X = 0, + ACC_Y = 1, + ACC_Z = 2, + NB_ACCS = 3 +} def_acc_t; + +/** + * \struct _velocities_t + * \brief Velocities in float32_t format + */ +typedef struct _velocities_t { + float32_t x; + float32_t y; + float32_t z; +} velocities_t; + +// Default control loops gains TODO Put these values in flash memory +// To avoid divisions in embedded software, gains are defined as ratios where +// - the numerator is an integer +// - the denominator is an integer + +/** + * \var CTRL_DEFAULT_NUM_PQ_KP + * \brief Numerator of default proportionnal gain for pitch (p) and roll (q) angular rate control loops + */ +/** + * \var CTRL_DEFAULT_NUM_EA_KP + * \brief Numerator of default proportionnal gain for Euler Angle control loops + */ +/** + * \var CTRL_DEFAULT_NUM_EA_KI + * \brief Numerator of default integral gain for Euler Angle control loops + */ + +#define CTRL_DEFAULT_NUM_PQ_KP_NO_SHELL /*30000 26000 */ 40000 +#define CTRL_DEFAULT_NUM_EA_KP_NO_SHELL /*7000 9000 7000 */ 8000 +#define CTRL_DEFAULT_NUM_EA_KI_NO_SHELL /*4000 7000 6000 */ 7000 + +#define CTRL_DEFAULT_NUM_PQ_KP_SHELL /*30000 23000*/ 40000 +#define CTRL_DEFAULT_NUM_EA_KP_SHELL /*9000 10000*/ 9000 +#define CTRL_DEFAULT_NUM_EA_KI_SHELL /*5000 9000*/ 8000 + +/** + * \var CTRL_DEFAULT_NUM_H_R + * \brief Numerator of default proportionnal gain for yaw (r) angular rate control loop + */ +#define CTRL_DEFAULT_NUM_R_KP 200000 + +/** + * \var CTRL_DEFAULT_NUM_R_KI + * \brief Numerator of default integral gain for yaw control loops + */ +#define CTRL_DEFAULT_NUM_R_KI 10000 + +/** + * \var CTRL_DEFAULT_DEN_W + * \brief Denominator of default proportionnal gain of pitch (p) roll (q) and yaw (r) angular rate control loops + */ +#define CTRL_DEFAULT_DEN_W 1024.0 //2^10 + +/** + * \var CTRL_DEFAULT_DEN_EA + * \brief Denominator of default gains for Euler Angle control loops + */ +#define CTRL_DEFAULT_DEN_EA 1024.0 //2^10 + +/** + * \var CTRL_DEFAULT_NUM_ALT_KP + * \brief Numerator of default proportionnal gain for Altitude control loop + */ +#ifdef NEW_ALT_FUSION +#define CTRL_DEFAULT_NUM_ALT_KP 4000 +#else +#define CTRL_DEFAULT_NUM_ALT_KP 2000 +#endif +/** + * \var CTRL_DEFAULT_NUM_ALT_KI + * \brief Numerator of default integral gain for Altitude control loop + */ +#ifdef NEW_ALT_FUSION + #define CTRL_DEFAULT_NUM_ALT_KI 2000 +#else + #define CTRL_DEFAULT_NUM_ALT_KI 400 +#endif +/** + * \var CTRL_DEFAULT_NUM_ALT_KD + * \brief Numerator of default derivative gain for Altitude control loop + */ +#define CTRL_DEFAULT_NUM_VZ_KP 200 + +/** + * \var CTRL_DEFAULT_NUM_ALT_TD + * \brief Numerator of default derivative time constant gain for Altitude control loop + */ +#define CTRL_DEFAULT_NUM_VZ_KI 100 + +/** + * \var CTRL_DEFAULT_DEN_ALT + * \brief Denominator of default gains for Altitude control loop + */ +#define CTRL_DEFAULT_DEN_ALT 1024.0 + +/** + * \var CTRL_DEFAULT_NUM_HOVER_KP + * \brief Numerator of default proportionnal gain for hovering control loop + */ +#define CTRL_DEFAULT_NUM_HOVER_KP_SHELL /*5000* 8000*/ 8000 +#define CTRL_DEFAULT_NUM_HOVER_KP_NO_SHELL /*6000 12000 5000*/ 7000 + +/** + * \var CTRL_DEFAULT_NUM_HOVER_KP + * \brief Numerator of default proportionnal gain for hovering beacon control loop + */ +#define CTRL_DEFAULT_NUM_HOVER_B_KP_SHELL 1200 +#define CTRL_DEFAULT_NUM_HOVER_B_KP_NO_SHELL 1200 + +/** + * \var CTRL_DEFAULT_NUM_HOVER_KI + * \brief Numerator of default integral gain for hovering control loop + */ +#define CTRL_DEFAULT_NUM_HOVER_KI_SHELL /*3000 10000*/ 8000 +#define CTRL_DEFAULT_NUM_HOVER_KI_NO_SHELL /*3000 8000 5000*/ 6000 + +/** + * \var CTRL_DEFAULT_NUM_HOVER_KI + * \brief Numerator of default integral gain for hovering beacon control loop + */ +#define CTRL_DEFAULT_NUM_HOVER_B_KI_SHELL 500 +#define CTRL_DEFAULT_NUM_HOVER_B_KI_NO_SHELL 500 + +/* + * \var CTRL_DEFAULT_DEN_HOVER + * \brief Numerator of default proportionnal gain for hovering control loop + */ +#define CTRL_DEFAULT_DEN_HOVER 32768.0 //2^15 + + +/* Timeout for mayday maneuvers*/ +static const int32_t MAYDAY_TIMEOUT[ARDRONE_NB_ANIM_MAYDAY] = { + 1000, // ARDRONE_ANIM_PHI_M30_DEG + 1000, // ARDRONE_ANIM_PHI_30_DEG + 1000, // ARDRONE_ANIM_THETA_M30_DEG + 1000, // ARDRONE_ANIM_THETA_30_DEG + 1000, // ARDRONE_ANIM_THETA_20DEG_YAW_200DEG + 1000, // ARDRONE_ANIM_THETA_20DEG_YAW_M200DEG + 5000, // ARDRONE_ANIM_TURNAROUND + 5000, // ARDRONE_ANIM_TURNAROUND_GODOWN + 2000, // ARDRONE_ANIM_YAW_SHAKE + 5000, // ARDRONE_ANIM_YAW_DANCE + 5000, // ARDRONE_ANIM_PHI_DANCE + 5000, // ARDRONE_ANIM_THETA_DANCE + 5000, // ARDRONE_ANIM_VZ_DANCE + 5000, // ARDRONE_ANIM_WAVE + 5000, // ARDRONE_ANIM_PHI_THETA_MIXED + 5000, // ARDRONE_ANIM_DOUBLE_PHI_THETA_MIXED +}; + +#define NAVDATA_SEQUENCE_DEFAULT 1 + +#define NAVDATA_HEADER 0x55667788 + +#define NAVDATA_MAX_SIZE 2048 +#define NAVDATA_MAX_CUSTOM_TIME_SAVE 20 + +/* !!! Warning !!! - changing the value below would break compatibility with older applications + * DO NOT CHANGE THIS */ +#define NB_NAVDATA_DETECTION_RESULTS 4 + + +/** + * @brief Tags identifying navdata blocks in a Navdata UDP packet + * This tag is stored in the first two bytes of any navdata block (aka 'option'). + */ + +#define NAVDATA_OPTION_DEMO(STRUCTURE,NAME,TAG) TAG = 0, +#define NAVDATA_OPTION(STRUCTURE,NAME,TAG) TAG , +#define NAVDATA_OPTION_CKS(STRUCTURE,NAME,TAG) NAVDATA_NUM_TAGS, TAG = 0xFFFF + +typedef enum _navdata_tag_t { + #include +} navdata_tag_t; + +#define NAVDATA_OPTION_MASK(option) ( 1 << (option) ) +#define NAVDATA_OPTION_FULL_MASK ((1< To integrate in video stage. + + // Camera parameters compute by detection + matrix33_t detection_camera_rot; /*!< Deprecated ! Don't use ! */ + vector31_t detection_camera_trans; /*!< Deprecated ! Don't use ! */ + uint32_t detection_tag_index; /*!< Deprecated ! Don't use ! */ + + uint32_t detection_camera_type; /*!< Type of tag searched in detection */ + + // Camera parameters compute by drone + matrix33_t drone_camera_rot; /*!< Deprecated ! Don't use ! */ + vector31_t drone_camera_trans; /*!< Deprecated ! Don't use ! */ +}_ATTRIBUTE_PACKED_ navdata_demo_t; + + + +/*----------------------------------------------------------------------------*/ +/** + * @brief Last navdata option that *must* be included at the end of all navdata packets + * + 6 bytes + */ +typedef struct _navdata_cks_t { + uint16_t tag; + uint16_t size; + + // Checksum for all navdatas (including options) + uint32_t cks; +}_ATTRIBUTE_PACKED_ navdata_cks_t; + + +/*----------------------------------------------------------------------------*/ +/** + * @brief Timestamp + * + 6 bytes + */ +typedef struct _navdata_time_t { + uint16_t tag; + uint16_t size; + + uint32_t time; /*!< 32 bit value where the 11 most significant bits represents the seconds, and the 21 least significant bits are the microseconds. */ +}_ATTRIBUTE_PACKED_ navdata_time_t; + + + +/*----------------------------------------------------------------------------*/ +/** + * @brief Raw sensors measurements + */ +typedef struct _navdata_raw_measures_t { + uint16_t tag; + uint16_t size; + + // +12 bytes + uint16_t raw_accs[NB_ACCS]; // filtered accelerometers + uint16_t raw_gyros[NB_GYROS]; // filtered gyrometers + uint16_t raw_gyros_110[2]; // gyrometers x/y 110 deg/s + uint32_t vbat_raw; // battery voltage raw (mV) + uint16_t us_debut_echo; + uint16_t us_fin_echo; + uint16_t us_association_echo; + uint16_t us_distance_echo; + uint16_t us_courbe_temps; + uint16_t us_courbe_valeur; + uint16_t us_courbe_ref; + uint16_t flag_echo_ini; +}_ATTRIBUTE_PACKED_ navdata_raw_measures_t; + + +typedef struct _navdata_phys_measures_t { + uint16_t tag; + uint16_t size; + + float32_t accs_temp; + uint16_t gyro_temp; + float32_t phys_accs[NB_ACCS]; + float32_t phys_gyros[NB_GYROS]; + uint32_t alim3V3; // 3.3volt alim [LSB] + uint32_t vrefEpson; // ref volt Epson gyro [LSB] + uint32_t vrefIDG; // ref volt IDG gyro [LSB] +}_ATTRIBUTE_PACKED_ navdata_phys_measures_t; + + +typedef struct _navdata_gyros_offsets_t { + uint16_t tag; + uint16_t size; + + float32_t offset_g[NB_GYROS]; +}_ATTRIBUTE_PACKED_ navdata_gyros_offsets_t; + + +typedef struct _navdata_euler_angles_t { + uint16_t tag; + uint16_t size; + + float32_t theta_a; + float32_t phi_a; +}_ATTRIBUTE_PACKED_ navdata_euler_angles_t; + + +typedef struct _navdata_references_t { + uint16_t tag; + uint16_t size; + + int32_t ref_theta; + int32_t ref_phi; + int32_t ref_theta_I; + int32_t ref_phi_I; + int32_t ref_pitch; + int32_t ref_roll; + int32_t ref_yaw; + int32_t ref_psi; +}_ATTRIBUTE_PACKED_ navdata_references_t; + + +typedef struct _navdata_trims_t { + uint16_t tag; + uint16_t size; + + float32_t angular_rates_trim_r; + float32_t euler_angles_trim_theta; + float32_t euler_angles_trim_phi; +}_ATTRIBUTE_PACKED_ navdata_trims_t; + +typedef struct _navdata_rc_references_t { + uint16_t tag; + uint16_t size; + + int32_t rc_ref_pitch; + int32_t rc_ref_roll; + int32_t rc_ref_yaw; + int32_t rc_ref_gaz; + int32_t rc_ref_ag; +}_ATTRIBUTE_PACKED_ navdata_rc_references_t; + + +typedef struct _navdata_pwm_t { + uint16_t tag; + uint16_t size; + + uint8_t motor1; + uint8_t motor2; + uint8_t motor3; + uint8_t motor4; + uint8_t sat_motor1; + uint8_t sat_motor2; + uint8_t sat_motor3; + uint8_t sat_motor4; + int32_t gaz_feed_forward; + int32_t gaz_altitude; + float32_t altitude_integral; + float32_t vz_ref; + int32_t u_pitch; + int32_t u_roll; + int32_t u_yaw; + float32_t yaw_u_I; + int32_t u_pitch_planif; + int32_t u_roll_planif; + int32_t u_yaw_planif; + float32_t u_gaz_planif; + uint16_t current_motor1; + uint16_t current_motor2; + uint16_t current_motor3; + uint16_t current_motor4; +}_ATTRIBUTE_PACKED_ navdata_pwm_t; + + +typedef struct _navdata_altitude_t { + uint16_t tag; + uint16_t size; + + int32_t altitude_vision; + float32_t altitude_vz; + int32_t altitude_ref; + int32_t altitude_raw; + + float32_t obs_accZ; + float32_t obs_alt; + vector31_t obs_x; + uint32_t obs_state; + vector21_t est_vb; + uint32_t est_state ; + +}_ATTRIBUTE_PACKED_ navdata_altitude_t; + + +typedef struct _navdata_vision_raw_t { + uint16_t tag; + uint16_t size; + + float32_t vision_tx_raw; + float32_t vision_ty_raw; + float32_t vision_tz_raw; +}_ATTRIBUTE_PACKED_ navdata_vision_raw_t; + + +typedef struct _navdata_vision_t { + uint16_t tag; + uint16_t size; + + uint32_t vision_state; + int32_t vision_misc; + float32_t vision_phi_trim; + float32_t vision_phi_ref_prop; + float32_t vision_theta_trim; + float32_t vision_theta_ref_prop; + + int32_t new_raw_picture; + float32_t theta_capture; + float32_t phi_capture; + float32_t psi_capture; + int32_t altitude_capture; + uint32_t time_capture; // time in TSECDEC format (see config.h) + velocities_t body_v; + + float32_t delta_phi; + float32_t delta_theta; + float32_t delta_psi; + + uint32_t gold_defined; + uint32_t gold_reset; + float32_t gold_x; + float32_t gold_y; +}_ATTRIBUTE_PACKED_ navdata_vision_t; + + +typedef struct _navdata_vision_perf_t { + uint16_t tag; + uint16_t size; + + // +44 bytes + float32_t time_szo; + float32_t time_corners; + float32_t time_compute; + float32_t time_tracking; + float32_t time_trans; + float32_t time_update; + float32_t time_custom[NAVDATA_MAX_CUSTOM_TIME_SAVE]; +}_ATTRIBUTE_PACKED_ navdata_vision_perf_t; + + +typedef struct _navdata_trackers_send_t { + uint16_t tag; + uint16_t size; + + int32_t locked[DEFAULT_NB_TRACKERS_WIDTH * DEFAULT_NB_TRACKERS_HEIGHT]; + screen_point_t point[DEFAULT_NB_TRACKERS_WIDTH * DEFAULT_NB_TRACKERS_HEIGHT]; +}_ATTRIBUTE_PACKED_ navdata_trackers_send_t; + + +typedef struct _navdata_vision_detect_t { + /* !! Change the function 'navdata_server_reset_vision_detect()' if this structure is modified !! */ + uint16_t tag; + uint16_t size; + + uint32_t nb_detected; + uint32_t type[NB_NAVDATA_DETECTION_RESULTS]; + uint32_t xc[NB_NAVDATA_DETECTION_RESULTS]; + uint32_t yc[NB_NAVDATA_DETECTION_RESULTS]; + uint32_t width[NB_NAVDATA_DETECTION_RESULTS]; + uint32_t height[NB_NAVDATA_DETECTION_RESULTS]; + uint32_t dist[NB_NAVDATA_DETECTION_RESULTS]; + float32_t orientation_angle[NB_NAVDATA_DETECTION_RESULTS]; +}_ATTRIBUTE_PACKED_ navdata_vision_detect_t; + +typedef struct _navdata_vision_of_t { + uint16_t tag; + uint16_t size; + + float32_t of_dx[5]; + float32_t of_dy[5]; +}_ATTRIBUTE_PACKED_ navdata_vision_of_t; + + +typedef struct _navdata_watchdog_t { + uint16_t tag; + uint16_t size; + + // +4 bytes + int32_t watchdog; +}_ATTRIBUTE_PACKED_ navdata_watchdog_t; + +typedef struct _navdata_adc_data_frame_t { + uint16_t tag; + uint16_t size; + + uint32_t version; + uint8_t data_frame[32]; +}_ATTRIBUTE_PACKED_ navdata_adc_data_frame_t; + +typedef struct _navdata_video_stream_t { + uint16_t tag; + uint16_t size; + + uint8_t quant; // quantizer reference used to encode frame [1:31] + uint32_t frame_size; // frame size (bytes) + uint32_t frame_number; // frame index + uint32_t atcmd_ref_seq; // atmcd ref sequence number + uint32_t atcmd_mean_ref_gap; // mean time between two consecutive atcmd_ref (ms) + float32_t atcmd_var_ref_gap; + uint32_t atcmd_ref_quality; // estimator of atcmd link quality +}_ATTRIBUTE_PACKED_ navdata_video_stream_t; + + +typedef struct _navdata_games_t { + uint16_t tag; + uint16_t size; + uint32_t double_tap_counter; + uint32_t finish_line_counter; +}_ATTRIBUTE_PACKED_ navdata_games_t; + +#if defined(_MSC_VER) + /* Go back to default packing policy */ + #pragma pack() +#endif + +#endif // _NAVDATA_COMMON_H_ + diff --git a/ARDroneLib/Soft/Common/navdata_keys.h b/ARDroneLib/Soft/Common/navdata_keys.h new file mode 100644 index 0000000..d605952 --- /dev/null +++ b/ARDroneLib/Soft/Common/navdata_keys.h @@ -0,0 +1,40 @@ +#ifndef NAVDATA_OPTION_DEMO + #define NAVDATA_OPTION_DEMO(x,y,z) +#endif +#ifndef NAVDATA_OPTION + #define NAVDATA_OPTION(x,y,z) +#endif +#ifndef NAVDATA_OPTION_CKS + #define NAVDATA_OPTION_CKS(x,y,z) +#endif + + +NAVDATA_OPTION_DEMO ( navdata_demo_t , navdata_demo , NAVDATA_DEMO_TAG) + +NAVDATA_OPTION( navdata_time_t, navdata_time , NAVDATA_TIME_TAG ) +NAVDATA_OPTION( navdata_raw_measures_t, navdata_raw_measures , NAVDATA_RAW_MEASURES_TAG ) +NAVDATA_OPTION( navdata_phys_measures_t, navdata_phys_measures , NAVDATA_PHYS_MEASURES_TAG ) +NAVDATA_OPTION( navdata_gyros_offsets_t, navdata_gyros_offsets , NAVDATA_GYROS_OFFSETS_TAG ) +NAVDATA_OPTION( navdata_euler_angles_t, navdata_euler_angles , NAVDATA_EULER_ANGLES_TAG ) +NAVDATA_OPTION( navdata_references_t, navdata_references , NAVDATA_REFERENCES_TAG ) +NAVDATA_OPTION( navdata_trims_t, navdata_trims , NAVDATA_TRIMS_TAG ) +NAVDATA_OPTION( navdata_rc_references_t, navdata_rc_references , NAVDATA_RC_REFERENCES_TAG ) +NAVDATA_OPTION( navdata_pwm_t, navdata_pwm , NAVDATA_PWM_TAG ) +NAVDATA_OPTION( navdata_altitude_t, navdata_altitude , NAVDATA_ALTITUDE_TAG ) +NAVDATA_OPTION( navdata_vision_raw_t, navdata_vision_raw , NAVDATA_VISION_RAW_TAG ) +NAVDATA_OPTION( navdata_vision_of_t, navdata_vision_of , NAVDATA_VISION_OF_TAG ) +NAVDATA_OPTION( navdata_vision_t, navdata_vision , NAVDATA_VISION_TAG ) +NAVDATA_OPTION( navdata_vision_perf_t , navdata_vision_perf , NAVDATA_VISION_PERF_TAG ) +NAVDATA_OPTION( navdata_trackers_send_t, navdata_trackers_send , NAVDATA_TRACKERS_SEND_TAG ) +NAVDATA_OPTION( navdata_vision_detect_t, navdata_vision_detect , NAVDATA_VISION_DETECT_TAG ) +NAVDATA_OPTION( navdata_watchdog_t , navdata_watchdog , NAVDATA_WATCHDOG_TAG ) +NAVDATA_OPTION( navdata_adc_data_frame_t, navdata_adc_data_frame , NAVDATA_ADC_DATA_FRAME_TAG ) +NAVDATA_OPTION( navdata_video_stream_t, navdata_video_stream , NAVDATA_VIDEO_STREAM_TAG ) +NAVDATA_OPTION( navdata_games_t, navdata_games , NAVDATA_GAMES_TAG ) + + +NAVDATA_OPTION_CKS( navdata_cks_t, navdata_cks , NAVDATA_CKS_TAG ) + +#undef NAVDATA_OPTION_DEMO +#undef NAVDATA_OPTION +#undef NAVDATA_OPTION_CKS diff --git a/ARDroneLib/Soft/Common/vision_common.h b/ARDroneLib/Soft/Common/vision_common.h new file mode 100644 index 0000000..d9eeee9 --- /dev/null +++ b/ARDroneLib/Soft/Common/vision_common.h @@ -0,0 +1,38 @@ +#ifndef _VISION_COMMON_H_ +#define _VISION_COMMON_H_ + +// NUMBER OF TRACKERS FOR EACH TRACKING +#define NB_CORNER_TRACKERS_WIDTH 5 /* number of trackers in width of current picture */ +#define NB_CORNER_TRACKERS_HEIGHT 4 /* number of trackers in height of current picture */ + +#define DEFAULT_NB_TRACKERS_WIDTH (NB_CORNER_TRACKERS_WIDTH+1)// + NB_BLOCK_TRACKERS_WIDTH) +#define DEFAULT_NB_TRACKERS_HEIGHT (NB_CORNER_TRACKERS_HEIGHT+1)// + NB_BLOCK_TRACKERS_HEIGHT) + +#define YBUF_OFFSET 0 + +// use by ihm/ihm_vision.c +#define DEFAULT_CS 1 +#define DEFAULT_NB_PAIRS 1 +#define DEFAULT_LOSS_PER 1 +#define DEFAULT_SCALE 1 +#define DEFAULT_TRANSLATION_MAX 1 +#define DEFAULT_MAX_PAIR_DIST 1 +#define DEFAULT_NOISE 1 + +typedef enum _CAMIF_CAMERA_ENUM_ +{ + CAMIF_CAMERA_LB, + + CAMIF_CAMERA_CRESYN, + CAMIF_CAMERA_VS6524, + CAMIF_CAMERA_OV7710, + CAMIF_CAMERA_OV7720, + CAMIF_CAMERA_OVTRULY, + CAMIF_CAMERA_OVTRULY_UPSIDE_DOWN_ONE_BLOCKLINE_LESS, + + CAMIF_CAMERA_UB +} +CAMIF_CAMERA; + +#endif //_VISION_COMMON_H + diff --git a/ARDroneLib/Soft/Lib/Build/Makefile b/ARDroneLib/Soft/Lib/Build/Makefile new file mode 100644 index 0000000..01d6fd5 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Build/Makefile @@ -0,0 +1,153 @@ +NO_COLOR=\033[0m +OK_COLOR=\033[32;01m + +ifdef ARDRONE_CUSTOM_CONFIG + ifdef ARDRONE_BUILD_CONFIG + include $(ARDRONE_CUSTOM_CONFIG) + include $(ARDRONE_BUILD_CONFIG) + else + include ../../Build/custom.makefile + include ../../Build/config.makefile + endif +else + include ../../Build/custom.makefile + include ../../Build/config.makefile +endif + +LIB_ID=ardrone +ifeq ($(USE_ARDRONE_TOOL),no) +LIB_ID:=$(LIB_ID)_notool +endif +GENERIC_TARGET_LIBRARY:=lib$(TARGET)$(LIB_ID).a + +GENERIC_CFLAGS+=-DAT_MESSAGES_HEADER="\"$(COMMON_DIR)/at_msgs.h\"" +GENERIC_CFLAGS+=-DUSE_NEW_ATCODEC + +ifeq ($(USE_ARDRONE_MAINLOOP),no) +GENERIC_CFLAGS+=-DNO_ARDRONE_MAINLOOP +endif + +ifeq ("$(USE_CHECK_WIFI_CONFIG)","yes") + GENERIC_CFLAGS+=-DCHECK_WIFI_CONFIG +endif + +SDK_FLAGS+="USE_APP=no" +SDK_FLAGS+="USE_LIB=yes" +SDK_FLAGS+="LIB_ID=ardrone_lib" + +MATHS_DIR=Maths +CONTROL_DIR=Control +ARDRONE_TOOL_DIR=ardrone_tool +UTILS_DIR=utils +INIPARSER_DIR=iniparser3.0b/src +LIBCALIBRATION_DIR=libCalibration + +GENERIC_LIBRARY_SOURCE_FILES+= \ + $(INIPARSER_DIR)/iniparser.c \ + $(INIPARSER_DIR)/dictionary.c \ + $(MATHS_DIR)/filter.c \ + $(MATHS_DIR)/maths.c \ + $(MATHS_DIR)/matrices.c \ + $(MATHS_DIR)/matrix3d.c \ + $(MATHS_DIR)/quaternions.c \ + $(MATHS_DIR)/time.c \ + $(MATHS_DIR)/vision_math.c \ + $(ARDRONE_TOOL_DIR)/Navdata/navdata.c \ + $(ARDRONE_TOOL_DIR)/config_keys.c \ + $(UTILS_DIR)/ardrone_crc_32.c \ + $(UTILS_DIR)/ardrone_gen_ids.c \ + $(UTILS_DIR)/ardrone_ftp.c + +ifneq ($(CONTROL_DLL),yes) + ifeq ($(USE_ARDRONE_TOOL),yes) + ifeq ($(PC_USE_POLARIS),yes) + GENERIC_CFLAGS+=-DPC_USE_POLARIS + endif + +GENERIC_LIBRARY_SOURCE_FILES+= \ + $(ARDRONE_TOOL_DIR)/AT/ardrone_at_mutex.c + +GENERIC_LIBRARY_SOURCE_FILES+= \ + $(ARDRONE_TOOL_DIR)/Control/ardrone_control_soft_update.c \ + $(ARDRONE_TOOL_DIR)/Control/ardrone_control_configuration.c \ + $(ARDRONE_TOOL_DIR)/Control/ardrone_control_ack.c \ + $(ARDRONE_TOOL_DIR)/Navdata/ardrone_navdata_file.c \ + $(ARDRONE_TOOL_DIR)/Navdata/ardrone_general_navdata.c \ + $(ARDRONE_TOOL_DIR)/UI/ardrone_input.c \ + $(ARDRONE_TOOL_DIR)/UI/ardrone_tool_ui.c \ + $(ARDRONE_TOOL_DIR)/ardrone_time.c \ + $(ARDRONE_TOOL_DIR)/ardrone_api.c \ + $(ARDRONE_TOOL_DIR)/ardrone_tool_configuration.c \ + $(ARDRONE_TOOL_DIR)/ardrone_tool.c \ + $(ARDRONE_TOOL_DIR)/Com/config_wifi.c + + ifneq ($(USE_MINGW32),yes) + GENERIC_LIBRARY_SOURCE_FILES+= \ + $(ARDRONE_TOOL_DIR)/Video/video_stage.c \ + $(ARDRONE_TOOL_DIR)/Video/video_com_stage.c \ + $(ARDRONE_TOOL_DIR)/Control/ardrone_control.c \ + $(ARDRONE_TOOL_DIR)/Control/ardrone_navdata_control.c \ + $(ARDRONE_TOOL_DIR)/Navdata/ardrone_navdata_client.c + + ifeq ($(USE_IPHONE),no) + GENERIC_LIBRARY_SOURCE_FILES+= \ + $(ARDRONE_TOOL_DIR)/Com/config_serial.c + endif + + ifeq ($(USE_ARDRONE_VICON),yes) + GENERIC_CFLAGS+=-DUSE_ARDRONE_VICON + endif + endif +endif + +ifneq ($(USE_MINGW32),yes) + GENERIC_LIBRARY_SOURCE_FILES+= \ + $(ARDRONE_TOOL_DIR)/Video/video_stage_recorder.c +endif + +ifeq ($(USE_LINUX),yes) + ifeq ($(FFMPEG_RECORDING_SUPPORT),yes) + GENERIC_CFLAGS+=-DUSE_FFMPEG_RECORDER + GENERIC_LIBRARY_SOURCE_FILES+=$(ARDRONE_TOOL_DIR)/Video/video_stage_ffmpeg_recorder.c + endif +endif + + + +ifeq ($(USE_ELINUX),yes) + +HARDWARE_ARDRONE:=$(SRC_PATH)/Soft/Toy/Sources/$(CARD_HARDWARE_DIR) + + ifeq ($(USE_MINGW32),yes) + HARDWARE_ARDRONE_CALIBRATION:=c:/$(CARD_HARDWARE_DIR) + else + HARDWARE_ARDRONE_CALIBRATION:=$(HARDWARE_ARDRONE) + endif + +GENERIC_CFLAGS+=-DHARDWARE_ARDRONE=\"$(HARDWARE_ARDRONE)\" \ + -DHARDWARE_ARDRONE_CALIBRATION=\"$(HARDWARE_ARDRONE_CALIBRATION)\" +endif + +endif + +BASE_RELATIVE_PATH_FROM_SDK=../../ + +GENERIC_INCLUDES+= \ + -I$(BASE_RELATIVE_PATH_FROM_SDK)/Soft/Common \ + -I$(BASE_RELATIVE_PATH_FROM_SDK)/Soft/Lib + +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR=$(BASE_RELATIVE_PATH_FROM_SDK)/Soft/Lib +export GENERIC_BINARIES_SOURCE_DIR=$(BASE_RELATIVE_PATH_FROM_SDK)/Soft/Lib + +export GENERIC_CFLAGS +export GENERIC_LIBRARY_SOURCE_FILES +export GENERIC_TARGET_LIBRARY + +export GENERIC_BINARIES_COMMON_SOURCE_FILES= +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= + +all $(MAKECMDGOALS): + @if [ '$(MAKECMDGOALS)' != 'clean' ]; then echo "$(OK_COLOR)Building ARDroneTool/Lib$(NO_COLOR)"; fi + @$(MAKE) -C ../../../VP_SDK/Build $(TMP_SDK_FLAGS) $(SDK_FLAGS) $(MAKECMDGOALS) + diff --git a/ARDroneLib/Soft/Lib/Maths/filter.c b/ARDroneLib/Soft/Lib/Maths/filter.c new file mode 100644 index 0000000..30b80b6 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/filter.c @@ -0,0 +1,126 @@ +/** + * \file filter.c + * \brief 1st and 2nd order filter implementation + * \author Jean Baptiste Lanfrey + * \version 1.0 + */ + +#include +#include +#include + +void filter_init(uint32_t n, float32_t *old_input, float32_t initial_input, float32_t *old_output, float32_t initial_output) +{ + uint32_t ii; + + for (ii=0; ii0; ii--) + old_input[ii] = old_input[ii-1]; + + old_input[0] = input; + + for (ii=n-1; ii>0; ii--) + old_output[ii] = old_output[ii-1]; + + old_output[0] = output; + + return output; +} + + +// Filtre du type Kd.p / (1+Td.p) +float32_t deriv(deriv_param_t *param, float32_t input) +{ + static float32_t exp_1 = 0.3678794411714423412f; // expf(-1.0f); + + float32_t exp; + float32_t td; + float32_t out; + + if( f_is_zero( param->td ) ) + { + // prevent from dividing by 0. + td = param->te; + exp = exp_1; + } + else + { + td = param->td; + // exp = expf(-param->te/td); + exp = exp_taylor(-param->te/td); + } + + param->internal_state = exp * param->internal_state + td * (1 - exp) * param->old_input; + + out = ( param->kd / td ) * ( input - param->internal_state / td ); + + param->old_input = input; + + return out; +} + +void delay_init(uint32_t m, float32_t *old_input, float32_t initial_input) +{ + uint32_t ii; + + for (ii=0; ii0; ii--) + old_input[ii] = old_input[ii-1]; + + old_input[0] = input; + + return output; +} + +float32_t rate_limiter(float32_t input, float32_t old_output, float32_t rate_max) +{ + float32_t output; + float_or_int_t FOI_rate,FOI_rate_max; + + FOI_rate.f = input - old_output; + FOI_rate_max.f = rate_max; + + if( f_abs( FOI_rate ) > FOI_rate_max.f ) + output = old_output + f_set_clamp( FOI_rate, FOI_rate_max ); + else + output = input; + + return output; +} diff --git a/ARDroneLib/Soft/Lib/Maths/filter.h b/ARDroneLib/Soft/Lib/Maths/filter.h new file mode 100644 index 0000000..06d7095 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/filter.h @@ -0,0 +1,188 @@ +/** + * \file filter.h + * \brief 1st and 2nd order filter implementation + * \author Jean Baptiste Lanfrey + * \version 1.0 + */ + +#ifndef _FILTER_H_ +#define _FILTER_H_ + +#include + + +#define NB_FIRST_ORDER 1 +#define NB_SECOND_ORDER 2 +#define NB_THIRD_ORDER 3 +#define NB_FOURTH_ORDER 4 +#define NB_SIXTH_ORDER 6 +#define DEFAULT_DELAY_STEP_TIME_DELAY TWENTY_STEP_TIME_DELAY +#define FORTY_STEP_TIME_DELAY 40 +#define THIRTY_TWO_STEP_TIME_DELAY 32 +#define TWENTY_STEP_TIME_DELAY 20 + +/////////////////////////////////////////////// +// STRUCTURES + + +/** + * \struct _first_order_filter_ + * \brief First order filter states using Matlab notation. + */ +typedef struct { + float32_t old_outputs[NB_FIRST_ORDER]; //< filter output history + float32_t old_inputs [NB_FIRST_ORDER]; //< filter input history +} first_order_filter_t; + + +/** + * \struct _second_order_filter_ + * \brief Second order filter states using Matlab notation. + */ +typedef struct { + float32_t old_outputs[NB_SECOND_ORDER]; //< filter output history + float32_t old_inputs [NB_SECOND_ORDER]; //< filter input history +} second_order_filter_t; + + +/** + * \struct _third_order_filter_ + * \brief Third order filter states using Matlab notation. + */ +typedef struct { + float32_t old_outputs[NB_THIRD_ORDER]; //< filter output history + float32_t old_inputs [NB_THIRD_ORDER]; //< filter input history +} third_order_filter_t; + + +/** + * \struct _fourth_order_filter_ + * \brief Fourth order filter states using Matlab notation. + */ +typedef struct { + float32_t old_outputs[NB_FOURTH_ORDER]; //< filter output history + float32_t old_inputs [NB_FOURTH_ORDER]; //< filter input history +} fourth_order_filter_t; + +typedef struct { + float32_t old_outputs[NB_SIXTH_ORDER]; //< filter output history + float32_t old_inputs [NB_SIXTH_ORDER]; //< filter input history +} sixth_order_filter_t; + + +typedef struct _deriv_param_t { + float32_t kd; + float32_t td; + float32_t te; + + float32_t internal_state; + float32_t old_input; +} deriv_param_t; + +/** + * \struct _delay_ + * \brief m sampling step time delay. + */ +typedef struct { + float32_t old_inputs[FORTY_STEP_TIME_DELAY]; //< input history +} delay_t; + +/////////////////////////////////////////////// +// FUNCTIONS + + +/** + * \fn Digital filter initialization. + * \brief This function is used to initialize previous values in digital filter. + * \param Filter order. + * \param address of previous inputs list. + * \param initial input value. + * \param address of previous outputs list. + * \param initial output value. + * \return void. + * + * \section History + * + * \par date: 2007-06-25 author: + * - first version + */ +void filter_init(uint32_t n, float32_t *old_input, float32_t initial_input, float32_t *old_output, float32_t initial_output); + + + +/** + * \fn Filter a value. + * \brief This function uses the same notation as Matlab except that array indices start at 0 + * \brief a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb) - a(2)*y(n-1) - ... - a(na+1)*y(n-na) + * \brief This function automatically shifts old inputs and outputs. + * \param Filter order + * \param address of B coefficients list. + * \param address of A coefficients list. + * \param input value. + * \param address of previous inputs list. + * \param address of previous outputs list. + * \return filtered value. + * + * \section History + * + * \par date: 2007-06-25 author: + * - first version + */ +float32_t filter(uint32_t n, const float32_t *b, const float32_t *a, float32_t input, float32_t *old_input, float32_t *old_output); + +/** + * \fn Derivative filter + * \brief Y/U = kd;p/(1+Td.p) + * \param Kd, Td, Te, previous values (state and input) + * \return filtered value. + * + * \section History + * + * \par date: 2007-10-15 author: + * - first version + */ +float32_t deriv(deriv_param_t *param, float32_t input); + +/** + * \fn Digital delay initialization + * \brief This function is used to initialize previous inputs of the digital delay. + * \param m number of sampling step time delay. + * \return void. + * + * \section History + * + * \par date: 2008-5-13 author: + * - first version + */ +void delay_init(uint32_t m, float32_t *old_input, float32_t initial_input); + +/** + * \fn Delay a value + * \brief y(k)=u(k-m). + * \param m number of sampling step time delay, previous values (state and input). + * \return delayed input. + * + * \section History + * + * \par date: 2008-5-13 author: + * - first version + */ +float delay(uint32_t m, float32_t input, float32_t *old_input); + +// rate limiter +// rate_max is the highest rate allowed in one sample time +// warning : rate_max must be positive +/** + * \fn rate limiter + * \brief limit the rate of an input. + * \param rate_max is the highest rate allowed in one sample time. Warning : rate_max must be positive + * \return rate limiter output. + * + * \section History + * + * \par date: 2008-7-24 author: + * - first version + */ +float32_t rate_limiter(float32_t input, float32_t old_output, float32_t rate_max); + +#endif // FILTER diff --git a/ARDroneLib/Soft/Lib/Maths/maths.c b/ARDroneLib/Soft/Lib/Maths/maths.c new file mode 100644 index 0000000..acbeb57 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/maths.c @@ -0,0 +1,149 @@ +/** + * \file maths.c + * \brief Maths library used by ARDrone + * \author Sylvain Gaeremynck + * \author Jean-Baptiste Lanfrey + * \version 1.0 + */ +#include + +float32_t f_epsilon = FLT_EPSILON; + +bool_t f_is_zero( float32_t f ) +{ + bool_t ret; + float32_t af; + + ret = FALSE; + + af = (float32_t)fabs( f ); + + if( af < f_epsilon ) + ret = TRUE; + + return ret; +} + +float32_t f_zero( float32_t f ) +{ + if( f_is_zero(f) ) + return 0.0f; + + return f; +} + +float32_t asin_taylor( float32_t x ) +{ + // float32_t xsquare = x*x; + // thrid order + return (float32_t)(x*(1.0f+x*x*0.16666667f)); + // fifth order + // return (x*(1.0+xsquare*(1.0/6.0 + 3.0*xsquare/40.0); +} + +float32_t atan2_taylor( float32_t num, float32_t den ) +{ + float32_t res; + + if ( f_is_zero(den) ) { + // pi/2 + res = 1.5707963268f; + } + else { + float32_t x = num/den; + // float32_t xsquare = x*x; + // thrid order + res = (float32_t)x*(1.0f-x*x*.33333333f); + // fifth order + // res = x*(1.0-xsquare*(1.0/3.0 + xsquare/5.0)); + } + return (res); +} + +// Polar saturation +void f_polar_sat( float32_t max, float32_t* phi, float32_t* theta) +{ + float32_t alpha; + float32_t c_alpha, s_alpha; + float32_t phi_in; + float32_t theta_in; + + phi_in = *phi; + theta_in = *theta; + + // angle beta du plan du drone avec l'horizontal vaut beta = acosf(cosf(theta_in)*cosf(phi_in)) + // on peut approximer par beta^2 = theta_in^2 + phi_in^2 + if ( theta_in*theta_in + phi_in*phi_in > max*max ) { + alpha = (float32_t)atan2(theta_in, phi_in); + sincosf( alpha, &s_alpha, &c_alpha); + *phi = max * c_alpha; + *theta = max * s_alpha; + } +} + +float32_t exp_taylor( float32_t x ) +{ + return (float32_t)(1.0f+x+x*x*0.5f); +} + +float32_t secant_taylor( float32_t x ) // secant(x) = 1 / cos(x) +{ + return (float32_t)(1.0f+x*x*0.5f); +} + +float32_t cos_taylor( float32_t x ) +{ + return (float32_t)(1.0f-x*x*0.5f); +} + +float32_t sin_taylor( float32_t x ) +{ + return (float32_t)(x*(1.0f-x*x*.16666667f)); +} + +float32_t time_navdata_in_ms(uint32_t current_time, int32_t dec) +{ + //convert time given by get_current_time() in millisecond + + uint32_t time_sec, time_micro_sec; + float32_t time_milli_sec; + + time_sec = current_time >> dec; + + time_micro_sec = current_time - (time_sec << dec); + + time_milli_sec = (float32_t)(1000.0*time_sec + time_micro_sec/1000.0); + + return(time_milli_sec); +} + +static uint32_t MASK_01010101 = (((unsigned int)(-1))/3); // 01010101010101010101010101010101 +static uint32_t MASK_00110011 = (((unsigned int)(-1))/5); // 00110011001100110011001100110011 +static uint32_t MASK_00001111 = (((unsigned int)(-1))/17); // 00001111000011110000111100001111 + +static inline int bitcountNifty_8(unsigned int n, uint32_t MASK_01010101, uint32_t MASK_00110011, uint32_t MASK_00001111) +{ + n = (n & MASK_01010101) + ((n >> 1) & MASK_01010101) ; + n = (n & MASK_00110011) + ((n >> 2) & MASK_00110011) ; + n = (n & MASK_00001111) + ((n >> 4) & MASK_00001111) ; + return n; +} + +static inline int bitcountNifty(unsigned int n, uint32_t MASK_01010101, uint32_t MASK_00110011, uint32_t MASK_00001111) +{ + n = (n & MASK_01010101) + ((n >> 1) & MASK_01010101) ; + n = (n & MASK_00110011) + ((n >> 2) & MASK_00110011) ; + n = (n & MASK_00001111) + ((n >> 4) & MASK_00001111) ; + return n % 255 ; +} + +uint32_t nb_bits_differents(uint32_t p, uint32_t q) +{ + return bitcountNifty(p^q, MASK_01010101, MASK_00110011, MASK_00001111); +} + +uint32_t nb_bits_differents_8(uint32_t p, uint32_t q) +{ + return bitcountNifty_8(p^q, MASK_01010101, MASK_00110011, MASK_00001111); +} + diff --git a/ARDroneLib/Soft/Lib/Maths/maths.h b/ARDroneLib/Soft/Lib/Maths/maths.h new file mode 100644 index 0000000..defb06f --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/maths.h @@ -0,0 +1,120 @@ +/** + * \file maths.h + * \brief Maths library used by ARDrone + * \author Sylvain Gaeremynck + * \version 1.0 + */ + +#ifndef _MATHS_H_ +#define _MATHS_H_ + +#include + +#ifndef __USE_GNU +#define __USE_GNU +#endif // __USE_GNU + +#include +#include + +/////////////////////////////////////////////// +// DEFINES + +#define RAD_TO_MDEG (57295.779513f) +#define RAD_TO_DEG (57.295779513f) +#define MDEG_TO_RAD (1.745329252e-05f) +#define DEG_TO_RAD (1.745329252e-02f) +#define PI (3.1415927f) +#define GRAVITY (9.81f) + +#ifndef min +#define min(a, b) (a) < (b) ? (a) : (b) +#endif + +#ifndef max +#define max(a, b) (a) < (b) ? (b) : (a) +#endif + +typedef struct _screen_point_t { + int32_t x; + int32_t y; +} screen_point_t; + +typedef union _float_or_int_t { + float32_t f; + int32_t i; +} float_or_int_t; + +extern float32_t f_epsilon; + +bool_t f_is_zero( float32_t f ); +float32_t f_zero( float32_t f ); + +static inline float32_t f_round(float32_t f, int32_t nb_decimal) +{ + float32_t puissance = (float32_t) (10 ^ nb_decimal); + return ((int)(f * puissance) / puissance); +} + +// Returns f's absolute value +static inline float32_t f_abs( float_or_int_t fi ) +{ + fi.i &= 0x7FFFFFFF; + + return fi.f; +} + +// Inverse f's sign +static inline void f_inv_sign( float_or_int_t* fi ) +{ + fi->i ^= 0x80000000; +} + +// Polar saturation +void f_polar_sat( float32_t max, float32_t* phi, float32_t* theta); + +// Returns clamp value with value's sign +static inline float32_t f_set_clamp( float_or_int_t value, float_or_int_t clamp_value ) +{ + clamp_value.i |= value.i & 0x80000000; + + return clamp_value.f; +} + +float32_t asin_taylor( float32_t x ); +float32_t atan2_taylor( float32_t num, float32_t den ); +float32_t exp_taylor( float32_t x ); +float32_t secant_taylor( float32_t x ); +float32_t cos_taylor( float32_t x ); +float32_t sin_taylor( float32_t x ); +float32_t time_navdata_in_ms( uint32_t current_time, int32_t dec ); + +static inline uint32_t iabs(int32_t v) { return ( v < 0 ) ? -v : v; } + +#if defined( USE_MINGW32 ) +static inline void sincosf(float32_t a, float32_t* out_s, float32_t* out_c) +{ + __asm( + "flds %2\n" + "fsincos\n" + "fstps %1\n" + "fstps %0" + :"=m"(*out_s), "=m"(*out_c) + :"m"(a) + ); +} +#elif defined( _MSC_VER ) || defined( TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) +static inline void sincosf(float32_t a, float32_t* out_s, float32_t* out_c) +{ + *out_s = sinf(a); + *out_c = cosf(a); +} +#endif // _MSC_VER || USE_MINGW32 + +// 8 bits version +uint32_t nb_bits_differents_8(uint32_t p, uint32_t q); + +uint32_t nb_bits_differents(uint32_t p, uint32_t q); + + +#endif // _MATHS_H_ diff --git a/ARDroneLib/Soft/Lib/Maths/matrices.c b/ARDroneLib/Soft/Lib/Maths/matrices.c new file mode 100644 index 0000000..43e59b1 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/matrices.c @@ -0,0 +1,164 @@ +#include + +#include +#include + +const matrix33_t matrix_id3 = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f }; +const vector31_t vector31_zero = { { { 0.0f, 0.0f, 0.0f } } }; +const vector31_t vector31_z = { { { 0.0f, 0.0f, 1.0f } } }; + +void mul_mat( matrix33_t* out, matrix33_t *m1, matrix33_t *m2 ) +{ + /// You can't have output & input pointing to the same location + VP_OS_ASSERT( out != m1 ); + VP_OS_ASSERT( out != m2 ); + + out->m11 = (m1->m11)*(m2->m11) + (m1->m12)*(m2->m21) + (m1->m13)*(m2->m31); + out->m12 = (m1->m11)*(m2->m12) + (m1->m12)*(m2->m22) + (m1->m13)*(m2->m32); + out->m13 = (m1->m11)*(m2->m13) + (m1->m12)*(m2->m23) + (m1->m13)*(m2->m33); + + out->m21 = (m1->m21)*(m2->m11) + (m1->m22)*(m2->m21) + (m1->m23)*(m2->m31); + out->m22 = (m1->m21)*(m2->m12) + (m1->m22)*(m2->m22) + (m1->m23)*(m2->m32); + out->m23 = (m1->m21)*(m2->m13) + (m1->m22)*(m2->m23) + (m1->m23)*(m2->m33); + + out->m31 = (m1->m31)*(m2->m11) + (m1->m32)*(m2->m21) + (m1->m33)*(m2->m31); + out->m32 = (m1->m31)*(m2->m12) + (m1->m32)*(m2->m22) + (m1->m33)*(m2->m32); + out->m33 = (m1->m31)*(m2->m13) + (m1->m32)*(m2->m23) + (m1->m33)*(m2->m33); +} + +void add_mat( matrix33_t* out, matrix33_t *m1, matrix33_t *m2 ) +{ + out->m11 = (m1->m11) + (m2->m11); + out->m12 = (m1->m12) + (m2->m12); + out->m13 = (m1->m13) + (m2->m13); + + out->m21 = (m1->m21) + (m2->m21); + out->m22 = (m1->m22) + (m2->m22); + out->m23 = (m1->m23) + (m2->m23); + + out->m31 = (m1->m31) + (m2->m31); + out->m32 = (m1->m32) + (m2->m32); + out->m33 = (m1->m33) + (m2->m33); +} + +void mulvec_mat( vector31_t* out, matrix33_t *m1, vector31_t *v1 ) +{ + out->x = (m1->m11) * (v1->x) + (m1->m12) * (v1->y) + (m1->m13) * (v1->z); + out->y = (m1->m21) * (v1->x) + (m1->m22) * (v1->y) + (m1->m23) * (v1->z); + out->z = (m1->m31) * (v1->x) + (m1->m32) * (v1->y) + (m1->m33) * (v1->z); +} + +void transpose_mat( matrix33_t *out, matrix33_t *m1 ) +{ + out->m11 = m1->m11; + out->m12 = m1->m21; + out->m13 = m1->m31; + + out->m21 = m1->m12; + out->m22 = m1->m22; + out->m23 = m1->m32; + + out->m31 = m1->m13; + out->m32 = m1->m23; + out->m33 = m1->m33; +} + +void mulconst_mat( matrix33_t *out, matrix33_t *m1, float32_t k ) +{ + out->m11 = m1->m11 * k; + out->m12 = m1->m12 * k; + out->m13 = m1->m13 * k; + + out->m21 = m1->m21 * k; + out->m22 = m1->m22 * k; + out->m23 = m1->m23 * k; + + out->m31 = m1->m31 * k; + out->m32 = m1->m32 * k; + out->m33 = m1->m33 * k; +} + +void cross_vec( vector31_t* out, vector31_t *v1, vector31_t *v2 ) +{ + /// You can't have output & input pointing to the same location + VP_OS_ASSERT( out != v1 ); + VP_OS_ASSERT( out != v2 ); + + out->x = (v1->y) * (v2->z) - (v1->z) * (v2->y); + out->y = (v1->z) * (v2->x) - (v1->x) * (v2->z); + out->z = (v1->x) * (v2->y) - (v1->y) * (v2->x); +} + +void dot_vec( float32_t* out, const vector31_t *v1, const vector31_t *v2 ) +{ + *out = v1->x * v2->x + v1->y * v2->y + v1->z * v2->z; +} + +void add_vec( vector31_t* out, vector31_t *v1, vector31_t *v2 ) +{ + out->x = (v1->x) + (v2->x); + out->y = (v1->y) + (v2->y); + out->z = (v1->z) + (v2->z); +} + +void mulconst_vec( vector31_t *out, vector31_t *v1, float32_t k ) +{ + out->x = (v1->x) * k; + out->y = (v1->y) * k; + out->z = (v1->z) * k; +} + +void skew_anti_symetric_vec( matrix33_t *out, vector31_t *v ) +{ + out->m11 = 0.0f; + out->m12 =-v->z; + out->m13 = v->y; + + out->m21 = v->z; + out->m22 = 0.0f; + out->m23 =-v->x; + + out->m31 =-v->y; + out->m32 = v->x; + out->m33 = 0.0f; +} + +void vex( vector31_t *out, matrix33_t *m ) +{ + out->x = m->m32; + out->y = m->m13; + out->z = m->m21; +} + +float32_t norm_vec( vector31_t *v ) +{ + return sqrtf( (v->x)*(v->x) + (v->y)*(v->y) + (v->z)*(v->z) ); +} + +bool_t normalize_vec( vector31_t* v ) +{ + bool_t ret; + float32_t l; + + l = norm_vec( v ); + + if( f_is_zero( l ) ) + { + v->x = 0.0f; + v->y = 0.0f; + v->z = 0.0f; + + ret = FALSE; + } + else + { + v->x = f_zero( v->x / l ); + v->y = f_zero( v->y / l ); + v->z = f_zero( v->z / l ); + + ret = TRUE; + } + + return ret; +} + diff --git a/ARDroneLib/Soft/Lib/Maths/matrices.h b/ARDroneLib/Soft/Lib/Maths/matrices.h new file mode 100644 index 0000000..1924c5d --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/matrices.h @@ -0,0 +1,93 @@ +/** + * \file matrices.h + * \brief Matrices library used by ARDrone + * \author Jean-Baptiste Lanfrey + * \version 1.0 + */ + +#ifndef _MATRICES_H_ +#define _MATRICES_H_ + +#include + +typedef struct _matrix33_t +{ + float32_t m11; + float32_t m12; + float32_t m13; + float32_t m21; + float32_t m22; + float32_t m23; + float32_t m31; + float32_t m32; + float32_t m33; +} matrix33_t; + +typedef struct _vector31_t { + union { + float32_t v[3]; + struct + { + float32_t x; + float32_t y; + float32_t z; + }; + }; +} vector31_t; + +typedef union _vector21_t { + float32_t v[2]; + struct + { + float32_t x; + float32_t y; + }; +} vector21_t; + +extern const matrix33_t matrix_id3; +extern const vector31_t vector31_zero; +extern const vector31_t vector31_z; + +// TODO Documentation + +// Multiplies two matrices m1 & m2. Stores result in out. +void mul_mat( matrix33_t* out, matrix33_t *m1, matrix33_t *m2 ); + + +void add_mat( matrix33_t* out, matrix33_t *m1, matrix33_t *m ); + + +void mulvec_mat( vector31_t* out, matrix33_t *m1, vector31_t *v1 ); + + +void transpose_mat( matrix33_t *out, matrix33_t *m1 ); + + +void mulconst_mat( matrix33_t *out, matrix33_t *m1, float32_t k ); + + +void cross_vec( vector31_t* out, vector31_t *v1, vector31_t *v2 ); + + +void dot_vec( float32_t* out, const vector31_t *v1, const vector31_t *v2 ); + + +void add_vec( vector31_t* out, vector31_t *v1, vector31_t *v2 ); + + +void mulconst_vec( vector31_t *out, vector31_t *V1, float32_t k ); + + +void skew_anti_symetric_vec( matrix33_t *out, vector31_t *v ); + + +void vex( vector31_t *out, matrix33_t *m ); + + +float32_t norm_vec( vector31_t *v ); + + +bool_t normalize_vec( vector31_t* v ); + + +#endif // _MATRICES_H_ diff --git a/ARDroneLib/Soft/Lib/Maths/matrix3d.c b/ARDroneLib/Soft/Lib/Maths/matrix3d.c new file mode 100644 index 0000000..00b05a1 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/matrix3d.c @@ -0,0 +1,313 @@ +/** + * \brief Matrix 3d implementation + * \author Sylvain Gaeremynck + * \version 1.0 + * \date 04/06/2007 + * \warning Subject to completion + */ + +#include +#include + +#include + +#include + +matrix3d_t matrix3d_id = { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f +}; + +static void vector_X( vector31_t* v ) +{ + v->x = 1.0f; + v->y = 0.0f; + v->z = 0.0f; +} + +static void vector_Y( vector31_t* v ) +{ + v->x = 0.0f; + v->y = 1.0f; + v->z = 0.0f; +} + +#if 0 // it is not used ... fix warning +static void vector_Z( vector31_t* v ) +{ + v->x = 0.0f; + v->y = 0.0f; + v->z = 1.0f; +} +#endif + +void matrix3d_zero(matrix3d_t* m) +{ + m->m00 = m->m01 = m->m02 = m->m03 = 0.0f; + m->m10 = m->m11 = m->m12 = m->m13 = 0.0f; + m->m20 = m->m21 = m->m22 = m->m23 = 0.0f; + m->m30 = m->m31 = m->m32 = m->m33 = 0.0f; +} + +void matrix3d_identity(matrix3d_t* m) +{ + m->m00 = m->m11 = m->m22 = m->m33 = 1.0f; + + m->m01 = m->m02 = m->m03 = 0.0f; + m->m10 = m->m12 = m->m13 = 0.0f; + m->m20 = m->m21 = m->m23 = 0.0f; + m->m30 = m->m31 = m->m32 = 0.0f; +} + +C_RESULT matrix3d_euler(matrix3d_t* m, float32_t phi, float32_t theta, float32_t psi) +{ + float32_t c_phi, s_phi, c_theta, s_theta, c_psi, s_psi; + + c_phi = cosf( phi ); + s_phi = sinf( phi ); + c_theta = cosf( theta ); + s_theta = sinf( theta ); + c_psi = cosf( psi ); + s_psi = sinf( psi ); + + matrix3d_identity(m); + + m->m00 = c_theta * c_psi; + m->m01 = c_theta * s_psi; + m->m02 = -s_theta; + + m->m10 = s_phi * s_theta * c_psi - c_phi * s_psi; + m->m11 = s_phi * s_theta * s_psi + c_phi * c_psi; + m->m12 = s_phi * c_theta; + + m->m20 = c_phi * s_theta * c_psi + s_phi * s_psi; + m->m21 = c_phi * s_theta * s_psi - s_phi * c_psi; + m->m22 = c_phi * c_theta; + + return C_OK; +} + +C_RESULT matrix3d_vector(matrix3d_t* m, vector31_t* pos, vector31_t* dir, vector31_t* right, vector31_t* up) +{ + normalize_vec( dir ); + vector_Y( up ); + + cross_vec( right, dir, up ); + if( normalize_vec( right ) ) + { + cross_vec( up, right, dir ); + } + else + { + vector_X( right ); + + cross_vec( up, right, dir ); + cross_vec( right, dir, up ); + normalize_vec( right ); + } + + normalize_vec( up ); + + return matrix3d_orientation( m, pos, dir, right, up ); +} + +C_RESULT matrix3d_orientation(matrix3d_t* m, const vector31_t* pos, const vector31_t* dir, + const vector31_t* right, const vector31_t* up) +{ + float32_t d0, d1, d2; + + m->m00 = right->x; + m->m01 = up->x; + m->m02 = -dir->x; + + m->m10 = right->y; + m->m11 = up->y; + m->m12 = -dir->y; + + m->m20 = right->z; + m->m21 = up->z; + m->m22 = -dir->z; + + dot_vec( &d0, right, pos ); + dot_vec( &d1, up, pos ); + dot_vec( &d2, dir, pos ); + + m->m30 = -d0; + m->m31 = -d1; + m->m32 = -d2; + + m->m03 = 0.0f; + m->m13 = 0.0f; + m->m23 = 0.0f; + m->m33 = 1.0f; + + return C_OK; +} + +#define MATRIX_EXCHANGE( out, in ) temp = out; out = in; in = out + +C_RESULT matrix3d_transpose(matrix3d_t* out, matrix3d_t* in) +{ + if( out != in ) + { + out->m00 = in->m00; + out->m10 = in->m01; + out->m20 = in->m02; + out->m30 = in->m03; + + out->m01 = in->m10; + out->m11 = in->m11; + out->m21 = in->m12; + out->m31 = in->m13; + + out->m02 = in->m20; + out->m12 = in->m21; + out->m22 = in->m22; + out->m32 = in->m23; + + out->m03 = in->m30; + out->m13 = in->m31; + out->m23 = in->m32; + out->m33 = in->m33; + } + else + { + float32_t temp; + + MATRIX_EXCHANGE( out->m01, out->m10 ); + MATRIX_EXCHANGE( out->m02, out->m20 ); + MATRIX_EXCHANGE( out->m03, out->m30 ); + MATRIX_EXCHANGE( out->m12, out->m21 ); + MATRIX_EXCHANGE( out->m13, out->m31 ); + MATRIX_EXCHANGE( out->m23, out->m32 ); + } + + return C_OK; +} + +C_RESULT matrix3d_add(matrix3d_t* out, matrix3d_t* m1, matrix3d_t* m2) +{ + out->m00 = m1->m00 + m2->m00; + out->m01 = m1->m01 + m2->m01; + out->m02 = m1->m02 + m2->m02; + out->m03 = m1->m03 + m2->m03; + + out->m10 = m1->m10 + m2->m10; + out->m11 = m1->m11 + m2->m11; + out->m12 = m1->m12 + m2->m12; + out->m13 = m1->m13 + m2->m13; + + out->m20 = m1->m20 + m2->m20; + out->m21 = m1->m21 + m2->m21; + out->m22 = m1->m22 + m2->m22; + out->m23 = m1->m23 + m2->m23; + + out->m30 = m1->m30 + m2->m30; + out->m31 = m1->m31 + m2->m31; + out->m32 = m1->m32 + m2->m32; + out->m33 = m1->m33 + m2->m33; + + return C_OK; +} + +C_RESULT matrix3d_sub(matrix3d_t* out, matrix3d_t* m1, matrix3d_t* m2) +{ + out->m00 = m1->m00 - m2->m00; + out->m01 = m1->m01 - m2->m01; + out->m02 = m1->m02 - m2->m02; + out->m03 = m1->m03 - m2->m03; + + out->m10 = m1->m10 - m2->m10; + out->m11 = m1->m11 - m2->m11; + out->m12 = m1->m12 - m2->m12; + out->m13 = m1->m13 - m2->m13; + + out->m20 = m1->m20 - m2->m20; + out->m21 = m1->m21 - m2->m21; + out->m22 = m1->m22 - m2->m22; + out->m23 = m1->m23 - m2->m23; + + out->m30 = m1->m30 - m2->m30; + out->m31 = m1->m31 - m2->m31; + out->m32 = m1->m32 - m2->m32; + out->m33 = m1->m33 - m2->m33; + + return C_OK; +} + +#define MATRIX_MUL_PART(a,b) \ + t1 = ( M1[a*4 + 0] * M2[b + 0 ] ); \ + t2 = ( M1[a*4 + 1] * M2[b + 4 ] ); \ + t3 = ( M1[a*4 + 2] * M2[b + 8 ] ); \ + t4 = ( M1[a*4 + 3] * M2[b + 12] ); \ + MOUT[a*4 + b] = ( t1 + t2 + t3 + t4 ); + +C_RESULT matrix3d_mul(matrix3d_t* out, matrix3d_t* m1, matrix3d_t* m2) +{ + float32_t t1, t2, t3, t4; + + float32_t* MOUT = (float32_t*) out; + float32_t* M1 = (float32_t*) m1; + float32_t* M2 = (float32_t*) m2; + + MATRIX_MUL_PART( 0, 0 ); MATRIX_MUL_PART( 0, 1 ); MATRIX_MUL_PART( 0, 2 ); MATRIX_MUL_PART( 0, 3 ); + MATRIX_MUL_PART( 1, 0 ); MATRIX_MUL_PART( 1, 1 ); MATRIX_MUL_PART( 1, 2 ); MATRIX_MUL_PART( 1, 3 ); + MATRIX_MUL_PART( 2, 0 ); MATRIX_MUL_PART( 2, 1 ); MATRIX_MUL_PART( 2, 2 ); MATRIX_MUL_PART( 2, 3 ); + MATRIX_MUL_PART( 3, 0 ); MATRIX_MUL_PART( 3, 1 ); MATRIX_MUL_PART( 3, 2 ); MATRIX_MUL_PART( 3, 3 ); + + return C_OK; +} + +C_RESULT matrix3d_translate(matrix3d_t* m, vector31_t* tr) +{ + m->m30 = tr->x; + m->m31 = tr->y; + m->m32 = tr->z; + m->m33 = 1.0f; + + return C_OK; +} + +C_RESULT matrix3d_add_translate(matrix3d_t* m, vector31_t* tr) +{ + m->m30 += tr->x; + m->m31 += tr->y; + m->m32 += tr->z; + m->m33 = 1.0f; + + return C_OK; +} + +C_RESULT matrix3d_rotate_euler(matrix3d_t* m, float32_t phi, float32_t theta, float32_t psi) +{ + matrix3d_t mat_rot; + matrix3d_t mat_res; + + matrix3d_euler(&mat_rot, phi, theta, psi); + matrix3d_mul(&mat_res, &mat_rot, m); + + vp_os_memcpy( (void *)m, (void *)&mat_res, sizeof(matrix3d_t) ); + + return C_OK; +} + +C_RESULT matrix3d_rotate_axis(matrix3d_t* m, vector31_t* axis, float32_t value) +{ + return C_OK; +} + +C_RESULT matrix3d_transform(matrix3d_t* m1, struct _vector31_t* v1) +{ + float32_t x = (m1->m00) * (v1->x) + (m1->m01) * (v1->y) + (m1->m02) * (v1->z) + m1->m30; + float32_t y = (m1->m10) * (v1->x) + (m1->m11) * (v1->y) + (m1->m12) * (v1->z) + m1->m31; + float32_t z = (m1->m20) * (v1->x) + (m1->m21) * (v1->y) + (m1->m22) * (v1->z) + m1->m32; + float32_t w = (m1->m30) * (v1->x) + (m1->m31) * (v1->y) + (m1->m32) * (v1->z) + m1->m33; + + v1->x = x / w; + v1->y = y / w; + v1->z = z / w; + + return C_OK; +} diff --git a/ARDroneLib/Soft/Lib/Maths/matrix3d.h b/ARDroneLib/Soft/Lib/Maths/matrix3d.h new file mode 100644 index 0000000..c0326ef --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/matrix3d.h @@ -0,0 +1,59 @@ +/** + * \brief Matrix 3d declaration + * \author Sylvain Gaeremynck + * \version 1.0 + * \date 04/06/2007 + * \warning Subject to completion + */ + +#ifndef _MATRIX3D_H_ +#define _MATRIX3D_H_ + +#include + +typedef struct _matrix3d_t { + float32_t m00, m01, m02, m03; + float32_t m10, m11, m12, m13; + float32_t m20, m21, m22, m23; + float32_t m30, m31, m32, m33; +} matrix3d_t; + +struct _vector31_t; + +extern matrix3d_t matrix3d_id; // identity matrix + +// Set m to zero +void matrix3d_zero(matrix3d_t* m); + +// Set m to identity +void matrix3d_identity(matrix3d_t* m); + +// Initialize m from euler angles +C_RESULT matrix3d_euler(matrix3d_t* m, float32_t phi, float32_t theta, float32_t psi); + +// Initialize m from a position and a direction +C_RESULT matrix3d_vector( matrix3d_t* m, struct _vector31_t* pos, struct _vector31_t* dir, + struct _vector31_t* right, struct _vector31_t* up); + +// Initialize m from a position and a normalized orientation +C_RESULT matrix3d_orientation(matrix3d_t* m, const struct _vector31_t* pos, const struct _vector31_t* dir, + const struct _vector31_t* right, const struct _vector31_t* up); + +// Compute transposed matrix +C_RESULT matrix3d_transpose(matrix3d_t* out, matrix3d_t* in); + +// Common arithmetic operation +C_RESULT matrix3d_add(matrix3d_t* out, matrix3d_t* m1, matrix3d_t* m2); +C_RESULT matrix3d_sub(matrix3d_t* out, matrix3d_t* m1, matrix3d_t* m2); +C_RESULT matrix3d_mul(matrix3d_t* out, matrix3d_t* m1, matrix3d_t* m2); + +// Common 3d transformation +C_RESULT matrix3d_translate(matrix3d_t* m, struct _vector31_t* tr); +C_RESULT matrix3d_add_translate(matrix3d_t* m, struct _vector31_t* tr); + +C_RESULT matrix3d_rotate_euler(matrix3d_t* m, float32_t phi, float32_t theta, float32_t psi); +C_RESULT matrix3d_rotate_axis(matrix3d_t* m, struct _vector31_t* axis, float32_t value); + +C_RESULT matrix3d_transform(matrix3d_t* m, struct _vector31_t* v); + +#endif // _MATRIX3D_H_ diff --git a/ARDroneLib/Soft/Lib/Maths/point3d.h b/ARDroneLib/Soft/Lib/Maths/point3d.h new file mode 100644 index 0000000..e8e59f5 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/point3d.h @@ -0,0 +1,11 @@ +#ifndef _POINT3D_H_ +#define _POINT3D_H_ + +typedef struct _point3d_t { + float32_t x; + float32_t y; + float32_t z; + float32_t w; +} point3d_t; + +#endif // _POINT3D_H_ diff --git a/ARDroneLib/Soft/Lib/Maths/quaternions.c b/ARDroneLib/Soft/Lib/Maths/quaternions.c new file mode 100644 index 0000000..bb14ef0 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/quaternions.c @@ -0,0 +1,129 @@ +/** + * \file quaternions.c + * \brief Quaternions library used by Mykonos + * \author Franďż˝ois Callou + * \version 1.0 + */ + +#include +#include +#include + +const quaternion_t quat_unitary = { 1.0f, {{{ 0.0f, 0.0f, 0.0f}}} }; + +void mul_quat( quaternion_t* out, quaternion_t* q1, quaternion_t* q2) +{ + vector31_t temp_v; + + /// You can't have output & input pointing to the same location + VP_OS_ASSERT( out != q1 ); + VP_OS_ASSERT( out != q2 ); + + // scalar result + out->a = q1->a*q2->a - (q1->v.x*q2->v.x + q1->v.y*q2->v.y + q1->v.z*q2->v.z); + + // pure quaternion result + cross_vec( &out->v , &q1->v, &q2->v ); + mulconst_vec( &temp_v, &q2->v, q1->a ); + add_vec( &out->v, &out->v, &temp_v); + mulconst_vec( &temp_v, &q1->v, q2->a ); + add_vec( &out->v, &out->v, &temp_v); +} + +void add_quat( quaternion_t* out, quaternion_t* q1, quaternion_t* q2 ) +{ + // scalar result + out->a = q1->a + q2->a; + // pure quaternion result + add_vec( &out->v, &q1->v, &q2->v ); +} + +void mulconst_quat( quaternion_t* out, quaternion_t* q, float32_t k ) +{ + out->a = (q->a) * k; + mulconst_vec( &out->v, &q->v, k ); +} + +void conjugate_quat( quaternion_t* out, quaternion_t* q ) +{ + out->a = q->a; + out->v.x = -q->v.x; + out->v.y = -q->v.y; + out->v.z = -q->v.z; +} + +float32_t norm_quat( quaternion_t *q ) +{ + return sqrtf( q->a*q->a + q->v.x * q->v.x + q->v.y * q->v.y + q->v.z * q->v.z ); +} + +bool_t normalize_quat( quaternion_t* q ) +{ + bool_t ret; + float32_t norm; + + norm = norm_quat( q ); + + if( f_is_zero( norm ) ) + { + q->a = 0.0f; + q->v.x = 0.0f; + q->v.y = 0.0f; + q->v.z = 0.0f; + + ret = FALSE; + } + else + { + q->a = f_zero( q->a / norm ); + q->v.x = f_zero( q->v.x / norm ); + q->v.y = f_zero( q->v.y / norm ); + q->v.z = f_zero( q->v.z / norm ); + + ret = TRUE; + } + + return ret; +} + + +void quat_to_euler_rot_mat(matrix33_t* m, quaternion_t* q) +{ + //to use with normalised quaternion + m->m11 = 1.0f - 2*q->v.y*q->v.y - 2*q->v.z*q->v.z; + m->m12 = 2*q->v.x*q->v.y - 2*q->v.z*q->a; + m->m13 = 2*q->v.z*q->v.x + 2*q->v.y*q->a; + m->m21 = 2*q->v.x*q->v.y + 2*q->v.z*q->a; + m->m22 = 1.0f - 2*q->v.x*q->v.x - 2*q->v.z*q->v.z; + m->m23 = 2*q->v.z*q->v.y - 2*q->v.x*q->a; + m->m31 = 2*q->v.z*q->v.x - 2*q->v.y*q->a; + m->m32 = 2*q->v.z*q->v.y + 2*q->v.x*q->a; + m->m33 = 1.0f - 2*q->v.x*q->v.x - 2*q->v.y*q->v.y; +} + + + +void quat_to_euler_angles(angles_t* a, quaternion_t* q) +{ + //to use with normalised quaternion + float32_t sqvx = q->v.x*q->v.x; + float32_t sqvy = q->v.y*q->v.y; + float32_t sqvz = q->v.z*q->v.z; + + /* if ( f_is_zero(test -0.5) ) { // singularity at north pole + a->psi = 2 * atan2(q->a,q->v.z); + a->theta = PI/2; + a->phi = 0; + return; + } + if ( f_is_zero(test + 0.5) ) { // singularity at south pole + a->psi = -2 * atan2(q->a,q->v.z); + a->theta = - PI/2; + a->phi = 0; + return; + }*/ + + a->phi = atan2(2*q->v.y*q->v.z+2*q->a*q->v.x , 1 - 2*sqvx - 2*sqvy); + a->theta = asin(2*(q->a*q->v.y - q->v.x*q->v.z )); + a->psi = atan2(2*q->v.x*q->v.y+2*q->a*q->v.z , 1 - 2*sqvy - 2*sqvz); +} diff --git a/ARDroneLib/Soft/Lib/Maths/quaternions.h b/ARDroneLib/Soft/Lib/Maths/quaternions.h new file mode 100644 index 0000000..481f19c --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/quaternions.h @@ -0,0 +1,56 @@ +/** + * \file quaternions.c + * \brief Quaternions library used by Mykonos + * \author Franďż˝ois Callou + * \version 1.0 + */ + +#ifndef _QUATERNIONS_H_ +#define _QUATERNIONS_H_ + +#include +#include + +typedef struct _angles_t +{ + float32_t phi; + float32_t theta; + float32_t psi; +} angles_t; + + +typedef struct _quaternion_t { + float32_t a; + vector31_t v; +} quaternion_t; + +extern const quaternion_t quat_unitary; + +// TODO Documentation + +// Multiplies two quaternions q1 & q2. Stores result in out. +void mul_quat( quaternion_t* out, quaternion_t* q1, quaternion_t* q2); + +// Adds two quaternions q1 & q2. Stores result in out. +void add_quat( quaternion_t* out, quaternion_t* q1, quaternion_t* q2 ); + +// Multiplies a quaternion ny a scalar +void mulconst_quat( quaternion_t *out, quaternion_t *q, float32_t k ); + +// Stores the conjugate quaternion in out +void conjugate_quat( quaternion_t* out, quaternion_t* q ); + +// Compuets the norm of a quaternion +float32_t norm_quat( quaternion_t* q ); + +//Normalises a quaternion +bool_t normalize_quat( quaternion_t* q ); + +//transformss a quaternion to the cprrsepďż˝nding euler rotation matrix +void quat_to_euler_rot_mat(matrix33_t* m, quaternion_t* q); + +//transformss a quaternion to the corrseponding euler angles +void quat_to_euler_angles(angles_t* a, quaternion_t* q); + + +#endif // _QUATERNIONS_H_ diff --git a/ARDroneLib/Soft/Lib/Maths/time.c b/ARDroneLib/Soft/Lib/Maths/time.c new file mode 100644 index 0000000..90f4012 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/time.c @@ -0,0 +1,34 @@ +#include + +#ifndef _WIN32 + #include +#else + + #include + //#include // dont include; already included and double inclusion is buggy + + int gettimeofday (struct timeval *tp, void *tz) + { + struct _timeb timebuffer; + _ftime (&timebuffer); + tp->tv_sec = (long)timebuffer.time; + tp->tv_usec = (long)timebuffer.millitm * 1000; + return 0; + } +#endif + +float32_t time_in_ms_f(void) +{ + float32_t time_milli_sec, f_sec, f_usec; + + struct timeval tv; + + gettimeofday(&tv, NULL); + + f_sec = (float32_t)tv.tv_sec; + f_usec = (float32_t)tv.tv_usec; + + time_milli_sec = (float32_t)(1000.0f*f_sec + f_usec/1000.0f); + + return time_milli_sec; +} diff --git a/ARDroneLib/Soft/Lib/Maths/time.h b/ARDroneLib/Soft/Lib/Maths/time.h new file mode 100644 index 0000000..7946ada --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/time.h @@ -0,0 +1,8 @@ +#ifndef _MATHS_TIME_H_ +#define _MATHS_TIME_H_ + +#include + +float32_t time_in_ms_f(void); + +#endif // _TIME_H_ diff --git a/ARDroneLib/Soft/Lib/Maths/vision_math.c b/ARDroneLib/Soft/Lib/Maths/vision_math.c new file mode 100644 index 0000000..fa33ebd --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/vision_math.c @@ -0,0 +1,255 @@ + +#include +#include + +extern float32_t used_focal; + +void euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat) +{ + float32_t cthe, sthe, cphi, sphi, cpsi, spsi; + + // Euler angles are now in radians + cthe = cosf(theta); + sthe = sinf(theta); + cphi = cosf(phi); + sphi = sinf(phi); + cpsi = cosf(psi); + spsi = sinf(psi); + + mat->m11 = cpsi* cthe; + mat->m12 = -spsi*cphi + cpsi*sthe*sphi; + mat->m13 = spsi*sphi + cpsi*sthe*cphi; + mat->m21 = spsi*cthe; + mat->m22 = cpsi*cphi + spsi*sthe*sphi; + mat->m23 = -cpsi*sphi + spsi*sthe*cphi; + mat->m31 = -sthe; + mat->m32 = cthe*sphi; + mat->m33 = cthe*cphi; +} + + +void frame_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat) +{ + float32_t cthe, sthe, cphi, sphi, cpsi, spsi; + float32_t m11, m12, m13, m21, m22, m23, m31, m32, m33; + // R_euler*Rc with Rc = [0 -1 0; 1 0 0; 0 0 1] + + // Euler angles are now in radians + cthe = cosf(theta); + sthe = sinf(theta); + cphi = cosf(phi); + sphi = sinf(phi); + cpsi = cosf(psi); + spsi = sinf(psi); + + m11 = cpsi* cthe; + m12 = -spsi*cphi + cpsi*sthe*sphi; + m13 = spsi*sphi + cpsi*sthe*cphi; + m21 = spsi*cthe; + m22 = cpsi*cphi + spsi*sthe*sphi; + m23 = -cpsi*sphi + spsi*sthe*cphi; + m31 = -sthe; + m32 = cthe*sphi; + m33 = cthe*cphi; + + + mat->m11= m12; + mat->m12 = -m11; + mat->m13 = m13; + mat->m21 = m22; + mat->m22 = -m21; + mat->m23 = m23; + mat->m31 = m32; + mat->m32 = -m31; + mat->m33 = m33; +} + +void vertical_frame_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat) +{ + float32_t cthe, sthe, cphi, sphi, cpsi, spsi; + float32_t m11, m12, m13, m21, m22, m23, m31, m32, m33; + // R_euler*Rc with Rc = [0 -1 0; 1 0 0; 0 0 1] + + // Euler angles are now in radians + cthe = cosf(theta); + sthe = sinf(theta); + cphi = cosf(phi); + sphi = sinf(phi); + cpsi = cosf(psi); + spsi = sinf(psi); + + m11 = cpsi* cthe; + m12 = -spsi*cphi + cpsi*sthe*sphi; + m13 = spsi*sphi + cpsi*sthe*cphi; + m21 = spsi*cthe; + m22 = cpsi*cphi + spsi*sthe*sphi; + m23 = -cpsi*sphi + spsi*sthe*cphi; + m31 = -sthe; + m32 = cthe*sphi; + m33 = cthe*cphi; + + + mat->m11= m12; + mat->m12 = -m11; + mat->m13 = m13; + mat->m21 = m22; + mat->m22 = -m21; + mat->m23 = m23; + mat->m31 = m32; + mat->m32 = -m31; + mat->m33 = m33; +} + +void horizontal_frame_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat) +{ + float32_t cthe, sthe, cphi, sphi, cpsi, spsi; + float32_t m11, m12, m13, m21, m22, m23, m31, m32, m33; + // R_euler*Rc with Rc = [ 0 0 1; 1 0 0; 0 1 0 ] + + // Euler angles are now in radians + cthe = cosf(theta); + sthe = sinf(theta); + cphi = cosf(phi); + sphi = sinf(phi); + cpsi = cosf(psi); + spsi = sinf(psi); + + m11 = cpsi* cthe; + m12 = -spsi*cphi + cpsi*sthe*sphi; + m13 = spsi*sphi + cpsi*sthe*cphi; + m21 = spsi*cthe; + m22 = cpsi*cphi + spsi*sthe*sphi; + m23 = -cpsi*sphi + spsi*sthe*cphi; + m31 = -sthe; + m32 = cthe*sphi; + m33 = cthe*cphi; + + mat->m11 = m12; + mat->m12 = m13; + mat->m13 = m11; + mat->m21 = m22; + mat->m22 = m23; + mat->m23 = m21; + mat->m31 = m32; + mat->m32 = m33; + mat->m33 = m31; +} + +void max_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat) +{ + float32_t cthe, sthe, cphi, sphi, cpsi, spsi; + float32_t m11, m12, m13, m21, m22, m23, m31, m32, m33; + // R_euler*Rc with Rc = [ 0 1 0; 0 0 -1; -1 0 0 ] + + // Euler angles are now in radians + cthe = cosf(theta); + sthe = sinf(theta); + cphi = cosf(phi); + sphi = sinf(phi); + cpsi = cosf(psi); + spsi = sinf(psi); + + m11 = cpsi* cthe; + m12 = -spsi*cphi + cpsi*sthe*sphi; + m13 = spsi*sphi + cpsi*sthe*cphi; + m21 = spsi*cthe; + m22 = cpsi*cphi + spsi*sthe*sphi; + m23 = -cpsi*sphi + spsi*sthe*cphi; + m31 = -sthe; + m32 = cthe*sphi; + m33 = cthe*cphi; + + + mat->m11 = -m13; + mat->m12 = m11; + mat->m13 = -m12; + mat->m21 = -m23; + mat->m22 = m21; + mat->m23 = -m22; + mat->m31 = -m33; + mat->m32 = m31; + mat->m33 = -m32; +} + +void integrated_gyros_matrix(float32_t delta_theta, float32_t delta_phi, float32_t delta_psi, matrix33_t *matproj) +{ + // for the case which used integrated gyros + // projection matrix used for cancelling rotation between two frames + // ie transpose(Rc) * matrot * Rc + // with Rc = [0 -1 0; 1 0 0; 0 0 1] + // matrot = [1 delta_psi -delta_theta ; -delta_psi 1 delta_phi; delta_theta -delta_phi 1] + + matproj->m11 = 1.0; + matproj->m12 = delta_psi; + matproj->m13 = delta_phi; + matproj->m21 = -delta_psi; + matproj->m22 = 1.0; + matproj->m23 = delta_theta; + matproj->m31 = -delta_phi; + matproj->m32 = -delta_theta; + matproj->m33 = 1.0; +} + +void frame_euler_angles(vector31_t *angles, matrix33_t *R) +{ + angles->x = (float32_t)asin(-R->m31); + angles->y = (float32_t)atan2(R->m32, R->m33); + angles->z = (float32_t)atan2(R->m21, R->m11); + + if (angles->z < 0) + angles->z += 2*PI; +} + +void horizontal_frame_euler_angles(vector31_t *angles, matrix33_t *R) +{ + angles->x = (float32_t)asin(-R->m33); + angles->y = (float32_t)atan2(R->m31, R->m32); + angles->z = (float32_t)atan2(R->m23, R->m13); + + if (angles->z < 0) + angles->z += 2*PI; +} + +void proj_point(screen_point_t *point, screen_point_t *center, matrix33_t *mat, vector21_t *out) +{ + float32_t denom; + int32_t x_centre = point->x - center->x; + int32_t y_centre = point->y - center->y; + + denom = mat->m31*x_centre/used_focal + mat->m32*y_centre/used_focal + mat->m33; + + out->x = (float32_t)center->x + ( mat->m11*x_centre + mat->m12*y_centre + mat->m13*used_focal) / denom; + out->y = (float32_t)center->y + ( mat->m21*x_centre + mat->m22*y_centre + mat->m23*used_focal ) / denom; +} + +void proj_pointf(vector21_t *point, screen_point_t *center, matrix33_t *mat, vector21_t *out) +{ + float32_t denom; + float32_t x_centre = point->x - (float32_t)center->x; + float32_t y_centre = point->y - (float32_t)center->y; + + denom = mat->m31*x_centre/used_focal + mat->m32*y_centre/used_focal + mat->m33; + + out->x = (float32_t)center->x + ( mat->m11*x_centre + mat->m12*y_centre + mat->m13*used_focal) / denom; + out->y = (float32_t)center->y + ( mat->m21*x_centre + mat->m22*y_centre + mat->m23*used_focal ) / denom; +} + + +void vision_direction_result(vector21_t *t, screen_point_t *v, int32_t threshold) +{ + float32_t norm, angle; + + norm = t->x*t->x + t->y*t->y; + + if (norm < threshold*threshold) + { + v->x = 0; + v->y = 0; + } + else + { + angle = (float32_t)atan2(t->y,t->x); + v->x = (angle >= -3*PI/8) * (angle <= 3*PI/8) - (angle <= -5*PI/8) - (angle >= 5*PI/8); + v->y = (angle >= PI/8) * (angle <= 7*PI/8) - (angle >= - 7*PI/8) * (angle <= -PI/8); + } +} diff --git a/ARDroneLib/Soft/Lib/Maths/vision_math.h b/ARDroneLib/Soft/Lib/Maths/vision_math.h new file mode 100644 index 0000000..7a0a2d7 --- /dev/null +++ b/ARDroneLib/Soft/Lib/Maths/vision_math.h @@ -0,0 +1,74 @@ + +#ifndef _STAGES_VISION_MATH_INCLUDE_ +#define _STAGES_VISION_MATH_INCLUDE_ + +#include +#include + +/** + * @fn Compute the matrix of uav pose in space + * @param float32_t theta : euler angle + * @param float32_t phi : euler angle + * @param float32_t psi : euler angle + * @param matrix *mat + * @return VOID +*/ +void +euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat); +void +horizontal_frame_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat); +void +vertical_frame_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat); +void +max_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat); + +/** + * @fn Compute the matrix of uav pose in space R_euler*Rc, in camera basis + * @param float32_t theta : euler angle + * @param float32_t phi : euler angle + * @param float32_t psi : euler angle + * @param matrix *mat + * @return VOID +*/ +void +frame_euler_matrix(float32_t theta, float32_t phi, float32_t psi, matrix33_t *mat); + +void +frame_euler_angles(vector31_t *angles, matrix33_t *R); +void +horizontal_frame_euler_angles(vector31_t *angles, matrix33_t *R); + +/** + * @fn Compute the matrix which projects points from frame (t-1) to frame (t) : tr(Rc)*Rot*Rc + * @param float32_t delta_theta : integrated gyro in theta + * @param float32_t delta_phi : integrated gyro in phi + * @param float32_t delta_psi : integrated gyro in psi + * @param matrix *matproj + * @return VOID +*/ +void +integrated_gyros_matrix(float32_t delta_theta, float32_t delta_phi, float32_t delta_psi, matrix33_t *matproj); + +/** + * @fn compute projection of a point on a plane + * @param int x : first coordinate + * @param int y : second coordinate + * @param int centerx : first coordinate of the image center + * @param int centery : second coordinate of the image center + * @param matrix mat : projection matrix + * @param float *u : first coordinate of result + * @param float *v : second coordinate of result + * @return VOID +*/ +void +proj_point(screen_point_t *point, screen_point_t *center, matrix33_t *mat, vector21_t *out); + +void +proj_pointf(vector21_t *point, screen_point_t *center, matrix33_t *mat, vector21_t *out); + +void +vision_direction_result(vector21_t *t, screen_point_t *v, int32_t threshold); + + +#endif // ! _STAGES_VISION_MATH_INCLUDE_ + diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/AT/ardrone_at_mutex.c b/ARDroneLib/Soft/Lib/ardrone_tool/AT/ardrone_at_mutex.c new file mode 100644 index 0000000..345081e --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/AT/ardrone_at_mutex.c @@ -0,0 +1,882 @@ +/******************************************************************** + * COPYRIGHT PARROT 2010 + ******************************************************************** + * PARROT MODULES + *-----------------------------------------------------------------*/ +/** + * @file ardrone_at.c + * @brief . + * + * @author K. Leplat + * @date Mon Feb 1 10:30:50 2010 + * + * + *******************************************************************/ +#include +#include +#include +#include + +//Common +#include +#include +#include + +//SDK +#include +#include + +//GNU STANDARD C LIBRARY +#include + +/******************************************************************** + * Constants + *******************************************************************/ +#define MAX_BUF_SIZE 256 + +/******************************************************************** + * Static variables and types + *******************************************************************/ +AT_CODEC_MSG_IDS ids; +static uint32_t at_init = 0; +static vp_os_mutex_t at_mutex; +static uint32_t nb_sequence = 0; +static vp_com_socket_t at_socket; +static AT_CODEC_FUNCTIONS_PTRS func_ptrs; +static Write atcodec_write = NULL; +static Read atcodec_read = NULL; + +// Navdata +float32_t nd_iphone_gaz=0; +float32_t nd_iphone_yaw=0; +int32_t nd_iphone_flag = 0; +float32_t nd_iphone_phi=0; +float32_t nd_iphone_theta=0; + +/******************************************************************** + * Static function declarations + *******************************************************************/ +static void atcodec_init( AT_CODEC_FUNCTIONS_PTRS *funcs ); +void ardrone_at_shutdown ( void ); +AT_CODEC_ERROR_CODE atresu_error(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id); +AT_CODEC_ERROR_CODE atresu_ok(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id); +AT_CODEC_ERROR_CODE host_init( void ); +AT_CODEC_ERROR_CODE host_shutdown( void ); +AT_CODEC_ERROR_CODE host_enable( void ); +AT_CODEC_ERROR_CODE host_open( void ); +AT_CODEC_ERROR_CODE host_close( void ); +AT_CODEC_ERROR_CODE host_write(int8_t *buffer, int32_t *len); +AT_CODEC_ERROR_CODE host_read(int8_t *buffer, int32_t *len); + + +/******************************************************************** + * Static functions + *******************************************************************/ +AT_CODEC_ERROR_CODE atresu_ok(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE atresu_error(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE host_init( void ) +{ + if( func_ptrs.init != NULL ) + func_ptrs.init(); + +# undef ATCODEC_DEFINE_AT_CMD +# define ATCODEC_DEFINE_AT_CMD(ID,Str,From,Cb,Prio) \ + if((ids.ID = ATcodec_Add_Defined_Message(Str)) == -1) \ + { \ + return AT_CODEC_INIT_ERROR; \ + } + +# undef ATCODEC_DEFINE_AT_RESU +# define ATCODEC_DEFINE_AT_RESU(ID,Str,From,Cb) \ + if((ids.ID = ATcodec_Add_Hashed_Message(Str,ids.From,Cb,0)) == -1) \ + { \ + return AT_CODEC_INIT_ERROR; \ + } + +# include + + return AT_CODEC_INIT_OK; +} + +AT_CODEC_ERROR_CODE host_shutdown( void ) +{ + if( func_ptrs.shutdown != NULL ) + func_ptrs.shutdown(); + + ardrone_at_shutdown(); + + return AT_CODEC_SHUTDOWN_OK; +} + +AT_CODEC_ERROR_CODE host_enable( void ) +{ + if( func_ptrs.enable != NULL ) + return func_ptrs.enable(); + + /* Only used with ARDrone */ + return AT_CODEC_ENABLE_OK; +} + +AT_CODEC_ERROR_CODE host_open( void ) +{ + static bool_t init_ok = FALSE; + + if( func_ptrs.open != NULL ) + return func_ptrs.open(); + + if( !init_ok ) + { + COM_CONFIG_SOCKET_AT(&at_socket, VP_COM_CLIENT, AT_PORT, wifi_ardrone_ip); + at_socket.protocol = VP_COM_UDP; + + if(VP_FAILED(vp_com_init(COM_AT()))) + { + PRINT ("Failed to init AT\n"); + vp_com_shutdown( COM_AT() ); + return AT_CODEC_OPEN_ERROR; + } + + if(VP_FAILED(vp_com_open(COM_AT(), &at_socket, &atcodec_read, &atcodec_write))) + { + PRINT ("Failed to open AT\n"); + return AT_CODEC_OPEN_ERROR; + } + + init_ok = TRUE; + } + + return AT_CODEC_OPEN_OK; +} + +AT_CODEC_ERROR_CODE host_close( void ) +{ + if( func_ptrs.close != NULL ) + return func_ptrs.close(); + + vp_com_close(COM_AT(), &at_socket); + + return AT_CODEC_CLOSE_OK; +} + +AT_CODEC_ERROR_CODE host_write(int8_t *buffer, int32_t *len) +{ + if( func_ptrs.write != NULL ) + return func_ptrs.write( buffer, len ); + + if( atcodec_write != NULL ) + { + return VP_FAILED(atcodec_write(&at_socket, buffer, len)) ? AT_CODEC_WRITE_ERROR : AT_CODEC_WRITE_OK; + } + + return AT_CODEC_WRITE_OK; +} + +AT_CODEC_ERROR_CODE host_read(int8_t *buffer, int32_t *len) +{ + if( func_ptrs.read != NULL ) + return func_ptrs.read( buffer, len ); + + return AT_CODEC_READ_OK; +} + +static void atcodec_init( AT_CODEC_FUNCTIONS_PTRS *funcs ) +{ + if( funcs != NULL) + { + memcpy(&func_ptrs, funcs, sizeof(*funcs)); + } + +#if defined (_MSC_VER) + + AT_CODEC_FUNCTIONS_PTRS ptrs = + { + /*init*/host_init, + /*shutdown*/host_shutdown, + /*enable*/host_enable, + /*open*/host_open, + /*close*/host_close, + /*write*/host_write, + /*read*/host_read + }; +#else + AT_CODEC_FUNCTIONS_PTRS ptrs = + { + .init = host_init, + .shutdown = host_shutdown, + .enable = host_enable, + .open = host_open, + .close = host_close, + .read = host_read, + .write = host_write, + }; +#endif + vp_os_mutex_init(&at_mutex); + ATcodec_Init_Library( &ptrs ); +} + +/******************************************************************** + * Public functions + *******************************************************************/ +void ardrone_at_set_ui_value( uint32_t value ) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_RC_REF_EXE, + ++nb_sequence, + value ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_pmode( int32_t pmode ) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_PMODE_EXE, + ++nb_sequence, + pmode ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_ui_misc(int32_t m1, int32_t m2, int32_t m3, int32_t m4) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_MISC_EXE, + ++nb_sequence, + m1, + m2, + m3, + m4 ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_anim( anim_mayday_t type, int32_t timeout ) +{ + int32_t animtype = type; + + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_ANIM_EXE, + ++nb_sequence, + animtype, + timeout ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_flat_trim(void) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_FTRIM_EXE, + ++nb_sequence ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_manual_trims(float32_t trim_pitch, float32_t trim_roll, float32_t trim_yaw) +{ + float_or_int_t _trim_pitch, _trim_roll, _trim_yaw; + if (!at_init) + return; + + _trim_pitch.f = trim_pitch; + _trim_roll.f = trim_roll; + _trim_yaw.f = trim_yaw; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_MTRIM_EXE, + ++nb_sequence, + _trim_pitch.i, + _trim_roll.i, + _trim_yaw.i); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_control_gains( api_control_gains_t* gains ) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_GAIN_EXE, + ++nb_sequence, + gains->pq_kp, gains->r_kp, gains->r_ki, gains->ea_kp, gains->ea_ki, + gains->alt_kp, gains->alt_ki, gains->vz_kp, gains->vz_ki, + gains->hovering_kp, gains->hovering_ki, + gains->hovering_b_kp, gains->hovering_b_ki); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_vision_track_params( api_vision_tracker_params_t* params ) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_VISP_EXE, + ++nb_sequence, + params->coarse_scale, + params->nb_pair, + params->loss_per, + params->nb_tracker_width, + params->nb_tracker_height, + params->scale, + params->trans_max, + params->max_pair_dist, + params->noise ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_start_raw_capture(void) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_RAWC_EXE, + ++nb_sequence); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_zap( ZAP_VIDEO_CHANNEL channel ) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_ZAP_EXE, + ++nb_sequence, + channel ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_cad( CAD_TYPE type, float32_t tag_size ) +{ + float_or_int_t size; + size.f = tag_size; + + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_CAD_EXE, + ++nb_sequence, + type, + size.i); + vp_os_mutex_unlock(&at_mutex); +} + +/******************************************************************** + * ardrone_at_set_progress_cmd: + *-----------------------------------------------------------------*/ +/** + * @param enable 1,with pitch,roll and 0,without pitch,roll. + * @param pitch Using floating value between -1 to +1. + * @param roll Using floating value between -1 to +1. + * @param gaz Using floating value between -1 to +1. + * @param yaw Using floating value between -1 to +1. + * + * @brief + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_set_progress_cmd( int32_t flag, float32_t phi, float32_t theta, float32_t gaz, float32_t yaw ) +{ + float_or_int_t _phi, _theta, _gaz, _yaw; + + if (!at_init) + return; + + _phi.f = phi; + _theta.f = theta; + _gaz.f = gaz; + _yaw.f = yaw; + + // Saving values to set them in navdata_file + nd_iphone_flag=flag; + nd_iphone_phi=phi; + nd_iphone_theta=theta; + nd_iphone_gaz=gaz; + nd_iphone_yaw=yaw; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_PCMD_EXE, + ++nb_sequence, + flag, + _phi.i, + _theta.i, + _gaz.i, + _yaw.i ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_led_animation ( LED_ANIMATION_IDS anim_id, float32_t freq, uint32_t duration_sec ) +{ + float_or_int_t _freq; + + if (!at_init) + return; + + _freq.f = freq; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_LED_EXE, + ++nb_sequence, + anim_id, + _freq.i, + duration_sec); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_vision_update_options(int32_t user_vision_option) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_VISO_EXE, + ++nb_sequence, + user_vision_option); + vp_os_mutex_unlock(&at_mutex); +} + +/******************************************************************** + * ardrone_at_set_polaris_pos: + *-----------------------------------------------------------------*/ +void ardrone_at_set_polaris_pos( float32_t fx, float32_t fy, float32_t fpsi, bool_t defined, int32_t time_us ) +{ + float_or_int_t x, y, psi; + + if (!at_init) + return; + + x.f = fx; + y.f = fy; + psi.f = fpsi; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_POLARIS_EXE, + ++nb_sequence, + x.i, + y.i, + psi.i, + defined, + time_us ); + vp_os_mutex_unlock(&at_mutex); +} + +void ardrone_at_set_vicon_data(struct timeval time, int32_t frame_number, float32_t latency, vector31_t global_translation, vector31_t global_rotation_euler) +{ + float_or_int_t _latency, _global_translation_x, _global_translation_y, _global_translation_z, _global_rotation_euler_x, _global_rotation_euler_y, + _global_rotation_euler_z; + + if (!at_init) + return; + + _latency.f = latency; + _global_translation_x.f = global_translation.x; + _global_translation_y.f = global_translation.y; + _global_translation_z.f = global_translation.z; + _global_rotation_euler_x.f = global_rotation_euler.x; + _global_rotation_euler_y.f = global_rotation_euler.y; + _global_rotation_euler_z.f = global_rotation_euler.z; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_VICON_EXE, + ++nb_sequence, + (int)time.tv_sec, + (int)time.tv_usec, + (int)frame_number, + _latency.i, + _global_translation_x.i, + _global_translation_y.i, + _global_translation_z.i, + _global_rotation_euler_x.i, + _global_rotation_euler_y.i, + _global_rotation_euler_z.i); + + vp_os_mutex_unlock(&at_mutex); +} + +/******************************************************************** + * ardrone_at_set_toy_configuration_ids: + *-----------------------------------------------------------------*/ +/** + * @param param A key as read from an ini file is given as "section:key". + * + * @param value + * + * @brief identified ardrone_at_set_toy_configuration + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_set_toy_configuration_ids(const char* param,char* ses_id, char* usr_id, char* app_id, const char* value) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_CONFIG_IDS, + ++nb_sequence, + ses_id, + usr_id, + app_id ); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_CONFIG_EXE, + ++nb_sequence, + param, + value ); + vp_os_mutex_unlock(&at_mutex); +} + +/******************************************************************** + * ardrone_at_reset_com_watchdog: + *-----------------------------------------------------------------*/ +/** + * @brief Re-connect with the ARDrone. + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_reset_com_watchdog(void) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_RESET_COM_WATCHDOG, + ++nb_sequence ); + vp_os_mutex_unlock(&at_mutex); +} + +/******************************************************************** + * ardrone_at_update_control_mode: + *-----------------------------------------------------------------*/ +/** + * @param what_to_do + * + * @param filesize + * + * @brief . + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_update_control_mode(uint32_t what_to_do, uint32_t filesize) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_CTRL_EXE, + ++nb_sequence, + what_to_do, + filesize ); + vp_os_mutex_unlock(&at_mutex); +} + +/******************************************************************** + * ardrone_at_configuration_get_ctrl_mode: + *-----------------------------------------------------------------*/ +/** + * @brief Request to receive configuration file. + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_configuration_get_ctrl_mode(void) +{ + if (!at_init) + return; + + ardrone_at_update_control_mode( CFG_GET_CONTROL_MODE, 0 ); +} + +/* Stephane - multiconfiguration support */ +void ardrone_at_custom_configuration_get_ctrl_mode(void) +{ + printf("%s %s %i\n",__FILE__,__FUNCTION__,__LINE__); + if (!at_init) + return; + + ardrone_at_update_control_mode( CUSTOM_CFG_GET_CONTROL_MODE, 0 ); +} + +/******************************************************************** + * ardrone_at_configuration_ack_ctrl_mode: + *-----------------------------------------------------------------*/ +/** + * @brief Signal to the drone that the file has been received. + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_configuration_ack_ctrl_mode(void) +{ + if (!at_init) + return; + + ardrone_at_update_control_mode( ACK_CONTROL_MODE, 0 ); +} + +/******************************************************************** + * ardrone_at_set_pwm: . + *-----------------------------------------------------------------*/ +/** + * @param p1 + * + * @param p2 + * + * @param p3 + * + * @param p4 + * + * @brief . + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_set_pwm(int32_t p1, int32_t p2, int32_t p3, int32_t p4) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_PWM_EXE, + ++nb_sequence, + p1, + p2, + p3, + p4 ); + vp_os_mutex_unlock(&at_mutex); +} + +/******************************************************************** + * ardrone_at_set_autonomous_flight: Enables / disables the autopilot. + *-----------------------------------------------------------------*/ +/** + * @param isActive Integer set to 1 to enable the autopilot. + * + * @brief Enables / disables the autopilot. + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_set_autonomous_flight( int32_t isActive ) +{ + if (!at_init) + return; + + vp_os_mutex_lock(&at_mutex); + ATcodec_Queue_Message_valist( ids.AT_MSG_ATCMD_AUTONOMOUS_FLIGHT_EXE, + ++nb_sequence, + isActive ); + vp_os_mutex_unlock(&at_mutex); +} + +static inline void strtolower(char *str) +{ + int i; + for(i = 0 ; str[i] != '\0' ; i++) + str[i] = (char)tolower((int)str[i]); +} + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +ARDRONE_CONFIGURATION_PROTOTYPE(NAME) \ +{ \ + C_RESULT res = C_FAIL; \ + char msg[64]; \ + if(strcmp("" #INI_TYPE, "INI_FLOAT") == 0) \ + { \ + sprintf( &msg[0], "%f", *((float*)value)); \ + res = C_OK; \ + } \ + if(strcmp("" #INI_TYPE, "INI_DOUBLE") == 0) \ + { \ + sprintf( &msg[0], "%lf", *((double*)value)); \ + res = C_OK; \ + } \ + else if(strcmp("" #INI_TYPE, "INI_INT") == 0) \ + { \ + sprintf( &msg[0], "%d", *((int*)value)); \ + res = C_OK; \ + } \ + else if(strcmp("" #INI_TYPE, "INI_BOOLEAN") == 0) \ + { \ + sprintf( &msg[0], *((bool_t*)value) ? "TRUE" : "FALSE"); \ + res = C_OK; \ + } \ + if(res == C_OK) \ + { \ + char tmp[64]; \ + strcpy(&tmp[0], KEY); \ + strtolower(&tmp[0]); \ + strcat(tmp, ":" #NAME); \ + ardrone_at_set_toy_configuration_ids( &tmp[0], ses_id, usr_id, app_id, &msg[0] ); \ + } \ + return res; \ +} + +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) + +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +ARDRONE_CONFIGURATION_PROTOTYPE(NAME) \ +{ \ + C_RESULT res = C_FAIL; \ + if(value != NULL) \ + { \ + char tmp[64]; \ + strcpy(&tmp[0], KEY); \ + strtolower(&tmp[0]); \ + strcat(&tmp[0], ":" #NAME); \ + ardrone_at_set_toy_configuration_ids( &tmp[0], ses_id, usr_id, app_id, ((C_TYPE_PTR)value) ); \ + res = C_OK; \ + } \ + return res; \ +} + +#include // must be included before to have types + + + +/******************************************************************** + * ardrone_at_init_with_funcs: Init at command with ATCodec funcs + *-----------------------------------------------------------------*/ +/** + * @param void + * + * @brief Fill structure AT codec + * and built the library AT commands. + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_init_with_funcs ( const char* ip, size_t ip_len, AT_CODEC_FUNCTIONS_PTRS *funcs) +{ + if ( at_init ) + return; + + VP_OS_ASSERT( ip_len < MAX_BUF_SIZE ); + + vp_os_memcpy( &wifi_ardrone_ip[0], ip, ip_len); + wifi_ardrone_ip[ip_len]='\0'; + + atcodec_init (funcs); + + at_init = 1; +} + +/******************************************************************** + * ardrone_at_shutdown: Close at command. + *-----------------------------------------------------------------*/ +/** + * @param void + * + * @brief + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_shutdown ( void ) +{ + if ( !at_init ) + return; + + ATcodec_Shutdown_Library(); + vp_os_mutex_destroy(&at_mutex); + + at_init = 0; +} + +/******************************************************************** + * ardrone_at_init: Init at command. + *-----------------------------------------------------------------*/ +/** + * @param void + * + * @brief Fill structure AT codec + * and built the library AT commands. + * + * @DESCRIPTION + * + *******************************************************************/ +void ardrone_at_init ( const char* ip, size_t ip_len) +{ + if ( at_init ) + return; + + VP_OS_ASSERT( ip_len < MAX_BUF_SIZE ); + + if(wifi_ardrone_ip!=ip){ + vp_os_memcpy( &wifi_ardrone_ip[0], ip, ip_len); + } + wifi_ardrone_ip[ip_len]='\0'; + + atcodec_init (NULL); + + at_init = 1; +} + +/******************************************************************** + * ardrone_at_open: Open at command socket. + *-----------------------------------------------------------------*/ +/** + * @param void + * + * @brief Open at command socket. + * + * @DESCRIPTION + * + *******************************************************************/ +ATCODEC_RET ardrone_at_open ( void ) +{ + if ( !at_init ) + return ATCODEC_FALSE; + + return host_open()==AT_CODEC_OPEN_OK?ATCODEC_TRUE:ATCODEC_FALSE; +} + +/******************************************************************** + * ardrone_at_send: Send all pushed messages. + *-----------------------------------------------------------------*/ +/** + * @param void + * + * @brief Send all pushed messages. + * + * @DESCRIPTION + * + *******************************************************************/ +ATCODEC_RET ardrone_at_send ( void ) +{ + C_RESULT res; + + if ( !at_init ) + return ATCODEC_FALSE; + + res = ATcodec_Send_Messages(); + + return res; +} + diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_com.h b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_com.h new file mode 100644 index 0000000..2717727 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_com.h @@ -0,0 +1,12 @@ +#ifndef _CONFIG_COM_H_ +#define _CONFIG_COM_H_ + +#include + +#define NUM_ATTEMPTS 10 + +#include + +#include + +#endif // _CONFIG_COM_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.c b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.c new file mode 100644 index 0000000..15463ed --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.c @@ -0,0 +1,108 @@ +#include + +#include +#include + +#ifndef _WIN32 + +vp_com_t* serial_com(void) +{ + static vp_com_t com = { + VP_COM_SERIAL, + FALSE, + 0, +#ifdef _WIN32 + 0, +#else + PTHREAD_MUTEX_INITIALIZER, +#endif + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* serial_config_0(void) +{ + static vp_com_serial_config_t config = { + SERIAL_LINK_0, + VP_COM_BAUDRATE_115200, + SL0_BAUDRATE, + 1, + 0, + 0 + }; + + return (vp_com_config_t*) &config; +} + +vp_com_config_t* serial_config_1(void) +{ + static vp_com_serial_config_t config = { + SERIAL_LINK_1, + VP_COM_BAUDRATE_115200, + SL1_BAUDRATE, + 1, + 0, + 1 + }; + + return (vp_com_config_t*) &config; +} + +vp_com_config_t* serial_config_2(void) +{ + static vp_com_serial_config_t config = { + SERIAL_LINK_2, + VP_COM_BAUDRATE_115200, + SL2_BAUDRATE, + 1, + 0, + 0 + }; + + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* serial_connection_0(void) +{ + static vp_com_connection_t connection = { 0 }; + + return &connection; +} + +vp_com_connection_t* serial_connection_1(void) +{ + static vp_com_connection_t connection = { 0 }; + + return &connection; +} + +vp_com_connection_t* serial_connection_2(void) +{ + static vp_com_connection_t connection = { 0 }; + + return &connection; +} + +void serial_config_socket(vp_com_socket_t* socket, VP_COM_SOCKET_TYPE type) +{ + vp_os_memset(socket, 0, sizeof(vp_com_socket_t)); + + socket->type = type; +} + +#endif diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.h b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.h new file mode 100644 index 0000000..a2cc559 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_serial.h @@ -0,0 +1,53 @@ +#ifndef _CONFIG_SERIAL_H_ +#define _CONFIG_SERIAL_H_ + +#ifndef _CONFIG_COM_H_ +#error "You cannot include config_serial.h. Please include config_com.h instead." +#endif + + +#include + +/// Initializations for serial communication +/// Serial link 0 is used for navdata & ATCmd +/// Serial link 1 is used for video +/// Serial link 2 is used for communication with ADC + +// Each tools must implement this functions +extern vp_com_t* serial_com(void); +extern vp_com_config_t* serial_config_0(void); +extern vp_com_config_t* serial_config_1(void); +extern vp_com_config_t* serial_config_2(void); +extern vp_com_connection_t* serial_connection_0(void); +extern vp_com_connection_t* serial_connection_1(void); +extern vp_com_connection_t* serial_connection_2(void); + +void serial_config_socket(vp_com_socket_t* socket, VP_COM_SOCKET_TYPE type); + +#ifdef USE_NAVDATA_SERIAL + #define COM_NAVDATA() serial_com() + #define COM_CONFIG_NAVDATA() serial_config_0() + #define COM_CONNECTION_NAVDATA() serial_connection_0() + #define COM_CONFIG_SOCKET_NAVDATA(socket, type, opt, serverhost) serial_config_socket(socket, type) +#endif // USE_NAVDATA_SERIAL + +#ifdef USE_AT_SERIAL + #define COM_AT() serial_com() + #define COM_CONFIG_AT() serial_config_0() + #define COM_CONNECTION_AT() serial_connection_0() + #define COM_CONFIG_SOCKET_AT(socket, type, opt, serverhost) serial_config_socket(socket, type) +#endif // USE_NAVDATA_SERIAL + +#ifdef USE_VIDEO_SERIAL + #define COM_VIDEO() serial_com() + #define COM_CONFIG_VIDEO() serial_config_1() + #define COM_CONNECTION_VIDEO() serial_connection_1() + #define COM_CONFIG_SOCKET_VIDEO(socket, type, opt, serverhost) serial_config_socket(socket, type) + + #define COM_RAW_CAPTURE() serial_com() + #define COM_CONFIG_RAW_CAPTURE() serial_config_2() + #define COM_CONNECTION_RAW_CAPTURE() serial_connection_2() + #define COM_CONFIG_SOCKET_RAW_CAPTURE(socket, type, opt, serverhost) serial_config_socket(socket, type) +#endif // USE_VIDEO_SERIAL + +#endif // _CONFIG_SERIAL_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.c b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.c new file mode 100644 index 0000000..e611e27 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.c @@ -0,0 +1,226 @@ +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#define BUFFER_SIZE 1024 +#define AUTH_MAX_NUMRETRIES 3 +#define AUTH_MSG "PARROT AUTH" +#define AUTH_MSG_OK "PARROT AUTH OK" + +vp_com_t* wifi_com(void) +{ + static vp_com_t com = { + VP_COM_WIFI, + FALSE, + 0, +#ifdef _WIN32 + { 0 }, +#else // ! USE_MINGW32 + PTHREAD_MUTEX_INITIALIZER, +#endif // ! USE_MINGW32 + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +C_RESULT wifi_server_auth(struct in_addr *addr) +{ + Read read = NULL; + Write write = NULL; + C_RESULT result = C_FAIL; + int numretries = 1; + int8_t recvString[BUFFER_SIZE]; /* Buffer for received string */ + int recvStringLen; /* Length of received string */ + struct timeval tv = {0, 500000}; + int on=1; + const int8_t msg[] = AUTH_MSG; + struct in_addr to; + struct in_addr from; + + vp_com_socket_t socket; + + // Initialize sending socket + to.s_addr = htonl(WIFI_BROADCAST_ADDR); + COM_CONFIG_SOCKET_AUTH(&socket, VP_COM_CLIENT, AUTH_PORT, inet_ntoa(to)); + socket.protocol = VP_COM_UDP; + + if(VP_FAILED(vp_com_init(COM_AUTH()))) + { + printf("Failed to init Authentification\n"); + vp_com_shutdown( COM_AUTH() ); + return C_FAIL; + } + + if(VP_FAILED(vp_com_open(COM_AUTH(), &socket, &read, &write))) + { + printf("Failed to open Authentification\n"); + vp_com_shutdown( COM_AUTH() ); + return C_FAIL; + } + + if (setsockopt((int)socket.priv, SOL_SOCKET, SO_BROADCAST,(char *)&on,sizeof(on)) < 0) + { + printf("Failed to set socket option Authentification\n"); + vp_com_close(COM_AUTH(), &socket); + vp_com_shutdown( COM_AUTH() ); + return C_FAIL; + } + + if (setsockopt((int)socket.priv, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) + { + printf("Failed to set socket option Authentification\n"); + vp_com_close(COM_AUTH(), &socket); + vp_com_shutdown( COM_AUTH() ); + return C_FAIL; + } + + do + { + int len = strlen((char*)msg); + if(write != NULL) + { + if (VP_FAILED(write(&socket, msg, &len))) + { + vp_com_close(COM_AUTH(), &socket); + vp_com_shutdown( COM_AUTH() ); + return C_FAIL; + } + } + + printf("Wait authentification\n"); + do + { + if(read != NULL) + { + recvStringLen = BUFFER_SIZE; + if(VP_FAILED(read(&socket, recvString, &recvStringLen))) + { + vp_com_close(COM_AUTH(), &socket); + vp_com_shutdown( COM_AUTH()); + return C_FAIL; + } + } + + recvString[recvStringLen] = '\0'; + } + while((recvStringLen != 0) && (strcmp((char *)recvString, AUTH_MSG) == 0)); + } + while((strcmp((char *)recvString, AUTH_MSG_OK) != 0) && (numretries++ < AUTH_MAX_NUMRETRIES)); + + if(strcmp((char*)recvString, AUTH_MSG_OK) == 0) + { + from.s_addr = socket.scn; + printf("Authentification ok from %s:%d\n", inet_ntoa(from), socket.port); + memcpy(addr, &from, sizeof(struct in_addr)); + result = C_OK; + } + + vp_com_close(COM_AUTH(), &socket); + vp_com_shutdown( COM_AUTH() ); + + return result; +} + +vp_com_config_t* wifi_config(void) +{ + static vp_com_wifi_config_t config = + { + { 0 }, + WIFI_MOBILE_IP, + WIFI_NETMASK, + WIFI_BROADCAST, + WIFI_GATEWAY, + WIFI_SERVER, + WIFI_INFRASTRUCTURE, + WIFI_SECURE, + WIFI_PASSKEY, + { 0 }, + }; + + struct ifaddrs * ifAddrStructHead = NULL; + struct ifaddrs * ifAddrStruct = NULL; + struct in_addr tmpAddr; + bool_t found = FALSE; + + if(strlen(config.itfName) == 0) + { + getifaddrs(&ifAddrStruct); + ifAddrStructHead = ifAddrStruct; + + while (!found && (ifAddrStruct != NULL)) + { + // Looking for WIFI interface's IP address corresponding to WIFI_BASE_ADDR + if (ifAddrStruct->ifa_addr->sa_family == AF_INET) + { + tmpAddr = ((struct sockaddr_in *)ifAddrStruct->ifa_addr)->sin_addr; + if ( (ntohl(tmpAddr.s_addr) & 0xFFFFFF00) == WIFI_BASE_ADDR ) + { + inet_ntop(AF_INET, &tmpAddr, config.localHost, VP_COM_NAME_MAXSIZE); + memcpy(config.itfName, ifAddrStruct->ifa_name, strlen(ifAddrStruct->ifa_name)); + if(VP_FAILED(wifi_server_auth(&tmpAddr))) + tmpAddr.s_addr = htonl ( ntohl(tmpAddr.s_addr) - ( ( ( ntohl(tmpAddr.s_addr) & 0xFF ) - 1 ) % 5 ) ); + memcpy(config.server, inet_ntoa(tmpAddr), strlen(inet_ntoa(tmpAddr))); + tmpAddr = ((struct sockaddr_in *)ifAddrStruct->ifa_netmask)->sin_addr; + inet_ntop(AF_INET, &tmpAddr, config.netmask, VP_COM_NAME_MAXSIZE); + tmpAddr = ((struct sockaddr_in *)ifAddrStruct->ifa_broadaddr)->sin_addr; + inet_ntop(AF_INET, &tmpAddr, config.broadcast, VP_COM_NAME_MAXSIZE); + found = TRUE; + } + } + ifAddrStruct = ifAddrStruct->ifa_next; + } + + if (ifAddrStructHead != NULL) + { + freeifaddrs(ifAddrStructHead); + } + } + + return (vp_com_config_t*)&config; +} + +vp_com_connection_t* wifi_connection(void) +{ + static vp_com_wifi_connection_t connection = { + 0, + WIFI_NETWORK_NAME + }; + + return (vp_com_connection_t*) &connection; +} + +void wifi_config_socket(vp_com_socket_t* socket, VP_COM_SOCKET_TYPE type, int32_t port, const char* serverhost) +{ + vp_os_memset(socket, 0, sizeof(vp_com_socket_t)); + + socket->type = type; + socket->protocol = VP_COM_TCP; + socket->port = port; + + if(serverhost && socket->type == VP_COM_CLIENT) + strcpy(socket->serverHost, serverhost); +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.h b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.h new file mode 100644 index 0000000..4189328 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Com/config_wifi.h @@ -0,0 +1,59 @@ +#ifndef _CONFIG_WIFI_H_ +#define _CONFIG_WIFI_H_ + +#ifndef _CONFIG_COM_H_ +#error "You cannot include config_wifi.h. Please include config_com.h instead." +#endif + + +#include + +// Each tools must implement this functions +extern vp_com_t* wifi_com(void); +extern vp_com_config_t* wifi_config(void); +extern vp_com_connection_t* wifi_connection(void); + +void wifi_config_socket(vp_com_socket_t* socket, VP_COM_SOCKET_TYPE type, int32_t port, const char* serverhost); + +#ifdef USE_NAVDATA_IP + #define COM_NAVDATA() wifi_com() + #define COM_CONFIG_NAVDATA() wifi_config() + #define COM_CONNECTION_NAVDATA() wifi_connection() + #define COM_CONFIG_SOCKET_NAVDATA(socket, type, opt, serverhost) wifi_config_socket(socket, type, opt, serverhost) +#endif // USE_NAVDATA_IP + +#ifdef USE_AT_IP + #define COM_AT() wifi_com() + #define COM_CONFIG_AT() wifi_config() + #define COM_CONNECTION_AT() wifi_connection() + #define COM_CONFIG_SOCKET_AT(socket, type, opt, serverhost) wifi_config_socket(socket, type, opt, serverhost) +#endif // USE_NAVDATA_IP + +#ifdef USE_VIDEO_IP + #define COM_VIDEO() wifi_com() + #define COM_CONFIG_VIDEO() wifi_config() + #define COM_CONNECTION_VIDEO() wifi_connection() + #define COM_CONFIG_SOCKET_VIDEO(socket, type, opt, serverhost) wifi_config_socket(socket, type, opt, serverhost) + + #define COM_RAW_CAPTURE() wifi_com() + #define COM_CONFIG_RAW_CAPTURE() wifi_config() + #define COM_CONNECTION_RAW_CAPTURE() wifi_connection() + #define COM_CONFIG_SOCKET_RAW_CAPTURE(socket, type, opt, serverhost) wifi_config_socket(socket, type, opt, serverhost) +#endif // USE_VIDEO_IP + +#define COM_AUTH() wifi_com() +#define COM_CONFIG_AUTH() wifi_config() +#define COM_CONNECTION_AUTH() wifi_connection() +#define COM_CONFIG_SOCKET_AUTH(socket, type, opt, serverhost) wifi_config_socket(socket, type, opt, serverhost) + +#define COM_CONTROL() wifi_com() +#define COM_CONFIG_CONTROL() wifi_config() +#define COM_CONNECTION_CONTROL() wifi_connection() +#define COM_CONFIG_SOCKET_CONTROL(socket, type, opt, serverhost) wifi_config_socket(socket, type, opt, serverhost) + +#define COM_REMOTE_CONSOLE() wifi_com() +#define COM_CONFIG_REMOTE_CONSOLE() wifi_config() +#define COM_CONNECTION_REMOTE_CONSOLE() wifi_connection() +#define COM_CONFIG_SOCKET_REMOTE_CONSOLE(socket, type, opt, serverhost) wifi_config_socket(socket, type, opt, serverhost) + +#endif // _CONFIG_WIFI_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.c b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.c new file mode 100644 index 0000000..20d2164 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.c @@ -0,0 +1,323 @@ +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _WIN32 +#include +#include +#include +#include +#include +#endif + +static vp_com_socket_t control_socket; +static Read control_read = NULL; +static Write control_write = NULL; + +static vp_os_mutex_t control_mutex; +static vp_os_cond_t control_cond; + +static bool_t control_waited; +static bool_t bContinue = TRUE; +static uint32_t ardrone_state; + +static int32_t start_index_in_queue; +static int32_t end_index_in_queue; +static ardrone_control_event_ptr_t ardrone_control_event_queue[ARDRONE_CONTROL_MAX_NUM_EVENTS_IN_QUEUE]; + +static vp_os_mutex_t event_queue_mutex; + +C_RESULT ardrone_control_init(void) +{ + COM_CONFIG_SOCKET_CONTROL(&control_socket, VP_COM_CLIENT, CONTROL_PORT, wifi_ardrone_ip); + + control_waited = FALSE; + ardrone_state = 0; + + vp_os_mutex_init(&control_mutex); + vp_os_cond_init(&control_cond, &control_mutex); + + vp_os_mutex_init(&event_queue_mutex); + + start_index_in_queue = 0; + end_index_in_queue = (start_index_in_queue - 1) & (ARDRONE_CONTROL_MAX_NUM_EVENTS_IN_QUEUE - 1); + + return C_OK; +} + +C_RESULT ardrone_control_shutdown(void) +{ + ardrone_control_resume_on_navdata_received(0); + /*BUG FIX : Dont destroy the mutexes here, + they are still being used by the ardrone_control thread, + while this function is called by another thread.*/ + #ifdef THIS_IS_A_BUG + vp_os_mutex_destroy(&event_queue_mutex); + vp_os_cond_destroy(&control_cond); + vp_os_mutex_destroy(&control_mutex);*/ + #endif + + bContinue = FALSE; + + return C_OK; +} + +C_RESULT ardrone_control_connect_to_drone() +{ + int res_open_socket; + +#ifdef _WIN32 + int timeout_windows=1000;/*milliseconds*/ +#else + struct timeval tv; +#endif + + vp_com_close(COM_CONTROL(), &control_socket); + + res_open_socket = vp_com_open(COM_CONTROL(), &control_socket, &control_read, &control_write); + if( VP_SUCCEEDED(res_open_socket) ) + { + tv.tv_sec = 1; + tv.tv_usec = 0; + + setsockopt((int32_t)control_socket.priv, + SOL_SOCKET, + SO_RCVTIMEO, + #ifdef _WIN32 + (const char*)&timeout_windows, sizeof(timeout_windows) + #else + (const char*)&tv, sizeof(tv) + #endif + ); + + control_socket.is_disable = FALSE; + return C_OK; + } + else + { + DEBUG_PRINT_SDK("VP_Com : Failed to open socket for control\n"); + perror("FTOSFC"); + return C_FAIL; + } +} + + +/** + * \brief Signals the client control thread that new navdata were received. + * Called by one of the navdata callbacks. + */ +C_RESULT ardrone_control_resume_on_navdata_received(uint32_t new_ardrone_state) +{ + vp_os_mutex_lock(&control_mutex); + if( control_waited ) + { + ardrone_state = new_ardrone_state; + vp_os_cond_signal(&control_cond); + } + vp_os_mutex_unlock(&control_mutex); + return C_OK; +} + +C_RESULT ardrone_control_read(int8_t* buffer, int32_t* size) +{ + C_RESULT res = C_FAIL; + + if( control_read != NULL ) + { + res = control_read(&control_socket, (int8_t*) buffer, size); + if(*size == 0) + { + res = C_FAIL; + } + } + + return res; +} + +C_RESULT ardrone_control_write(const int8_t* buffer, int32_t* size) +{ + C_RESULT res = C_FAIL; + + if( control_write != NULL ) + { + res = control_write(&control_socket, buffer, size); + } + + return res; +} + +C_RESULT ardrone_control_send_event( ardrone_control_event_t* event ) +{ + C_RESULT res; + int32_t next_index_in_queue; + + res = C_FAIL; + + vp_os_mutex_lock(&event_queue_mutex); + next_index_in_queue = (start_index_in_queue + 1) & (ARDRONE_CONTROL_MAX_NUM_EVENTS_IN_QUEUE - 1); + if( next_index_in_queue != end_index_in_queue ) + { + ardrone_control_event_queue[start_index_in_queue] = event; + start_index_in_queue = next_index_in_queue; + + res = C_OK; + } + + vp_os_mutex_unlock(&event_queue_mutex); + + return res; +} + +DEFINE_THREAD_ROUTINE( ardrone_control, nomParams ) +{ + C_RESULT res_wait_navdata = C_OK; + C_RESULT res = C_OK; + uint32_t retry, current_ardrone_state; + int32_t next_index_in_queue; + ardrone_control_event_ptr_t current_event; + + retry = 0; + current_event = NULL; + + DEBUG_PRINT_SDK("Thread control in progress...\n"); + control_socket.is_disable = TRUE; + + ardrone_control_connect_to_drone(); + + while( bContinue + && !ardrone_tool_exit() ) + { + vp_os_mutex_lock(&control_mutex); + control_waited = TRUE; + + /* Wait for new navdata to be received. */ + res_wait_navdata = vp_os_cond_timed_wait(&control_cond, 1000); + vp_os_mutex_unlock(&control_mutex); + + /* + * In case of timeout on the navdata, we assume that there was a problem + * with the Wifi connection. + * It is then safer to close and reopen the control socket (TCP 5559) since + * some OS might stop giving data but not signal any disconnection. + */ + if(VP_FAILED(res_wait_navdata)) + { + DEBUG_PRINT_SDK("Timeout while waiting for new navdata.\n"); + if(!control_socket.is_disable) + control_socket.is_disable = TRUE; + } + + if(control_socket.is_disable) + { + ardrone_control_connect_to_drone(); + } + + if(VP_SUCCEEDED(res_wait_navdata) && (!control_socket.is_disable)) + { + vp_os_mutex_lock(&control_mutex); + current_ardrone_state = ardrone_state; + control_waited = FALSE; + vp_os_mutex_unlock(&control_mutex); + + if( ardrone_tool_exit() ) // Test if we received a signal because we are quitting the application + THREAD_RETURN( res ); + + if( current_event == NULL ) + { + vp_os_mutex_lock(&event_queue_mutex); + next_index_in_queue = (end_index_in_queue + 1) & (ARDRONE_CONTROL_MAX_NUM_EVENTS_IN_QUEUE - 1); + + if( next_index_in_queue != start_index_in_queue ) + { // There's an event to process + current_event = ardrone_control_event_queue[next_index_in_queue]; + if( current_event != NULL ) + { + if( current_event->ardrone_control_event_start != NULL ) + { + current_event->ardrone_control_event_start( current_event ); + } + } + end_index_in_queue = next_index_in_queue; + + retry = 0; + } + + vp_os_mutex_unlock(&event_queue_mutex); + } + + if( current_event != NULL ) + { + switch( current_event->event ) + { + case ARDRONE_UPDATE_CONTROL_MODE: + res = ardrone_control_soft_update_run( current_ardrone_state, (ardrone_control_soft_update_event_t*) current_event ); + break; + + case PIC_UPDATE_CONTROL_MODE: + res = ardrone_control_soft_update_run( current_ardrone_state, (ardrone_control_soft_update_event_t*) current_event ); + break; + + case LOGS_GET_CONTROL_MODE: + break; + + case CFG_GET_CONTROL_MODE: + case CUSTOM_CFG_GET_CONTROL_MODE: /* multiconfiguration support */ + res = ardrone_control_configuration_run( current_ardrone_state, (ardrone_control_configuration_event_t*) current_event ); + break; + + case ACK_CONTROL_MODE: + res = ardrone_control_ack_run( current_ardrone_state, (ardrone_control_ack_event_t *) current_event); + break; + + default: + break; + } + + if( VP_FAILED(res) ) + { + retry ++; + if( retry > current_event->num_retries) + current_event->status = ARDRONE_CONTROL_EVENT_FINISH_FAILURE; + } + else + { + retry = 0; + } + + if( current_event->status & ARDRONE_CONTROL_EVENT_FINISH ) + { + if( current_event->ardrone_control_event_end != NULL ) + current_event->ardrone_control_event_end( current_event ); + + /* Make the thread read a new event on the next loop iteration */ + current_event = NULL; + } + else + { + /* Not changing 'current_event' makes the loop process the same + * event when the next navdata packet arrives. */ + } + } + } + }// while + + /* Stephane : Bug fix - mutexes were previously detroyed by another thread, + which made ardrone_control crash.*/ + vp_os_mutex_destroy(&event_queue_mutex); + vp_os_cond_destroy(&control_cond); + vp_os_mutex_destroy(&control_mutex); + + vp_com_close(COM_CONTROL(), &control_socket); + + THREAD_RETURN( res ); +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.h b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.h new file mode 100644 index 0000000..7cbdd40 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control.h @@ -0,0 +1,46 @@ +#ifndef _ARDRONE_TOOL_CONTROL_H_ +#define _ARDRONE_TOOL_CONTROL_H_ + +#include +#include + +#define ARDRONE_CONTROL_MAX_NUM_EVENTS_IN_QUEUE 32 + +typedef enum _ardrone_control_event_status_t { + ARDRONE_CONTROL_EVENT_IDLE = 0x0000, + ARDRONE_CONTROL_EVENT_WAITING = 0x1000, + ARDRONE_CONTROL_EVENT_IN_PROGRESS = 0x2000, + ARDRONE_CONTROL_EVENT_FINISH = 0x4000, + ARDRONE_CONTROL_EVENT_FINISH_SUCCESS = 0x4001, + ARDRONE_CONTROL_EVENT_FINISH_FAILURE = 0x4002 +} ardrone_control_event_status_t; + +struct _ardrone_control_event_t; + +typedef void (*ardrone_control_event_cb)( struct _ardrone_control_event_t* event ); + +typedef struct _ardrone_control_event_t { + + uint32_t event; // event type + uint32_t num_retries; // number of times we'll try to execute this event + uint32_t status; // event status + + ardrone_control_event_cb ardrone_control_event_start; + ardrone_control_event_cb ardrone_control_event_end; + + uint8_t data[]; // User data associated with this event + +} ardrone_control_event_t, *ardrone_control_event_ptr_t; + +C_RESULT ardrone_control_init(void); +C_RESULT ardrone_control_shutdown(void); +C_RESULT ardrone_control_resume_on_navdata_received(uint32_t ardrone_state); + +C_RESULT ardrone_control_read(int8_t* buffer, int32_t* size); +C_RESULT ardrone_control_write(const int8_t* buffer, int32_t* size); + +C_RESULT ardrone_control_send_event( ardrone_control_event_t* event ); + +PROTO_THREAD_ROUTINE( ardrone_control, nomParams ); + +#endif // _ARDRONE_TOOL_CONTROL_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.c b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.c new file mode 100644 index 0000000..f5b5bbc --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.c @@ -0,0 +1,35 @@ +#include +#include +#include + +C_RESULT ardrone_control_ack_run( uint32_t ardrone_state, ardrone_control_ack_event_t* event ) +{ + C_RESULT res; + + switch( event->ack_state ) + { + case ACK_COMMAND_MASK_TRUE: + res = ( ardrone_state & ARDRONE_COMMAND_MASK ) ? C_OK : C_FAIL; + if( VP_SUCCEEDED(res) ) + { + ardrone_at_update_control_mode( ACK_CONTROL_MODE, 0); + event->ack_state = ACK_COMMAND_MASK_FALSE; + } + break; + + case ACK_COMMAND_MASK_FALSE: + ardrone_at_update_control_mode( ACK_CONTROL_MODE, 0); + + res = ( ( ardrone_state & ARDRONE_COMMAND_MASK ) == 0 ) ? C_OK : C_FAIL; + if( VP_SUCCEEDED(res) ) + event->status = ARDRONE_CONTROL_EVENT_FINISH_SUCCESS; + break; + + default: + res = C_FAIL; + event->ack_state = ACK_COMMAND_MASK_TRUE; // Go back to a know state (we may timeout) + break; + } + + return res; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h new file mode 100644 index 0000000..4c8a13c --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_ack.h @@ -0,0 +1,26 @@ +#ifndef _ARDRONE_CONTROL_ACK_H_ +#define _ARDRONE_CONTROL_ACK_H_ + +#include + +typedef enum _ardrone_ack_state_t { + ACK_COMMAND_MASK_TRUE, // First we are waiting command mask goes true + ACK_COMMAND_MASK_FALSE, // Then we are waiting after its reset +} ardrone_ack_state_t; + +typedef struct _ardrone_control_ack_event_t { + + uint32_t event; // event type + uint32_t num_retries; // number of times we'll try to execute this event + uint32_t status; // event status + + ardrone_control_event_cb ardrone_control_event_start; + ardrone_control_event_cb ardrone_control_event_end; + + ardrone_ack_state_t ack_state; + +} ardrone_control_ack_event_t; + +C_RESULT ardrone_control_ack_run( uint32_t ardrone_state, ardrone_control_ack_event_t* event ); + +#endif // _ARDRONE_CONTROL_CONFIGURATION_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.c b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.c new file mode 100644 index 0000000..706fce6 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.c @@ -0,0 +1,376 @@ +#include +#include + +#include + +#include + +#include + +static int8_t ini_buffer[ARDRONE_CONTROL_CONFIGURATION_INI_BUFFER_SIZE]; +static uint32_t ini_buffer_index = 0; + +static void set_state(ardrone_control_configuration_event_t* event, ardrone_config_state_t s) +{ + DEBUG_PRINT_SDK("[CONTROL CONFIGURATION] Switching to state %d\n", s); + + event->config_state = s; +} + +static inline void noprintf(char *s,...){} + +/* Activate debugging this file */ + //#define DEBUG_CONFIG_RECEIVE PRINT + #define DEBUG_CONFIG_RECEIVE noprintf + +//extern const char * custom_configuration_headers[NB_CONFIG_CATEGORIES]; +//extern custom_configuration_list_t available_configurations[NB_CONFIG_CATEGORIES]; + +void ardrone_control_reset_custom_configurations_list(custom_configuration_list_t *available_configurations) +{ + int i; + + for (i=0;i\n"); + /* Go to the beginning of a section */ + while((*pindex)!='[') { index++; pindex++; if (pindex==end_of_buffer) return; } + /* Search the end of the section name */ + for (;index\n",custom_configuration_headers[j]); + break; + } + } + if (j==NB_CONFIG_CATEGORIES) { DEBUG_CONFIG_RECEIVE("Unknown category."); return ;} + /* Reset the list */ + if (current_scope!=NULL) + { + current_scope->nb_configurations = 0; + if (current_scope->list!=NULL) { vp_os_free(current_scope->list); current_scope->list = NULL; } + } + /* Points on the first ID */ + index++; + pindex=buffer+index; + + /* Read the IDs */ + while(pindex %i\n",*pindex,index); + for (;index description <%s>\n",id,description); + index++; + pindex=buffer+index; + + /* Store the found ID */ + /* Increase the size of the list by one element */ + current_scope->list = vp_os_realloc(current_scope->list,sizeof(*current_scope->list)*(current_scope->nb_configurations+1)); + /* Store the new element */ + strncpy(current_scope->list[current_scope->nb_configurations].id, + id, + sizeof(current_scope->list[current_scope->nb_configurations].id) ); + strncpy(current_scope->list[current_scope->nb_configurations].description, + description, + sizeof(current_scope->list[current_scope->nb_configurations].description) ); + current_scope->nb_configurations++; + } + } + return; +} + + + +/** + * \brief Runs a control event managing the configuration file. + * This functions handles reading the configuration information + * sent by the drone on the TCP 'control' socket on port 5559. + * Called by the 'ardrone_control' thread loop in 'ardrone_control.c'. + */ +C_RESULT ardrone_control_configuration_run( uint32_t ardrone_state, ardrone_control_configuration_event_t* event ) +{ + int32_t buffer_size; + char *start_buffer, *buffer; + char *value, *param, *c; + bool_t ini_buffer_end, ini_buffer_more; + C_RESULT res = C_OK; + int bytes_to_read; + + /* Multiconfiguration support */ + static char *custom_configuration_list_buffer = NULL; + static int custom_configuration_list_buffer_size = 0; + static int custom_configuration_list_data_size = 0; + #define CUSTOM_CFG_BLOCK_SIZE 1024 + + int i; + + switch( event->config_state ) + { + case CONFIG_REQUEST_INI: + if( ardrone_state & ARDRONE_COMMAND_MASK ) + { + /* If the ACK bit is set, we must ask the drone to clear it before asking the configuration. */ + DEBUG_CONFIG_RECEIVE("%s %s %i - Requesting ack. bit reset.\n",__FILE__,__FUNCTION__,__LINE__); + ardrone_at_update_control_mode(ACK_CONTROL_MODE, 0); + } + else + { + DEBUG_CONFIG_RECEIVE("%s %s %i - Requesting the configuration.\n",__FILE__,__FUNCTION__,__LINE__); + ini_buffer_index = 0; + ardrone_at_configuration_get_ctrl_mode(); + set_state(event, CONFIG_RECEIVE_INI); + } + break; + + /* multi-configuration support */ + case CUSTOM_CONFIG_REQUEST: + DEBUG_CONFIG_RECEIVE("%s %s %i\n",__FILE__,__FUNCTION__,__LINE__); + if( ardrone_state & ARDRONE_COMMAND_MASK ) + { + DEBUG_CONFIG_RECEIVE("%s %s %i - Requesting ack. bit reset.\n",__FILE__,__FUNCTION__,__LINE__); + ardrone_at_update_control_mode(ACK_CONTROL_MODE, 0); + } + else + { + DEBUG_CONFIG_RECEIVE("%s %s %i - Requesting the custom config.\n",__FILE__,__FUNCTION__,__LINE__); + custom_configuration_list_buffer = NULL; + custom_configuration_list_buffer_size = 0; + custom_configuration_list_data_size = 0; + ardrone_at_custom_configuration_get_ctrl_mode(); + set_state(event, CUSTOM_CONFIG_RECEIVE); + } + break; + + case CONFIG_RECEIVE_INI: + DEBUG_CONFIG_RECEIVE("%s %s %i - Trying to read the control socket.\n",__FILE__,__FUNCTION__,__LINE__); + // Read data coming from ARDrone + buffer_size = ARDRONE_CONTROL_CONFIGURATION_INI_BUFFER_SIZE - ini_buffer_index; + res = ardrone_control_read( &ini_buffer[ini_buffer_index], &buffer_size ); + DEBUG_CONFIG_RECEIVE("Received <<%s>>\n",&ini_buffer[ini_buffer_index]); + if(VP_SUCCEEDED(res)) + { + buffer_size += ini_buffer_index; + + ini_buffer[buffer_size]=0; // Makes sure the buffer ends with a zero + + // Parse received data + if( buffer_size > 0 ) + { + //DEBUG_CONFIG_RECEIVE(" Searching value\n"); + + ini_buffer_end = ini_buffer[buffer_size-1] == '\0'; // End of configuration data + ini_buffer_more = ini_buffer[buffer_size-1] != '\n'; // Need more configuration data to end parsing current line + + //if (ini_buffer_end) DEBUG_CONFIG_RECEIVE(" ini_buffer_end\n"); + //if (ini_buffer_more) DEBUG_CONFIG_RECEIVE(" ini_buffer_more\n"); + + start_buffer = (char*)&ini_buffer[0]; + buffer = strchr(start_buffer, '\n'); + + //DEBUG_CONFIG_RECEIVE("Le start buffer : <<%s>>\n",start_buffer); + + while( buffer != NULL ) + { + //DEBUG_CONFIG_RECEIVE(" Found an '\\n' \n"); + + value = start_buffer; + param = strchr(value, '='); + + *buffer = '\0'; + *param = '\0'; + + // Remove spaces at end of strings + c = param - 1; + while( *c == ' ' ) + { + *c = '\0'; + c = c-1; + } + + c = buffer-1; + while( *c == ' ' ) + { + *c = '\0'; + c = c-1; + } + + // Remove spaces at beginning of strings + while( *value == ' ' ) + { + value = value + 1; + } + + param = param + 1; + while( *param == ' ' ) + { + param = param + 1; + } + + DEBUG_CONFIG_RECEIVE(" Decoding from control stream : <%s>=<%s>\n",value,param); + iniparser_setstring( event->ini_dict, value, param ); + + start_buffer = buffer + 1; + buffer = strchr(start_buffer, '\n'); + } + + if( ini_buffer_end ) + { + /* Reading the condfiguration is finished, we ask the drone + * to clear the ACK bit */ + ardrone_at_update_control_mode(ACK_CONTROL_MODE, 0); + set_state(event, CONFIG_RECEIVED); + } + else if( ini_buffer_more ) + { + // Compute number of bytes to copy + int32_t size = (int32_t)&ini_buffer[buffer_size] - (int32_t)start_buffer; + vp_os_memcpy( &ini_buffer[0], start_buffer, size ); + ini_buffer_index = size; + } + else + { + /* The previous line was completely consumed - next data + * from the network will be stored at the beginning of the + * buffer. */ + ini_buffer_index = 0; + } + } + } + else + { + res = C_FAIL; + + DEBUG_CONFIG_RECEIVE("%s %s %i - no data to read from the control socket.\n",__FILE__,__FUNCTION__,__LINE__); + + if(!(ardrone_state & ARDRONE_COMMAND_MASK)) + set_state(event, CONFIG_REQUEST_INI); + } + break; + + case CUSTOM_CONFIG_RECEIVE: + DEBUG_CONFIG_RECEIVE("%s %s %i - Trying to read the control socket.\n",__FILE__,__FUNCTION__,__LINE__); + DEBUG_CONFIG_RECEIVE("%s %s %i\n",__FILE__,__FUNCTION__,__LINE__); + /* Read data until a zero byte is received */ + + /* Clear old data from the buffer when receiving the first bytes */ + if (custom_configuration_list_buffer!=NULL && custom_configuration_list_data_size==0){ + vp_os_memset(custom_configuration_list_buffer,0,custom_configuration_list_buffer_size); + } + + /* Enlarge the buffer if needed */ + if (custom_configuration_list_data_size==custom_configuration_list_buffer_size) + { + custom_configuration_list_buffer_size += CUSTOM_CFG_BLOCK_SIZE; + custom_configuration_list_buffer = vp_os_realloc(custom_configuration_list_buffer,custom_configuration_list_buffer_size); + } + /* Read data at the end of the buffer */ + bytes_to_read = custom_configuration_list_buffer_size - custom_configuration_list_data_size; + res = ardrone_control_read( &custom_configuration_list_buffer[custom_configuration_list_data_size], &bytes_to_read ); + DEBUG_CONFIG_RECEIVE(" Reading %i bytes of the custom config. list\n",bytes_to_read); + for (i=0;i",custom_configuration_list_buffer[i]); } + + /* Searches a zero */ + if (VP_SUCCEEDED(res)) + { + custom_configuration_list_data_size += bytes_to_read; + for (i=bytes_to_read;i>0;i--){ + if (custom_configuration_list_buffer[custom_configuration_list_data_size - i] == 0) { + + /* Reading the condfiguration is finished, we ask the drone + * to clear the ACK bit */ + DEBUG_CONFIG_RECEIVE("Finished receiving\n"); + ardrone_at_update_control_mode(ACK_CONTROL_MODE, 0); + set_state(event, CUSTOM_CONFIG_RECEIVED); + + ardrone_control_reset_custom_configurations_list(available_configurations); + + ardrone_control_read_custom_configurations_list(custom_configuration_list_buffer, + custom_configuration_list_data_size, + available_configurations); + + /* Clean up */ + vp_os_sfree(&custom_configuration_list_buffer); + custom_configuration_list_buffer_size = 0; + custom_configuration_list_data_size = 0; + res = C_OK; + break; + } + } + + } + else{ + /* No data are available on the control socket. */ + DEBUG_CONFIG_RECEIVE("%s %s %i - no data to read from the control socket.\n",__FILE__,__FUNCTION__,__LINE__); + /* Reset the buffer */ + custom_configuration_list_data_size = 0; + /* The request for the configuration file should have been acknowledged by the drone. + * If not, another request is sent. */ + if(!(ardrone_state & ARDRONE_COMMAND_MASK)) set_state(event, CUSTOM_CONFIG_REQUEST); + } + + break; + + + case CONFIG_RECEIVED: + case CUSTOM_CONFIG_RECEIVED: + /* We finished reading the configuration, we wait for the drone to reset the ACK bit */ + if( ardrone_state & ARDRONE_COMMAND_MASK ) + { + /* If the ACK bit is set, we must ask the drone to clear it before asking the configuration. */ + PRINT("%s %s %i - Requesting ack. bit reset.\n",__FILE__,__FUNCTION__,__LINE__); + ardrone_at_update_control_mode(ACK_CONTROL_MODE, 0); + } + else + { + PRINT("%s %s %i - Finished.\n",__FILE__,__FUNCTION__,__LINE__); + event->status = ARDRONE_CONTROL_EVENT_FINISH_SUCCESS; + } + res = C_OK; + break; + + + default: + res = C_FAIL; + break; + } + + return res; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h new file mode 100644 index 0000000..b3d08e0 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_configuration.h @@ -0,0 +1,39 @@ +#ifndef _ARDRONE_CONTROL_CONFIGURATION_H_ +#define _ARDRONE_CONTROL_CONFIGURATION_H_ + +#include +#include + +#include + +// Size of temporary buffer used to parse incoming configuration data +// This value should be big enough to hold a line from the config file +#define ARDRONE_CONTROL_CONFIGURATION_INI_BUFFER_SIZE 1024 + +typedef enum _ardrone_config_state_t { + CONFIG_REQUEST_INI, + CONFIG_RECEIVE_INI, + /* Stephane - multiconfiguration support */ + CUSTOM_CONFIG_REQUEST, + CUSTOM_CONFIG_RECEIVE, + CONFIG_RECEIVED, + CUSTOM_CONFIG_RECEIVED +} ardrone_config_state_t; + +typedef struct _ardrone_control_configuration_event_t { + + uint32_t event; // event type + uint32_t num_retries; // number of times we'll try to execute this event + uint32_t status; // event status + + ardrone_control_event_cb ardrone_control_event_start; + ardrone_control_event_cb ardrone_control_event_end; + + ardrone_config_state_t config_state; + dictionary* ini_dict; + +} ardrone_control_configuration_event_t; + +C_RESULT ardrone_control_configuration_run( uint32_t ardrone_state, ardrone_control_configuration_event_t* event ); + +#endif // _ARDRONE_CONTROL_CONFIGURATION_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.c b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.c new file mode 100644 index 0000000..255c34e --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.c @@ -0,0 +1,58 @@ +#include + +#include +#include +#include + +int8_t* send_buffer = NULL; +int32_t send_buffer_size = 0; + +C_RESULT ardrone_control_soft_update_run( uint32_t ardrone_state, ardrone_control_soft_update_event_t* event ) +{ + C_RESULT res = C_OK; + + switch( event->ack_received ) + { + case 0: // First step - Reset command mask if needed + if( ardrone_state & ARDRONE_COMMAND_MASK ) + { + ardrone_at_update_control_mode(ACK_CONTROL_MODE, 0); + } + else + { + event->ack_received ++; + } + break; + case 1: + if( !(ardrone_state & ARDRONE_COMMAND_MASK) ) + { + ardrone_at_update_control_mode(event->event, event->filesize); + } + else + { + event->ack_received ++; + } + break; + + case 2: + if( (ardrone_state & ARDRONE_COMMAND_MASK) == 0) + { + if((ardrone_state & ARDRONE_FW_FILE_MASK) && (ardrone_state & ARDRONE_FW_VER_MASK)) + { + event->status = ARDRONE_CONTROL_EVENT_FINISH_SUCCESS; + event->error_state = FIRMWARE_NO_ERR; + } + else + { + event->status = ARDRONE_CONTROL_EVENT_FINISH_FAILURE; + if(ardrone_state & ARDRONE_FW_VER_MASK) + event->error_state = FIRMWARE_FILE_ERR; + else + event->error_state = FIRMWARE_VERSION_ERR; + } + } + break; + } + + return res; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.h b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.h new file mode 100644 index 0000000..a7fc434 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_control_soft_update.h @@ -0,0 +1,34 @@ +#ifndef _ARDRONE_CONTROL_SOFT_UPDATE_H_ +#define _ARDRONE_CONTROL_SOFT_UPDATE_H_ + +#include + +#include + +typedef enum _ardrone_control_soft_update_error_state_t +{ + FIRMWARE_NO_ERR, + FIRMWARE_FILE_ERR, + FIRMWARE_VERSION_ERR +} ardrone_control_soft_update_error_state_t; + +typedef struct _ardrone_control_soft_update_event_t { + + uint32_t event; // event type + uint32_t num_retries; // number of times we'll try to execute this event + uint32_t status; // event status + + ardrone_control_event_cb ardrone_control_event_start; + ardrone_control_event_cb ardrone_control_event_end; + + uint32_t ack_received; // Progress of this event + ardrone_control_soft_update_error_state_t error_state; + uint32_t filesize; + uint32_t sendsize; // Data size in bytes we'll send per write + FILE* fp; // Descriptor of opened file + +} ardrone_control_soft_update_event_t; + +C_RESULT ardrone_control_soft_update_run( uint32_t ardrone_state, ardrone_control_soft_update_event_t* event ); + +#endif // _ARDRONE_CONTROL_SOFT_UPDATE_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.c b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.c new file mode 100644 index 0000000..8f266b7 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.c @@ -0,0 +1,21 @@ +#include +#include + +C_RESULT ardrone_navdata_control_init( void* data ) +{ + return C_OK; +} + +C_RESULT ardrone_navdata_control_process( const navdata_unpacked_t* const navdata ) +{ + /* Signal the client control thread that new navdata arrived. + * The control thread can then decide, depending on the ACK bit value, + * to send AT commands to retrieve the configuration or set a configuration parameter. + */ + return ardrone_control_resume_on_navdata_received(navdata->ardrone_state); +} + +C_RESULT ardrone_navdata_control_release( void ) +{ + return C_OK; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h new file mode 100644 index 0000000..f829fbe --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Control/ardrone_navdata_control.h @@ -0,0 +1,14 @@ +#ifndef _ARDRONE_NAVDATA_CONTROL_H_ +#define _ARDRONE_NAVDATA_CONTROL_H_ + +#include + +// +// Handler that resume ardrone control thread when new navdatas are received +// + +C_RESULT ardrone_navdata_control_init( void* data ); +C_RESULT ardrone_navdata_control_process( const navdata_unpacked_t* const navdata ); +C_RESULT ardrone_navdata_control_release( void ); + +#endif // _ARDRONE_NAVDATA_CONTROL_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.c b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.c new file mode 100644 index 0000000..8f80831 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.c @@ -0,0 +1,423 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +static MULTICONFIG_STATE configState; +static NAVDATA_REQUEST_STATE navdataState; +static int appSwitch = 0; +static int usrSwitch = 0; +static int sesSwitch = 0; +static int navdataNeeded = 0; +static int droneSupportsMulticonfig = 0; + +#define __MULTICONFIGURATION_MIN_VERSION_MAJOR__ (1U) +#define __MULTICONFIGURATION_MIN_VERSION_MINOR__ (6U) +#define __MULTICONFIGURATION_MIN_VERSION_REVISION__ (0U) +#define __MULTICONFIGURATION_MIN_VERSION__ ((__MULTICONFIGURATION_MIN_VERSION_MAJOR__ << 16) | (__MULTICONFIGURATION_MIN_VERSION_MINOR__ << 8) | (__MULTICONFIGURATION_MIN_VERSION_REVISION__)) +static inline int versionSupportsMulticonfiguration (const char *currentString) +{ + uint32_t currentMajor = 0, currentMinor = 0, currentRevision = 0; + uint32_t currentVersion; + sscanf (currentString, "%d.%d.%d", ¤tMajor, ¤tMinor, ¤tRevision); + currentVersion = ((currentMajor << 16) | (currentMinor << 8) | (currentRevision)); + return currentVersion >= __MULTICONFIGURATION_MIN_VERSION__; +} + + +#define _GENERAL_NAVDATA_DEBUG (0) +#define _GENERAL_NAVDATA_DEBUG_PREFIX "General Navdata : " +#if _GENERAL_NAVDATA_DEBUG +#define PRINTDBG(...) \ +do \ +{ \ + printf ("[%d] %s", __LINE__, _GENERAL_NAVDATA_DEBUG_PREFIX);\ + printf (__VA_ARGS__); \ +} while (0) +#else +#define PRINTDBG(...) +#endif + +static void switchToSession(void) +{ + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (session_id, ses_id, NULL); +} + +static void switchToUser(void) +{ + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (profile_id, usr_id, NULL); +} + +static void switchToApplication(void) +{ + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (application_id , app_id, NULL); +} + +void configurationCallback (int res) +{ + PRINTDBG ("Config callback called with result %d\n", res); + if (0 != res) + { + PRINTDBG ("State : %d\n", configState); + switch (configState) + { + case MULTICONFIG_IN_PROGRESS_VERSION: // got config version + PRINTDBG ("Got config file\n"); + configState = MULTICONFIG_GOT_DRONE_VERSION; + break; + case MULTICONFIG_IN_PROGRESS_LIST: // got multiconfig ids + PRINTDBG ("Got ids list\n"); + configState = MULTICONFIG_GOT_IDS_LIST; + break; + case MULTICONFIG_IN_PROGRESS_IDS: + PRINTDBG ("Got current ids\n"); + configState = MULTICONFIG_GOT_CURRENT_IDS; + break; + case MULTICONFIG_IDLE: + case MULTICONFIG_GOT_IDS_LIST: + case MULTICONFIG_GOT_DRONE_VERSION: + case MULTICONFIG_GOT_CURRENT_IDS: + case MULTICONFIG_NEEDED: + case MULTICONFIG_REQUEST_NAVDATA: + default: + break; + } + } + PRINTDBG ("End of config callback call\n"); +} + +void navdataCallback (int res) +{ + PRINTDBG ("Navdata callback called with result %d\n", res); + if (0 != res) + { + PRINTDBG ("State : %d\n", navdataState); + switch (navdataState) + { + case NAVDATA_REQUEST_IN_PROGRESS: // Navdata request got acknowledged by the AR.Drone + navdataState = NAVDATA_REQUEST_IDLE; + break; + case NAVDATA_REQUEST_IDLE: + case NAVDATA_REQUEST_NEEDED: + default: + break; + } + } + PRINTDBG ("End of navdata callback call\n"); +} + +C_RESULT ardrone_general_navdata_init( void* data ) +{ + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (session_id, "-all", NULL); + + navdataState = NAVDATA_REQUEST_IDLE; + configState = MULTICONFIG_NEEDED; + appSwitch = 1; + usrSwitch = 1; + sesSwitch = 1; + navdataNeeded = 1; + + return C_OK; +} + +C_RESULT ardrone_general_navdata_process( const navdata_unpacked_t* const pnd ) +{ + navdata_mode_t current_navdata_state = NAVDATA_BOOTSTRAP; + + /* Makes sure the navdata stream will be resumed if the drone is disconnected and reconnected. + * Allows changing the drone battery during debugging sessions. */ + if( ardrone_get_mask_from_state(pnd->ardrone_state, ARDRONE_NAVDATA_BOOTSTRAP) ) + { + current_navdata_state = NAVDATA_BOOTSTRAP; + } + else + { + current_navdata_state = (ardrone_get_mask_from_state(pnd->ardrone_state, ARDRONE_NAVDATA_DEMO_MASK)) ? NAVDATA_DEMO : NAVDATA_FULL ; + } + + if (current_navdata_state == NAVDATA_BOOTSTRAP && configState == MULTICONFIG_IDLE && navdataState == NAVDATA_REQUEST_IDLE) + { + navdataState = NAVDATA_REQUEST_NEEDED; + } + + /* Multiconfig settings */ + int configIndex, userNeedInit, appNeedInit; + userNeedInit = 0; appNeedInit = 0; + switch (configState) + { + case MULTICONFIG_GOT_DRONE_VERSION: + PRINTDBG ("Checking drone version ...\n"); + // Check if drone version is >= 1.6 + if (versionSupportsMulticonfiguration (ardrone_control_config.num_version_soft)) + { + PRINTDBG ("Drone supports multiconfig\n"); + configState = MULTICONFIG_IN_PROGRESS_LIST; + ARDRONE_TOOL_CUSTOM_CONFIGURATION_GET (configurationCallback); + droneSupportsMulticonfig = 1; + } + else + { + PRINTDBG ("Drone does not support multiconfig\n"); + // Drone does not support multiconfig ... don't call init functions because we don't want to mess up things in default config + configState = MULTICONFIG_REQUEST_NAVDATA; + } + break; + case MULTICONFIG_GOT_IDS_LIST: + // At this point, we're sure that the AR.Drone supports multiconfiguration, so we'll wheck if our ids exists, and send them. + PRINTDBG ("Got AR.Drone ID list. Switch->%d,%d,%d. ND->%d\n", sesSwitch, usrSwitch, appSwitch, navdataNeeded); + if (1 == sesSwitch) + { + switchToSession(); // Go to session ... + } + + if (1 == appSwitch) + { + if (0 != strcmp(ardrone_control_config_default.application_id, app_id)) // Check for application only if we're not asking for the default one + { + appNeedInit = 1; + for (configIndex = 0; configIndex < available_configurations[CAT_APPLI].nb_configurations; configIndex++) // Check all existing app_ids + { + PRINTDBG ("Checking application %s (desc : %s)\n", available_configurations[CAT_APPLI].list[configIndex].id, + available_configurations[CAT_APPLI].list[configIndex].description); + if (0 == strcmp(available_configurations[CAT_APPLI].list[configIndex].id, app_id)) + { + PRINTDBG ("Found our application ... should not init\n"); + appNeedInit = 0; + break; + } + } + switchToApplication(); + } + else + { + PRINTDBG ("We're requesting default application (%s), do nothing.\n", app_id); + } + } + + if (1 == usrSwitch) + { + if (0 != strcmp(ardrone_control_config_default.profile_id, usr_id)) // Check for user only if we're not asking for the default one + { + userNeedInit = 1; + for (configIndex = 0; configIndex < available_configurations[CAT_USER].nb_configurations; configIndex++) // Check all existing user_ids + { + PRINTDBG ("Checking user %s (desc : %s)\n", available_configurations[CAT_USER].list[configIndex].id, + available_configurations[CAT_USER].list[configIndex].description); + if (0 == strcmp(available_configurations[CAT_USER].list[configIndex].id, usr_id)) + { + PRINTDBG ("Found our user ... should not init\n"); + userNeedInit = 0; + break; + } + } + switchToUser(); + } + else + { + PRINTDBG ("We're requesting default user (%s), do nothing.\n", usr_id); + } + } + + if (1 == appNeedInit) + { + // Send application defined default values + ardrone_tool_send_application_default(); + PRINTDBG ("Creating app. profile on AR.Drone\n"); + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (application_desc, app_name, NULL); + } + if (1 == userNeedInit) + { + // Send user defined default values + ardrone_tool_send_user_default(); + PRINTDBG ("Creating usr. profile on AR.Drone\n"); + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (profile_desc, usr_name, NULL); + } + if (1 == sesSwitch) + { + if (0 != strcmp(ardrone_control_config_default.session_id, ses_id)) // Send session info only if session is not the default one + { + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (session_desc, ses_name, NULL); + // Send session specific default values + ardrone_tool_send_session_default(); + } + else + { + PRINTDBG ("We're requesting default session (%s), do nothing.\n", ses_id); + } + } + configState = MULTICONFIG_IN_PROGRESS_IDS; + ARDRONE_TOOL_CONFIGURATION_GET (configurationCallback); + + case MULTICONFIG_GOT_CURRENT_IDS: + if (0 != strcmp(ardrone_control_config.session_id, ses_id) || + 0 != strcmp(ardrone_control_config.profile_id, usr_id) || + 0 != strcmp(ardrone_control_config.application_id, app_id)) + { + configState = MULTICONFIG_GOT_DRONE_VERSION; // We failed at setting up the application ids ... restart (but assume that drone supports multiconfig as we already checked) + } + else if (1 == navdataNeeded) + { + configState = MULTICONFIG_REQUEST_NAVDATA; + } + else + { + configState = MULTICONFIG_IDLE; + } + break; + case MULTICONFIG_NEEDED: + PRINTDBG ("Need to check multiconfig ... request config file\n"); + // Get config file for reset + configState = MULTICONFIG_IN_PROGRESS_VERSION; + ARDRONE_TOOL_CONFIGURATION_GET (configurationCallback); + break; + case MULTICONFIG_REQUEST_NAVDATA: + PRINTDBG ("Send application navdata demo/options\n"); + // Send application navdata demo/options to start navdatas from AR.Drone + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (navdata_demo, &ardrone_application_default_config.navdata_demo, NULL); + if (TRUE == ardrone_application_default_config.navdata_demo) + { // Send navdata options only for navdata demo mode + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (navdata_options, &ardrone_application_default_config.navdata_options, NULL); + } + configState = MULTICONFIG_IDLE; + break; + case MULTICONFIG_IDLE: + case MULTICONFIG_IN_PROGRESS_LIST: + case MULTICONFIG_IN_PROGRESS_VERSION: + case MULTICONFIG_IN_PROGRESS_IDS: + default: + break; + } + + /* Navdata request settings */ + switch (navdataState) + { + case NAVDATA_REQUEST_NEEDED: + PRINTDBG ("Resetting navdatas to %s\n", (0 == ardrone_application_default_config.navdata_demo) ? "full" : "demo"); + navdataState = NAVDATA_REQUEST_IN_PROGRESS; + switchToSession(); // Resend session id when reconnecting. + ARDRONE_TOOL_CONFIGURATION_ADDEVENT(navdata_demo, &ardrone_application_default_config.navdata_demo, NULL); + if (TRUE == ardrone_application_default_config.navdata_demo) + { // Send navdata options only for navdata demo mode + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (navdata_options, &ardrone_application_default_config.navdata_options, navdataCallback); + } + break; + case NAVDATA_REQUEST_IN_PROGRESS: + case NAVDATA_REQUEST_IDLE: + default: + break; + } + + return C_OK; +} + +C_RESULT ardrone_general_navdata_release( void ) +{ + return C_OK; +} + +/* User switch/list functions */ + + +/* User functions */ +void ardrone_refresh_user_list(void) +{ + if (1 == droneSupportsMulticonfig) + { + appSwitch = 0; + usrSwitch = 0; + sesSwitch = 0; + navdataNeeded = 0; + configState = MULTICONFIG_GOT_DRONE_VERSION; + } +} + +void ardrone_switch_to_user(const char *new_user) +{ + if (1 == droneSupportsMulticonfig) + { + ardrone_gen_usrid (new_user, usr_id, usr_name, USER_NAME_SIZE); + appSwitch = 0; + usrSwitch = 1; + sesSwitch = 0; + navdataNeeded = 0; + configState = MULTICONFIG_GOT_DRONE_VERSION; + } +} + +void ardrone_switch_to_user_id(const char *new_user_id) +{ + if (1 == droneSupportsMulticonfig) + { + // We assume that the userlist is up to date + int userExists = 0; + int configIndex; + for (configIndex = 0; configIndex < available_configurations[CAT_USER].nb_configurations; configIndex++) // Check all existing user_ids + { + if (0 == strcmp(available_configurations[CAT_USER].list[configIndex].id, new_user_id)) + { + userExists = 1; + break; + } + } + + if (1 == userExists) + { + strncpy (usr_id, new_user_id, MULTICONFIG_ID_SIZE); + appSwitch = 0; + usrSwitch = 0; + sesSwitch = 0; + navdataNeeded = 0; + configState = MULTICONFIG_GOT_DRONE_VERSION; + } + } +} + +ardrone_users_t *ardrone_get_user_list(void) +{ + if (0 == droneSupportsMulticonfig) + { + return NULL; + } + ardrone_users_t *retVal = vp_os_malloc (sizeof (ardrone_users_t)); + if (NULL == retVal) + return NULL; + + + // Assume that userlist is up to date + int validUserCount = 0; // User whose descriptions start with a dot ('.') are hidden users that may not be shown to the application user (e.g. default user for each iPhone, or user specific to a control mode + int configIndex; + for (configIndex = 0; configIndex < available_configurations[CAT_USER].nb_configurations; configIndex++) // Check all existing user_ids + { + if ('.' != available_configurations[CAT_USER].list[configIndex].description[0]) // Not an hidden user + { + validUserCount++; + retVal->userList = vp_os_realloc (retVal->userList, validUserCount * sizeof (ardrone_user_t)); + if (NULL == retVal->userList) + { + vp_os_free (retVal); + return NULL; + } + strncpy (retVal->userList[validUserCount-1].ident, available_configurations[CAT_USER].list[configIndex].id, MULTICONFIG_ID_SIZE); + strncpy (retVal->userList[validUserCount-1].description, available_configurations[CAT_USER].list[configIndex].description, USER_NAME_SIZE); + } + } + retVal->userCount = validUserCount; + return retVal; +} + +void ardrone_free_user_list (ardrone_users_t **users) +{ + if (NULL != *users) + { + if (NULL != (*users)->userList) + { + vp_os_free ((*users)->userList); + } + vp_os_free (*users); + *users = NULL; + } +} \ No newline at end of file diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h new file mode 100644 index 0000000..c3f6387 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_general_navdata.h @@ -0,0 +1,31 @@ +#ifndef _ARDRONE_NAVDATA_GENERAL_H_ +#define _ARDRONE_NAVDATA_GENERAL_H_ + +#include + +typedef enum _MULTICONFIG_STATE_ +{ + MULTICONFIG_IDLE, + MULTICONFIG_NEEDED, + MULTICONFIG_GOT_DRONE_VERSION, + MULTICONFIG_GOT_IDS_LIST, + MULTICONFIG_GOT_CURRENT_IDS, + MULTICONFIG_IN_PROGRESS_VERSION, + MULTICONFIG_IN_PROGRESS_LIST, + MULTICONFIG_IN_PROGRESS_IDS, + MULTICONFIG_REQUEST_NAVDATA, +} MULTICONFIG_STATE; + +typedef enum _NAVDATA_REQUEST_STATE_ +{ + NAVDATA_REQUEST_IDLE, + NAVDATA_REQUEST_NEEDED, + NAVDATA_REQUEST_IN_PROGRESS, +} NAVDATA_REQUEST_STATE; + +C_RESULT ardrone_general_navdata_init( void* data ); +C_RESULT ardrone_general_navdata_process( const navdata_unpacked_t* const navdata ); +C_RESULT ardrone_general_navdata_release( void ); + +#endif //! _ARDRONE_NAVDATA_GENERAL_H_ + diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.c b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.c new file mode 100644 index 0000000..2b7dae9 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.c @@ -0,0 +1,257 @@ +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#ifndef _WIN32 +#include +#include +#include +#include +#include +#endif + +// PROTO_THREAD_ROUTINE( navdata_update , nomParams ); + +static bool_t navdata_thread_in_pause = TRUE; +static bool_t bContinue = TRUE; +static uint32_t num_retries = 0; +static vp_os_cond_t navdata_client_condition; +static vp_os_mutex_t navdata_client_mutex; + +static vp_com_socket_t navdata_socket; +static Read navdata_read = NULL; +static Write navdata_write = NULL; + +static uint8_t navdata_buffer[NAVDATA_MAX_SIZE]; +navdata_unpacked_t navdata_unpacked; + +C_RESULT ardrone_navdata_client_init(void) +{ + C_RESULT res; + + COM_CONFIG_SOCKET_NAVDATA(&navdata_socket, VP_COM_CLIENT, NAVDATA_PORT, wifi_ardrone_ip); + navdata_socket.protocol = VP_COM_UDP; + navdata_socket.is_multicast = 1; // enable multicast for Navdata + navdata_socket.multicast_base_addr = MULTICAST_BASE_ADDR; + + vp_os_mutex_init(&navdata_client_mutex); + vp_os_cond_init(&navdata_client_condition, &navdata_client_mutex); + + res = C_OK; + + return res; +} + +C_RESULT ardrone_navdata_client_suspend(void) +{ + vp_os_mutex_lock(&navdata_client_mutex); + navdata_thread_in_pause = TRUE; + vp_os_mutex_unlock(&navdata_client_mutex); + + return C_OK; +} + +C_RESULT ardrone_navdata_client_resume(void) +{ + vp_os_mutex_lock(&navdata_client_mutex); + vp_os_cond_signal(&navdata_client_condition); + navdata_thread_in_pause = FALSE; + vp_os_mutex_unlock(&navdata_client_mutex); + + return C_OK; +} + +C_RESULT ardrone_navdata_open_server(void) +{ + // Flag value : + // 1 -> Unicast + // 2 -> Multicast + int32_t flag = 1, len = sizeof(flag); + + if( navdata_write != NULL ) + { + if (navdata_socket.is_multicast == 1) + flag = 2; + + navdata_write(&navdata_socket, (const int8_t*) &flag, &len); + } + + return C_OK; +} + +DEFINE_THREAD_ROUTINE( navdata_update, nomParams ) +{ + C_RESULT res; + int32_t i, size; + uint32_t cks, navdata_cks, sequence = NAVDATA_SEQUENCE_DEFAULT-1; + struct timeval tv; +#ifdef _WIN32 + int timeout_for_windows=1000/*milliseconds*/; +#endif + + + navdata_t* navdata = (navdata_t*) &navdata_buffer[0]; + + tv.tv_sec = 1/*second*/; + tv.tv_usec = 0; + + res = C_OK; + + if( VP_FAILED(vp_com_open(COM_NAVDATA(), &navdata_socket, &navdata_read, &navdata_write)) ) + { + printf("VP_Com : Failed to open socket for navdata\n"); + res = C_FAIL; + } + + if( VP_SUCCEEDED(res) ) + { + PRINT("Thread navdata_update in progress...\n"); + +#ifdef _WIN32 + setsockopt((int32_t)navdata_socket.priv, SOL_SOCKET, SO_RCVTIMEO, (const char*)&timeout_for_windows, sizeof(timeout_for_windows)); + /* Added by Stephane to force the drone start sending data. */ + if(navdata_write) + { int sizeinit = 5; navdata_write( (void*)&navdata_socket, (int8_t*)"Init", &sizeinit ); } +#else + setsockopt((int32_t)navdata_socket.priv, SOL_SOCKET, SO_RCVTIMEO, (const char*)&tv, sizeof(tv)); +#endif + + + i = 0; + while( ardrone_navdata_handler_table[i].init != NULL ) + { + // if init failed for an handler we set its process function to null + // We keep its release function for cleanup + if( VP_FAILED( ardrone_navdata_handler_table[i].init(ardrone_navdata_handler_table[i].data) ) ) + ardrone_navdata_handler_table[i].process = NULL; + + i ++; + } + + navdata_thread_in_pause = FALSE; + while( VP_SUCCEEDED(res) + && !ardrone_tool_exit() + && bContinue ) + { + if(navdata_thread_in_pause) + { + vp_os_mutex_lock(&navdata_client_mutex); + num_retries = NAVDATA_MAX_RETRIES + 1; + vp_os_cond_wait(&navdata_client_condition); + vp_os_mutex_unlock(&navdata_client_mutex); + } + + if( navdata_read == NULL ) + { + res = C_FAIL; + continue; + } + + size = NAVDATA_MAX_SIZE; + navdata->header = 0; // Soft reset + res = navdata_read( (void*)&navdata_socket, (int8_t*)&navdata_buffer[0], &size ); + +#ifdef _WIN32 + if( size <= 0 ) +#else + if( size == 0 ) +#endif + { + // timeout + PRINT("Timeout when reading navdatas - resending a navdata request on port %i\n",NAVDATA_PORT); + /* Resend a request to the drone to get navdatas */ + ardrone_navdata_open_server(); + sequence = NAVDATA_SEQUENCE_DEFAULT-1; + num_retries++; + } + else + num_retries = 0; + + if( VP_SUCCEEDED( res ) ) + { + if( navdata->header == NAVDATA_HEADER ) + { + if( ardrone_get_mask_from_state(navdata->ardrone_state, ARDRONE_COM_WATCHDOG_MASK) ) + { + // reset sequence number because of com watchdog + // This code is mandatory because we can have a com watchdog without detecting it on mobile side : + // Reconnection is fast enough (less than one second) + sequence = NAVDATA_SEQUENCE_DEFAULT-1; + + if( ardrone_get_mask_from_state(navdata->ardrone_state, ARDRONE_NAVDATA_BOOTSTRAP) == FALSE ) + ardrone_tool_send_com_watchdog(); // acknowledge + } + + if( navdata->sequence > sequence ) + { + i = 0; + + ardrone_navdata_unpack_all(&navdata_unpacked, navdata, &navdata_cks); + cks = ardrone_navdata_compute_cks( &navdata_buffer[0], size - sizeof(navdata_cks_t) ); + + if( cks == navdata_cks ) + { + while( ardrone_navdata_handler_table[i].init != NULL ) + { + if( ardrone_navdata_handler_table[i].process != NULL ) + ardrone_navdata_handler_table[i].process( &navdata_unpacked ); + + i++; + } + } + else + { + PRINT("[Navdata] Checksum failed : %d (distant) / %d (local)\n", navdata_cks, cks); + } + } + else + { + PRINT("[Navdata] Sequence pb : %d (distant) / %d (local)\n", navdata->sequence, sequence); + } + + // remaining = sizeof(navdata); + + sequence = navdata->sequence; + } + } + } + + // Release resources alllocated by handlers + i = 0; + while( ardrone_navdata_handler_table[i].init != NULL ) + { + ardrone_navdata_handler_table[i].release(); + + i ++; + } + } + + vp_com_close(COM_NAVDATA(), &navdata_socket); + + DEBUG_PRINT_SDK("Thread navdata_update ended\n"); + + return (THREAD_RET)res; +} + +uint32_t ardrone_navdata_client_get_num_retries(void) +{ + return num_retries; +} + +C_RESULT ardrone_navdata_client_shutdown(void) +{ + bContinue = FALSE; + + return C_OK; +} + + diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h new file mode 100644 index 0000000..7818ef8 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_client.h @@ -0,0 +1,59 @@ +#ifndef _ARDRONE_NAVDATA_CLIENT_H_ +#define _ARDRONE_NAVDATA_CLIENT_H_ + +#include +#include + +#include +#include +#include +#include + +#define NAVDATA_MAX_RETRIES 5 + +// Facility to declare a set of navdata handler +// Handler to resume control thread is mandatory +#define BEGIN_NAVDATA_HANDLER_TABLE \ + ardrone_navdata_handler_t ardrone_navdata_handler_table[] = { + +#define END_NAVDATA_HANDLER_TABLE \ + { ardrone_general_navdata_init, ardrone_general_navdata_process, ardrone_general_navdata_release, NULL }, \ + { ardrone_navdata_control_init, ardrone_navdata_control_process, ardrone_navdata_control_release, NULL }, \ + { NULL, NULL, NULL, NULL } \ +}; + +#define NAVDATA_HANDLER_TABLE_ENTRY( init, process, release, init_data_ptr ) \ + { (ardrone_navdata_handler_init_t)init, process, release, init_data_ptr }, + +typedef C_RESULT (*ardrone_navdata_handler_init_t)( void* data ); +typedef C_RESULT (*ardrone_navdata_handler_process_t)( const navdata_unpacked_t* const navdata ); +typedef C_RESULT (*ardrone_navdata_handler_release_t)( void ); + +typedef struct _ardrone_navdata_handler_t { + ardrone_navdata_handler_init_t init; + ardrone_navdata_handler_process_t process; + ardrone_navdata_handler_release_t release; + + void* data; // Data used during initialization +} ardrone_navdata_handler_t; + +typedef enum +{ + NAVDATA_BOOTSTRAP = 0, + NAVDATA_DEMO, + NAVDATA_FULL +} navdata_mode_t; + +extern ardrone_navdata_handler_t ardrone_navdata_handler_table[] WEAK; + +uint32_t ardrone_navdata_client_get_num_retries(void); +C_RESULT ardrone_navdata_client_init(void); +C_RESULT ardrone_navdata_client_suspend(void); +C_RESULT ardrone_navdata_client_resume(void); +C_RESULT ardrone_navdata_client_shutdown(void); +C_RESULT ardrone_navdata_open_server(void); + +PROTO_THREAD_ROUTINE( navdata_update , nomParams ); + +#endif // _ARDRONE_NAVDATA_H_ + diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.c b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.c new file mode 100644 index 0000000..714e564 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.c @@ -0,0 +1,462 @@ +#include +#ifndef _WIN32 + #include +#else + + #include + #include // for timeval structure + + int gettimeofday (struct timeval *tp, void *tz) + { + struct _timeb timebuffer; + _ftime (&timebuffer); + tp->tv_sec = (long)timebuffer.time; + tp->tv_usec = (long)timebuffer.millitm * 1000; + return 0; + } +#endif + +#include + +#include +#include + +#include +#include +#include + +uint32_t num_picture_decoded = 0; + +extern float32_t nd_iphone_gaz; +extern float32_t nd_iphone_yaw; +extern int32_t nd_iphone_flag; +extern float32_t nd_iphone_phi; +extern float32_t nd_iphone_theta; + +// Public declaration of navdata_file allowing other handlers to write into +FILE* navdata_file = NULL; + +// Private declaration of navdata_file +// Allow this handler to disable other handlers that write in navdata file +static FILE* navdata_file_private = NULL; + +static void ardrone_navdata_file_print_version( void ) +{ + unsigned int i; + fprintf(navdata_file,"VERSION 19b\n"); // TODO : CHANGE VERSION NUMBER EVERY TIME THE FILE STRUCTURE CHANGES + fprintf(navdata_file, + "Control_state [-]; ARDrone_state [-]; Time [s]; \ + AccX_raw [LSB]; AccY_raw [LSB]; AccZ_raw [LSB]; \ + GyroX_raw [LSB]; GyroY_raw [LSB]; GyroZ_raw [LSB]; GyroX_110_raw [LSB]; GyroY_110_raw [LSB];Battery_Voltage_raw [mV]; \ + Alim_3V3 [LSB]; vrefEpson [LSB]; vrefIDG [LSB]; flag_echo_ini [LSB]; us_debut_echo [LSB]; us_fin_echo [LSB]; us_association_echo; us_distance_echo [LSB];\ + us_courbe_temps [LSB]; us_courbe_valeur [LSB]; us_courbe_ref [LSB];\ + Accs_temperature [K]; Gyro_temperature [LSB]; AccX_phys_filt [mg]; AccY_phys_filt [mg]; AccZ_phys_filt [mg]; \ + GyroX_phys_filt [deg/s]; GyroY_phys_filt [deg/s]; GyroZ_phys_filt [deg/s];\ + GyroX_offset [deg/s]; GyroY_offset [deg/s]; GyroZ_offset [deg/s]; \ + Theta_acc [mdeg]; Phi_acc [mdeg];\ + Theta_ref_embedded [mdeg]; Phi_ref_embedded [mdeg]; Psi_ref_embedded [mdeg]; Theta_ref_int [mdeg]; Phi_ref_int [mdeg]; \ + Pitch_ref_embedded [mdeg]; Roll_ref_embedded [mdeg]; Yaw_ref_embedded [mdeg/s]; \ + Theta_trim_embedded [mdeg]; Phi_trim_embedded [mdeg]; Yaw_trim_embedded [mdeg/s]; \ + Pitch_rc_embedded [-]; Roll_rc_embedded [-]; Yaw_rc_embedded [-]; Gaz_rc_embedded [-]; Ag_rc_embedded [-]; User_Input [-]; \ + PWM1 [PWM]; PWM2 [PWM]; PWM3 [PWM]; PWM4 [PWM];\ + SAT_PWM1 [PWM]; SAT_PWM2 [PWM]; SAT_PWM3 [PWM]; SAT_PWM4 [PWM];\ + Gaz_feed_forward [PWM]; Gaz_altitude [PWM]; Altitude_integral [mm/s]; Vz_Ref [mm/s] ;\ + u_pitch [PWM]; u_roll [PWM]; u_yaw [PWM]; yaw_u_I [PWM];\ + u_pitch_planif [PWM]; u_roll_planif [PWM]; u_yaw_planif [PWM]; u_gaz_planif [PWM];\ + Current_motor1 [mA]; Current_motor2 [mA]; Current_motor3 [mA]; Current_motor4 [mA];\ + Altitude_vision [mm]; Altitude_vz [mm/s]; Altitude_ref_embedded [mm]; Altitude_raw [mm]; \ + Observer AccZ [m/s2]; Observer altitude US [m]; Estimated Altitude[m]; Estimated Vz [m/s]; Estimated acc bias [m/s2];\ + Observer state [-]; vb 1; vb 2; Observer flight state [-];\ + Vision_tx_raw [-]; Vision_ty_raw [-]; Vision_tz_raw [-]; Vision_State [-]; Vision_defined [-];\ + Vision_phi_trim[rad]; Vision_phi_ref_prop[rad]; Vision_theta_trim[rad]; Vision_theta_ref_prop[rad];\ + Vx_body [mm/s]; Vy_body [mm/s]; Vz_body [mm/s];\ + New_raw_picture [-]; T_capture; F_capture; P_capture; delta_Phi; delta_Theta; delta_Psi; Alt_capture [-]; time_capture [s];\ + Demo_vbat [-]; Demo_theta [mdeg]; Demo_phi [mdeg]; Demo_psi [mdeg]; Demo_altitude [mm]; Demo_vx [mm/s]; Demo_vy [mm/s]; Demo_vz [mm/s];Demo_num_frames [-];\ + Demo_detect_rot_m11 [-]; Demo_detect_rot_m12 [-]; Demo_detect_rot_m13 [-]; Demo_detect_rot_m21 [-]; Demo_detect_rot_m22 [-]; Demo_detect_rot_m23 [-];\ + Demo_detect_rot_m31 [-]; Demo_detect_rot_m32 [-]; Demo_detect_rot_m33 [-]; Demo_detect_trans_v1 [-]; Demo_detect_trans_v2 [-]; Demo_detect_trans_v3 [-]; \ + Demo_detect_tag_index [-]; Demo_camera_type [-]; Demo_drone_camera_rot_m11 [-]; Demo_drone_camera_rot_m12 [-]; Demo_drone_camera_rot_m13 [-];\ + Demo_drone_camera_rot_m21 [-]; Demo_drone_camera_rot_m22 [-]; Demo_drone_camera_rot_m23 [-]; Demo_drone_camera_rot_m31 [-]; Demo_drone_camera_rot_m32 [-];\ + Demo_drone_camera_rot_m33 [-]; Demo_drone_camera_trans_x [-]; Demo_drone_camera_trans_y [-]; Demo_drone_camera_trans_z [-];\ + nd_iphone_flag [-]; nd_iphone_phi [-]; nd_iphone_theta [-]; nd_iphone_gaz [-]; nd_iphone_yaw [-];\ + quant [-]; encoded_frame_size [bytes]; encoded_frame_number [-]; atcmd_ref_seq [-]; atcmd_mean_ref_gap [ms]; atcmd_var_ref_gap [SU]; atcmd_ref_quality[-];"); + + for(i = 0 ; i < DEFAULT_NB_TRACKERS_WIDTH*DEFAULT_NB_TRACKERS_HEIGHT ; i++) + fprintf(navdata_file, "Locked_%u; X_%u; Y_%u; ", i, i, i); + + fprintf(navdata_file, "Nb_detected; "); + + for(i = 0 ; i < 4 ; i++) + fprintf(navdata_file, "Type_%u; Xd_%u; Yd_%u; W_%u; H_%u; D_%u; O_%u; ", i, i, i, i, i, i, i); + + fprintf(navdata_file, "Perf_szo [ms]; Perf_corners [ms]; Perf_compute [ms]; Perf_tracking [ms]; Perf_trans [ms]; Perf_update [ms]; "); + + for(i=0; itm_year+1900, navdata_atm->tm_mon+1, navdata_atm->tm_mday, + navdata_atm->tm_hour, navdata_atm->tm_min, navdata_atm->tm_sec); + } + else + { + sprintf(filename, "mesures_%04d%02d%02d_%02d%02d%02d.txt", + navdata_atm->tm_year+1900, navdata_atm->tm_mon+1, navdata_atm->tm_mday, + navdata_atm->tm_hour, navdata_atm->tm_min, navdata_atm->tm_sec); + } + + // private for instance + navdata_file_private = fopen(filename, "wb"); + + return navdata_file_private != NULL ? C_OK : C_FAIL; +} + +C_RESULT ardrone_navdata_file_process( const navdata_unpacked_t* const pnd ) +{ + uint32_t i; + char str[50]; + int32_t* locked_ptr; + screen_point_t* point_ptr; + struct timeval time; + + gettimeofday(&time,NULL); + + if( navdata_file_private == NULL ) + return C_FAIL; + + if( ardrone_get_mask_from_state(pnd->ardrone_state, ARDRONE_NAVDATA_BOOTSTRAP) ) + return C_OK; + + if( navdata_file == NULL ) + { + navdata_file = navdata_file_private; + + if( ardrone_get_mask_from_state(pnd->ardrone_state, ARDRONE_NAVDATA_DEMO_MASK) ) + { + printf("Receiving navdata demo\n"); + } + else + { + printf("Receiving all navdata\n"); + } + ardrone_navdata_file_print_version(); + } + + // Handle the case where user asked for a new navdata file + if( navdata_file != navdata_file_private ) + { + fclose(navdata_file); + navdata_file = navdata_file_private; + + if( ardrone_get_mask_from_state(pnd->ardrone_state, ARDRONE_NAVDATA_DEMO_MASK) ) + { + printf("Receiving navdata demo\n"); + } + else + { + printf("Receiving all navdata\n"); + } + ardrone_navdata_file_print_version(); + } + + vp_os_memset(&str[0], 0, sizeof(str)); + + fprintf( navdata_file,"\n" ); + fprintf( navdata_file, "%u; %u", (unsigned int) pnd->navdata_demo.ctrl_state, (unsigned int) pnd->ardrone_state ); + + sprintf( str, "%d.%06d", (int)((pnd->navdata_time.time & TSECMASK) >> TSECDEC), (int)(pnd->navdata_time.time & TUSECMASK) ); + fprintf( navdata_file, ";%s", str ); + + fprintf( navdata_file, "; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u; %04u", + (unsigned int) pnd->navdata_raw_measures.raw_accs[ACC_X], + (unsigned int) pnd->navdata_raw_measures.raw_accs[ACC_Y], + (unsigned int) pnd->navdata_raw_measures.raw_accs[ACC_Z], + (unsigned int) pnd->navdata_raw_measures.raw_gyros[GYRO_X], + (unsigned int) pnd->navdata_raw_measures.raw_gyros[GYRO_Y], + (unsigned int) pnd->navdata_raw_measures.raw_gyros[GYRO_Z], + (unsigned int) pnd->navdata_raw_measures.raw_gyros_110[0], + (unsigned int) pnd->navdata_raw_measures.raw_gyros_110[1], + (unsigned int) pnd->navdata_raw_measures.vbat_raw, + (unsigned int) pnd->navdata_phys_measures.alim3V3, + (unsigned int) pnd->navdata_phys_measures.vrefEpson, + (unsigned int) pnd->navdata_phys_measures.vrefIDG, + (unsigned int) pnd->navdata_raw_measures.flag_echo_ini, + (unsigned int) pnd->navdata_raw_measures.us_debut_echo, + (unsigned int) pnd->navdata_raw_measures.us_fin_echo, + (unsigned int) pnd->navdata_raw_measures.us_association_echo, + (unsigned int) pnd->navdata_raw_measures.us_distance_echo, + (unsigned int) pnd->navdata_raw_measures.us_courbe_temps, + (unsigned int) pnd->navdata_raw_measures.us_courbe_valeur, + (unsigned int) pnd->navdata_raw_measures.us_courbe_ref ); + + fprintf( navdata_file, "; %f; %04u; % 5f; % 5f; % 5f; % 6f; % 6f; % 6f", + pnd->navdata_phys_measures.accs_temp, + (unsigned int)pnd->navdata_phys_measures.gyro_temp, + pnd->navdata_phys_measures.phys_accs[ACC_X], + pnd->navdata_phys_measures.phys_accs[ACC_Y], + pnd->navdata_phys_measures.phys_accs[ACC_Z], + pnd->navdata_phys_measures.phys_gyros[GYRO_X], + pnd->navdata_phys_measures.phys_gyros[GYRO_Y], + pnd->navdata_phys_measures.phys_gyros[GYRO_Z]); + + fprintf( navdata_file, "; % f; % f; % f", + pnd->navdata_gyros_offsets.offset_g[GYRO_X], + pnd->navdata_gyros_offsets.offset_g[GYRO_Y], + pnd->navdata_gyros_offsets.offset_g[GYRO_Z] ); + + fprintf( navdata_file, "; % f; % f", + pnd->navdata_euler_angles.theta_a, + pnd->navdata_euler_angles.phi_a); + + fprintf( navdata_file, "; %04d; %04d; %04d; %04d; %04d; %06d; %06d; %06d", + (int) pnd->navdata_references.ref_theta, + (int) pnd->navdata_references.ref_phi, + (int) pnd->navdata_references.ref_psi, + (int) pnd->navdata_references.ref_theta_I, + (int) pnd->navdata_references.ref_phi_I, + (int) pnd->navdata_references.ref_pitch, + (int) pnd->navdata_references.ref_roll, + (int) pnd->navdata_references.ref_yaw ); + + fprintf( navdata_file, "; % 8.6f; % 8.6f; % 8.6f", + pnd->navdata_trims.euler_angles_trim_theta, + pnd->navdata_trims.euler_angles_trim_phi, + pnd->navdata_trims.angular_rates_trim_r ); + + fprintf( navdata_file, "; %04d; %04d; %04d; %04d; %04d; %04u", + (int) pnd->navdata_rc_references.rc_ref_pitch, + (int) pnd->navdata_rc_references.rc_ref_roll, + (int) pnd->navdata_rc_references.rc_ref_yaw, + (int) pnd->navdata_rc_references.rc_ref_gaz, + (int) pnd->navdata_rc_references.rc_ref_ag, + (unsigned int) ui_get_user_input() ); + + fprintf( navdata_file, "; %03u; %03u; %03u; %03u; %03u; %03u; %03u; %03u; %03u; %03d; % f; % f; %03d; %03d; %03d; % f; %03d; %03d; %03d; % f; %04d; %04d; %04d; %04d", + (unsigned int) pnd->navdata_pwm.motor1, + (unsigned int) pnd->navdata_pwm.motor2, + (unsigned int) pnd->navdata_pwm.motor3, + (unsigned int) pnd->navdata_pwm.motor4, + (unsigned int) pnd->navdata_pwm.sat_motor1, + (unsigned int) pnd->navdata_pwm.sat_motor2, + (unsigned int) pnd->navdata_pwm.sat_motor3, + (unsigned int) pnd->navdata_pwm.sat_motor4, + (int) pnd->navdata_pwm.gaz_feed_forward, + pnd->navdata_pwm.gaz_altitude, + pnd->navdata_pwm.altitude_integral, + pnd->navdata_pwm.vz_ref, + (int) pnd->navdata_pwm.u_pitch, + (int) pnd->navdata_pwm.u_roll, + (int) pnd->navdata_pwm.u_yaw, + pnd->navdata_pwm.yaw_u_I, + (int) pnd->navdata_pwm.u_pitch_planif, + (int) pnd->navdata_pwm.u_roll_planif, + (int) pnd->navdata_pwm.u_yaw_planif, + pnd->navdata_pwm.u_gaz_planif, + (int) pnd->navdata_pwm.current_motor1, + (int) pnd->navdata_pwm.current_motor2, + (int) pnd->navdata_pwm.current_motor3, + (int) pnd->navdata_pwm.current_motor4 ); + + fprintf( navdata_file, "; %04d; %f; %04d; %04u", + (int) pnd->navdata_altitude.altitude_vision, + pnd->navdata_altitude.altitude_vz, + (int) pnd->navdata_altitude.altitude_ref, + (unsigned int) pnd->navdata_altitude.altitude_raw ); + + fprintf( navdata_file, "; %f; %f; %f; %f; %f; %04u; %f; %f; %04u", + pnd->navdata_altitude.obs_accZ, + pnd->navdata_altitude.obs_alt, + pnd->navdata_altitude.obs_x.v[0], + pnd->navdata_altitude.obs_x.v[1], + pnd->navdata_altitude.obs_x.v[2], + pnd->navdata_altitude.obs_state, + pnd->navdata_altitude.est_vb.v[0], + pnd->navdata_altitude.est_vb.v[1], + pnd->navdata_altitude.est_state ); + + vp_os_memset(&str[0], 0, sizeof(str)); + sprintf( str, "%d.%06d", (int)((pnd->navdata_vision.time_capture & TSECMASK) >> TSECDEC), (int)(pnd->navdata_vision.time_capture & TUSECMASK) ); + + fprintf( navdata_file, "; % 8.6f; % 8.6f; % 8.6f; %u; %u; % f;% f;% f;% f; % f; % f; % f; %u; % f; % f; % f; % f; % f; % f; % d; %s", + pnd->navdata_vision_raw.vision_tx_raw, + pnd->navdata_vision_raw.vision_ty_raw, + pnd->navdata_vision_raw.vision_tz_raw, + (unsigned int) pnd->navdata_vision.vision_state, + (unsigned int) pnd->vision_defined, + pnd->navdata_vision.vision_phi_trim, + pnd->navdata_vision.vision_phi_ref_prop, + pnd->navdata_vision.vision_theta_trim, + pnd->navdata_vision.vision_theta_ref_prop, + pnd->navdata_vision.body_v.x, + pnd->navdata_vision.body_v.y, + pnd->navdata_vision.body_v.z, + (unsigned int) pnd->navdata_vision.new_raw_picture, + pnd->navdata_vision.theta_capture, + pnd->navdata_vision.phi_capture, + pnd->navdata_vision.psi_capture, + pnd->navdata_vision.delta_phi, + pnd->navdata_vision.delta_theta, + pnd->navdata_vision.delta_psi, + (int)pnd->navdata_vision.altitude_capture, + str ); + + fprintf( navdata_file, "; %04u", + (unsigned int) pnd->navdata_demo.vbat_flying_percentage ); + + fprintf( navdata_file, "; % f; % f; % f", + pnd->navdata_demo.theta, + pnd->navdata_demo.phi, + pnd->navdata_demo.psi ); + + fprintf( navdata_file, "; %04d", + (int) pnd->navdata_demo.altitude ); + + fprintf( navdata_file, "; %f; %f; %f ", + pnd->navdata_demo.vx, + pnd->navdata_demo.vy, + pnd->navdata_demo.vz ); + + fprintf( navdata_file, "; %04u", (unsigned int) pnd->navdata_demo.num_frames ); + + fprintf( navdata_file, "; %f; %f; %f; %f; %f; %f; %f; %f; %f", pnd->navdata_demo.detection_camera_rot.m11, + pnd->navdata_demo.detection_camera_rot.m12, + pnd->navdata_demo.detection_camera_rot.m13, + pnd->navdata_demo.detection_camera_rot.m21, + pnd->navdata_demo.detection_camera_rot.m22, + pnd->navdata_demo.detection_camera_rot.m23, + pnd->navdata_demo.detection_camera_rot.m31, + pnd->navdata_demo.detection_camera_rot.m32, + pnd->navdata_demo.detection_camera_rot.m33); + + fprintf( navdata_file, "; %f; %f; %f", pnd->navdata_demo.detection_camera_trans.x, + pnd->navdata_demo.detection_camera_trans.y, + pnd->navdata_demo.detection_camera_trans.z); + + fprintf( navdata_file, "; %04u; %04u", + (unsigned int) pnd->navdata_demo.detection_tag_index, + (unsigned int) pnd->navdata_demo.detection_camera_type); + + fprintf( navdata_file, "; %f; %f; %f; %f; %f; %f; %f; %f; %f", pnd->navdata_demo.drone_camera_rot.m11, + pnd->navdata_demo.drone_camera_rot.m12, + pnd->navdata_demo.drone_camera_rot.m13, + pnd->navdata_demo.drone_camera_rot.m21, + pnd->navdata_demo.drone_camera_rot.m22, + pnd->navdata_demo.drone_camera_rot.m23, + pnd->navdata_demo.drone_camera_rot.m31, + pnd->navdata_demo.drone_camera_rot.m32, + pnd->navdata_demo.drone_camera_rot.m33); + + fprintf( navdata_file, "; %f; %f; %f", pnd->navdata_demo.drone_camera_trans.x, + pnd->navdata_demo.drone_camera_trans.y, + pnd->navdata_demo.drone_camera_trans.z); + + fprintf( navdata_file, "; %d; %f; %f; %f; %f", + (int)nd_iphone_flag, + nd_iphone_phi, + nd_iphone_theta, + nd_iphone_gaz, + nd_iphone_yaw); + + fprintf( navdata_file, "; %d; %d; %d; %d; %d; %f; %d", + pnd->navdata_video_stream.quant, + pnd->navdata_video_stream.frame_size, + pnd->navdata_video_stream.frame_number, + pnd->navdata_video_stream.atcmd_ref_seq, + pnd->navdata_video_stream.atcmd_mean_ref_gap, + pnd->navdata_video_stream.atcmd_var_ref_gap, + pnd->navdata_video_stream.atcmd_ref_quality); + + + + locked_ptr = (int32_t*) &pnd->navdata_trackers_send.locked[0]; + point_ptr = (screen_point_t*) &pnd->navdata_trackers_send.point[0]; + + for(i = 0; i < DEFAULT_NB_TRACKERS_WIDTH*DEFAULT_NB_TRACKERS_HEIGHT; i++) + { + fprintf( navdata_file, "; %d; %u; %u", + (int) *locked_ptr++, + (unsigned int) point_ptr->x, + (unsigned int) point_ptr->y ); + point_ptr++; + } + + fprintf( navdata_file, "; %u", (unsigned int) pnd->navdata_vision_detect.nb_detected ); + for(i = 0 ; i < 4 ; i++) + { + fprintf( navdata_file, "; %u; %u; %u; %u; %u; %u; %f", + (unsigned int) pnd->navdata_vision_detect.type[i], + (unsigned int) pnd->navdata_vision_detect.xc[i], + (unsigned int) pnd->navdata_vision_detect.yc[i], + (unsigned int) pnd->navdata_vision_detect.width[i], + (unsigned int) pnd->navdata_vision_detect.height[i], + (unsigned int) pnd->navdata_vision_detect.dist[i], + pnd->navdata_vision_detect.orientation_angle[i]); + } + + fprintf( navdata_file, "; %f; %f; %f; %f; %f; %f", + pnd->navdata_vision_perf.time_szo, + pnd->navdata_vision_perf.time_corners, + pnd->navdata_vision_perf.time_compute, + pnd->navdata_vision_perf.time_tracking, + pnd->navdata_vision_perf.time_trans, + pnd->navdata_vision_perf.time_update ); + + for(i = 0 ; i < NAVDATA_MAX_CUSTOM_TIME_SAVE ; i++) + { + fprintf( navdata_file, "; %f", pnd->navdata_vision_perf.time_custom[i]); + } + + fprintf( navdata_file, "; %d", (int) pnd->navdata_watchdog.watchdog ); + + fprintf( navdata_file, "; %u", (unsigned int) num_picture_decoded ); + + sprintf( str, "%d.%06d", (int)time.tv_sec, (int)time.tv_usec); + fprintf( navdata_file, "; %s", str ); + + return C_OK; +} + +C_RESULT ardrone_navdata_file_release( void ) +{ + if( navdata_file != NULL ) + { + navdata_file = NULL; + + fprintf(navdata_file_private,"\n"); + + fclose( navdata_file_private ); + + navdata_file_private = NULL; + } + + return C_OK; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.h b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.h new file mode 100644 index 0000000..52526ec --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/ardrone_navdata_file.h @@ -0,0 +1,17 @@ +#ifndef _ARDRONE_NAVDATA_FILE_H_ +#define _ARDRONE_NAVDATA_FILE_H_ + +#include +#include + +#include + +extern FILE* navdata_file; + +// For this handler, data is the path where the file will be created +// If data is NULL then the file is created in current directory +C_RESULT ardrone_navdata_file_init( void* data ); +C_RESULT ardrone_navdata_file_process( const navdata_unpacked_t* const navdata ); +C_RESULT ardrone_navdata_file_release( void ); + +#endif // _ARDRONE_NAVDATA_FILE_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/navdata.c b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/navdata.c new file mode 100644 index 0000000..1146253 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Navdata/navdata.c @@ -0,0 +1,145 @@ + +#include +#include +#include + +#include + +/* Uncomment to activate interesting printf's */ +//#define DEBUG_NAVDATA_C + + +/******************************************************************** + * @fn ardrone_navdata_compute_cks: + * @param nv Data to calculate the checksum. + * @param size Size of data calculate as follow : size-sizeof(navdata_cks_t). + * @return Retrieves the checksum from the navdata nv. + *******************************************************************/ +uint32_t ardrone_navdata_compute_cks( uint8_t* nv, int32_t size ) +{ + int32_t i; + uint32_t cks; + uint32_t temp; + + cks = 0; + + for( i = 0; i < size; i++ ) + { + temp = nv[i]; + cks += temp; + } + + return cks; +} + + + +/******************************************************************** + * @fn ardrone_navdata_search_option: + * @param navdata_options_ptr + * @param tag ID of the bloc to search for. + * @brief Jumps to a specified 'option' (block of navdata) inside + * a navdata packed buffer. + *******************************************************************/ +navdata_option_t* ardrone_navdata_search_option( navdata_option_t* navdata_options_ptr, navdata_tag_t tag ) +{ + uint8_t* ptr; + + while( navdata_options_ptr->tag != tag ) + { + ptr = (uint8_t*) navdata_options_ptr; + ptr += navdata_options_ptr->size; + + navdata_options_ptr = (navdata_option_t*) ptr; + } + + return navdata_options_ptr; +} + + +/******************************************************************** + * ardrone_navdata_unpack_all: + * @param navdata_unpacked navdata_unpacked in which to store the navdata. + * @param navdata One packet read from the port NAVDATA. + * @param Checksum of navdata + * @brief Disassembles a buffer of received navdata, and dispatches + * it inside 'navdata_unpacked' structure. + * @DESCRIPTION + * + *******************************************************************/ +C_RESULT ardrone_navdata_unpack_all(navdata_unpacked_t* navdata_unpacked, navdata_t* navdata, uint32_t* cks) +{ + C_RESULT res; + navdata_cks_t navdata_cks = { 0 }; + navdata_option_t* navdata_option_ptr; + + navdata_option_ptr = (navdata_option_t*) &navdata->options[0]; + + vp_os_memset( navdata_unpacked, 0, sizeof(*navdata_unpacked) ); + + navdata_unpacked->ardrone_state = navdata->ardrone_state; + navdata_unpacked->vision_defined = navdata->vision_defined; + + res = C_OK; + +#ifdef DEBUG_NAVDATA_C + if (navdata_unpacked->ardrone_state & ARDRONE_COMMAND_MASK) { printf("[ACK]"); } + printf("Received navdatas tags :"); +#endif + + + while( navdata_option_ptr != NULL ) + { + // Check if we have a valid option + if( navdata_option_ptr->size == 0 ) + { + PRINT("One option (%d) is not a valid option because its size is zero\n", navdata_option_ptr->tag); + navdata_option_ptr = NULL; + res = C_FAIL; + } + else + { + + if( navdata_option_ptr->tag <= NAVDATA_NUM_TAGS){ + #ifdef DEBUG_NAVDATA_C + printf("[%d]",navdata_option_ptr->tag); + #endif + navdata_unpacked->last_navdata_refresh |= NAVDATA_OPTION_MASK(navdata_option_ptr->tag); + } + + + + switch( navdata_option_ptr->tag ) + { + + #define NAVDATA_OPTION(STRUCTURE,NAME,TAG) \ + case TAG: \ + navdata_option_ptr = ardrone_navdata_unpack( navdata_option_ptr, navdata_unpacked->NAME); \ + break; + + #define NAVDATA_OPTION_DEMO(STRUCTURE,NAME,TAG) NAVDATA_OPTION(STRUCTURE,NAME,TAG) + #define NAVDATA_OPTION_CKS(STRUCTURE,NAME,TAG) {} + + #include + + case NAVDATA_CKS_TAG: + navdata_option_ptr = ardrone_navdata_unpack( navdata_option_ptr, navdata_cks ); + *cks = navdata_cks.cks; + navdata_option_ptr = NULL; // End of structure + break; + + + default: + PRINT("Tag %d is an unknown navdata option tag\n", (int) navdata_option_ptr->tag); + navdata_option_ptr = (navdata_option_t *)(((uint32_t)navdata_option_ptr) + navdata_option_ptr->size); + break; + } + } + } + + #ifdef DEBUG_NAVDATA_C + printf("\n"); + #endif + + return res; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.c b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.c new file mode 100644 index 0000000..9418ac6 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.c @@ -0,0 +1,237 @@ +#include +#include + +#include +#include + +static input_device_t* devices[MAX_NUM_DEVICES]; + +static input_state_t input_state = { 0 }; + +C_RESULT ardrone_tool_input_add( input_device_t* device ) +{ + C_RESULT res; + int32_t i; + + VP_OS_ASSERT( device != NULL ); + + res = C_FAIL; + i = 0; + + while( i < MAX_NUM_DEVICES && devices[i] != NULL ) i++; + + if( i < MAX_NUM_DEVICES ) + { + if( VP_SUCCEEDED(device->init()) ) + { + devices[i] = device; + PRINT("Input device %s added\n", device->name); + res = C_OK; + } + else + { + PRINT("Input device %s init failed\n", device->name); + res = C_FAIL; + } + } + else + { + PRINT("Not enough memory to add input device %s\n", device->name); + } + + return res; +} + +static C_RESULT ardrone_tool_input_remove_i( int32_t i ) +{ + C_RESULT res; + + res = C_OK; + + if( devices[i] != NULL ) + { + if( VP_SUCCEEDED(devices[i]->shutdown()) ) + { + PRINT("Input device %s removed\n", devices[i]->name); + res = C_OK; + } + else + { + PRINT("Input device %s removed but an error occured during its shutdown\n", devices[i]->name); + res = C_FAIL; + } + + devices[i] = NULL; + } + + return res; +} + +C_RESULT ardrone_tool_input_remove( input_device_t* device ) +{ + C_RESULT res; + int32_t i; + + VP_OS_ASSERT( device != NULL ); + + res = C_FAIL; + i = 0; + + while( i < MAX_NUM_DEVICES && devices[i] != device ) i++; + + if( i < MAX_NUM_DEVICES ) + { + res = ardrone_tool_input_remove_i(i); + } + else + { + DEBUG_PRINT_SDK("Input %s not found while removing\n", device->name); + } + + return res; +} + +C_RESULT ardrone_tool_set_ui_pad_ab(int32_t value) +{ + input_state.ab = value; + return ui_pad_ab(value); +} + +C_RESULT ardrone_tool_set_ui_pad_ag(int32_t value) +{ + input_state.ag = value; + return ui_pad_ag(value); +} + +C_RESULT ardrone_tool_set_ui_pad_ad(int32_t value) +{ + input_state.ad = value; + return ui_pad_ad(value); +} + +C_RESULT ardrone_tool_set_ui_pad_ah(int32_t value) +{ + input_state.ah = value; + return ui_pad_ah(value); +} + +C_RESULT ardrone_tool_set_ui_pad_l1(int32_t value) +{ + input_state.l1 = value; + return ui_pad_l1(value); +} + +C_RESULT ardrone_tool_set_ui_pad_r1(int32_t value) +{ + input_state.r1 = value; + return ui_pad_r1(value); +} + +C_RESULT ardrone_tool_set_ui_pad_l2(int32_t value) +{ + input_state.l2 = value; + return ui_pad_l2(value); +} + +C_RESULT ardrone_tool_set_ui_pad_r2(int32_t value) +{ + input_state.r2 = value; + return ui_pad_r2(value); +} + +C_RESULT ardrone_tool_set_ui_pad_select(int32_t value) +{ + input_state.select = value; + return ui_pad_select(value); +} + + +C_RESULT ardrone_tool_set_ui_pad_start(int32_t value) +{ + input_state.start = value; + return ui_pad_start_stop(value); +} + +C_RESULT ardrone_tool_set_ui_pad_xy(int32_t x, int32_t y) +{ + input_state.x = x; + input_state.y = y; + + return ui_pad_xy_change(x, y); +} + +C_RESULT ardrone_tool_input_init(void) +{ + int32_t i; + + i = 0; + + while( i < MAX_NUM_DEVICES ) + { + devices[i] = NULL; + i++; + } + + return ardrone_tool_input_reset(); +} + +C_RESULT ardrone_tool_input_reset(void) +{ + return ui_pad_reset_user_input(&input_state); +} + +C_RESULT ardrone_tool_start_reset(void) +{ + input_state.start = 0; + + return ui_pad_reset_user_input_start(&input_state); +} + +C_RESULT ardrone_tool_input_update(void) +{ + C_RESULT res; + int32_t i; + + res = C_OK; + i = 0; + + while( VP_SUCCEEDED(res) && i < MAX_NUM_DEVICES ) + { + if( devices[i] != NULL && VP_FAILED(devices[i]->update()) ) + { + PRINT("Input device %s update failed... it'll be removed\n", devices[i]->name); + ardrone_tool_input_remove_i(i); + + res = C_FAIL; + } + i++; + } + + ui_pad_update_user_input(&input_state); + + return res; +} + +C_RESULT ardrone_tool_input_shutdown(void) +{ + int32_t i; + + i = 0; + + while( i < MAX_NUM_DEVICES ) + { + ardrone_tool_input_remove_i(i); + i++; + } + + return C_OK; +} + +input_state_t* ardrone_tool_get_input_state( void ) +{ + return &input_state; +} + + +C_RESULT custom_reset_user_input(input_state_t* input_state, uint32_t user_input ) { return C_OK; } +C_RESULT custom_update_user_input(input_state_t* input_state, uint32_t user_input ) { return C_OK; } diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.h b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.h new file mode 100644 index 0000000..a846e5e --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_input.h @@ -0,0 +1,60 @@ +#ifndef _ARDRONE_INPUT_H_ +#define _ARDRONE_INPUT_H_ + +#include +#include + +typedef struct _input_device_t { + char name[MAX_NAME_LENGTH]; + + C_RESULT (*init)(void); + C_RESULT (*update)(void); + C_RESULT (*shutdown)(void); +} input_device_t; + +typedef struct _input_state_t +{ + int32_t ag; + int32_t ab; + int32_t ad; + int32_t ah; + int32_t l1; + int32_t r1; + int32_t l2; + int32_t r2; + int32_t select; + int32_t start; + + int32_t x; + int32_t y; +} input_state_t; + +// Input change handling +input_state_t* ardrone_tool_get_input_state( void ); +C_RESULT ardrone_tool_set_ui_pad_ag(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_ab(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_ad(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_ah(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_l1(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_r1(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_l2(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_r2(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_select(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_start(int32_t value); +C_RESULT ardrone_tool_set_ui_pad_xy(int32_t x, int32_t y); + +// Callbacks for user input event handling +extern C_RESULT custom_reset_user_input(input_state_t* input_state, uint32_t user_input ) WEAK; +extern C_RESULT custom_update_user_input(input_state_t* input_state, uint32_t user_input ) WEAK; + +// Input API +C_RESULT ardrone_tool_input_add( input_device_t* device ); +C_RESULT ardrone_tool_input_remove( input_device_t* device ); + +C_RESULT ardrone_tool_input_init(void); +C_RESULT ardrone_tool_input_reset(void); +C_RESULT ardrone_tool_input_update(void); +C_RESULT ardrone_tool_input_shutdown(void); +C_RESULT ardrone_tool_start_reset(void); + +#endif // _ARDRONE_INPUT_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.c b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.c new file mode 100644 index 0000000..853a3d6 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.c @@ -0,0 +1,230 @@ +// +// Inputs specification +// rien d'appuyer : 11540000 +// start: 11540200 +// select: 11540000 +// 1 : 11540001 +// 2 : 11540002 +// 3 : 11540004 +// 4 : 11540008 +// 5 : 11540010 +// 6 : 11540020 +// 7 : 11540040 +// 8 : 11540080 +// x+: 12540000 +// x-: 10540000 +// y+: 01540000 +// y-: 21540000 +// +// trims +// r2 + x+ = 11640080 +// r2 + x- = 11440080 +// r2 + y+ = 11500080 +// r2 + y- = 11580080 +// r2 + 5 = 11140090 +// r2 + 6 = 119400A0 +// + +#include +#include + +#include +#include + +static uint32_t user_input = 0; + +C_RESULT ui_pad_ab(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_AB); + else + user_input &= ~(1 << ARDRONE_UI_BIT_AB); + + return C_OK; +} + +C_RESULT ui_pad_ag(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_AG); + else + user_input &= ~(1 << ARDRONE_UI_BIT_AG); + + return C_OK; +} + +C_RESULT ui_pad_ad(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_AD); + else + user_input &= ~(1 << ARDRONE_UI_BIT_AD); + + return C_OK; +} + +C_RESULT ui_pad_ah(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_AH); + else + user_input &= ~(1 << ARDRONE_UI_BIT_AH); + + return C_OK; +} + +C_RESULT ui_pad_l1(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_L1); + else + user_input &= ~(1 << ARDRONE_UI_BIT_L1); + + return C_OK; +} + +C_RESULT ui_pad_r1(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_R1); + else + user_input &= ~(1 << ARDRONE_UI_BIT_R1); + + return C_OK; +} + +C_RESULT ui_pad_l2(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_L2); + else + user_input &= ~(1 << ARDRONE_UI_BIT_L2); + + return C_OK; +} + +C_RESULT ui_pad_r2(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_R2); + else + user_input &= ~(1 << ARDRONE_UI_BIT_R2); + + return C_OK; +} + +C_RESULT ui_pad_start_stop(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_START); + else + user_input &= ~(1 << ARDRONE_UI_BIT_START); + + return C_OK; +} + +C_RESULT ui_pad_select(int32_t value) +{ + if( value ) + user_input |= (1 << ARDRONE_UI_BIT_SELECT); + else + user_input &= ~(1 << ARDRONE_UI_BIT_SELECT); + + return C_OK; +} + +C_RESULT ui_pad_xy_change(int32_t x, int32_t y) +{ + user_input &= ~(3 << ARDRONE_UI_BIT_X); + user_input &= ~(3 << ARDRONE_UI_BIT_Y); + + user_input |= (x + 1) << ARDRONE_UI_BIT_X; + user_input |= (y + 1) << ARDRONE_UI_BIT_Y; + + return C_OK; +} + +C_RESULT ui_pad_reset_user_input(input_state_t* input_state) +{ + user_input = 0; + + input_state->ag = 0; + input_state->ab = 0; + input_state->ad = 0; + input_state->ah = 0; + input_state->l1 = 0; + input_state->r1 = 0; + input_state->l2 = 0; + //input_state->r2 = 0; (To avoid angle trim done when CTRL_TRANS_LANDING =>CTRL_LANDING) + input_state->select = 0; + input_state->start = 0; + + input_state->x = 0; + input_state->y = 0; + + ui_pad_ag(1); + ui_pad_ag(0); + ui_pad_ab(1); + ui_pad_ab(0); + ui_pad_ad(1); + ui_pad_ad(0); + ui_pad_ah(1); + ui_pad_ah(0); + ui_pad_l1(1); + ui_pad_l1(0); + ui_pad_r1(1); + ui_pad_r1(0); + ui_pad_l2(1); + ui_pad_l2(0); + //ui_pad_r2_pressed(input_state); + //ui_pad_r2_released(input_state); + ui_pad_xy_change(0, 0); + ui_pad_yaw_trim(0); + ui_pad_phi_trim(0); + ui_pad_theta_trim(0); + + return custom_reset_user_input(input_state, user_input); +} + +C_RESULT ui_pad_reset_user_input_start(input_state_t* input_state) +{ + ui_pad_start_stop(0); + + return custom_reset_user_input(input_state, user_input); +} + +C_RESULT ui_pad_update_user_input(input_state_t* input_state) +{ + ardrone_at_set_ui_value( user_input ); + + return custom_update_user_input(input_state, user_input ); +} + +C_RESULT ui_pad_phi_trim( int32_t phi_trim ) +{ + user_input &= ~(3 << ARDRONE_UI_BIT_TRIM_PHI); + user_input |= (phi_trim + 1) << ARDRONE_UI_BIT_TRIM_PHI; + + return C_OK; +} + +C_RESULT ui_pad_theta_trim( int32_t theta_trim ) +{ + user_input &= ~(3 << ARDRONE_UI_BIT_TRIM_THETA); + user_input |= (theta_trim + 1) << ARDRONE_UI_BIT_TRIM_THETA; + + return C_OK; +} + +C_RESULT ui_pad_yaw_trim( int32_t yaw_trim ) +{ + user_input &= ~(3 << ARDRONE_UI_BIT_TRIM_YAW); + user_input |= (yaw_trim + 1) << ARDRONE_UI_BIT_TRIM_YAW; + + return C_OK; +} + +uint32_t ui_get_user_input(void) +{ + return user_input; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.h b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.h new file mode 100644 index 0000000..74e5289 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/UI/ardrone_tool_ui.h @@ -0,0 +1,29 @@ +#ifndef _ARDRONE_TOOL_UI_H_ +#define _ARDRONE_TOOL_UI_H_ + +#include +#include + +C_RESULT ui_pad_ab(int32_t value); +C_RESULT ui_pad_ad(int32_t value); +C_RESULT ui_pad_ag(int32_t value); +C_RESULT ui_pad_ah(int32_t value); +C_RESULT ui_pad_l1(int32_t value); +C_RESULT ui_pad_r1(int32_t value); +C_RESULT ui_pad_l2(int32_t value); +C_RESULT ui_pad_r2(int32_t value); +C_RESULT ui_pad_xy_change(int32_t x, int32_t y); +C_RESULT ui_pad_phi_trim( int32_t phi_trim ); +C_RESULT ui_pad_theta_trim( int32_t theta_trim ); +C_RESULT ui_pad_yaw_trim( int32_t yaw_trim ); + +C_RESULT ui_pad_reset_user_input(input_state_t* input_state); +C_RESULT ui_pad_update_user_input(input_state_t* input_state); +C_RESULT ui_pad_reset_user_input_start(input_state_t* input_state); + +C_RESULT ui_pad_start_stop(int32_t value); +C_RESULT ui_pad_select(int32_t value); + +uint32_t ui_get_user_input(void); + +#endif // _ARDRONE_TOOL_UI_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.c b/ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.c new file mode 100644 index 0000000..5643ae3 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.c @@ -0,0 +1,142 @@ +#include +#include + +#include +#include + +static int32_t copy_input_to_buffer( uint8_t* buffer, int32_t input_size, int32_t max_size, buffer_to_picture_config_t *cfg ) +{ + int32_t size_to_copy; + + size_to_copy = input_size; + if( size_to_copy > max_size ) + size_to_copy = max_size; + vp_os_memcpy( buffer, cfg->input_ptr, size_to_copy ); + + cfg->cumulated_size += size_to_copy; + cfg->input_ptr += size_to_copy; + + return size_to_copy; +} + +C_RESULT buffer_to_picture_open(buffer_to_picture_config_t *cfg) +{ + cfg->num_picture_decoded = 0; + + return C_OK; +} + +C_RESULT buffer_to_picture_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)(int8_t*) cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + + cfg->y_buf_ptr = cfg->picture->y_buf; +#ifdef USE_VIDEO_YUV + cfg->cr_buf_ptr = cfg->picture->cr_buf; + cfg->cb_buf_ptr = cfg->picture->cb_buf; +#endif + cfg->cumulated_size = 0; + cfg->input_ptr = NULL; + } + + if( in->status == VP_API_STATUS_ENDED ) + out->status = in->status; + + if( out->status == VP_API_STATUS_PROCESSING ) + cfg->input_ptr = (uint8_t*)in->buffers[in->indexBuffer]; + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + int32_t copied_size, y_size, c_size = 0; + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + y_size = cfg->y_blockline_size; +#ifdef USE_VIDEO_YUV + c_size = cfg->y_blockline_size / 4; +#endif + + while(in->size > 0 && cfg->y_current_size != cfg->y_buffer_size) + { + if( in->size > 0 && cfg->cumulated_size < y_size ) + { + copied_size = copy_input_to_buffer( cfg->y_buf_ptr, in->size, y_size - cfg->cumulated_size, cfg ); + + cfg->y_buf_ptr += copied_size; + in->size -= copied_size; + } + +#ifdef USE_VIDEO_YUV + if( in->size > 0 && cfg->cumulated_size >= y_size && cfg->cumulated_size < y_size + c_size ) + { + copied_size = copy_input_to_buffer( cfg->cb_buf_ptr, in->size, y_size + c_size - cfg->cumulated_size, cfg ); + + cfg->cb_buf_ptr += copied_size; + in->size -= copied_size; + } + + if( in->size > 0 && cfg->cumulated_size >= y_size + c_size && cfg->cumulated_size < y_size + 2*c_size ) + { + copied_size = copy_input_to_buffer( cfg->cr_buf_ptr, in->size, y_size + 2*c_size - cfg->cumulated_size, cfg ); + + cfg->cr_buf_ptr += copied_size; + in->size -= copied_size; + } +#endif + + if( cfg->cumulated_size == y_size + 2*c_size ) + { + cfg->cumulated_size = 0; + cfg->y_current_size += cfg->y_blockline_size; + } + } + + // All buffers are full but there's still data + if( in->size > 0 ) + out->status = VP_API_STATUS_STILL_RUNNING; + + if( cfg->y_current_size == cfg->y_buffer_size ) + { + // we got one picture (handle case 1) + out->size = 1; + + cfg->num_picture_decoded++; + + DEBUG_PRINT_SDK( "%d picture received\n", (int)cfg->num_picture_decoded ); + + cfg->y_current_size = 0; + cfg->y_buf_ptr = cfg->picture->y_buf; +#ifdef USE_VIDEO_YUV + cfg->cr_buf_ptr = cfg->picture->cr_buf; + cfg->cb_buf_ptr = cfg->picture->cb_buf; +#endif + } + } + + vp_os_mutex_unlock(&out->lock); + + return C_OK; +} + +C_RESULT buffer_to_picture_close(buffer_to_picture_config_t *cfg) +{ + return C_OK; +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.h b/ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.h new file mode 100644 index 0000000..7b1e1a8 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/buffer_to_picture_stage.h @@ -0,0 +1,35 @@ +#ifndef _BUFFER_TO_PICTURE_H_ +#define _BUFFER_TO_PICTURE_H_ + +#include +#include + +typedef struct _buffer_to_picture_config_t +{ + vp_api_picture_t* picture; + int32_t y_buffer_size; + int32_t y_blockline_size; + int32_t y_current_size; + + int32_t num_frames; + + uint8_t* y_buf_ptr; +#ifdef USE_VIDEO_YUV + uint8_t* cr_buf_ptr; + uint8_t* cb_buf_ptr; +#endif + + int32_t cumulated_size; + uint8_t* input_ptr; + + int32_t num_picture_decoded; + +} buffer_to_picture_config_t; + +C_RESULT buffer_to_picture_open(buffer_to_picture_config_t *cfg); +C_RESULT buffer_to_picture_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT buffer_to_picture_close(buffer_to_picture_config_t *cfg); + +extern const vp_api_stage_funcs_t buffer_to_picture_funcs; + +#endif // _BUFFER_TO_PICTURE_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.c b/ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.c new file mode 100644 index 0000000..5ffb3bd --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.c @@ -0,0 +1,98 @@ +#include +#include + +#include + +uint32_t mjpeg_stage_num_picture_decoded = 0; + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + stream_new( &cfg->stream, OUTPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**) cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) { + out->status = in->status; + } + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( out->status == VP_API_STATUS_PROCESSING ) + { + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + + mjpeg_stage_num_picture_decoded = cfg->mjpeg.num_frames; + +#ifndef USE_VIDEO_YUV + int32_t i; + for(i = 0; i < cfg->picture->width * cfg->picture->height / 4; i++ ) + { + cfg->picture->cr_buf[i] = 0x80; + cfg->picture->cb_buf[i] = 0x80; + } +#endif + + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.h b/ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.h new file mode 100644 index 0000000..2534705 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/mjpeg_stage_decode.h @@ -0,0 +1,24 @@ +#ifndef _MJPEG_STAGE_DECODE_H_ +#define _MJPEG_STAGE_DECODE_H_ + +#include +#include + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg); +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg); + +extern uint32_t mjpeg_stage_num_picture_decoded; +extern const vp_api_stage_funcs_t mjpeg_decoding_funcs; + +#endif // _MJPEG_STAGE_DECODE_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.c b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.c new file mode 100644 index 0000000..b395998 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.c @@ -0,0 +1,156 @@ +#include + +#include +#include +#include + +#include + +#include + +#ifndef _WIN32 + #include + #include + #include + #include + #include + #define SSOPTCAST_RW(x) x + #define SSOPTCAST_RO(x) x +#else + #define SSOPTCAST_RO(x) (const char*)x + #define SSOPTCAST_RW(x) (char*)x + typedef int socklen_t; +#endif + +const vp_api_stage_funcs_t video_com_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) video_com_stage_open, + (vp_api_stage_transform_t) video_com_stage_transform, + (vp_api_stage_close_t) video_com_stage_close +}; + +C_RESULT video_com_stage_open(video_com_config_t *cfg) +{ +#ifdef _WIN32 + int sizeinit; +#endif + + C_RESULT res = C_FAIL; + + if( cfg->protocol == VP_COM_UDP ) + { + struct timeval tv; +#ifdef _WIN32 + int timeout_for_windows=1000; /* timeout in milliseconds */ +#endif + + // 1 second timeout + tv.tv_sec = 1; + tv.tv_usec = 0; + + cfg->socket.protocol = VP_COM_UDP; + cfg->socket.is_multicast = 1; // enable multicast for video + cfg->socket.multicast_base_addr = MULTICAST_BASE_ADDR; + + res = vp_com_open(cfg->com, &cfg->socket, &cfg->read, &cfg->write); + + if( VP_SUCCEEDED(res) ) + { + int numi= 1; + + socklen_t numi1= sizeof(int); + +#ifdef _WIN32 + setsockopt((int32_t)cfg->socket.priv, SOL_SOCKET, SO_RCVTIMEO, SSOPTCAST_RO(&timeout_for_windows), sizeof(timeout_for_windows)); +#else + setsockopt((int32_t)cfg->socket.priv, SOL_SOCKET, SO_RCVTIMEO, SSOPTCAST_RO(&tv), sizeof(tv)); +#endif + + // Increase buffer for receiving datas. + setsockopt( (int32_t)cfg->socket.priv, SOL_SOCKET, SO_DEBUG, SSOPTCAST_RO(&numi), sizeof(numi)); + numi= 256*256; + setsockopt( (int32_t)cfg->socket.priv, SOL_SOCKET, SO_RCVBUF, SSOPTCAST_RO(&numi),numi1); + getsockopt( (int32_t)cfg->socket.priv, SOL_SOCKET, SO_RCVBUF, SSOPTCAST_RW(&numi),&numi1); + + numi1=0; + setsockopt( (int32_t)cfg->socket.priv, SOL_SOCKET, SO_DEBUG, SSOPTCAST_RO(&numi1), sizeof(numi1)); + } + } + else if( cfg->protocol == VP_COM_TCP ) + { + res = vp_com_open(cfg->com, &cfg->socket, &cfg->read, &cfg->write); + + if( VP_SUCCEEDED(res) ) + { + vp_com_sockopt(cfg->com, &cfg->socket, cfg->sockopt); + } + } + + /* Stephane */ + #ifdef _WIN32 + sizeinit = strlen("Init"); + vp_com_write_socket(&cfg->socket,"Init",&sizeinit); + #endif + return res; +} + +C_RESULT video_com_stage_transform(video_com_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + C_RESULT res; + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = cfg->buffer_size; + out->buffers = (int8_t **) vp_os_malloc (sizeof(int8_t *)+out->size*sizeof(int8_t)); + out->buffers[0] = (int8_t *)(out->buffers+1); + out->indexBuffer = 0; + // out->lineSize not used + + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_PROCESSING && cfg->read != NULL) + { + out->size = cfg->buffer_size; + res = cfg->read(&cfg->socket, out->buffers[0], &out->size); + + if( cfg->protocol == VP_COM_UDP ) + { + if( out->size == 0 ) + { + // Send "1" for Unicast + // Send "2" to enable Multicast + int32_t flag = 1, len = sizeof(flag); + if ( cfg->socket.is_multicast == 1 ) + flag = 2; + + cfg->write(&cfg->socket, (int8_t*) &flag, &len); + } + } + + if( VP_FAILED(res) ) + { + out->status = VP_API_STATUS_ERROR; + out->size = 0; + } + + if( out->size == 0) + cfg->num_retries++; + else + cfg->num_retries = 0; + } + + vp_os_mutex_unlock(&out->lock); + + return C_OK; +} + + +C_RESULT video_com_stage_close(video_com_config_t *cfg) +{ + vp_com_close(cfg->com, &cfg->socket); + return C_OK; +} + diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.h b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.h new file mode 100644 index 0000000..ce95ac9 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_com_stage.h @@ -0,0 +1,33 @@ +#ifndef _VIDEO_COM_STAGE_H_ +#define _VIDEO_COM_STAGE_H_ + +#include +#include + +#define VIDEO_MAX_RETRIES 5 + +typedef struct _video_com_config_t +{ + vp_com_t* com; + + vp_com_socket_t socket; + VP_COM_SOCKET_OPTIONS sockopt; + + uint32_t buffer_size; + + // Private Datas + Read read; + Write write; + uint32_t num_retries; + + VP_COM_SOCKET_PROTOCOL protocol; + +} video_com_config_t; + +extern const vp_api_stage_funcs_t video_com_funcs; + +C_RESULT video_com_stage_open(video_com_config_t *cfg); +C_RESULT video_com_stage_transform(video_com_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT video_com_stage_close(video_com_config_t *cfg); + +#endif // _VIDEO_COM_STAGE_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.c b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.c new file mode 100644 index 0000000..21dde0e --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.c @@ -0,0 +1,239 @@ +/* + * video_stage.c + * Test + * + * Created by FrĂ©dĂ©ric D'HAEYER on 22/02/10. + * Copyright 2010 Parrot SA. All rights reserved. + * + */ +#include + +#define NB_STAGES 5 + +PIPELINE_HANDLE pipeline_handle; +static bool_t video_stage_in_pause = TRUE; +static vp_os_cond_t video_stage_condition; +static vp_os_mutex_t video_stage_mutex; +static video_com_config_t icc; +static video_stage_config_t video_stage_config; + +const vp_api_stage_funcs_t video_stage_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) video_stage_open, + (vp_api_stage_transform_t) video_stage_transform, + (vp_api_stage_close_t) video_stage_close +}; + +C_RESULT video_stage_open(vlib_stage_decoding_config_t *cfg) +{ + vp_os_mutex_init( &video_stage_config.mutex ); + + vp_os_mutex_lock( &video_stage_config.mutex ); + video_stage_config.data = vp_os_malloc(512 * 512 * 4); + vp_os_memset(video_stage_config.data, 0x0, 512 * 512 * 4); + vp_os_mutex_unlock( &video_stage_config.mutex ); + + return C_OK; +} + +C_RESULT video_stage_transform(vlib_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) + { + out->status = in->status; + } + + if(out->status == VP_API_STATUS_PROCESSING ) + { + vp_os_mutex_lock( &video_stage_config.mutex ); + + if(cfg->num_picture_decoded > video_stage_config.num_picture_decoded) + { + video_stage_config.num_picture_decoded = cfg->num_picture_decoded; + video_stage_config.num_frame = cfg->controller.num_frames; + video_stage_config.bytesPerPixel = 2; + video_stage_config.widthImage = cfg->controller.width; + video_stage_config.heightImage = cfg->controller.height; + + if (video_stage_config.data != NULL) + { + vp_os_memcpy(video_stage_config.data, cfg->picture->y_buf, cfg->picture->width * cfg->picture->height ); + } + + out->numBuffers = in->numBuffers; + out->indexBuffer = in->indexBuffer; + out->buffers = in->buffers; + } + + vp_os_mutex_unlock( &video_stage_config.mutex ); + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT video_stage_close(vlib_stage_decoding_config_t *cfg) +{ + vp_os_free(video_stage_config.data); + + return C_OK; +} + +video_stage_config_t* video_stage_get(void) +{ + return &video_stage_config; +} + +void video_stage_init(void) +{ + vp_os_mutex_init(&video_stage_mutex); + vp_os_cond_init(&video_stage_condition, &video_stage_mutex); +} + +void video_stage_suspend_thread(void) +{ + vp_os_mutex_lock(&video_stage_mutex); + video_stage_in_pause = TRUE; + vp_os_mutex_unlock(&video_stage_mutex); +} + +void video_stage_resume_thread(void) +{ + vp_os_mutex_lock(&video_stage_mutex); + vp_os_cond_signal(&video_stage_condition); + video_stage_in_pause = FALSE; + vp_os_mutex_unlock(&video_stage_mutex); +} + +DEFINE_THREAD_ROUTINE(video_stage, data) +{ + C_RESULT res; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_api_picture_t picture; + + vlib_stage_decoding_config_t vec; + + vp_os_memset(&icc, 0, sizeof( icc )); + vp_os_memset(&vec, 0, sizeof( vec )); + vp_os_memset(&picture, 0, sizeof( picture )); + +//#ifdef RECORD_VIDEO +// video_stage_recorder_config_t vrc; +//#endif + + /// Picture configuration + picture.format = PIX_FMT_RGB565; + + picture.width = 512; + picture.height = 512; + picture.framerate = 15; + + picture.y_buf = vp_os_malloc( picture.width * picture.height * 2); + picture.cr_buf = NULL; + picture.cb_buf = NULL; + + picture.y_line_size = picture.width * 2; + picture.cb_line_size = 0; + picture.cr_line_size = 0; + + icc.com = COM_VIDEO(); + icc.buffer_size = 100000; + icc.protocol = VP_COM_UDP; + COM_CONFIG_SOCKET_VIDEO(&icc.socket, VP_COM_CLIENT, VIDEO_PORT, wifi_ardrone_ip); + + vec.width = 512; + vec.height = 512; + vec.picture = &picture; + vec.luma_only = FALSE; + vec.block_mode_enable = TRUE; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&icc; + stages[pipeline.nb_stages].funcs = video_com_funcs; + pipeline.nb_stages++; + + stages[pipeline.nb_stages].type = VP_API_FILTER_DECODER; + stages[pipeline.nb_stages].cfg = (void*)&vec; + stages[pipeline.nb_stages].funcs = vlib_decoding_funcs; + pipeline.nb_stages++; + +/* +#ifdef RECORD_VIDEO + stages[pipeline.nb_stages].type = VP_API_FILTER_DECODER; + stages[pipeline.nb_stages].cfg = (void*)&vrc; + stages[pipeline.nb_stages].funcs = video_recorder_funcs; + pipeline.nb_stages++; +#endif +*/ + stages[pipeline.nb_stages].type = VP_API_OUTPUT_LCD; + stages[pipeline.nb_stages].cfg = (void*)&vec; + stages[pipeline.nb_stages].funcs = video_stage_funcs; + pipeline.nb_stages++; + + pipeline.stages = &stages[0]; + + if( !ardrone_tool_exit() ) + { + PRINT("\nvideo stage thread initialisation\n\n"); + + res = vp_api_open(&pipeline, &pipeline_handle); + + if( SUCCEED(res) ) + { + int loop = SUCCESS; + out.status = VP_API_STATUS_PROCESSING; +#ifdef RECORD_VIDEO + { + DEST_HANDLE dest; + dest.stage = 2; + dest.pipeline = pipeline_handle; + vp_api_post_message( dest, PIPELINE_MSG_START, NULL, (void*)NULL); + } +#endif + + while( !ardrone_tool_exit() && (loop == SUCCESS) ) + { + if(video_stage_in_pause) + { + vp_os_mutex_lock(&video_stage_mutex); + icc.num_retries = VIDEO_MAX_RETRIES; + vp_os_cond_wait(&video_stage_condition); + vp_os_mutex_unlock(&video_stage_mutex); + } + + if( SUCCEED(vp_api_run(&pipeline, &out)) ) { + if( (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING) ) { + loop = SUCCESS; + } + } + else loop = -1; // Finish this thread + } + + vp_api_close(&pipeline, &pipeline_handle); + } + } + + PRINT(" video stage thread ended\n\n"); + + return (THREAD_RET)0; +} + +uint32_t video_stage_get_num_retries(void) +{ + return icc.num_retries; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.h b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.h new file mode 100644 index 0000000..27928e2 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage.h @@ -0,0 +1,56 @@ +/* + * video_stage.h + * Test + * + * Created by FrĂ©dĂ©ric D'HAEYER on 22/02/10. + * Copyright 2010 Parrot SA. All rights reserved. + * + */ +#ifndef _VIDEO_STAGE_H_ +#define _VIDEO_STAGE_H_ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +//#define RECORD_VIDEO +//#ifdef RECORD_VIDEO +//# include +//#endif + +PROTO_THREAD_ROUTINE(video_stage, data); + +typedef struct _video_stage_config_t +{ + vp_os_mutex_t mutex; + uint32_t widthImage; + uint32_t heightImage; + uint32_t bytesPerPixel; + uint32_t num_picture_decoded; // Number of pictures decoded + uint32_t num_frame; // Frame index of the last decoded picture, for association with navdata detect_tag frame index + void* data; +} video_stage_config_t; + +static C_RESULT video_stage_open(vlib_stage_decoding_config_t *cfg); +static C_RESULT video_stage_transform(vlib_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +static C_RESULT video_stage_close(vlib_stage_decoding_config_t *cfg); + +void video_stage_init(void); +void video_stage_suspend_thread(void); +void video_stage_resume_thread(void); +uint32_t video_stage_get_num_retries(void); +video_stage_config_t* video_stage_get(void); + +#endif // _VIDEO_STAGE_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.c b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.c new file mode 100644 index 0000000..d06282e --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.c @@ -0,0 +1,700 @@ +/* CODE ADAPATED FOR ARDRONE NAVIGATION FROM : + * + * Libavformat API example: Output a media file in any supported + * libavformat format. The default codecs are used. + * + * Copyright (c) 2003 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +/*#ifndef USE_FFMPEG_RECORDER +#define USE_FFMPEG_RECORDER +#endif*/ + +#ifdef USE_FFMPEG_RECORDER + +/* From FFMPEG example */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + + + +/* Should be in avutil.h but Ubuntu 10.04 package is too old + * http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/libavutil_2avutil_8h-source.html + * */ +#if LIBAVUTIL_VERSION_MAJOR < 50 +#define AV_PKT_FLAG_KEY 0x0001 +enum AVMediaType { + AVMEDIA_TYPE_UNKNOWN = -1, + AVMEDIA_TYPE_VIDEO, + AVMEDIA_TYPE_AUDIO, + AVMEDIA_TYPE_DATA, + AVMEDIA_TYPE_SUBTITLE, + AVMEDIA_TYPE_ATTACHMENT, + AVMEDIA_TYPE_NB + }; +#endif + + +#include +#ifndef _WIN32 + #include +#else + #include + #include // for timeval structure + + int gettimeofday (struct timeval *tp, void *tz) + { + struct _timeb timebuffer; + _ftime (&timebuffer); + tp->tv_sec = (long)timebuffer.time; + tp->tv_usec = (long)timebuffer.millitm * 1000; + return 0; + } +#endif + +#include +#include + +#include +#include + +/*#ifdef USE_VIDEO_YUV +#define VIDEO_FILE_EXTENSION "yuv" +#else +#define VIDEO_FILE_EXTENSION "y" +#endif +#define VIDEO_TIMESTAMPS_FILE_EXTENSION "time.txt" + +#ifndef VIDEO_FILE_DEFAULT_PATH +#ifdef USE_ELINUX +#define VIDEO_FILE_DEFAULT_PATH "/data/video" +#else +#define VIDEO_FILE_DEFAULT_PATH "." +#endif +#endif +*/ +#define VIDEO_FILE_DEFAULT_PATH "." + + /*- LibAVFormat variables */ + const char *filename; + AVOutputFormat *fmt; + AVFormatContext *oc; + AVStream *video_st; + double video_pts; + int i; + +#define STREAM_FRAME_RATE (60) +#define STREAM_BIT_RATE_KBITS 1600 +#define STREAM_PIX_FMT PIX_FMT_YUV420P /* default pix_fmt */ + +static int sws_flags = SWS_BICUBIC; + +AVFrame *picture_to_encode=NULL, *tmp_picture=NULL; +uint8_t *video_outbuf=NULL; +int frame_count=0, video_outbuf_size=0; + + +const vp_api_stage_funcs_t video_ffmpeg_recorder_funcs = { + (vp_api_stage_handle_msg_t) video_stage_ffmpeg_recorder_handle, + (vp_api_stage_open_t) video_stage_ffmpeg_recorder_open, + (vp_api_stage_transform_t) video_stage_ffmpeg_recorder_transform, + (vp_api_stage_close_t) video_stage_ffmpeg_recorder_close +}; + +char video_filename_ffmpeg[VIDEO_FILENAME_LENGTH]; + +struct +{ + int width,height; + char* buffer; + unsigned long long int timestamp_us; + int frame_number; +}previous_frame; + + +/******************************************************************************************************************************************/ + +void create_video_file(const char*filename,int width,int height) +{ +/* auto detect the output format from the name. default is + mpeg. */ + //fmt = av_guess_format(NULL, filename, NULL); + +#if (LIBAVFORMAT_VERSION_INT>=AV_VERSION_INT(52,81,0)) + #define libavformat_guess_format av_guess_format +#else + #define libavformat_guess_format guess_format +#endif + + fmt = libavformat_guess_format(NULL, filename, NULL); + + if (!fmt) { + printf("Could not deduce output format from file extension: using MPEG.\n"); + //fmt = av_guess_format("mpeg", NULL, NULL); + fmt = libavformat_guess_format("mpeg", NULL, NULL); + } + if (!fmt) { + fprintf(stderr, "Could not find suitable output format\n"); + exit(1); + } + + /* allocate the output media context */ + oc = avformat_alloc_context(); + if (!oc) { + fprintf(stderr, "Memory error\n"); + exit(1); + } + oc->oformat = fmt; + snprintf(oc->filename, sizeof(oc->filename), "%s", filename); + + /* add the audio and video streams using the default format codecs + and initialize the codecs */ + video_st = NULL; + + if (fmt->video_codec != CODEC_ID_NONE) { + video_st = add_video_stream(oc, fmt->video_codec,width,height); + } + + /* set the output parameters (must be done even if no + parameters). */ + if (av_set_parameters(oc, NULL) < 0) { + fprintf(stderr, "Invalid output format parameters\n"); + exit(1); + } + + dump_format(oc, 0, filename, 1); + + /* now that all the parameters are set, we can open the audio and + video codecs and allocate the necessary encode buffers */ + if (video_st) + open_video(oc, video_st); + + /* open the output file, if needed */ + if (!(fmt->flags & AVFMT_NOFILE)) { + if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) { + fprintf(stderr, "Could not open '%s'\n", filename); + exit(1); + } + } + + /* write the stream header, if any */ + av_write_header(oc); + } + + +void close_video_file() +{ +/* write the trailer, if any. the trailer must be written + * before you close the CodecContexts open when you wrote the + * header; otherwise write_trailer may try to use memory that + * was freed on av_codec_close() */ + av_write_trailer(oc); + + /* close each codec */ + if (video_st) + close_video(oc, video_st); + + /* free the streams */ + for(i = 0; i < oc->nb_streams; i++) { + av_freep(&oc->streams[i]->codec); + av_freep(&oc->streams[i]); + } + + if (!(fmt->flags & AVFMT_NOFILE)) { + /* close the output file */ + url_fclose(oc->pb); + } + + /* free the stream */ + av_free(oc); +} + + + + +/**************************************************************/ +/* video output */ + + + +/* add a video output stream */ + AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id, int width, int height) +{ + AVCodecContext *c; + AVStream *st; + + st = av_new_stream(oc, 0); + if (!st) { + fprintf(stderr, "Could not alloc stream\n"); + exit(1); + } + + c = st->codec; + c->codec_id = codec_id; + c->codec_type = AVMEDIA_TYPE_VIDEO; + + /* put sample parameters */ + c->bit_rate = (STREAM_BIT_RATE_KBITS)*1000; + /* resolution must be a multiple of two */ + c->width = width; + c->height = height; + /* time base: this is the fundamental unit of time (in seconds) in terms + of which frame timestamps are represented. for fixed-fps content, + timebase should be 1/framerate and timestamp increments should be + identically 1. */ + c->time_base.den = STREAM_FRAME_RATE; + c->time_base.num = 1; + c->gop_size = 12; /* emit one intra frame every twelve frames at most */ + c->pix_fmt = STREAM_PIX_FMT; + if (c->codec_id == CODEC_ID_MPEG2VIDEO) { + /* just for testing, we also add B frames */ + c->max_b_frames = 2; + } + if (c->codec_id == CODEC_ID_MPEG1VIDEO){ + /* Needed to avoid using macroblocks in which some coeffs overflow. + This does not happen with normal video, it just happens here as + the motion of the chroma plane does not match the luma plane. */ + c->mb_decision=2; + } + // some formats want stream headers to be separate + if(oc->oformat->flags & AVFMT_GLOBALHEADER) + c->flags |= CODEC_FLAG_GLOBAL_HEADER; + + return st; +} + + AVFrame *alloc_picture(enum PixelFormat pix_fmt, int width, int height) +{ + AVFrame *picture; + uint8_t *picture_buf; + int size; + + picture = avcodec_alloc_frame(); + if (!picture) + return NULL; + size = avpicture_get_size(pix_fmt, width, height); + picture_buf = av_malloc(size); + if (!picture_buf) { + av_free(picture); + return NULL; + } + avpicture_fill((AVPicture *)picture, picture_buf, + pix_fmt, width, height); + return picture; +} + + void open_video(AVFormatContext *oc, AVStream *st) +{ + AVCodec *codec; + AVCodecContext *c; + + c = st->codec; + + /* find the video encoder */ + codec = avcodec_find_encoder(c->codec_id); + if (!codec) { + fprintf(stderr, "codec not found\n"); + exit(1); + } + + /* open the codec */ + if (avcodec_open(c, codec) < 0) { + fprintf(stderr, "could not open codec\n"); + exit(1); + } + + video_outbuf = NULL; + if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) { + /* allocate output buffer */ + /* XXX: API change will be done */ + /* buffers passed into lav* can be allocated any way you prefer, + as long as they're aligned enough for the architecture, and + they're freed appropriately (such as using av_free for buffers + allocated with av_malloc) */ + video_outbuf_size = 200000; + video_outbuf = av_malloc(video_outbuf_size); + } + + /* allocate the encoded raw picture */ + picture_to_encode = avcodec_alloc_frame(); + //alloc_picture(c->pix_fmt, c->width, c->height); + /*if (!picture) { + fprintf(stderr, "Could not allocate picture\n"); + exit(1); + }*/ + + /* if the output format is not YUV420P, then a temporary YUV420P + picture is needed too. It is then converted to the required + output format */ + tmp_picture = NULL; + if (c->pix_fmt != PIX_FMT_YUV420P) { + tmp_picture = alloc_picture(PIX_FMT_YUV420P, c->width, c->height); + if (!tmp_picture) { + fprintf(stderr, "Could not allocate temporary picture\n"); + exit(1); + } + } +} + + + void write_video_frame(AVFormatContext *oc, AVStream *st) +{ + int out_size, ret; + AVCodecContext *c; + static struct SwsContext *img_convert_ctx; + + //printf("Here0 \n"); + + c = st->codec; + + if (c->pix_fmt != PIX_FMT_YUV420P) { + /* as we only generate a YUV420P picture, we must convert it + to the codec pixel format if needed */ + if (img_convert_ctx == NULL) { + + #if (LIBSWSCALE_VERSION_INTwidth, c->height, + PIX_FMT_YUV420P, + c->width, c->height, + c->pix_fmt, + sws_flags, NULL, NULL, NULL); + #else + img_convert_ctx = sws_alloc_context(); + + if (img_convert_ctx == NULL) { + fprintf(stderr, "Cannot initialize the conversion context\n"); + exit(1); + } + + /* see http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/118362 */ + /* see http://ffmpeg-users.933282.n4.nabble.com/Documentation-for-sws-init-context-td2956723.html */ + + av_set_int(img_convert_ctx, "srcw", c->width); + av_set_int(img_convert_ctx, "srch", c->height); + + av_set_int(img_convert_ctx, "dstw", c->width); + av_set_int(img_convert_ctx, "dsth", c->height); + + av_set_int(img_convert_ctx, "src_format", PIX_FMT_YUV420P); + av_set_int(img_convert_ctx, "dst_format", c->pix_fmt); + + av_set_int(img_convert_ctx, "param0", 0); + av_set_int(img_convert_ctx, "param1", 0); + + av_set_int(img_convert_ctx, "flags", sws_flags); + + sws_init_context(img_convert_ctx,NULL,NULL); + #endif + + } + sws_scale(img_convert_ctx, (const uint8_t* const *)tmp_picture->data, + tmp_picture->linesize, + 0, c->height, picture_to_encode->data, picture_to_encode->linesize); + } else { + + } + + + if (oc->oformat->flags & AVFMT_RAWPICTURE) { + /* raw video case. The API will change slightly in the near + futur for that */ + AVPacket pkt; + av_init_packet(&pkt); + + pkt.flags |= AV_PKT_FLAG_KEY; + pkt.stream_index= st->index; + pkt.data= (uint8_t *)picture_to_encode; + pkt.size= sizeof(AVPicture); + + ret = av_interleaved_write_frame(oc, &pkt); + } else { + /* encode the image */ + //printf("Here1 \n"); + out_size = avcodec_encode_video(c, video_outbuf, video_outbuf_size, picture_to_encode); + /* if zero size, it means the image was buffered */ + if (out_size > 0) { + AVPacket pkt; + av_init_packet(&pkt); + + if (c->coded_frame->pts != AV_NOPTS_VALUE) + pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base); + if(c->coded_frame->key_frame) + pkt.flags |= AV_PKT_FLAG_KEY; + pkt.stream_index= st->index; + pkt.data= video_outbuf; + pkt.size= out_size; + + /* write the compressed frame in the media file */ + ret = av_interleaved_write_frame(oc, &pkt); + } else { + ret = 0; + } + } + if (ret != 0) { + fprintf(stderr, "Error while writing video frame\n"); + exit(1); + } + frame_count++; +} + + void close_video(AVFormatContext *oc, AVStream *st) +{ + avcodec_close(st->codec); + //av_free(picture->data[0]); + av_free(picture_to_encode); + picture_to_encode = NULL; + if (tmp_picture) { + av_free(tmp_picture->data[0]); + av_free(tmp_picture); + tmp_picture=NULL; + } + av_free(video_outbuf); +} + + +/******************************************************************************************************************************************/ +C_RESULT +video_stage_ffmpeg_recorder_handle (video_stage_ffmpeg_recorder_config_t * cfg, PIPELINE_MSG msg_id, void *callback, void *param) +{ + //return (VP_SUCCESS); + + printf("FFMPEG recorder message handler.\n"); + switch (msg_id) + { + case PIPELINE_MSG_START: + { + + if(cfg->startRec==VIDEO_RECORD_STOP) + cfg->startRec=VIDEO_RECORD_HOLD; + else + cfg->startRec=VIDEO_RECORD_STOP; + } + break; + default: + break; + } + return (VP_SUCCESS); +} + + +/******************************************************************************************************************************************/ +C_RESULT video_stage_ffmpeg_recorder_open(video_stage_ffmpeg_recorder_config_t *cfg) +{ + //return C_OK; + + previous_frame.width = previous_frame.height = 0; + previous_frame.buffer = NULL; + previous_frame.timestamp_us = 0; + previous_frame.frame_number =0; + + cfg->startRec=VIDEO_RECORD_STOP; + + /* initialize libavcodec, and register all codecs and formats */ + av_register_all(); + + return C_OK; +} + + +/******************************************************************************************************************************************/ +C_RESULT video_stage_ffmpeg_recorder_transform(video_stage_ffmpeg_recorder_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + time_t temptime; + struct timeval tv; + struct tm *atm; + long long int current_timestamp_us; + static long long int first_frame_timestamp_us=0; + static int frame_counter=0; + int i; + int frame_size; + static int flag_video_file_open=0; + + vp_os_mutex_lock( &out->lock ); + vp_api_picture_t* picture = (vp_api_picture_t *) in->buffers; + + gettimeofday(&tv,NULL); + + temptime = (time_t)tv.tv_sec; + atm = localtime(&temptime); //atm = localtime(&tv.tv_sec); + + current_timestamp_us = tv.tv_sec *1000000 + tv.tv_usec; + + + if( out->status == VP_API_STATUS_INIT ) + { + out->numBuffers = 1; + out->indexBuffer = 0; + out->lineSize = NULL; + //out->buffers = (int8_t **) vp_os_malloc( sizeof(int8_t *) ); + } + + out->size = in->size; + out->status = in->status; + out->buffers = in->buffers; + + if( in->status == VP_API_STATUS_ENDED ) { + out->status = in->status; + } + else if(in->status == VP_API_STATUS_STILL_RUNNING) { + out->status = VP_API_STATUS_PROCESSING; + } + else { + out->status = in->status; + } + + + + if(cfg->startRec==VIDEO_RECORD_HOLD) + { + /* Create a new video file */ + + sprintf(video_filename_ffmpeg, "%s/video_%04d%02d%02d_%02d%02d%02d_w%i_h%i.mp4", + VIDEO_FILE_DEFAULT_PATH, + atm->tm_year+1900, atm->tm_mon+1, atm->tm_mday, + atm->tm_hour, atm->tm_min, atm->tm_sec, + picture->width, + picture->height); + + create_video_file(video_filename_ffmpeg, picture->width,picture->height); + flag_video_file_open=1; + + cfg->startRec=VIDEO_RECORD_START; + + first_frame_timestamp_us = current_timestamp_us; + frame_counter=1; + } + + if( out->size > 0 && out->status == VP_API_STATUS_PROCESSING && cfg->startRec==VIDEO_RECORD_START) + { + frame_size = ( previous_frame.width * previous_frame.height )*3/2; + + /* Send the previous frame to FFMPEG */ + if (previous_frame.buffer!=NULL) + { + /* Compute the number of frames to store to achieve 60 FPS + * This should be computed using the timestamp of the first frame + * to avoid error accumulation. + */ + int current_frame_number = (current_timestamp_us - first_frame_timestamp_us) / 16666; + int nb_frames_to_write = current_frame_number - previous_frame.frame_number; + + if (picture_to_encode!=NULL){ + picture_to_encode->data[0] = picture_to_encode->base[0] = picture->y_buf; + picture_to_encode->data[1] = picture_to_encode->base[1] = picture->cb_buf; + picture_to_encode->data[2] = picture_to_encode->base[2] = picture->cr_buf; + + picture_to_encode->linesize[0] = picture->width; + picture_to_encode->linesize[1] = picture->width/2; + picture_to_encode->linesize[2] = picture->width/2; + } + + for (i=0;iwidth || previous_frame.height!=picture->height)) + { + vp_os_free(previous_frame.buffer); + previous_frame.buffer=NULL; + } + if (previous_frame.buffer==NULL) + { + previous_frame.width = picture->width; + previous_frame.height = picture->height; + frame_size = ( previous_frame.width * previous_frame.height )*3/2; + printf("Allocating previous frame.\n"); + previous_frame.buffer=vp_os_malloc( frame_size ); + } + + /* Copy the current frame in a buffer so it can be encoded at next stage call */ + if (previous_frame.buffer!=NULL) + { + char * dest = previous_frame.buffer; + int size = picture->width*picture->height; + vp_os_memcpy(dest,picture->y_buf,size); + + dest+=size; + size /= 4; + vp_os_memcpy(dest,picture->cb_buf,size); + + dest+=size; + vp_os_memcpy(dest,picture->cr_buf,size); + } + } + } + + + else + { + if(cfg->startRec==VIDEO_RECORD_STOP && flag_video_file_open) + { + close_video_file(); + flag_video_file_open=0; + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + + + +/******************************************************************************************************************************************/ + + +C_RESULT video_stage_ffmpeg_recorder_close(video_stage_ffmpeg_recorder_config_t *cfg) +{ + if( cfg->fp != NULL ) + fclose( cfg->fp ); + + return C_OK; +} + + + +#endif diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.h b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.h new file mode 100644 index 0000000..a7c6460 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_ffmpeg_recorder.h @@ -0,0 +1,51 @@ +#ifndef _VIDEO_STAGE_FFMPEG_RECORDER_H_ +#define _VIDEO_STAGE_FFMPEG_RECORDER_H_ + +/* From FFMPEG example */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + + +#ifndef _VIDEO_RECORD_STATE_ENUM_ +#define _VIDEO_RECORD_STATE_ENUM_ +#endif + +typedef struct _video_stage_ffmpeg_recorder_config_t +{ + char video_filename[1024]; + FILE* fp; + video_record_state startRec; +} video_stage_ffmpeg_recorder_config_t; + +C_RESULT video_stage_ffmpeg_recorder_handle (video_stage_ffmpeg_recorder_config_t * cfg, PIPELINE_MSG msg_id, void *callback, void *param); +C_RESULT video_stage_ffmpeg_recorder_open(video_stage_ffmpeg_recorder_config_t *cfg); +C_RESULT video_stage_ffmpeg_recorder_transform(video_stage_ffmpeg_recorder_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT video_stage_ffmpeg_recorder_close(video_stage_ffmpeg_recorder_config_t *cfg); + + + + +void create_video_file(const char*filename,int width,int height); +void close_video_file(); +AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id,int width, int height); +AVFrame *alloc_picture(enum PixelFormat pix_fmt, int width, int height); +void open_video(AVFormatContext *oc, AVStream *st); +void write_video_frame(AVFormatContext *oc, AVStream *st); +void close_video(AVFormatContext *oc, AVStream *st); + +extern const vp_api_stage_funcs_t video_ffmpeg_recorder_funcs; + +#endif // _VIDEO_STAGE_RECORDER_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.c b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.c new file mode 100644 index 0000000..8582197 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.c @@ -0,0 +1,255 @@ +#include +#ifndef _WIN32 + #include +#else + + #include + #include // for timeval structure + + int gettimeofday (struct timeval *tp, void *tz) + { + struct _timeb timebuffer; + _ftime (&timebuffer); + tp->tv_sec = (long)timebuffer.time; + tp->tv_usec = (long)timebuffer.millitm * 1000; + return 0; + } +#endif + +#include +#include + +#include +#include + +//#define USE_FIXED_60FPS + +#ifdef USE_VIDEO_YUV +#define VIDEO_FILE_EXTENSION "yuv" +#else +#define VIDEO_FILE_EXTENSION "y" +#endif + +#ifndef VIDEO_FILE_DEFAULT_PATH +#ifdef USE_ELINUX +#define VIDEO_FILE_DEFAULT_PATH "/data/video" +#else +#define VIDEO_FILE_DEFAULT_PATH "." +#endif +#endif + +#if defined (NAVDATA_VISION_INCLUDED) && defined (USE_ELINUX) +static int32_t picture_captured = 0; +extern void navdata_set_raw_picture(int32_t new_raw_picture); +#endif + +const vp_api_stage_funcs_t video_recorder_funcs = { + (vp_api_stage_handle_msg_t) video_stage_recorder_handle, + (vp_api_stage_open_t) video_stage_recorder_open, + (vp_api_stage_transform_t) video_stage_recorder_transform, + (vp_api_stage_close_t) video_stage_recorder_close +}; + +char video_filename[VIDEO_FILENAME_LENGTH]; + +C_RESULT +video_stage_recorder_handle (video_stage_recorder_config_t * cfg, PIPELINE_MSG msg_id, void *callback, void *param) +{ + void (*recorder_callback)(video_stage_recorder_config_t*) = callback; + + switch (msg_id) + { + case PIPELINE_MSG_START: //video + { + if(cfg->startRec==VIDEO_RECORD_STOP) + { + cfg->startRec=VIDEO_RECORD_HOLD; + } + else + { + cfg->startRec=VIDEO_RECORD_STOP; + } + } + break; + + case PIPELINE_MSG_COMMAND: //picture + { + if(cfg->startRec==VIDEO_RECORD_STOP) + { + cfg->startRec=VIDEO_PICTURE_HOLD; + } + else + { + cfg->startRec=VIDEO_RECORD_STOP; + } + } + default: + { + break; + } + } + if (recorder_callback!=NULL) { recorder_callback(cfg); } + + return (VP_SUCCESS); +} + +C_RESULT video_stage_recorder_open(video_stage_recorder_config_t *cfg) +{ + cfg->startRec=VIDEO_RECORD_STOP; + return C_OK; +} + +C_RESULT video_stage_recorder_transform(video_stage_recorder_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ +#ifndef _WIN32 + + time_t temptime; + struct timeval tv; +#ifdef USE_FIXED_60FPS + static struct timeval old_tv; + static uint8_t* old_pic=NULL; + unsigned long delta_us=0; + int ratio=0; + int i=0; +#endif + vp_os_mutex_lock( &out->lock ); + + if( out->status == VP_API_STATUS_INIT ) + { + out->numBuffers = 1; + out->indexBuffer = 0; + out->lineSize = NULL; + //out->buffers = (int8_t **) vp_os_malloc( sizeof(int8_t *) ); + } + + out->size = in->size; + out->status = in->status; + out->buffers = in->buffers; + + if( in->status == VP_API_STATUS_ENDED ) { + out->status = in->status; + } + else if(in->status == VP_API_STATUS_STILL_RUNNING) { + out->status = VP_API_STATUS_PROCESSING; + } + else { + out->status = in->status; + } + + gettimeofday(&tv,NULL); + vp_api_picture_t* picture = (vp_api_picture_t *) in->buffers; + + if(cfg->startRec==VIDEO_RECORD_HOLD) + { + struct tm *atm; + + + temptime = (time_t)tv.tv_sec; + atm = localtime(&temptime); //atm = localtime(&tv.tv_sec); + printf("recording video\n"); + sprintf(cfg->video_filename, "%s/video_%04d%02d%02d_%02d%02d%02d_w%i_h%i.%s", + VIDEO_FILE_DEFAULT_PATH, + atm->tm_year+1900, atm->tm_mon+1, atm->tm_mday, + atm->tm_hour, atm->tm_min, atm->tm_sec, + picture->width,picture->height, + VIDEO_FILE_EXTENSION); + + memcpy(video_filename, cfg->video_filename, sizeof(video_filename)); + + cfg->fp = fopen(cfg->video_filename, "wb"); + if (cfg->fp == NULL) + printf ("error open file %s\n", cfg->video_filename); + cfg->startRec=VIDEO_RECORD_START; + } + + if(cfg->startRec==VIDEO_PICTURE_HOLD) + { + struct tm *atm; + + + temptime = (time_t)tv.tv_sec; + atm = localtime(&temptime); //atm = localtime(&tv.tv_sec); + + printf("recording picture\n"); + sprintf(cfg->video_filename, "%s/picture_%04d%02d%02d_%02d%02d%02d_w%i_h%i.%s", + VIDEO_FILE_DEFAULT_PATH, + atm->tm_year+1900, atm->tm_mon+1, atm->tm_mday, + atm->tm_hour, atm->tm_min, atm->tm_sec, + picture->width,picture->height, + VIDEO_FILE_EXTENSION); + + memcpy(video_filename, cfg->video_filename, sizeof(video_filename)); + cfg->fp = fopen(cfg->video_filename, "wb"); + if (cfg->fp == NULL) + printf ("error open file %s\n", cfg->video_filename); + cfg->startRec=VIDEO_PICTURE_START; + } + if( cfg->fp != NULL && out->size > 0 && out->status == VP_API_STATUS_PROCESSING && (cfg->startRec==VIDEO_RECORD_START||cfg->startRec==VIDEO_PICTURE_START )) + { + + +#if defined (NAVDATA_VISION_INCLUDED) && defined (USE_ELINUX) + navdata_set_raw_picture(picture_captured++); +#endif + +#ifdef USE_FIXED_60FPS + delta_us=(tv.tv_sec*1000000+tv.tv_usec)-(old_tv.tv_sec*1000000+old_tv.tv_usec); + ratio=delta_us/16666; + old_tv=tv; + + for(i=0; iwidth * picture->height, 1, cfg->fp); +#ifdef USE_VIDEO_YUV + fwrite(old_pic+(picture->width * picture->height), picture->width * picture->height >> 1, 1, cfg->fp); +#endif + } + + if(old_pic==NULL) + { + old_pic=vp_os_malloc(picture->width * picture->height*3/2); + } + + memcpy(old_pic, picture->y_buf, picture->width * picture->height); + memcpy(old_pic + picture->width * picture->height, picture->cb_buf, picture->width * picture->height >> 2); + memcpy(old_pic + picture->width * picture->height*5/4, picture->cr_buf, picture->width * picture->height >> 2); +#endif //USE_FIXED_60FPS + + fwrite(picture->y_buf, picture->width * picture->height, 1, cfg->fp); +#ifdef USE_VIDEO_YUV + fwrite(picture->cb_buf, picture->width * picture->height >> 2, 1, cfg->fp); + fwrite(picture->cr_buf, picture->width * picture->height >> 2, 1, cfg->fp); +#endif + if(cfg->startRec==VIDEO_PICTURE_START )//if picture, we stop after one picture ( and if video we continue ) + { + cfg->startRec=VIDEO_RECORD_STOP; + } + } + else + { + if(cfg->startRec==VIDEO_RECORD_STOP && cfg->fp !=NULL) + { +#ifdef USE_FIXED_60FPS + if(old_pic) + { + vp_os_free(old_pic); + old_pic=NULL; + } +#endif + fclose(cfg->fp); + cfg->fp=NULL; + } + } + + vp_os_mutex_unlock( &out->lock ); +#endif + return C_OK; +} + +C_RESULT video_stage_recorder_close(video_stage_recorder_config_t *cfg) +{ + if( cfg->fp != NULL ) + fclose( cfg->fp ); + + return C_OK; +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.h b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.h new file mode 100644 index 0000000..9da9e20 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/video_stage_recorder.h @@ -0,0 +1,35 @@ +#ifndef _VIDEO_STAGE_RECORDER_H_ +#define _VIDEO_STAGE_RECORDER_H_ + +#include +#include + +#define VIDEO_FILENAME_LENGTH 1024 + +#ifndef _VIDEO_RECORD_STATE_ENUM_ +#define _VIDEO_RECORD_STATE_ENUM_ +typedef enum +{ + VIDEO_RECORD_HOLD, // Video recording is on hold, waiting for the start command. This is the default state. + VIDEO_RECORD_START, // Video recording has started. + VIDEO_PICTURE_START, + VIDEO_PICTURE_HOLD, + VIDEO_RECORD_STOP // Video recording has been stopped. Stage will end and restart. +} video_record_state; +#endif + +typedef struct _video_stage_recorder_config_t +{ + char video_filename[VIDEO_FILENAME_LENGTH]; + FILE* fp; + video_record_state startRec; +} video_stage_recorder_config_t; + +C_RESULT video_stage_recorder_handle (video_stage_recorder_config_t * cfg, PIPELINE_MSG msg_id, void *callback, void *param); +C_RESULT video_stage_recorder_open(video_stage_recorder_config_t *cfg); +C_RESULT video_stage_recorder_transform(video_stage_recorder_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT video_stage_recorder_close(video_stage_recorder_config_t *cfg); + +extern const vp_api_stage_funcs_t video_recorder_funcs; + +#endif // _VIDEO_STAGE_RECORDER_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.c b/ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.c new file mode 100644 index 0000000..7d8f5a5 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.c @@ -0,0 +1,84 @@ +#include +#include +#include + +#include + +const vp_api_stage_funcs_t vlib_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vlib_stage_decoding_open, + (vp_api_stage_transform_t) vlib_stage_decoding_transform, + (vp_api_stage_close_t) vlib_stage_decoding_close +}; + +C_RESULT vlib_stage_decoding_open(vlib_stage_decoding_config_t *cfg) +{ + video_codec_open( &cfg->controller, UVLC_CODEC ); + video_controller_set_motion_estimation( &cfg->controller, FALSE ); + video_controller_set_format( &cfg->controller, ACQ_WIDTH, ACQ_HEIGHT ); + + vp_os_free( cfg->controller.in_stream.bytes ); + + return C_OK; +} + +C_RESULT vlib_stage_decoding_transform(vlib_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)&cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) { + out->status = in->status; + } + + if(out->status == VP_API_STATUS_PROCESSING ) + { + // If out->size == 1 it means picture is ready + out->size = 0; + + cfg->controller.in_stream.bytes = (uint32_t*)in->buffers[0]; + cfg->controller.in_stream.used = in->size; + cfg->controller.in_stream.size = in->size; + cfg->controller.in_stream.index = 0; + cfg->controller.in_stream.length = 32; + cfg->controller.in_stream.code = 0; + + got_image = FALSE; + video_decode_blockline( &cfg->controller, cfg->picture, &got_image ); + + if( got_image ) + { + // we got one picture + out->size = 1; + +#ifndef USE_VIDEO_YUV + int32_t i; + for(i = 0; i < cfg->picture->width * cfg->picture->height / 4; i++ ) + { + cfg->picture->cr_buf[i] = 0x80; + cfg->picture->cb_buf[i] = 0x80; + } +#endif + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT vlib_stage_decoding_close(vlib_stage_decoding_config_t *cfg) +{ + return video_codec_close( &cfg->controller ); +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.h b/ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.h new file mode 100644 index 0000000..cbc303e --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/Video/vlib_stage_decode.h @@ -0,0 +1,20 @@ +#ifndef _VLIB_STAGE_DECODE_H_ +#define _VLIB_STAGE_DECODE_H_ + +#include +#include + +typedef struct _vlib_stage_decoding_config_t +{ + video_controller_t controller; + vp_api_picture_t* picture; + +} vlib_stage_decoding_config_t; + +C_RESULT vlib_stage_decoding_open(vlib_stage_decoding_config_t *cfg); +C_RESULT vlib_stage_decoding_transform(vlib_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT vlib_stage_decoding_close(vlib_stage_decoding_config_t *cfg); + +extern const vp_api_stage_funcs_t vlib_decoding_funcs; + +#endif // _VLIB_STAGE_DECODE_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_api.c b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_api.c new file mode 100644 index 0000000..7129c74 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_api.c @@ -0,0 +1,8 @@ + +#include + +#include +#include +#include +#include +#include diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.c b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.c new file mode 100644 index 0000000..5b411cb --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.c @@ -0,0 +1,108 @@ +#include + +#include + +#ifndef _WIN32 + #include +#else + + #include + + + static int gettimeofday (struct timeval *tp, void *tz) + { + struct _timeb timebuffer; + _ftime (&timebuffer); + tp->tv_sec = (long)timebuffer.time; + tp->tv_usec = (long)timebuffer.millitm * 1000; + return 0; + } +#endif + +C_RESULT ardrone_timer_reset(ardrone_timer_t* timer) +{ + vp_os_memset(timer, 0, sizeof(ardrone_timer_t)); + + return C_OK; +} + +C_RESULT ardrone_timer_update(ardrone_timer_t* timer) +{ + if( timer->init == FALSE ) + { + gettimeofday(&timer->tv_init, NULL); + timer->init = TRUE; + } + + gettimeofday(&timer->tv, NULL); + timer->tv.tv_sec -= timer->tv_init.tv_sec; + timer->tv.tv_usec -= timer->tv_init.tv_usec; + + return C_OK; +} + +int32_t ardrone_timer_elapsed_ms(ardrone_timer_t* timer) +{ + int32_t time; + + time = -1; + + if( timer->init ) + { + float32_t t, s, us; + + s = (float32_t)timer->tv.tv_sec; + us = (float32_t)timer->tv.tv_usec; + + t = (s * 1000.0f) + ( us / 1000.0f); + + time = (int32_t)t; + } + + return (int32_t)time; +} + +int32_t ardrone_timer_elapsed_us(ardrone_timer_t* timer) +{ + int32_t time; + + time = -1; + + if( timer->init ) + { + float32_t t, s, us; + + s = (float32_t)timer->tv.tv_sec; + us = (float32_t)timer->tv.tv_usec; + + t = (s * 1000.0f * 1000.0f) + us; + + time = (int32_t)t; + } + + return time; +} + +int32_t ardrone_timer_delta_ms(ardrone_timer_t* timer) +{ + ardrone_timer_t timer_current; + + timer_current.init = TRUE; + timer_current.tv_init = timer->tv_init; + + ardrone_timer_update(&timer_current); + + return ardrone_timer_elapsed_ms(&timer_current) - ardrone_timer_elapsed_ms(timer); +} + +int32_t ardrone_timer_delta_us(ardrone_timer_t* timer) +{ + ardrone_timer_t timer_current; + + timer_current.init = TRUE; + timer_current.tv_init = timer->tv_init; + + ardrone_timer_update(&timer_current); + + return ardrone_timer_elapsed_us(&timer_current) - ardrone_timer_elapsed_us(timer); +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.h b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.h new file mode 100644 index 0000000..df4edcf --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_time.h @@ -0,0 +1,25 @@ +#ifndef _ARDRONE_TIME_H_ +#define _ARDRONE_TIME_H_ + +#ifndef _WIN32 + #include +#endif + +#include + +typedef struct _ardrone_timer_t +{ + bool_t init; + struct timeval tv_init; + struct timeval tv; +} ardrone_timer_t; + +C_RESULT ardrone_timer_reset(ardrone_timer_t* timer); +C_RESULT ardrone_timer_update(ardrone_timer_t* timer); + +int32_t ardrone_timer_elapsed_ms(ardrone_timer_t* timer); +int32_t ardrone_timer_elapsed_us(ardrone_timer_t* timer); +int32_t ardrone_timer_delta_ms(ardrone_timer_t* timer); +int32_t ardrone_timer_delta_us(ardrone_timer_t* timer); + +#endif // _ARDRONE_TIME_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.c b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.c new file mode 100644 index 0000000..9c4f35b --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.c @@ -0,0 +1,441 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +int32_t MiscVar[NB_MISC_VARS] = { + DEFAULT_MISC1_VALUE, + DEFAULT_MISC2_VALUE, + DEFAULT_MISC3_VALUE, + DEFAULT_MISC4_VALUE + }; + +//static bool_t need_update = TRUE; +static ardrone_timer_t ardrone_tool_timer; +static int ArdroneToolRefreshTimeInUs = ARDRONE_REFRESH_MS * 1000; +static vp_os_mutex_t ardrone_tool_mutex; +static bool_t ardrone_tool_in_pause = FALSE; +char wifi_ardrone_ip[256] = { WIFI_ARDRONE_IP }; +char app_id [MULTICONFIG_ID_SIZE] = "00000000"; // Default application ID. +char app_name [APPLI_NAME_SIZE] = "Default application"; // Default application name. +char usr_id [MULTICONFIG_ID_SIZE] = "00000000"; // Default user ID. +char usr_name [USER_NAME_SIZE] = "Default user"; // Default user name. +char ses_id [MULTICONFIG_ID_SIZE] = "00000000"; // Default session ID. +char ses_name [SESSION_NAME_SIZE] = "Default session"; // Default session name. + +#ifndef __SDK_VERSION__ +#define __SDK_VERSION__ "1.8" // TEMPORARY LOCATION OF __SDK_VERSION__ !!! +#endif + + +int usleep(unsigned int usec); + +static bool_t send_com_watchdog = FALSE; + +void ardrone_tool_send_com_watchdog( void ) +{ + send_com_watchdog = TRUE; +} + +#ifndef NO_ARDRONE_MAINLOOP +static void ardrone_tool_usage( const char* appname ) +{ + printf("%s based on ARDrone Tool\n", appname); + printf("Be aware to not insert space in your options\n"); + + ardrone_tool_display_cmd_line_custom(); +} +#endif + +static void ardrone_toy_network_adapter_cb( const char* name ) +{ + strcpy( COM_CONFIG_NAVDATA()->itfName, name ); +} + +C_RESULT ardrone_tool_setup_com( const char* ssid ) +{ + C_RESULT res = C_OK; + +#ifdef CHECK_WIFI_CONFIG + if( FAILED(vp_com_init(COM_NAVDATA())) ) + { + DEBUG_PRINT_SDK("VP_Com : Failed to init com for navdata\n"); + vp_com_shutdown(COM_NAVDATA()); + res = C_FAIL; + } + + vp_com_network_adapter_lookup(COM_NAVDATA(), ardrone_toy_network_adapter_cb); + + if( SUCCEED(res) && FAILED(vp_com_local_config(COM_NAVDATA(), COM_CONFIG_NAVDATA())) ) + { + DEBUG_PRINT_SDK("VP_Com : Failed to configure com for navdata\n"); + vp_com_shutdown(COM_NAVDATA()); + res = C_FAIL; + } + + if( ssid != NULL ) + { + strcpy( ((vp_com_wifi_connection_t*)wifi_connection())->networkName, ssid ); + } + + if( SUCCEED(res) && FAILED(vp_com_connect(COM_NAVDATA(), COM_CONNECTION_NAVDATA(), NUM_ATTEMPTS))) + { + DEBUG_PRINT_SDK("VP_Com: Failed to connect for navdata\n"); + vp_com_shutdown(COM_NAVDATA()); + res = C_FAIL; + } +#else + vp_com_init(COM_NAVDATA()); + vp_com_network_adapter_lookup(COM_NAVDATA(), ardrone_toy_network_adapter_cb); + vp_com_local_config(COM_NAVDATA(), COM_CONFIG_NAVDATA()); + + if( ssid != NULL ) + { + strcpy( ((vp_com_wifi_connection_t*)wifi_connection())->networkName, ssid ); + } + + vp_com_connect(COM_NAVDATA(), COM_CONNECTION_NAVDATA(), NUM_ATTEMPTS); + ((vp_com_wifi_connection_t*)wifi_connection())->is_up=1; +#endif + + return res; +} + +#ifdef NO_ARDRONE_MAINLOOP +C_RESULT ardrone_tool_init( const char* ardrone_ip, size_t n, AT_CODEC_FUNCTIONS_PTRS *ptrs, const char *appname, const char *usrname) +{ + // Initalize mutex and condition + vp_os_mutex_init(&ardrone_tool_mutex); + ardrone_tool_in_pause = FALSE; + + // Initialize ardrone_control_config structures; + ardrone_tool_reset_configuration(); + // ardrone_control_config_default initialisation. Sould not be modified after that ! + vp_os_memcpy ((void *)&ardrone_control_config_default, (const void *)&ardrone_control_config, sizeof (ardrone_control_config_default)); + // initialization of application defined default values + vp_os_memcpy ((void *)&ardrone_application_default_config, (const void *)&ardrone_control_config, sizeof (ardrone_application_default_config)); + + //Fill structure AT codec and built the library AT commands. + if( ptrs != NULL ) + ardrone_at_init_with_funcs( ardrone_ip, n, ptrs ); + else + ardrone_at_init( ardrone_ip, n ); + + // Save appname/appid for reconnections + if (NULL != appname) + { + ardrone_gen_appid (appname, __SDK_VERSION__, app_id, app_name, sizeof (app_name)); + } + // Save usrname/usrid for reconnections + if (NULL != usrname) + { + ardrone_gen_usrid (usrname, usr_id, usr_name, sizeof (usr_name)); + } + // Create pseudorandom session id + ardrone_gen_sessionid (ses_id, ses_name, sizeof (ses_name)); + + // Init subsystems + ardrone_timer_reset(&ardrone_tool_timer); + ardrone_timer_update(&ardrone_tool_timer); + + ardrone_tool_input_init(); + ardrone_control_init(); + ardrone_tool_configuration_init(); + ardrone_navdata_client_init(); + + + //Opens a connection to AT port. + ardrone_at_open(); + + START_THREAD(navdata_update, 0); + START_THREAD(ardrone_control, 0); + + // Send start up configuration + ardrone_at_set_pmode( MiscVar[0] ); + ardrone_at_set_ui_misc( MiscVar[0], MiscVar[1], MiscVar[2], MiscVar[3] ); + + return C_OK; +} +#else +C_RESULT ardrone_tool_init(int argc, char **argv) +{ + C_RESULT res; + int32_t b_value = FALSE; + + // Initalize mutex and condition + vp_os_mutex_init(&ardrone_tool_mutex); + ardrone_tool_in_pause = FALSE; + + // Initialize ardrone_control_config structures; + ardrone_tool_reset_configuration(); + // ardrone_control_config_default initialisation. Sould not be modified after that ! + vp_os_memcpy ((void *)&ardrone_control_config_default, (const void *)&ardrone_control_config, sizeof (ardrone_control_config_default)); + // initialization of application defined default values + vp_os_memcpy ((void *)&ardrone_application_default_config, (const void *)&ardrone_control_config, sizeof (ardrone_application_default_config)); + ardrone_application_default_config.navdata_demo = b_value; + + // Save appname/appid for reconnections + if (NULL != argv[0]) + { + char *appname = NULL; + int lastSlashPos; + /* Cut the invoking name to the last / or \ character on the command line + * This avoids using differents app_id for applications called from different directories + * e.g. if argv[0] is "Build/Release/ardrone_navigation", appname will point to "ardrone_navigation" only + */ + for (lastSlashPos = strlen (argv[0])-1; + lastSlashPos > 0 && + argv[0][lastSlashPos] != '/' && + argv[0][lastSlashPos] != '\\'; + lastSlashPos--); + appname = &argv[0][lastSlashPos+1]; + ardrone_gen_appid (appname, __SDK_VERSION__, app_id, app_name, sizeof (app_name)); + } + + // Create pseudorandom session id + ardrone_gen_sessionid (ses_id, ses_name, sizeof (ses_name)); + + //Fill structure AT codec and built the library AT commands. + ardrone_at_init( wifi_ardrone_ip, strlen( wifi_ardrone_ip) ); + + // Init subsystems + ardrone_timer_reset(&ardrone_tool_timer); + ardrone_timer_update(&ardrone_tool_timer); + + ardrone_tool_input_init(); + ardrone_control_init(); + ardrone_tool_configuration_init(); + ardrone_navdata_client_init(); + + // Init custom tool + res = ardrone_tool_init_custom(argc, argv); + + //Opens a connection to AT port. + ardrone_at_open(); + + START_THREAD(navdata_update, 0); + START_THREAD(ardrone_control, 0); + + // Send start up configuration + ardrone_at_set_pmode( MiscVar[0] ); + ardrone_at_set_ui_misc( MiscVar[0], MiscVar[1], MiscVar[2], MiscVar[3] ); + + return res; +} +#endif + +C_RESULT ardrone_tool_set_refresh_time(int refresh_time_in_ms) +{ + ArdroneToolRefreshTimeInUs = refresh_time_in_ms * 1000; + + return C_OK; +} + +C_RESULT ardrone_tool_pause( void ) +{ + ardrone_navdata_client_suspend(); + + vp_os_mutex_lock(&ardrone_tool_mutex); + ardrone_tool_in_pause = TRUE; + vp_os_mutex_unlock(&ardrone_tool_mutex); + + return C_OK; +} + +C_RESULT ardrone_tool_resume( void ) +{ + ardrone_navdata_client_resume(); + + vp_os_mutex_lock(&ardrone_tool_mutex); + ardrone_tool_in_pause = FALSE; + vp_os_mutex_unlock(&ardrone_tool_mutex); + + return C_OK; +} + +C_RESULT ardrone_tool_update() +{ + int delta; + + C_RESULT res = C_OK; + + delta = ardrone_timer_delta_us(&ardrone_tool_timer); + if( delta >= ArdroneToolRefreshTimeInUs) + { + // Render frame + ardrone_timer_update(&ardrone_tool_timer); + + if(!ardrone_tool_in_pause) + { + ardrone_tool_input_update(); + res = ardrone_tool_update_custom(); + } + + if( send_com_watchdog == TRUE ) + { + ardrone_at_reset_com_watchdog(); + send_com_watchdog = FALSE; + } + + // Send all pushed messages + ardrone_at_send(); + + res = ardrone_tool_display_custom(); + } + else + { + usleep(ArdroneToolRefreshTimeInUs - delta); + } + + return res; +} + +C_RESULT ardrone_tool_shutdown() +{ + C_RESULT res = C_OK; + +#ifndef NO_ARDRONE_MAINLOOP + res = ardrone_tool_shutdown_custom(); +#endif + + // Shutdown subsystems + ardrone_navdata_client_shutdown(); + ardrone_control_shutdown(); + ardrone_tool_input_shutdown(); + + JOIN_THREAD(ardrone_control); + JOIN_THREAD(navdata_update); + + // Shutdown AT Commands + ATcodec_exit_thread(); + ATcodec_Shutdown_Library(); + + vp_com_disconnect(COM_NAVDATA()); + vp_com_shutdown(COM_NAVDATA()); + + PRINT("Custom ardrone tool ended\n"); + + return res; +} +#ifndef NO_ARDRONE_MAINLOOP + +#include + +int main(int argc, char **argv) +{ + C_RESULT res; + const char* old_locale; + const char* appname = argv[0]; + int argc_backup = argc; + char** argv_backup = argv; + + bool_t show_usage = FAILED( ardrone_tool_check_argc_custom(argc) ) ? TRUE : FALSE; + + argc--; argv++; + while( argc && *argv[0] == '-' ) + { + if( !strcmp(*argv, "-?") || !strcmp(*argv, "-h") || !strcmp(*argv, "-help") || !strcmp(*argv, "--help") ) + { + ardrone_tool_usage( appname ); + exit( 0 ); + } + else if( !ardrone_tool_parse_cmd_line_custom( *argv ) ) + { + printf("Option %s not recognized\n", *argv); + show_usage = TRUE; + } + + argc--; argv++; + } + + if( show_usage || (argc != 0) ) + { + ardrone_tool_usage( appname ); + exit(-1); + } + + /* After a first analysis, the arguments are restored so they can be passed to the user-defined functions */ + argc=argc_backup; + argv=argv_backup; + + old_locale = setlocale(LC_NUMERIC, "en_GB.UTF-8"); + + if( old_locale == NULL ) + { + PRINT("You have to install new locales in your dev environment! (avoid the need of conv_coma_to_dot)\n"); + PRINT("As root, do a \"dpkg-reconfigure locales\" and add en_GB.UTF8 to your locale settings\n"); + PRINT("If you have any problem, feel free to contact Pierre Eline (pierre.eline@parrot.com)\n"); + } + else + { + PRINT("Setting locale to %s\n", old_locale); + } + + vp_com_wifi_config_t *config = (vp_com_wifi_config_t*)wifi_config(); + if(config) + { + vp_os_memset( &wifi_ardrone_ip[0], 0, sizeof(wifi_ardrone_ip) ); + printf("===================+> %s\n", config->server); + strcpy( &wifi_ardrone_ip[0], config->server); + } + + if( &custom_main ) + { + return custom_main(argc, argv); + } + else + { + res = ardrone_tool_setup_com( NULL ); + + if( FAILED(res) ) + { + PRINT("Wifi initialization failed. It means either:\n"); + PRINT("\t* you're not root (it's mandatory because you can set up wifi connection only as root)\n"); + PRINT("\t* wifi device is not present (on your pc or on your card)\n"); + PRINT("\t* you set the wrong name for wifi interface (for example rausb0 instead of wlan0) \n"); + PRINT("\t* ap is not up (reboot card or remove wifi usb dongle)\n"); + PRINT("\t* wifi device has no antenna\n"); + } + else + { + res = ardrone_tool_init(argc, argv); + + while( SUCCEED(res) && ardrone_tool_exit() == FALSE ) + { + res = ardrone_tool_update(); + } + + res = ardrone_tool_shutdown(); + } + } + + if( old_locale != NULL ) + { + setlocale(LC_NUMERIC, old_locale); + } + + return SUCCEED(res) ? 0 : -1; +} +#endif // ! WITH_ARDRONE_MAIN_LOOP + +// Default implementation for weak functions +#ifndef _WIN32 + C_RESULT ardrone_tool_init_custom(int argc, char **argv) { return C_OK; } + C_RESULT ardrone_tool_update_custom() { return C_OK; } + C_RESULT ardrone_tool_display_custom() { return C_OK; } + C_RESULT ardrone_tool_shutdown_custom() { return C_OK; } + bool_t ardrone_tool_exit() { return FALSE; } + C_RESULT ardrone_tool_check_argc_custom( int32_t argc) { return C_OK; } + void ardrone_tool_display_cmd_line_custom( void ) {} + bool_t ardrone_tool_parse_cmd_line_custom( const char* cmd ) { return TRUE; } +#endif + + diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.h b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.h new file mode 100644 index 0000000..c0fb4df --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.h @@ -0,0 +1,256 @@ +#ifndef _ARDRONE_TOOL_H_ +#define _ARDRONE_TOOL_H_ + +#include +#include +#include + +#define ARDRONE_REFRESH_MS 20 + +#define MAX_NAME_LENGTH 255 +#define MAX_NUM_DEVICES 10 +#define MAX_NUM_INPUT_EVENTS 16 + +#ifdef ND_WRITE_TO_FILE +extern uint32_t num_picture_decoded; +extern uint32_t wiimote_enable; +extern float32_t wiimote_ax, wiimote_ay, wiimote_az; +#endif + +extern char wifi_ardrone_ip[]; +extern char app_id[]; +extern char app_name[]; +extern char usr_id[]; +extern char usr_name[]; +extern char ses_id[]; +extern char ses_name[]; + +typedef struct _ardrone_tool_configure_data_t { + char* var; + char* value; +} ardrone_tool_configure_data_t; + +/// +/// Required api each tool can implement +/// +extern ardrone_tool_configure_data_t configure_data[] WEAK; + +extern C_RESULT ardrone_tool_init_custom(int argc, char **argv) WEAK; +extern C_RESULT ardrone_tool_update_custom( void ) WEAK; +extern C_RESULT ardrone_tool_display_custom( void ) WEAK; +extern C_RESULT ardrone_tool_shutdown_custom( void ) WEAK; +extern bool_t ardrone_tool_exit( void ) WEAK; + +// cmd line parsing +extern C_RESULT ardrone_tool_check_argc_custom( int32_t argc) WEAK; +extern void ardrone_tool_display_cmd_line_custom( void ) WEAK; +extern bool_t ardrone_tool_parse_cmd_line_custom( const char* cmd ) WEAK; + +// Tricky ... +extern int custom_main(int argc, char **argv) WEAK; + +// This is implemented by the library +#ifdef NO_ARDRONE_MAINLOOP +C_RESULT ardrone_tool_init( const char* ardrone_ip, size_t n, AT_CODEC_FUNCTIONS_PTRS *ptrs, const char *appname, const char *usrname); +#else +C_RESULT ardrone_tool_init(int argc, char **argv); +#endif +C_RESULT ardrone_tool_set_refresh_time(int refresh_time_in_ms); +C_RESULT ardrone_tool_pause( void ); +C_RESULT ardrone_tool_resume( void ); +C_RESULT ardrone_tool_setup_com( const char* ssid ); +C_RESULT ardrone_tool_update(void); +C_RESULT ardrone_tool_shutdown(void); + + +void ardrone_tool_send_com_watchdog(void); // To send it only once +int main(); + +// There because not defined in embedded +void api_configuration_get_ctrl_mode(void); +void api_configuration_ack_ctrl_mode(void); + +/*! \page page2 + * @defgroup ARDrone_Tool ARDrone_Tool + +

+


+ +

General Overview

+ +\par + +ARDrone Tool is an attempt to create a common base code for all tools that must connect to ARDrone. In this document we call client any tools that link with ARDrone Tool. ARDrone Tool + +
    +
  • already implements main and do various initialization including com layer +
  • implements stub for ATcodec. All functions declared in ardrone_api.h are implemented. +
  • receives, parses Navdata and calls user defined handlers +
  • provides vp_sdk's stages to record video, ... +
  • provides a framework to handle user inputs (keyboard, gamepad, wiimote) +
+ +\par + +Usually a client will create a user interface +User inputs are refreshed every 20 ms (see ARDRONE_REFRESH_MS in ardrone_tool.h) + +\par WEAK functions + +ARDrone Tool uses a gcc specific extension : WEAK. This extension allows ARDrone Tool to give a default implementation to functions that can be overriden by clients. Overriding is not mandatory so a client can choose to keep a default implementation for these functions. + +\note +Some version of mingw32 doesn't support WEAK function. + +

+


+ +

Code implementation

+ +\section Navdata + +Navdata works with a DHCP's option like system. This text is inspired by the rfc2132. + +\par +Navdata items are carried in tagged data items that are stored in the options field of the navdata packet. The data items are also called "options". Basically an option is a declaration respecting the following format: + +\code + typedef struct _navdata_option_t { + // Common part + uint16_t tag; + uint16_t size; + + // Opaque declaration + uint8_t data[]; + } navdata_option_t; +\endcode + +For example : + +\code + typedef struct _navdata_demo_t { + // Common part + uint16_t tag; + uint16_t size; + + // Specialize part + uint32_t ctrl_state; + uint32_t vbat_flying_percentage; + + float32_t theta; + float32_t phi; + float32_t psi; + + int32_t altitude; + + float32_t vx; + float32_t vy; + } navdata_demo_t; +\endcode + +A navdata packet follow the following prototype: + +\code + typedef struct _navdata_t { + uint32_t header; + uint32_t ardrone_state; + uint32_t sequence; + bool_t vision_defined; + + navdata_option_t options[1]; + } navdata_t; +\endcode + +\par +At the moment of we write this document, developper can choose to send all navdata or only a prefdefined subset called Navdata Demo by using a ardrone config variable called navdata_demo. Navdata demo defines minimum data ARDrone must sent to a remote host + +\subsection navdata_list List of navdata options. + +In the following subsection we described all the currently available navdata options and their meanings. + + + + + + + + + + + + + + + + + + + + + + + + +\subsection navdata_new Adding/Customizing navdata options + +\par + +When updating a navdata option or adding a navdata option one must take care to update the following files too: + +
    +
  • navdata_server.h and navdata_server.c in \ref Toy +
  • navdata.h and navdata.c in Soft/Lib/Control +
  • any navdata handler (in particular ardrone_navdata_file.c in \ref ARDrone_Tool ) +
+ +\note +There's a way to ease this process by defining an header file like config_keys.h (TODO list ;-)) + +\subsection navdata_handling Handling navdata options + +\par +ARDrone Tools provides facility to handle navdata options. First ARDrone Tool will established a connection, as a client, on port 5554, when application starts (it handles timeout and reconnections). Then it will listen to navdata's udp packets to parse navdata options found inside them. We called this functionnality unpacking and it is implemented in Control library (Soft/Lib/Control/navdata.c). + +\par +When all options are parsed, navdata handlers are called to allow user to manipulate navdata options. Some handlers are predefined. The most important one is ardrone_navdata_file that registers all incomming navdata in local storage. + +\par +To add a new handler, a developper have to implement three functions: + +
    +
  • an init function +
  • a process function +
  • a release function +
+ +The init and release functions are called only once and the process function is called whenever a new navdata packet is received. The init function can receive any data as a parameter (see ardrone_navdataf_file.c or navdata_ihm.c if you want examples). + +\subsection navdata_control Relationship between flashing/updating and configuration by wifi and navdata + +\par +Navdata are also used to regulate data we send to ARDrone. We find out there was problem to send big amount of data (some packets were lost). We decided to split large amount of data in smaller packets and to use navdata to delay their sending. + +\par + +This approach was generalized to send all files to ARDrone: + +
    +
  • Update file for P5P software [ARDRONE_UPDATE_CONTROL_MODE] +
  • Update file for ADC software [PIC_UPDATE_CONTROL_MODE] +
+ +to ask for files containing: + +
    +
  • Configuration data (ini file) [CFG_GET_CONTROL_MODE] +
  • Log of previous flies [LOGS_GET_CONTROL_MODE] +
+ +and to know when some commands sent over UDP (for example AT_MSG_ATCMD_CONFIG_EXE) are received by setting a flag in navdata's ardrone_state (ARDRONE_COMMAND_MASK). + +\note +CONTROL is perhaps a badly choosen name. + + */ + +#endif // _ARDRONE_TOOL_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.c b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.c new file mode 100644 index 0000000..ff56e50 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.c @@ -0,0 +1,374 @@ +// +// ardrone_tool_configuration.c +// +// Created by D'HAEYER Frederic on 13/09/10. +// Copyright 20010 Parrot SA. All rights reserved. +// +#include +#include +#include + +#define ARDRONE_TOOL_CONFIGURATION_MAX_EVENT 128 + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) DEFAULT, +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) DEFAULT, +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) DEFAULT, + +/* ardrone_control_config and ardrone_control_config_default are now initialized at runtime */ +ardrone_config_t ardrone_control_config_default; +ardrone_config_t ardrone_control_config; +ardrone_config_t ardrone_application_default_config; + + +static ardrone_tool_configuration_data_t ardrone_tool_configuration_data[ARDRONE_TOOL_CONFIGURATION_MAX_EVENT]; +static dictionary *ardrone_tool_configuration_dict; +static bool_t ardrone_tool_configuration_is_init = FALSE; +static int ardrone_tool_configuration_current_index = 0; +static int ardrone_tool_configuration_nb_event = 0; +static vp_os_mutex_t ardrone_tool_configuration_mutex; + +static void ardrone_tool_configuration_event_configure(void); + +void ardrone_tool_reset_configuration (void) +{ +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) ardrone_control_config.NAME = DEFAULT; +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) ardrone_control_config.NAME = DEFAULT; +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) strncpy (ardrone_control_config.NAME, DEFAULT, sizeof (ardrone_control_config.NAME)); +#include +} + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +bool_t ardrone_tool_configuration_addevent_##NAME(C_TYPE_PTR value, ardrone_tool_configuration_callback result_callback) \ +{ \ + bool_t res = FALSE; \ + vp_os_mutex_lock(&ardrone_tool_configuration_mutex); \ + if(ardrone_tool_configuration_current_index == (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT) \ + { \ + printf("ARDRONE_TOOL_CONFIGURATION QUEUE FILLED !! %s\n", #NAME); \ + } \ + else \ + { \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].control_mode = ACK_CONTROL_MODE; \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].result_callback = result_callback; \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].key = #NAME; \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].value = vp_os_malloc(sizeof(C_TYPE)); \ + vp_os_memcpy(ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].value, value, sizeof(C_TYPE)); \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].callback = (ardrone_at_configuration_set)&ARDRONE_CONFIGURATION_SET_FUNCTION(NAME); \ + ardrone_tool_configuration_nb_event = (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT; \ + if(ardrone_tool_configuration_nb_event == ((ardrone_tool_configuration_current_index + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT)) \ + ardrone_tool_configuration_event_configure(); \ + res = TRUE; \ + } \ + vp_os_mutex_unlock(&ardrone_tool_configuration_mutex); \ + return res; \ +} + +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +bool_t ardrone_tool_configuration_addevent_##NAME(C_TYPE_PTR value, ardrone_tool_configuration_callback result_callback) \ +{ \ + bool_t res = FALSE; \ + if(value != NULL) \ + { \ + vp_os_mutex_lock(&ardrone_tool_configuration_mutex); \ + if(ardrone_tool_configuration_current_index == (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT) \ + { \ + printf("ARDRONE_TOOL_CONFIGURATION QUEUE FILLED !! %s\n", #NAME); \ + } \ + else \ + { \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].control_mode = ACK_CONTROL_MODE; \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].result_callback = result_callback; \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].key = #NAME; \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].value = vp_os_malloc((strlen((char*)value) + 1) * sizeof(C_TYPE)); \ + vp_os_memcpy(ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].value, value, (strlen((char*)value) + 1) * sizeof(C_TYPE)); \ + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].callback = (ardrone_at_configuration_set)&ARDRONE_CONFIGURATION_SET_FUNCTION(NAME); \ + ardrone_tool_configuration_nb_event = (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT; \ + if(ardrone_tool_configuration_nb_event == ((ardrone_tool_configuration_current_index + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT)) \ + ardrone_tool_configuration_event_configure(); \ + res = TRUE; \ + } \ + vp_os_mutex_unlock(&ardrone_tool_configuration_mutex); \ + } \ + return res; \ +} + +#include + + +bool_t ardrone_tool_configuration_get(ardrone_tool_configuration_callback result_callback) +{ + bool_t res = FALSE; + vp_os_mutex_lock(&ardrone_tool_configuration_mutex); + if(ardrone_tool_configuration_current_index == (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT) + { + printf("ARDRONE_TOOL_CONFIGURATION QUEUE FILLED !!\n"); + } + else + { + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].key = NULL; + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].callback = NULL; + + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].control_mode = CFG_GET_CONTROL_MODE; + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].result_callback = result_callback; + ardrone_tool_configuration_nb_event = (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT; + if(ardrone_tool_configuration_nb_event == ((ardrone_tool_configuration_current_index + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT)) + ardrone_tool_configuration_event_configure(); + res = TRUE; + } + vp_os_mutex_unlock(&ardrone_tool_configuration_mutex); + + return res; +} + + +/* Multiconfiguration support */ +/*============================================================================*/ +/** @brief Queues a request to retrieve from the drone the list of available custom configurations. + * This functions works like the 'ardrone_tool_configuration_get' function. + */ +bool_t ardrone_tool_custom_configuration_get(ardrone_tool_configuration_callback result_callback) +{ + vp_os_mutex_lock(&ardrone_tool_configuration_mutex); + //printf("%s %s %i\n",__FILE__,__FUNCTION__,__LINE__); + if(ardrone_tool_configuration_current_index == (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT) + { + printf("ARDRONE_TOOL_CONFIGURATION QUEUE FILLED !!\n"); + } + else + { + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].key = NULL; + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].callback = NULL; + + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].control_mode = CUSTOM_CFG_GET_CONTROL_MODE; + ardrone_tool_configuration_data[ardrone_tool_configuration_nb_event].result_callback = result_callback; + ardrone_tool_configuration_nb_event = (ardrone_tool_configuration_nb_event + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT; + if(ardrone_tool_configuration_nb_event == ((ardrone_tool_configuration_current_index + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT)) + ardrone_tool_configuration_event_configure(); + } + //printf("%s %s %i\n",__FILE__,__FUNCTION__,__LINE__); + vp_os_mutex_unlock(&ardrone_tool_configuration_mutex); + + return TRUE; +} + +/*============================================================================*/ +/** @brief Initializes the configuration manager. + * This function creates a dictionary, ie. a structure which is used by the + * .ini file parser to translate into binary values the text file sent by the + * drone when the client request the drone configuration file. + */ +void ardrone_tool_configuration_init(void) +{ + if(!ardrone_tool_configuration_is_init) + { + /* Create a new dictionary */ + ardrone_tool_configuration_dict = dictionary_new(0); + + /* For each configuration parameter stored in config_keys.h, + * we bind it to the address of the corresponding binary data field + * inside the 'ardrone_control_config' structure. + * This structure will later be filled with the drone configuration. + */ +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +iniparser_alias(ardrone_tool_configuration_dict, KEY ":" #NAME, INI_TYPE, &ardrone_control_config.NAME, NULL,RW); +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +iniparser_alias(ardrone_tool_configuration_dict, KEY ":" #NAME, INI_TYPE, &ardrone_control_config.NAME, NULL,RW); +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +iniparser_alias(ardrone_tool_configuration_dict, KEY ":" #NAME, INI_TYPE, &ardrone_control_config.NAME[0], NULL,RW); +#include + + ardrone_tool_configuration_current_index = 0; + ardrone_tool_configuration_nb_event = 0; + vp_os_memset(&ardrone_tool_configuration_data[0], 0, sizeof(ardrone_tool_configuration_data_t) * ARDRONE_TOOL_CONFIGURATION_MAX_EVENT); + vp_os_mutex_init(&ardrone_tool_configuration_mutex); + ardrone_tool_configuration_is_init = TRUE; + } +} + + +/*============================================================================*/ +/* Callback function called by the 'control' thread on the client side, once the configuration + * file was retrieved from the drone and stored in the 'ardrone_control_config' structure. + */ +static void ardrone_tool_configuration_event_configure_end(struct _ardrone_control_event_t* event) +{ + ardrone_tool_configuration_callback callback = NULL; + int result_callback_argument = FALSE; + + vp_os_mutex_lock(&ardrone_tool_configuration_mutex); + + callback = ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].result_callback; + + switch(event->status) + { + case ARDRONE_CONTROL_EVENT_FINISH_SUCCESS: + result_callback_argument = TRUE; + if (callback!=NULL) + { + callback(result_callback_argument); + } + + if (NULL!=ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].value) + vp_os_free(ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].value); + if (NULL!=ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event) + vp_os_free(ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event); + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event = NULL; + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].value = NULL; + ardrone_tool_configuration_current_index = (ardrone_tool_configuration_current_index + 1) % ARDRONE_TOOL_CONFIGURATION_MAX_EVENT; + break; + + case ARDRONE_CONTROL_EVENT_FINISH_FAILURE: + result_callback_argument = FALSE; + if (callback!=NULL) + { + callback(result_callback_argument); + } + break; + + default: + // Nothing to do + break; + } + + if (ardrone_tool_configuration_current_index != ardrone_tool_configuration_nb_event) + ardrone_tool_configuration_event_configure(); + + vp_os_mutex_unlock(&ardrone_tool_configuration_mutex); + + /* + * Should we trigger the callback after unlocking the mutex, so that + * the callback function can add a new event without creating a deadlock ? + */ + +} + +static void ardrone_tool_configuration_event_configure(void) +{ + bool_t control_mode_ok = FALSE; + switch(ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].control_mode) + { + case ACK_CONTROL_MODE: + { + ardrone_control_ack_event_t *event = NULL; + + if (ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].callback) + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].callback(ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].value, ses_id, usr_id, app_id); + + if(ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event == NULL) + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event = vp_os_malloc(sizeof(ardrone_control_ack_event_t)); + + /* ACK_COMMAND_MASK_TRUE means we are going to ask the control thread to negotiate a switch of the ACK bit if it is currently set */ + event = (ardrone_control_ack_event_t*)ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event; + event->ack_state = ACK_COMMAND_MASK_TRUE; + + control_mode_ok = TRUE; + } + break; + + case CFG_GET_CONTROL_MODE: + { + ardrone_control_configuration_event_t *event = NULL; + + if(ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event == NULL) + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event = vp_os_malloc(sizeof(ardrone_control_configuration_event_t)); + + event = (ardrone_control_configuration_event_t*)ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event; + event->config_state = CONFIG_REQUEST_INI; + event->ini_dict = ardrone_tool_configuration_dict; + + control_mode_ok = TRUE; + } + break; + + case CUSTOM_CFG_GET_CONTROL_MODE: + { + ardrone_control_configuration_event_t *event = NULL; + + if(ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event == NULL) + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event = vp_os_malloc(sizeof(ardrone_control_configuration_event_t)); + + event = (ardrone_control_configuration_event_t*)ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event; + event->config_state = CUSTOM_CONFIG_REQUEST; + event->ini_dict = ardrone_tool_configuration_dict; + + control_mode_ok = TRUE; + } + break; + + + default: + break; + } + + if(control_mode_ok) + { + /* Prepare a task for the control thread + * We are going to ask this thread to negociate with the drone a ACK bit toggling + * or a configuration file retrieval. + */ + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event->event = ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].control_mode; + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event->status = ARDRONE_CONTROL_EVENT_WAITING; + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event->num_retries = 10; + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event->ardrone_control_event_start = NULL; + ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event->ardrone_control_event_end = ardrone_tool_configuration_event_configure_end; + + /* Add a task in the task-list of the Control thread of the client */ + ardrone_control_send_event( ardrone_tool_configuration_data[ardrone_tool_configuration_current_index].event ); + } +} + +/** + * Sending application defined default application for each category. + */ +void ardrone_tool_send_application_default(void) +{ + printf("Sending default CAT_APPLI settings\n"); +#undef ARDRONE_CONFIG_KEY_IMM_a10 +#undef ARDRONE_CONFIG_KEY_REF_a10 +#undef ARDRONE_CONFIG_KEY_STR_a10 +#define ARDRONE_CONFIG_KEY_IMM_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) \ +if (CAT_APPLI == CATEGORY && ardrone_application_default_config.NAME != DEFAULT) { ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, &ardrone_application_default_config.NAME, NULL); } +#define ARDRONE_CONFIG_KEY_REF_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) +#define ARDRONE_CONFIG_KEY_STR_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) \ +if (CAT_APPLI == CATEGORY && 0 != strcmp(ardrone_application_default_config.NAME, DEFAULT)) { ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, ardrone_application_default_config.NAME, NULL); } +#include +} +void ardrone_tool_send_user_default(void) +{ + printf("Sending default CAT_USER settings\n"); +#undef ARDRONE_CONFIG_KEY_IMM_a10 +#undef ARDRONE_CONFIG_KEY_REF_a10 +#undef ARDRONE_CONFIG_KEY_STR_a10 +#define ARDRONE_CONFIG_KEY_IMM_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) \ +if (CAT_USER == CATEGORY && ardrone_application_default_config.NAME != DEFAULT) { ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, &ardrone_application_default_config.NAME, NULL); } +#define ARDRONE_CONFIG_KEY_REF_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) +#define ARDRONE_CONFIG_KEY_STR_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) \ +if (CAT_USER == CATEGORY && 0 != strcmp(ardrone_application_default_config.NAME, DEFAULT)) { ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, ardrone_application_default_config.NAME, NULL); } +#include +} +void ardrone_tool_send_session_default(void) +{ + printf("Sending default CAT_SESSION settings\n"); +#undef ARDRONE_CONFIG_KEY_IMM_a10 +#undef ARDRONE_CONFIG_KEY_REF_a10 +#undef ARDRONE_CONFIG_KEY_STR_a10 +#define ARDRONE_CONFIG_KEY_IMM_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) \ +if (CAT_SESSION == CATEGORY && ardrone_application_default_config.NAME != DEFAULT) { ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, &ardrone_application_default_config.NAME, NULL); } +#define ARDRONE_CONFIG_KEY_REF_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) +#define ARDRONE_CONFIG_KEY_STR_a10(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, RW_CUSTOM, DEFAULT, CALLBACK, CATEGORY) \ +if (CAT_SESSION == CATEGORY && 0 != strcmp(ardrone_application_default_config.NAME, DEFAULT)) { ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, ardrone_application_default_config.NAME, NULL); } +#include +} diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.h b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.h new file mode 100644 index 0000000..0083c26 --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool_configuration.h @@ -0,0 +1,68 @@ +/* + * ardrone_tool_configuration.h + * + * + * Created by Frederic D'HAEYER on 13/09/10. + * Copyright 2010 Parrot SA. All rights reserved. + * + */ +#ifndef _ARDRONE_TOOL_CONFIGURATION_H_ +#define _ARDRONE_TOOL_CONFIGURATION_H_ +#include +#include +#include +#include + +#include +#include + +#include + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#include + +typedef void (*ardrone_tool_configuration_callback)(bool_t result); + +typedef struct _ardrone_tool_configuration_data_t { + char* key; + void* value; + ardrone_at_configuration_set callback; + ARDRONE_CONTROL_MODE control_mode; + ardrone_tool_configuration_callback result_callback; + ardrone_control_event_t* event; +} ardrone_tool_configuration_data_t; + +#define ARDRONE_TOOL_CONFIGURATION_ADDEVENT(NAME, VALUE, CALLBACK) ardrone_tool_configuration_addevent_##NAME(VALUE, CALLBACK) +#define ARDRONE_TOOL_CONFIGURATION_GET(CALLBACK) ardrone_tool_configuration_get(CALLBACK) +#define ARDRONE_TOOL_CUSTOM_CONFIGURATION_GET(CALLBACK) ardrone_tool_custom_configuration_get(CALLBACK) + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +bool_t ardrone_tool_configuration_addevent_##NAME(C_TYPE_PTR value, ardrone_tool_configuration_callback result_callback); +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) \ +bool_t ardrone_tool_configuration_addevent_##NAME(C_TYPE_PTR value, ardrone_tool_configuration_callback result_callback); +#include + +extern ardrone_config_t ardrone_control_config; +extern ardrone_config_t ardrone_control_config_default; +extern ardrone_config_t ardrone_application_default_config; + +void ardrone_tool_reset_configuration(void); +void ardrone_tool_configuration_init(void); +void ardrone_tool_send_application_default(void); +void ardrone_tool_send_user_default(void); +void ardrone_tool_send_session_default(void); +bool_t ardrone_tool_configuration_get(ardrone_tool_configuration_callback result_callback); +bool_t ardrone_tool_custom_configuration_get(ardrone_tool_configuration_callback result_callback); + +PROTO_THREAD_ROUTINE(ardrone_configuration, data); + +#endif // _ARDRONE_TOOL_CONFIGURATION_H_ diff --git a/ARDroneLib/Soft/Lib/ardrone_tool/config_keys.c b/ARDroneLib/Soft/Lib/ardrone_tool/config_keys.c new file mode 100644 index 0000000..f068e4c --- /dev/null +++ b/ARDroneLib/Soft/Lib/ardrone_tool/config_keys.c @@ -0,0 +1,70 @@ + +#include +#include + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#include + +const vector31_t default_accs_offset = {{{ -2048.0f, 2048.0f, 2048.0f}}}; +const matrix33_t default_accs_gain = {1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f }; +const vector31_t default_gyros_offset = {{{ 1662.5f, 1662.5f, 1662.5f}}}; +const vector31_t default_gyros_gains = {{{ 395.0f * MDEG_TO_RAD, -395.0f * MDEG_TO_RAD, -207.5f * MDEG_TO_RAD }}}; +const vector21_t default_gyros110_offset = {{ 1662.5f, 1662.5f}}; +const vector21_t default_gyros110_gains = {{ 87.5f * MDEG_TO_RAD, -87.5f * MDEG_TO_RAD }}; + +/* Stephane - multiconfiguration support */ + + /* Those data are present both on the client and the drone side */ + + const char * custom_configuration_id_keys[NB_CONFIG_CATEGORIES+1]= + { + "", + "custom:application_desc", + "custom:profile_desc", + "custom:session_desc", + }; + + const char * custom_configuration_headers[NB_CONFIG_CATEGORIES+1]= + { + "[common]", + "[applis]", + "[profiles]", + "[sessions]" + }; + + const char *configuration_switching_commands[NB_CONFIG_CATEGORIES+1]= + { + "", + "custom:application_id", + "custom:profile_id", + "custom:session_id", + NULL + }; + + custom_configuration_list_t available_configurations[NB_CONFIG_CATEGORIES]; + + + /* Stephane - multiconfiguration support */ + + C_RESULT configuration_check_config_id_char(const char session_id_char) + { + char c = session_id_char; + return ( (c>='a' && c<='f') || (c>='A' && c<='F') || (c>='0' && c<='9') ); + } + + C_RESULT configuration_check_config_id(const char * session_id) + { + int i; + unsigned char c; + // Session IDs should be strings containing a 32-bit integer hexadecimal representation + if (session_id==NULL) return C_FAIL; + for (i=0;i + +Many thanks to the many people who contributed ideas, code, suggestions, +corrections, enhancements. diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/INSTALL b/ARDroneLib/Soft/Lib/iniparser3.0b/INSTALL new file mode 100644 index 0000000..4199bc8 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/INSTALL @@ -0,0 +1,15 @@ + +iniParser installation instructions +----------------------------------- + +- Modify the Makefile to suit your environment. +- Type 'make' to make the library. +- Type 'make check' to make the test program. +- Type 'test/iniexample' to launch the test program. +- Type 'test/parse' to launch torture tests. + + + +Enjoy! +N. Devillard +Thu Jan 3 19:36:38 CET 2008 diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/LICENSE b/ARDroneLib/Soft/Lib/iniparser3.0b/LICENSE new file mode 100644 index 0000000..dbfa45d --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2000-2007 by Nicolas Devillard. +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/Makefile b/ARDroneLib/Soft/Lib/iniparser3.0b/Makefile new file mode 100644 index 0000000..1405a34 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/Makefile @@ -0,0 +1,62 @@ +# +# iniparser Makefile +# + +# Compiler settings +CC = gcc +CFLAGS = -O2 -fPIC -Wall -ansi -pedantic + +# Ar settings to build the library +AR = ar +ARFLAGS = rcv + +SHLD = ${CC} ${CFLAGS} +LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib +LDFLAGS = -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib + +# Set RANLIB to ranlib on systems that require it (Sun OS < 4, Mac OSX) +# RANLIB = ranlib +RANLIB = true + +RM = rm -f + + +# Implicit rules + +SUFFIXES = .o .c .h .a .so .sl + +COMPILE.c=$(CC) $(CFLAGS) -c +.c.o: + @(echo "compiling $< ...") + @($(COMPILE.c) -o $@ $<) + + +SRCS = src/iniparser.c \ + src/dictionary.c + +OBJS = $(SRCS:.c=.o) + + +default: libiniparser.a libiniparser.so + +libiniparser.a: $(OBJS) + @($(AR) $(ARFLAGS) libiniparser.a $(OBJS)) + @($(RANLIB) libiniparser.a) + +libiniparser.so: $(OBJS) + @$(SHLD) $(LDSHFLAGS) -o $@.0 $(OBJS) $(LDFLAGS) \ + -Wl,-soname=`basename $@`.0 + +clean: + $(RM) $(OBJS) + +veryclean: + $(RM) $(OBJS) libiniparser.a libiniparser.so* + rm -rf ./html ; mkdir html + cd test ; $(MAKE) veryclean + +docs: + @(cd doc ; $(MAKE)) + +check: + @(cd test ; $(MAKE)) diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/README b/ARDroneLib/Soft/Lib/iniparser3.0b/README new file mode 100644 index 0000000..acb73ce --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/README @@ -0,0 +1,12 @@ + +Welcome to iniParser -- version 3.0b (beta) +released 03 Jan 2008 + +This modules offers parsing of ini files from the C level. +See a complete documentation in HTML format, from this directory +open the file html/index.html with any HTML-capable browser. + +Enjoy! + +N.Devillard +Thu Jan 3 19:36:31 CET 2008 diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/doxygen.css b/ARDroneLib/Soft/Lib/iniparser3.0b/html/doxygen.css new file mode 100644 index 0000000..c7db1a8 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/html/doxygen.css @@ -0,0 +1,358 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/doxygen.png b/ARDroneLib/Soft/Lib/iniparser3.0b/html/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..f0a274bbaffdd67f6d784c894d9cf28729db0e14 GIT binary patch literal 1281 zcmaJ>ZA?>F7(Vx-ms?uoS`b@hdRtpo6o^%HU>M$hfGrBvQnk$LE?p^P!kn&ikhyq! zX~V@&tPF5Qt@V?oTL96Bi%aRiwbe1)9DWQI#?)=HxS7QSw`J`5fAJ*eJbB;uNuKA& zdERDo*{Y<(If(#(B$Lr#;nB(8Y#ia=ZCeW?JfPLuQY`=@cW$k}Rivq|vbxGrRq1Tl9;+(gNt?}UtVKM2`T5t1jLzuL@0UIs`S#vlhl4)^ zLgSYrPj@$+`|j?eSbXTmiHGkWxV8V}BzNR?pl9k_s4pDu9vd5a_UzZEPk)}Ad{AV_ zzddrjrh4=Imr`E06;LY{)YYt?o}L~H@7C}F^WB!Ra=v`Q0bj{>5&$66CWF>mf6vjP z2N>RRY6ZYa=K`76>+|_)Xdwko+7wv}7cN|btOhWb(*{sta~6b?S8Omrxw}!4`NhGr zZVpNqpu1@BE`QGWNTpEpcJVW5izu~2B^GlM?1(OPg)zwW;QcP@Ltcclm>XbJL9C|j z=9!2?ua=uIlf0%AndzHsRC}IyTL$EhAee(fdKB`?27KeS^2M8M_7b~PiCFO&r5LC7 z7gl1*a<8;SjNaw#h=843_AV9iZbWQOAp5YOC^&_F*9K0> zB|6%IDb?aM#3viTxkLU4aXg&@+CkNTOnQ1iMP*^?b|^lJy$4C)Zk4isV!|RZ*XhXh zw8q3$=*0LeGC!XI_Wc?dkT~3+*Gu%%yIqP+Wr3H$=&ROMQU6q}Ag^P~>c5vAEO;a- z_dK-3PPeKar%)6$j~vI2#*-YH!1h6HYVtwCX5_wM`iF#UKz&&@9Oo5w3%XGYrX zW>dY~)SG-((Yim%`InwgTvyRC?e=Wh^8KCao!R6Eg&TpVWUY1sN~4G}V?nFnEGo-; zHZ_$eW9-GnC%^WS9b z@p;-$oH#MtC0v>Q$HX%4^JdFdO$0cbv-W)Q TtK}Eh@>>I#ipmV1>S*>q-hkC} literal 0 HcmV?d00001 diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/globals_func.html b/ARDroneLib/Soft/Lib/iniparser3.0b/html/globals_func.html new file mode 100644 index 0000000..5d9871d --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/html/globals_func.html @@ -0,0 +1,48 @@ + + +iniparser: Data Fields + + + + +
+ +
+  +

+

+
Generated on Thu Jan 3 19:45:34 2008 for iniparser by  + +doxygen 1.5.3
+ + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/index.html b/ARDroneLib/Soft/Lib/iniparser3.0b/html/index.html new file mode 100644 index 0000000..d5b2f56 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/html/index.html @@ -0,0 +1,96 @@ + + +iniparser: iniparser documentation + + + + +

iniparser documentation

+

+

3.0


+

+Introduction

+iniParser is a simple C library offering ini file parsing services. The library is pretty small (less than 1500 lines of C) and robust, and does not depend on any other external library to compile. It is written in ANSI C and should compile on most platforms without difficulty.

+


+

+What is an ini file?

+An ini file is an ASCII file describing simple parameters (character strings, integers, floating-point values or booleans) in an explicit format, easy to use and modify for users.

+An ini file is segmented into Sections, declared by the following syntax:

+

+    [Section Name]
+	

+i.e. the section name enclosed in square brackets, alone on a line. Sections names are allowed to contain any character but square brackets or linefeeds. Slashes (/) are also reserved with this parser for hierarchical sections (see below).

+In any section are zero or more variables, declared with the following syntax:

+

+    Key = value ; comment
+	

+The key is any string (possibly containing blanks). The value is any character on the right side of the equal sign. Values can be given enclosed with quotes. If no quotes are present, the value is understood as containing all characters between the first and the last non-blank characters. The following declarations are identical:

+

+    Hello = "this is a long string value" ; comment
+    Hello = this is a long string value ; comment
+	

+The semicolon and comment at the end of the line are optional. If there is a comment, it starts from the first character after the semicolon up to the end of the line.

+Multi-line values can be provided by ending the line with a backslash (\).

+

+    Multiple = Line 1 \
+    Line 2 \
+    Line 3 \
+    Line 4 ; comment
+    

+This would yield: "multiple" <- "Line1 Line2 Line3 Line4"

+Comments in an ini file are:

+

    +
  • Lines starting with a hash sign
  • Blank lines (only blanks or tabs)
  • Comments given on value lines after the semicolon (if present)
+

+


+

+Compiling/installing the library

+Edit the Makefile to indicate the C compiler you want to use, the options to provide to compile ANSI C, and possibly the options to pass to the ar program on your machine to build a library (.a) from a set of object (.o) files.

+Defaults are set for the gcc compiler and the standard ar library builder.

+Type 'make', that should do it.

+To use the library in your programs, add the following line on top of your module:

+

    #include "iniparser.h"
+

+And link your program with the iniparser library by adding -liniparser.a to the compile line.

+See the file test/initest.c for an example.

+


+

+Library reference

+The library is completely documented in its header file. On-line documentation has been generated and can be consulted here:

+

+

+


+

+Using the parser

+Comments are discarded by the parser. Then sections are identified, and in each section a new entry is created for every keyword found. The keywords are stored with the following syntax:

+

+    [Section]
+    Keyword = value ; comment
+	

+is converted to the following key pair:

+

+    ("section:keyword", "value")
+	

+This means that if you want to retrieve the value that was stored in the section called Pizza, in the keyword Cheese, you would make a request to the dictionary for "pizza:cheese". All section and keyword names are converted to lowercase before storage in the structure. The value side is conserved as it has been parsed, though.

+Section names are also stored in the structure. They are stored using as key the section name, and a NULL associated value. They can be queried through iniparser_find_entry().

+To launch the parser, use the function called iniparser_load(), which takes an input file name and returns a newly allocated dictionary structure. This latter object should remain opaque to the user and only accessed through the following accessor functions:

+

+

+Finally, discard this structure using iniparser_freedict().

+All values parsed from the ini file are stored as strings. The accessors are just converting these strings to the requested type on the fly, but you could basically perform this conversion by yourself after having called the string accessor.

+Notice that iniparser_getboolean() will return an integer (0 or 1), trying to make sense of what was found in the file. Strings starting with "y", "Y", "t", "T" or "1" are considered true values (return 1), strings starting with "n", "N", "f", "F", "0" are considered false (return 0). This allows some flexibility in handling of boolean answers.

+If you want to add extra information into the structure that was not present in the ini file, you can use iniparser_setstring() to insert a string.

+


+

+A word about the implementation

+The dictionary structure is a pretty simple dictionary implementation which might find some uses in other applications. If you are curious, look into the source.

+


+

+Authors

+Nicolas Devillard (ndevilla AT free DOT fr).
Generated on Thu Jan 3 19:45:34 2008 for iniparser by  + +doxygen 1.5.3
+ + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8h.html b/ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8h.html new file mode 100644 index 0000000..1a25359 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8h.html @@ -0,0 +1,582 @@ + + +iniparser: iniparser.h File Reference + + + + +

iniparser.h File Reference

Parser for ini files. More... +

+

OptionDescription
NAVDATA_DEMOMinimum data needed
NAVDATA_TIMEARDrone current time
NAVDATA_RAW_MEASURESRaw measures (acceleros & gyros) coming from PIC
NAVDATA_PHYS_MEASURESFiltered values after control processing
NAVDATA_GYROS_OFFSETSGyros offsets
NAVDATA_EULER_ANGLESFused euler angles
NAVDATA_REFERENCES
NAVDATA_TRIMS
NAVDATA_RC_REFERENCES
NAVDATA_PWMData used to control motors
NAVDATA_ALTITUDEEstimated values with a relation to altitude
NAVDATA_VISION_RAWVision's estimated velocities
NAVDATA_VISIONData used when computing vision
NAVDATA_VISION_PERFPerformance data collected when profiling vision code
NAVDATA_TRACKERS_SENDPosition of all trackers computed by vision
NAVDATA_VISION_DETECTPosition of the chemney detected by vision
NAVDATA_WATCHDOGTells if there was an anormal delay between two navdata packets
NAVDATA_IPHONE_ANGLESUsed to send back to iPhone its attitude (was an attempt to compute latency between ardrone & iPhone)
NAVDATA_ADC_DATA_FRAMEUsed in remote control. Sends data frame coming from PIC
NAVDATA_CKSDescription
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

int iniparser_getnsec (dictionary *d)
 Get number of sections in a dictionary.
char * iniparser_getsecname (dictionary *d, int n)
 Get name for section n in a dictionary.
void iniparser_dump_ini (dictionary *d, FILE *f)
 Save a dictionary to a loadable ini file.
void iniparser_dump (dictionary *d, FILE *f)
 Dump a dictionary to an opened file pointer.
char * iniparser_getstring (dictionary *d, const char *key, char *def)
 Get the string associated to a key.
int iniparser_getint (dictionary *d, const char *key, int notfound)
 Get the string associated to a key, convert to an int.
double iniparser_getdouble (dictionary *d, char *key, double notfound)
 Get the string associated to a key, convert to a double.
int iniparser_getboolean (dictionary *d, const char *key, int notfound)
 Get the string associated to a key, convert to a boolean.
int iniparser_setstring (dictionary *ini, char *entry, char *val)
 Set an entry in a dictionary.
void iniparser_unset (dictionary *ini, char *entry)
 Delete an entry in a dictionary.
int iniparser_find_entry (dictionary *ini, char *entry)
 Finds out if a given entry exists in a dictionary.
dictionary * iniparser_load (const char *ininame)
 Parse an ini file and return an allocated dictionary object.
void iniparser_freedict (dictionary *d)
 Free all memory associated to an ini dictionary.
+

Detailed Description

+Parser for ini files. +

+

Author:
N. Devillard
+
Date:
Sep 2007
+
Version:
3.0
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
void iniparser_dump (dictionary *  d,
FILE *  f 
)
+
+
+ +

+Dump a dictionary to an opened file pointer. +

+

Parameters:
+ + + +
d Dictionary to dump.
f Opened file pointer to dump to.
+
+
Returns:
void
+This function prints out the contents of a dictionary, one element by line, onto the provided file pointer. It is OK to specify stderr or stdout as output files. This function is meant for debugging purposes mostly. +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void iniparser_dump_ini (dictionary *  d,
FILE *  f 
)
+
+
+ +

+Save a dictionary to a loadable ini file. +

+

Parameters:
+ + + +
d Dictionary to dump
f Opened file pointer to dump to
+
+
Returns:
void
+This function dumps a given dictionary into a loadable ini file. It is Ok to specify stderr or stdout as output files. +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int iniparser_find_entry (dictionary *  ini,
char *  entry 
)
+
+
+ +

+Finds out if a given entry exists in a dictionary. +

+

Parameters:
+ + + +
ini Dictionary to search
entry Name of the entry to look for
+
+
Returns:
integer 1 if entry exists, 0 otherwise
+Finds out if a given entry exists in the dictionary. Since sections are stored as keys with NULL associated values, this is the only way of querying for the presence of sections in a dictionary. +
+

+ +

+
+ + + + + + + + + +
void iniparser_freedict (dictionary *  d  ) 
+
+
+ +

+Free all memory associated to an ini dictionary. +

+

Parameters:
+ + +
d Dictionary to free
+
+
Returns:
void
+Free all memory associated to an ini dictionary. It is mandatory to call this function before the dictionary object gets out of the current context. +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int iniparser_getboolean (dictionary *  d,
const char *  key,
int  notfound 
)
+
+
+ +

+Get the string associated to a key, convert to a boolean. +

+

Parameters:
+ + + + +
d Dictionary to search
key Key string to look for
notfound Value to return in case of error
+
+
Returns:
integer
+This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the notfound value is returned.

+A true boolean is found if one of the following is matched:

+

    +
  • A string starting with 'y'
  • A string starting with 'Y'
  • A string starting with 't'
  • A string starting with 'T'
  • A string starting with '1'
+

+A false boolean is found if one of the following is matched:

+

    +
  • A string starting with 'n'
  • A string starting with 'N'
  • A string starting with 'f'
  • A string starting with 'F'
  • A string starting with '0'
+

+The notfound value returned if no boolean is identified, does not necessarily have to be 0 or 1. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
double iniparser_getdouble (dictionary *  d,
char *  key,
double  notfound 
)
+
+
+ +

+Get the string associated to a key, convert to a double. +

+

Parameters:
+ + + + +
d Dictionary to search
key Key string to look for
notfound Value to return in case of error
+
+
Returns:
double
+This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the notfound value is returned. +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int iniparser_getint (dictionary *  d,
const char *  key,
int  notfound 
)
+
+
+ +

+Get the string associated to a key, convert to an int. +

+

Parameters:
+ + + + +
d Dictionary to search
key Key string to look for
notfound Value to return in case of error
+
+
Returns:
integer
+This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the notfound value is returned.

+Supported values for integers include the usual C notation so decimal, octal (starting with 0) and hexadecimal (starting with 0x) are supported. Examples:

+

    +
  • "42" -> 42
  • "042" -> 34 (octal -> decimal)
  • "0x42" -> 66 (hexa -> decimal)
+

+Warning: the conversion may overflow in various ways. Conversion is totally outsourced to strtol(), see the associated man page for overflow handling.

+Credits: Thanks to A. Becker for suggesting strtol() +

+

+ +

+
+ + + + + + + + + +
int iniparser_getnsec (dictionary *  d  ) 
+
+
+ +

+Get number of sections in a dictionary. +

+

Parameters:
+ + +
d Dictionary to examine
+
+
Returns:
int Number of sections found in dictionary
+This function returns the number of sections found in a dictionary. The test to recognize sections is done on the string stored in the dictionary: a section name is given as "section" whereas a key is stored as "section:key", thus the test looks for entries that do not contain a colon.

+This clearly fails in the case a section name contains a colon, but this should simply be avoided.

+This function returns -1 in case of error. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
char* iniparser_getsecname (dictionary *  d,
int  n 
)
+
+
+ +

+Get name for section n in a dictionary. +

+

Parameters:
+ + + +
d Dictionary to examine
n Section number (from 0 to nsec-1).
+
+
Returns:
Pointer to char string
+This function locates the n-th section in a dictionary and returns its name as a pointer to a string statically allocated inside the dictionary. Do not free or modify the returned string!

+This function returns NULL in case of error. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
char* iniparser_getstring (dictionary *  d,
const char *  key,
char *  def 
)
+
+
+ +

+Get the string associated to a key. +

+

Parameters:
+ + + + +
d Dictionary to search
key Key string to look for
def Default value to return if key not found.
+
+
Returns:
pointer to statically allocated character string
+This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the pointer passed as 'def' is returned. The returned char pointer is pointing to a string allocated in the dictionary, do not free or modify it. +
+

+ +

+
+ + + + + + + + + +
dictionary* iniparser_load (const char *  ininame  ) 
+
+
+ +

+Parse an ini file and return an allocated dictionary object. +

+

Parameters:
+ + +
ininame Name of the ini file to read.
+
+
Returns:
Pointer to newly allocated dictionary
+This is the parser for ini files. This function is called, providing the name of the file to be read. It returns a dictionary object that should not be accessed directly, but through accessor functions instead.

+The returned dictionary must be freed using iniparser_freedict(). +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int iniparser_setstring (dictionary *  ini,
char *  entry,
char *  val 
)
+
+
+ +

+Set an entry in a dictionary. +

+

Parameters:
+ + + + +
ini Dictionary to modify.
entry Entry to modify (entry name)
val New value to associate to the entry.
+
+
Returns:
int 0 if Ok, -1 otherwise.
+If the given entry can be found in the dictionary, it is modified to contain the provided value. If it cannot be found, -1 is returned. It is Ok to set val to NULL. +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void iniparser_unset (dictionary *  ini,
char *  entry 
)
+
+
+ +

+Delete an entry in a dictionary. +

+

Parameters:
+ + + +
ini Dictionary to modify
entry Entry to delete (entry name)
+
+
Returns:
void
+If the given entry can be found, it is deleted from the dictionary. +
+

+


Generated on Thu Jan 3 19:45:34 2008 for iniparser by  + +doxygen 1.5.3
+ + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8main.html b/ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8main.html new file mode 100644 index 0000000..5d92ece --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/html/iniparser_8main.html @@ -0,0 +1,15 @@ + + +iniparser: iniparser.main File Reference + + + + +

iniparser.main File Reference

+ +
+
Generated on Thu Jan 3 19:45:34 2008 for iniparser by  + +doxygen 1.5.3
+ + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_b.gif b/ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_b.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d623483ffdf5f9f96900108042a7ab0643fe2a3 GIT binary patch literal 35 ncmZ?wbhEHbWMp7uXkcJy*>IeJfk6j|fqX^=1|}vKMh0sDa2W*H literal 0 HcmV?d00001 diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_l.gif b/ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_l.gif new file mode 100644 index 0000000000000000000000000000000000000000..9b1e6337c9299a700401a2a78a2c6ffced475216 GIT binary patch literal 706 zcmZ?wbhEHbZT`}F1e&(Gg}Y(8=I;HA5#Z$3JI=gGB)FQ#odI(O&E^@q;x zK6mr*m3xOS-#u~t!I@i+u0DKm^U160k6t`|^WpV}&n+8{U%dD9&a>B#U%!9-@yol< zU%&tQ{rk_K|NsC0`}dE5ET99@1@a36+kb~?0UJ*yc&I3X_m z!ND^5$O7$#8OFRuDhG}!?8z?cdZK&!`PWjdR;Aj^wZ` zeK{IEYHBJ)6K8VIp1`BVt++swf6j+=L{p1*nO(VhE`pFexG@5$|>uaCcd z`0m=9m+yak{QmXN#Sc$^{$X9h9&q2jiKAI|&T)a;PPx2K9p`YIdw8HtR5k2Q$2-O2 z*;3y{MQ-RnJTgJfI&R5|O)AHxDf_00XbPvDZPy4t=hHd)nfLPvms&O`Ok(sD()5v$ z5U@&h;a=#xbxVbo2~X&Xj0Ie(f{v>vERH+qC+nTG=B8Nca=wU-O$?1&vUgV~9=!H; zx>3p9Yn%*<>t~sk+&0xfyS8RsPfYBd<~wWK%j-LmpU>O7yX^h#UCp1x-p#i7@bE;py8XI6 zmY<)m>~)W~yIWcMVoiPg{duuf<*)9qZ9l$m*Ph&W&$jlv*Vpa+{pH@n=IQ$L?0$ax ec60Ul|8o2P|NVbd{6P)#weSbE3}s?04AuZvx_~SI literal 0 HcmV?d00001 diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_r.gif b/ARDroneLib/Soft/Lib/iniparser3.0b/html/tab_r.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce9dd9f533cb5486d6941844f442b59d4a9e9175 GIT binary patch literal 2585 zcmbV}`9Bkk1ILFF--w5zJc=ZZT(zjE=;2|_S)Qm~rCWz1Pc)KPl;jv%A#&v2*x}yc zmf2~Jm~&=xjJY?PqwIN}f8qQ2{r$uH{c*nJbmr{cR5??*egHrs-B=MzCF`3%e{FAW z{oL5xTHn~5TM{jaB;@|_Ue5F&Zb@p(kMyG{*;gWDg zyeL|eZf7Qd8=#bXzSiR{yzRgLSj-fJS8>lBjVHN z^o-0eS=nE6a`W;LChBs=`+QAJP~{b93>H^eRb5kCSC1zUNezun%`L5M?RDzv#%jk7 zYVRX=vATPD`+oEfum^{RM@GjuP?-r=yh0!p;Vx^T9G7~`7%5ydH%70=jyJ;;`d;hv92x3R=z{xp+Lg2!*@OK*K15-t&okoPtSED)h&$RLxdbA zseWm^C3d%-yRNi-ryk^!ek+C`n&~cd$#ZWct_cUL{l~i+Nzx^5d!n94(>bW-iL~Rl z&8r)?q|1DIo=0=judQ{FaGcfLERz8gfn3-Qt<2lksh{mzpT}DXxUuR^z=^key&q4! z+wWI45vL0k$R^(F#{qfqhUsN@WA+w-V?LPH33!Q?WFSB3)WBojE@hK41Nb?KfS+Qo zXgrzfsP$wr4Qzy*{OD>uJBjdgGM@VMml5)2f~_}lD*YyOb}Hjeobhz#4c`w(l^>KK zr?Ud;W~Z}*w;%hZ|2^p^+f06gJDJQD zeIhGADbDmm&6arh(q>EZ<7mjzg7l|z$hRL8=1>)Nv=S7CY$B}iYJ&*T_-T_OG*L1q ztZ3Lana33?y3AKnyq^YCF|4x%Rb5WU&2qcl{TFKey%QJeMxn^SdT!hZ5+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 HcmV?d00001 diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/html/tabs.css b/ARDroneLib/Soft/Lib/iniparser3.0b/html/tabs.css new file mode 100644 index 0000000..c37faaf --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.c b/ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.c new file mode 100644 index 0000000..af82396 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.c @@ -0,0 +1,418 @@ +/*-------------------------------------------------------------------------*/ +/** + @file dictionary.c + @author N. Devillard + @date Sep 2007 + @version $Revision: 1.1.2.1 $ + @brief Implements a dictionary for string variables. + + This module implements a simple dictionary object, i.e. a list + of string/string associations. This object is useful to store e.g. + informations retrieved from a configuration file (ini files). +*/ +/*--------------------------------------------------------------------------*/ + +/* + $Id: dictionary.c,v 1.1.2.1 2010-02-12 10:19:23 kleplat Exp $ + $Revision: 1.1.2.1 $ +*/ +/*--------------------------------------------------------------------------- + Includes + ---------------------------------------------------------------------------*/ +#include "dictionary.h" + +#include +#include +#include +#ifndef _WIN32 +#include +#endif + +/** Maximum value size for integers and doubles. */ +#define MAXVALSZ 1024 + +/** Minimal allocated number of entries in a dictionary */ +#define DICTMINSZ 128 + +/** Invalid key token */ +#define DICT_INVALID_KEY ((char*)-1) + +/*--------------------------------------------------------------------------- + Private functions + ---------------------------------------------------------------------------*/ + +/* Doubles the allocated size associated to a pointer */ +/* 'size' is the current allocated size. */ +static void * mem_double(void * ptr, int size) +{ + void * newptr ; + + newptr = calloc(2*size, 1); + if (newptr==NULL) { + return NULL ; + } + memcpy(newptr, ptr, size); + free(ptr); + return newptr ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Duplicate a string + @param s String to duplicate + @return Pointer to a newly allocated string, to be freed with free() + + This is a replacement for strdup(). This implementation is provided + for systems that do not have it. + */ +/*--------------------------------------------------------------------------*/ +static char * xstrdup(const char * s) +{ + char * t ; + if (!s) + return NULL ; + t = malloc(strlen(s)+1) ; + if (t) { + strcpy(t,s); + } + return t ; +} + +/*--------------------------------------------------------------------------- + Function codes + ---------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------*/ +/** + @brief Compute the hash key for a string. + @param key Character string to use for key. + @return 1 unsigned int on at least 32 bits. + + This hash function has been taken from an Article in Dr Dobbs Journal. + This is normally a collision-free function, distributing keys evenly. + The key is stored anyway in the struct so that collision can be avoided + by comparing the key itself in last resort. + */ +/*--------------------------------------------------------------------------*/ +unsigned dictionary_hash(const char * key) +{ + int len ; + unsigned hash ; + int i ; + + len = strlen(key); + for (hash=0, i=0 ; i>6) ; + } + hash += (hash <<3); + hash ^= (hash >>11); + hash += (hash <<15); + return hash ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Create a new dictionary object. + @param size Optional initial size of the dictionary. + @return 1 newly allocated dictionary objet. + + This function allocates a new dictionary object of given size and returns + it. If you do not know in advance (roughly) the number of entries in the + dictionary, give size=0. + */ +/*--------------------------------------------------------------------------*/ +dictionary * dictionary_new(int size) +{ + dictionary* d; + + /* If no size was specified, allocate space for DICTMINSZ */ + if (sizesize = size ; + d->values = (dictionary_value *)calloc(size, sizeof(dictionary_value)); + d->key = (char **)calloc(size, sizeof(char*)); + d->hash = (unsigned int *)calloc(size, sizeof(unsigned)); + + memset(d->values, 0, size*sizeof(dictionary_value)); + memset(d->key, 0, size*sizeof(char*)); + memset(d->hash, 0, size*sizeof(unsigned)); + + return d ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a dictionary object + @param d dictionary object to deallocate. + @return void + + Deallocate a dictionary object and all memory associated to it. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_del(dictionary * d) +{ + int i ; + + if (d==NULL) return ; + for (i=0 ; isize ; i++) { + if (d->key[i]!=NULL) + free(d->key[i]); + if (d->values[i].val!=NULL) + free(d->values[i].val); + } + free(d->values); + free(d->key); + free(d->hash); + free(d); + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get a value from a dictionary. + @param d dictionary object to search. + @param key Key to look for in the dictionary. + @return 1 pointer to internally allocated character string. + + This function locates a key in a dictionary and returns a pointer to its + value, or the passed 'def' pointer if no such key can be found in + dictionary. The returned character pointer points to data internal to the + dictionary object, you should not try to free it or modify it. + */ +/*--------------------------------------------------------------------------*/ +dictionary_value* dictionary_get(dictionary * d, const char * key) +{ + unsigned hash ; + int i; + + hash = dictionary_hash(key); + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) + continue ; + /* Compare hash */ + if (hash==d->hash[i]) { + /* Compare string, to avoid hash collisions */ + if (!strcmp(key, d->key[i])) { + return &d->values[i]; + } + } + } + return NULL; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Set a value in a dictionary. + @param d dictionary object to modify. + @param key Key to modify or add. + @param val Value to add. + @return int 0 if Ok, anything else otherwise + + If the given key is found in the dictionary, the associated value is + replaced by the provided one. If the key cannot be found in the + dictionary, it is added to it. + + It is Ok to provide a NULL value for val, but NULL values for the dictionary + or the key are considered as errors: the function will return immediately + in such a case. + + Notice that if you dictionary_set a variable to NULL, a call to + dictionary_get will return a NULL value: the variable will be found, and + its value (NULL) is returned. In other words, setting the variable + content to NULL is equivalent to deleting the variable from the + dictionary. It is not possible (in this implementation) to have a key in + the dictionary without value. + + This function returns non-zero in case of failure. + */ +/*--------------------------------------------------------------------------*/ +dictionary_value* dictionary_set(dictionary * d, const char * key, char * val, int type, void* ptr,void (*cb)(void)) +{ + int i; + unsigned hash; + + if (d==NULL || key==NULL) + return NULL ; + + /* Compute hash for this key */ + hash = dictionary_hash(key) ; + /* Find if value is already in dictionary */ + if (d->n>0) { + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) + continue ; + if (hash==d->hash[i]) { /* Same hash value */ + if (!strcmp(key, d->key[i])) { /* Same key */ + /* Found a value: modify and return */ + if (d->values[i].val!=NULL) + free(d->values[i].val); + + d->values[i].val = (val != NULL) ? xstrdup(val) : NULL ; + /* Value has been modified: return */ + return &d->values[i]; + } + } + } + } + + /* Add a new value */ + /* See if dictionary needs to grow */ + if (d->n==d->size) { + /* Reached maximum size: reallocate dictionary */ + d->values = (dictionary_value *)mem_double(d->values, d->size * sizeof(dictionary_value*)) ; + d->key = (char **)mem_double(d->key, d->size * sizeof(char*)) ; + d->hash = (unsigned int *)mem_double(d->hash, d->size * sizeof(unsigned)) ; + if ((d->values==NULL) || (d->key==NULL) || (d->hash==NULL)) { + /* Cannot grow dictionary */ + return NULL; + } + /* Double size */ + d->size *= 2 ; + } + + /* Insert key in the first empty slot */ + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) { + /* Add key here */ + break ; + } + } + /* Copy key */ + d->key[i] = xstrdup(key); + d->values[i].val = (val != NULL) ? xstrdup(val) : NULL; + d->values[i].type = type; + d->values[i].callback = NULL; + d->values[i].rw = 0; + d->values[i].scope = -1; + d->values[i].ptr = ptr; + d->hash[i] = hash; + d->n ++ ; + + return &d->values[i] ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a key in a dictionary + @param d dictionary object to modify. + @param key Key to remove. + @return void + + This function deletes a key in a dictionary. Nothing is done if the + key cannot be found. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_unset(dictionary * d, const char * key) +{ + unsigned hash; + int i; + + if (key == NULL) { + return; + } + + hash = dictionary_hash(key); + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) + continue ; + /* Compare hash */ + if (hash==d->hash[i]) { + /* Compare string, to avoid hash collisions */ + if (!strcmp(key, d->key[i])) { + /* Found key */ + break ; + } + } + } + + if (i>=d->size) + /* Key not found */ + return ; + + free(d->key[i]); + d->key[i] = NULL ; + if (d->values[i].val!=NULL) { + free(d->values[i].val); + d->values[i].val = NULL ; + } + d->hash[i] = 0 ; + d->n -- ; + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump + @param f Opened file pointer. + @return void + + Dumps a dictionary onto an opened file pointer. Key pairs are printed out + as @c [Key]=[Value], one per line. It is Ok to provide stdout or stderr as + output file pointers. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_dump(dictionary * d, FILE * out) +{ + int i; + + if (d==NULL || out==NULL) return ; + if (d->n<1) { + fprintf(out, "empty dictionary\n"); + return ; + } + for (i=0 ; isize ; i++) { + if (d->key[i]) { + fprintf(out, "%20s\t[%s]\n", d->key[i], (d->values[i].val != NULL) ? d->values[i].val : "UNDEF"); + } + } + return ; +} + + +/* Test code */ +#ifdef TESTDIC +#define NVALS 20000 +int main(int argc, char *argv[]) +{ + dictionary * d ; + char * val ; + int i ; + char cval[90] ; + + /* Allocate dictionary */ + printf("allocating...\n"); + d = dictionary_new(0); + + /* Set values in dictionary */ + printf("setting %d values...\n", NVALS); + for (i=0 ; in != 0) { + printf("error deleting values\n"); + } + printf("deallocating...\n"); + dictionary_del(d); + return 0 ; +} +#endif +/* vim: set ts=4 et sw=4 tw=75 */ diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.h b/ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.h new file mode 100644 index 0000000..c7a7ce9 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/src/dictionary.h @@ -0,0 +1,197 @@ + +/*-------------------------------------------------------------------------*/ +/** + @file dictionary.h + @author N. Devillard + @date Sep 2007 + @version $Revision: 1.1.2.1 $ + @brief Implements a dictionary for string variables. + + This module implements a simple dictionary object, i.e. a list + of string/string associations. This object is useful to store e.g. + informations retrieved from a configuration file (ini files). +*/ +/*--------------------------------------------------------------------------*/ + +/* + $Id: dictionary.h,v 1.1.2.1 2010-02-12 10:19:23 kleplat Exp $ + $Author: kleplat $ + $Date: 2010-02-12 10:19:23 $ + $Revision: 1.1.2.1 $ +*/ + +#ifndef _DICTIONARY_H_ +#define _DICTIONARY_H_ + +/*--------------------------------------------------------------------------- + Includes + ---------------------------------------------------------------------------*/ + +#include +#include +#include +#ifndef _WIN32 +#include +#endif + +/*--------------------------------------------------------------------------- + New types + ---------------------------------------------------------------------------*/ + +typedef enum _dictionary_value_type_ { + INI_SECTION = 0x00, + INI_STRING = 0x01, + INI_INT = 0x02, + INI_FLOAT = 0x03, + INI_DOUBLE = 0x04, + INI_BOOLEAN = 0x05, + INI_VECTOR = 0x06, + INI_MATRIX = 0x07, + INI_UNKNOW = 0x08, + INI_VECTOR21= 0x09 +} dictionary_value_type; + +typedef struct _dictionary_value_ { + dictionary_value_type type; + char* val; + void* ptr; + void (*callback)(void); + char rw; + signed int scope; /* default scope (common,appli,user profile,session) */ +} dictionary_value; + +/*-------------------------------------------------------------------------*/ +/** + @brief Dictionary object + + This object contains a list of string/string associations. Each + association is identified by a unique string key. Looking up values + in the dictionary is speeded up by the use of a (hopefully collision-free) + hash function. + */ +/*-------------------------------------------------------------------------*/ +typedef struct _dictionary_ { + int n; /** Number of entries in dictionary */ + int size; /** Storage size */ + // char** val; /** List of string values */ + dictionary_value* values; + char** key; /** List of string keys */ + unsigned* hash; /** List of hash values for keys */ +} dictionary ; + + +/*--------------------------------------------------------------------------- + Function prototypes + ---------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------*/ +/** + @brief Compute the hash key for a string. + @param key Character string to use for key. + @return 1 unsigned int on at least 32 bits. + + This hash function has been taken from an Article in Dr Dobbs Journal. + This is normally a collision-free function, distributing keys evenly. + The key is stored anyway in the struct so that collision can be avoided + by comparing the key itself in last resort. + */ +/*--------------------------------------------------------------------------*/ +unsigned dictionary_hash(const char * key); + +/*-------------------------------------------------------------------------*/ +/** + @brief Create a new dictionary object. + @param size Optional initial size of the dictionary. + @return 1 newly allocated dictionary objet. + + This function allocates a new dictionary object of given size and returns + it. If you do not know in advance (roughly) the number of entries in the + dictionary, give size=0. + */ +/*--------------------------------------------------------------------------*/ +dictionary * dictionary_new(int size); + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a dictionary object + @param d dictionary object to deallocate. + @return void + + Deallocate a dictionary object and all memory associated to it. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_del(dictionary * vd); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get a value from a dictionary. + @param d dictionary object to search. + @param key Key to look for in the dictionary. + @return 1 pointer to internally allocated character string. + + This function locates a key in a dictionary and returns a pointer to its + value, or the passed 'def' pointer if no such key can be found in + dictionary. The returned character pointer points to data internal to the + dictionary object, you should not try to free it or modify it. + */ +/*--------------------------------------------------------------------------*/ +dictionary_value* dictionary_get(dictionary * d, const char * key); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Set a value in a dictionary. + @param d dictionary object to modify. + @param key Key to modify or add. + @param val Value to add. + @return int 0 if Ok, anything else otherwise + + If the given key is found in the dictionary, the associated value is + replaced by the provided one. If the key cannot be found in the + dictionary, it is added to it. + + It is Ok to provide a NULL value for val, but NULL values for the dictionary + or the key are considered as errors: the function will return immediately + in such a case. + + Notice that if you dictionary_set a variable to NULL, a call to + dictionary_get will return a NULL value: the variable will be found, and + its value (NULL) is returned. In other words, setting the variable + content to NULL is equivalent to deleting the variable from the + dictionary. It is not possible (in this implementation) to have a key in + the dictionary without value. + + This function returns non-zero in case of failure. + */ +/*--------------------------------------------------------------------------*/ +dictionary_value* dictionary_set(dictionary * d, const char * key, char * val, int type, void* ptr,void (*cb)(void)); + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a key in a dictionary + @param d dictionary object to modify. + @param key Key to remove. + @return void + + This function deletes a key in a dictionary. Nothing is done if the + key cannot be found. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_unset(dictionary * d, const char * key); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump + @param f Opened file pointer. + @return void + + Dumps a dictionary onto an opened file pointer. Key pairs are printed out + as @c [Key]=[Value], one per line. It is Ok to provide stdout or stderr as + output file pointers. + */ +/*--------------------------------------------------------------------------*/ +void dictionary_dump(dictionary * d, FILE * out); + +#endif diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.c b/ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.c new file mode 100644 index 0000000..d25498e --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.c @@ -0,0 +1,1083 @@ + +/*-------------------------------------------------------------------------*/ +/** + @file iniparser.c + @author N. Devillard + @date Sep 2007 + @version 3.0 + @brief Parser for ini files. +*/ +/*--------------------------------------------------------------------------*/ +/* + $Id: iniparser.c,v 1.1.2.1 2010-02-12 10:19:23 kleplat Exp $ + $Revision: 1.1.2.1 $ + $Date: 2010-02-12 10:19:23 $ +*/ +/*---------------------------- Includes ------------------------------------*/ +#include +#include "iniparser.h" + +#include + +#include + + +#undef ARDRONE_CONFIG_KEY_IMM +#undef ARDRONE_CONFIG_KEY_REF +#undef ARDRONE_CONFIG_KEY_STR +#define ARDRONE_CONFIG_KEY_IMM(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_REF(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#define ARDRONE_CONFIG_KEY_STR(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK) +#include + +/*---------------------------- Defines -------------------------------------*/ +#define ASCIILINESZ (1024) +#define INI_INVALID_KEY ((char*)-1) + +/*--------------------------------------------------------------------------- + Private to this module + ---------------------------------------------------------------------------*/ +/** + * This enum stores the status for each parsed line (internal use only). + */ +typedef enum _line_status_ { + LINE_UNPROCESSED, + LINE_ERROR, + LINE_EMPTY, + LINE_COMMENT, + LINE_SECTION, + LINE_VALUE +} line_status ; + +/*-------------------------------------------------------------------------*/ +/** + @brief Convert a string to lowercase. + @param s String to convert. + @return ptr to statically allocated string. + + This function returns a pointer to a statically allocated string + containing a lowercased version of the input string. Do not free + or modify the returned string! Since the returned string is statically + allocated, it will be modified at each function call (not re-entrant). + */ +/*--------------------------------------------------------------------------*/ +static char * strlwc(const char * s) +{ + static char l[ASCIILINESZ+1]; + int i ; + + if (s==NULL) return NULL ; + memset(l, 0, sizeof(l)); + i=0 ; + while (s[i] && i l) { + if (!isspace((int)*(last-1))) + break ; + last -- ; + } + *last = (char)0; + return (char*)l ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get number of sections in a dictionary + @param d Dictionary to examine + @return int Number of sections found in dictionary + + This function returns the number of sections found in a dictionary. + The test to recognize sections is done on the string stored in the + dictionary: a section name is given as "section" whereas a key is + stored as "section:key", thus the test looks for entries that do not + contain a colon. + + This clearly fails in the case a section name contains a colon, but + this should simply be avoided. + + This function returns -1 in case of error. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getnsec(dictionary * d) +{ + int i ; + int nsec ; + + if (d==NULL) return -1 ; + nsec=0 ; + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) + continue ; + if (/*strchr(d->key[i], ':')*/d->values[i].type==INI_SECTION) { + nsec ++ ; + } + } + return nsec ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get name for section n in a dictionary. + @param d Dictionary to examine + @param n Section number (from 0 to nsec-1). + @return Pointer to char string + + This function locates the n-th section in a dictionary and returns + its name as a pointer to a string statically allocated inside the + dictionary. Do not free or modify the returned string! + + This function returns NULL in case of error. + */ +/*--------------------------------------------------------------------------*/ +char * iniparser_getsecname(dictionary * d, int n) +{ + int i ; + int foundsec ; + + if (d==NULL || n<0) return NULL ; + foundsec=0 ; + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) + continue ; + if (/*strchr(d->key[i], ':')==NULL*/ d->values[i].type==INI_SECTION) { + foundsec++ ; + if (foundsec>n) + break ; + } + } + if (foundsec<=n) { + return NULL ; + } + return d->key[i] ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Duplicate a string + @param s String to duplicate + @return Pointer to a newly allocated string, to be freed with free() + + This is a replacement for strdup(). This implementation is provided + for systems that do not have it. + */ +/*--------------------------------------------------------------------------*/ +static char * xstrdup(const char * s) +{ + char * t ; + if (!s) + return NULL ; + t = malloc(strlen(s)+1) ; + if (t) { + strcpy(t,s); + } + return t ; +} + +void iniparser_ptr2val(dictionary_value* value) +{ + if( value && value->ptr != NULL ) + { + if(value->val) + { + free(value->val); + value->val = NULL; + } + + switch( value->type ) + { + case INI_STRING: + value->val = xstrdup(value->ptr); + break; + + case INI_INT: + value->val = malloc(64); + sprintf(value->val, "%d", *(int*)(value->ptr)); + break; + + case INI_FLOAT: + value->val = malloc(64); + sprintf(value->val, "%.7e", *(float*)(value->ptr)); + break; + + case INI_DOUBLE: + value->val = malloc(64); + sprintf(value->val, "%.16e", *(double*)(value->ptr)); + break; + + case INI_BOOLEAN: + value->val = malloc(64); + sprintf(value->val, "%s", ( *(int*)(value->ptr) ? "TRUE" : "FALSE" ) ); + break; + + case INI_VECTOR: + value->val = malloc(256); + sprintf(value->val, "{ %.7e %.7e %.7e }", ((vector31_t*)value->ptr)->x, ((vector31_t*)value->ptr)->y, ((vector31_t*)value->ptr)->z); + break; + + case INI_VECTOR21: + value->val = malloc(256); + sprintf(value->val, "{ %.7e %.7e }", ((vector21_t*)value->ptr)->x, ((vector21_t*)value->ptr)->y); + break; + + case INI_MATRIX: + value->val = malloc(1024); + sprintf(value->val, "{ %.7e %.7e %.7e %.7e %.7e %.7e %.7e %.7e %.7e }", + ((matrix33_t*)value->ptr)->m11, ((matrix33_t*)value->ptr)->m12, ((matrix33_t*)value->ptr)->m13, + ((matrix33_t*)value->ptr)->m21, ((matrix33_t*)value->ptr)->m22, ((matrix33_t*)value->ptr)->m23, + ((matrix33_t*)value->ptr)->m31, ((matrix33_t*)value->ptr)->m32, ((matrix33_t*)value->ptr)->m33 ); + break; + + case INI_UNKNOW: + default: + break; + } + } +} + +void iniparser_val2ptr(dictionary_value* value) +{ + if( value ) + { + if( value->ptr != NULL && value->val != NULL ) + { + switch( value->type ) + { + case INI_STRING: + strcpy(value->ptr, value->val); + break; + + case INI_INT: + *(int*)(value->ptr) = (int)strtol(value->val, NULL, 0); + break; + + case INI_FLOAT: + *(float*)(value->ptr) = (float)atof(value->val); + break; + + case INI_DOUBLE: + *(double*)(value->ptr) = (double)atof(value->val); + break; + + case INI_BOOLEAN: + { + int ret; + char c = value->val[0]; + + if( c=='y' || c=='Y' || c=='1' || c=='t' || c=='T') { + ret = 1 ; + } else if (c=='n' || c=='N' || c=='0' || c=='f' || c=='F') { + ret = 0 ; + } + else { + ret = 0xdeadbeef; + } + + *(int*)(value->ptr) = ret; + } + break; + + case INI_VECTOR: + sscanf(value->val, "{ %e %e %e }", &((vector31_t*)value->ptr)->x, &((vector31_t*)value->ptr)->y, &((vector31_t*)value->ptr)->z); + break; + + case INI_VECTOR21: + sscanf(value->val, "{ %e %e }", &((vector21_t*)value->ptr)->x, &((vector21_t*)value->ptr)->y); + break; + + case INI_MATRIX: + sscanf(value->val, "{ %e %e %e %e %e %e %e %e %e }", + &((matrix33_t*)value->ptr)->m11, &((matrix33_t*)value->ptr)->m12, &((matrix33_t*)value->ptr)->m13, + &((matrix33_t*)value->ptr)->m21, &((matrix33_t*)value->ptr)->m22, &((matrix33_t*)value->ptr)->m23, + &((matrix33_t*)value->ptr)->m31, &((matrix33_t*)value->ptr)->m32, &((matrix33_t*)value->ptr)->m33 ); + break; + + case INI_UNKNOW: + default: + break; + } + } + } +} + + + +/*-------------------------------------------------------------------------*/ +/** + @brief Transfer values from the dictionary to the bound variables + @param d Dictionary to dump. + @param scope Scope for which values must be transfered (set to -1 to tranfer all values) + @return void + */ +/*--------------------------------------------------------------------------*/ +void iniparser_vals2ptrs(dictionary * d , int scope) +{ + int i ; + + if (d==NULL) return ; + for (i=0 ; isize ; i++) { + + if (d->key[i]==NULL) + continue ; + + if( d->values[i].ptr != NULL ) { + if (scope==-1 || d->values[i].scope==scope) { + iniparser_val2ptr(&d->values[i]); + } + } + } + + return ; +} + + +/*-------------------------------------------------------------------------*/ +/** + @brief Transfer values from the bound variables to the dictionary. + @param d Dictionary to fill. + @param scope Scope for which values must be transfered (set to -1 to tranfer all values) + @return void + */ +/*--------------------------------------------------------------------------*/ +void iniparser_ptrs2vals(dictionary * d , int scope) +{ + int i ; + + if (d==NULL) return ; + for (i=0 ; isize ; i++) { + + if (d->key[i]==NULL) + continue ; + + if( d->values[i].ptr != NULL ) { + if (scope==-1 || d->values[i].scope==scope) { + iniparser_ptr2val(&d->values[i]); + } + } + } + + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump. + @param f Opened file pointer to dump to. + @return void + + This function prints out the contents of a dictionary, one element by + line, onto the provided file pointer. It is OK to specify @c stderr + or @c stdout as output files. This function is meant for debugging + purposes mostly. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_dump(dictionary * d) +{ + int i ; + + if (d==NULL) return ; + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) + continue ; + if( d->values[i].ptr != NULL ) { + switch(d->values[i].type) + { + case INI_STRING: + PRINT("%s= %s [STRING]\n", d->key[i], d->values[i].val); + break; + + case INI_INT: + PRINT("%s= %d [INT]\n", d->key[i], *(int*)d->values[i].ptr); + break; + + case INI_FLOAT: + PRINT("%s= %f [FLOAT]\n", d->key[i], *(float*)d->values[i].ptr); + break; + + case INI_DOUBLE: + PRINT("%s= %lf [DOUBLE]\n", d->key[i], *(double*)d->values[i].ptr); + break; + + case INI_BOOLEAN: + PRINT("%s= %d [BOOLEAN]\n", d->key[i], *(int*)d->values[i].ptr); + break; + + case INI_VECTOR: + PRINT("%s= { %f %f %f } [VECTOR]\n", d->key[i], ((vector31_t*)d->values[i].ptr)->x, + ((vector31_t*)d->values[i].ptr)->y, + ((vector31_t*)d->values[i].ptr)->z); + break; + + case INI_VECTOR21: + PRINT("%s= { %f %f } [VECTOR21]\n", d->key[i], ((vector21_t*)d->values[i].ptr)->x, + ((vector21_t*)d->values[i].ptr)->y); + break; + + case INI_MATRIX: + PRINT("%s= { %f %f %f %f %f %f %f %f %f } [MATRIX]\n", d->key[i], + ((matrix33_t*)d->values[i].ptr)->m11, ((matrix33_t*)d->values[i].ptr)->m12, ((matrix33_t*)d->values[i].ptr)->m13, + ((matrix33_t*)d->values[i].ptr)->m21, ((matrix33_t*)d->values[i].ptr)->m22, ((matrix33_t*)d->values[i].ptr)->m23, + ((matrix33_t*)d->values[i].ptr)->m31, ((matrix33_t*)d->values[i].ptr)->m32, ((matrix33_t*)d->values[i].ptr)->m33 ); + break; + + case INI_UNKNOW: + default: + PRINT("%s=[%s]\n", d->key[i], d->values[i].val); + break; + } +// fprintf(f, "[%s]=[%s]\n", d->key[i], d->val[i]); + } else { + if (d->values[i].val!=NULL) { + PRINT("%s=[%s]\n", d->key[i], d->values[i].val); + } + else { + if( d->values[i].type == INI_SECTION ) + PRINT("[%s]\n", d->key[i]); + else + PRINT("%s=UNDEF\n", d->key[i]); +// fprintf(f, "[%s]=UNDEF\n", d->key[i]); + } + } + } + return ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Save a dictionary to a loadable ini file + @param d Dictionary to dump + @param f Opened file pointer to dump to + @param flag_dump_k_shallows If true, K_SHALLOW values are written on disk + @return void + + This function dumps a given dictionary into a loadable ini file. + It is Ok to specify @c stderr or @c stdout as output files. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_dump_ini(dictionary * d, FILE * f) +{ iniparser_dump_ini_a4(d,f,0,1); } +void iniparser_dump_ini_a3(dictionary * d, FILE * f , int flag_dump_k_shallows) +{ iniparser_dump_ini_a4(d,f,flag_dump_k_shallows,1); } + +void iniparser_dump_ini_a4(dictionary * d, FILE * f , int flag_dump_k_shallows , int update_values_from_memory) +{ + int i, j ; + char keym[ASCIILINESZ+1]; + int nsec ; + char * secname ; + int seclen ; + + if (d==NULL || f==NULL) return ; + + nsec = iniparser_getnsec(d); + if (nsec<1) { + /* No section in file: dump all keys as they are */ + for (i=0 ; isize ; i++) { + if (d->key[i]==NULL) + continue ; + /* Stephane - add K_SHALLOW support */ + if (!flag_dump_k_shallows) + if ((d->values[i].rw&K_SHALLOW)!=0) + continue; + if(update_values_from_memory) + iniparser_ptr2val(&d->values[i]); // Make sure we are synchro before dump + fprintf(f, "%s = %s\n", d->key[i], d->values[i].val); + } + return ; + } + for (i=0 ; isize ; j++) { + if (d->key[j]==NULL) + continue ; + /* Stephane - add K_SHALLOW support */ + if (!flag_dump_k_shallows) + if ((d->values[j].rw&K_SHALLOW)!=0) + continue; + if (!strncmp(d->key[j], strlwc(keym), seclen+1)) { + if(update_values_from_memory) + iniparser_ptr2val(&d->values[j]); // Make sure we are synchro before dump + fprintf(f, + "%-30s = %s\n", + d->key[j]+seclen+1, + d->values[j].val ? d->values[j].val : ""); + } + } + } + fprintf(f, "\n"); + return ; +} + +static dictionary_value* iniparser_getdictionaryvalue(dictionary * d, const char * key) +{ + char * lc_key; + + if (d==NULL || key==NULL) + return NULL; + + lc_key = strlwc(key); + return dictionary_get(d, lc_key); +} + +int iniparser_alias_ex(dictionary * d, const char* kkey, int type, void* ptr, void (*cb)(void), char rw,int scope); +int iniparser_alias(dictionary * d, const char* kkey, int type, void* ptr, void (*cb)(void), char rw) +{ return iniparser_alias_ex(d,kkey,type,ptr,cb,rw,CAT_COMMON); } + +int iniparser_alias_ex(dictionary * d, const char* kkey, int type, void* ptr, void (*cb)(void), char rw,int scope) +{ + dictionary_value* value; + char *pos; + char key[ASCIILINESZ]; + + strcpy(&key[0], kkey); + + // Create a new section ? + pos = strchr(key, ':'); + if( pos ) + { + *pos = '\0'; + value = iniparser_getdictionaryvalue(d, key); + if( value == NULL) + dictionary_set(d, key, NULL, INI_SECTION, NULL,NULL); + *pos = ':'; + } + else + { + return -1; + } + + value = iniparser_getdictionaryvalue(d, key); + + // TODO: change hardcoded value + if( value == NULL ) + { + if( ptr != NULL ) + { + // Create a new value + value = dictionary_set(d, strlwc(key), NULL, type, ptr, cb); + value->callback = cb; + value->rw = rw; + value->scope = scope; + iniparser_ptr2val(value); + + if( cb ) + cb(); + } + else + { + return -1; + } + } + else + { + if( ptr != NULL ) + { + // setup existing value + value->type = type; + value->ptr = ptr; + value->callback = cb; + value->rw = rw; + value->scope = scope; + + if(rw & 1<<2) + { + iniparser_ptr2val(value); + } + else + { + iniparser_val2ptr(value); + } + + if( cb ) + cb(); + } + else + { + dictionary_unset(d, key); + } + } + + return 0; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key + @param d Dictionary to search + @param key Key string to look for + @param def Default value to return if key not found. + @return pointer to statically allocated character string + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the pointer passed as 'def' is returned. + The returned char pointer is pointing to a string allocated in + the dictionary, do not free or modify it. + */ +/*--------------------------------------------------------------------------*/ +char * iniparser_getstring(dictionary * d, const char * key, char * def) +{ + dictionary_value* value = iniparser_getdictionaryvalue(d, key); + + if( value == NULL ) + return def; + + return value->val; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to an int + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + Supported values for integers include the usual C notation + so decimal, octal (starting with 0) and hexadecimal (starting with 0x) + are supported. Examples: + + "42" -> 42 + "042" -> 34 (octal -> decimal) + "0x42" -> 66 (hexa -> decimal) + + Warning: the conversion may overflow in various ways. Conversion is + totally outsourced to strtol(), see the associated man page for overflow + handling. + + Credits: Thanks to A. Becker for suggesting strtol() + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getint(dictionary * d, const char * key, int notfound) +{ + int i; + + dictionary_value* value = iniparser_getdictionaryvalue(d, key); + + if( value == NULL ) + return notfound; + + if( value->ptr ) + { + i = *(int*)(value->ptr); + } + else + { + i = strtol(value->val, NULL, 0); + } + + return i; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a double + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return double + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + */ +/*--------------------------------------------------------------------------*/ +double iniparser_getdouble(dictionary * dict, char * key, double notfound) +{ + double d; + dictionary_value* value = iniparser_getdictionaryvalue(dict, key); + + if( value == NULL ) + return notfound; + + if( value->ptr ) + { + switch( value->type ) + { + case INI_FLOAT: + d = (double)*(float*)(value->ptr); + break; + case INI_DOUBLE: + d = *(double*)(value->ptr); + break; + default: + d = notfound; + break; + } + } + else + { + d = (int)atof(value->val); + } + + return d; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a boolean + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + A true boolean is found if one of the following is matched: + + - A string starting with 'y' + - A string starting with 'Y' + - A string starting with 't' + - A string starting with 'T' + - A string starting with '1' + + A false boolean is found if one of the following is matched: + + - A string starting with 'n' + - A string starting with 'N' + - A string starting with 'f' + - A string starting with 'F' + - A string starting with '0' + + The notfound value returned if no boolean is identified, does not + necessarily have to be 0 or 1. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getboolean(dictionary* dict, const char* key, int notfound) +{ + int ret; + + dictionary_value* value = iniparser_getdictionaryvalue(dict, key); + + if( value == NULL ) + return notfound; + + if( value->ptr ) + { + ret = *(int*)(value->ptr); + } + else + { + char c = value->val[0]; + + if( c=='y' || c=='Y' || c=='1' || c=='t' || c=='T') { + ret = 1 ; + } else if (c=='n' || c=='N' || c=='0' || c=='f' || c=='F') { + ret = 0 ; + } else { + ret = notfound ; + } + } + + return ret; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Finds out if a given entry exists in a dictionary + @param ini Dictionary to search + @param entry Name of the entry to look for + @return integer 1 if entry exists, 0 otherwise + + Finds out if a given entry exists in the dictionary. Since sections + are stored as keys with NULL associated values, this is the only way + of querying for the presence of sections in a dictionary. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_find_entry( dictionary * ini, char* entry ) +{ + return iniparser_getstring(ini, entry, INI_INVALID_KEY) != INI_INVALID_KEY ? 1 : 0; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Set an entry in a dictionary. + @param ini Dictionary to modify. + @param entry Entry to modify (entry name) + @param val New value to associate to the entry. + @return int 0 if Ok, -1 otherwise. + + If the given entry can be found in the dictionary, it is modified to + contain the provided value. If it cannot be found, -1 is returned. + It is Ok to set val to NULL. + */ +/*--------------------------------------------------------------------------*/ + +int iniparser_setstring(dictionary * ini, const char * entry, const char * val) +{ return iniparser_setstring_a4(ini,entry,val,1); } + +int iniparser_setstring_a4(dictionary * ini,const char * entry, const char * val , int trigger_callback) +{ + dictionary_value* value = dictionary_set(ini, strlwc(entry), val, INI_UNKNOW, NULL,NULL); + + if( value == NULL ) + return -1; + + iniparser_val2ptr(value); + + if( (trigger_callback) && (value->callback) ) + value->callback(); + + return 0; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete an entry in a dictionary + @param ini Dictionary to modify + @param entry Entry to delete (entry name) + @return void + + If the given entry can be found, it is deleted from the dictionary. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_unset(dictionary * ini, char * entry) +{ + dictionary_unset(ini, strlwc(entry)); +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Load a single line from an INI file + @param input_line Input line, may be concatenated multi-line input + @param section Output space to store section + @param key Output space to store key + @param value Output space to store value + @return line_status value + */ +/*--------------------------------------------------------------------------*/ +static line_status iniparser_line( + char * input_line, + char * section, + char * key, + char * value) +{ + line_status sta ; + char line[ASCIILINESZ+1]; + int len ; + + strcpy(line, strstrip(input_line)); + len = (int)strlen(line); + + sta = LINE_UNPROCESSED ; + if (len<1) { + /* Empty line */ + sta = LINE_EMPTY ; + } else if (line[0]=='#') { + /* Comment line */ + sta = LINE_COMMENT ; + } else if (line[0]=='[' && line[len-1]==']') { + /* Section name */ + sscanf(line, "[%[^]]", section); + strcpy(section, strstrip(section)); + strcpy(section, strlwc(section)); + sta = LINE_SECTION ; + } else if ((sscanf (line, "%[^=] = \"%[^\"]\"", key, value) == 2 + || sscanf (line, "%[^=] = '%[^\']'", key, value) == 2 + || sscanf (line, "%[^=] = %[^;#]", key, value) == 2) /*&& (strcmp(section,""))*/) { + /* Usual key=value, with or without comments */ + strcpy(key, strstrip(key)); + strcpy(key, strlwc(key)); + strcpy(value, strstrip(value)); + /* + * sscanf cannot handle '' or "" as empty values + * this is done here + */ + if (!strcmp(value, "\"\"") || (!strcmp(value, "''"))) { + value[0]=0 ; + } + sta = LINE_VALUE ; + } else if ((sscanf(line, "%[^=] = %[;#]", key, value)==2 + || sscanf(line, "%[^=] %[=]", key, value) == 2) /*&& (strcmp(section,""))*/) { + /* + * Special cases: + * key= + * key=; + * key=# + */ + strcpy(key, strstrip(key)); + strcpy(key, strlwc(key)); + value[0]=0 ; + sta = LINE_VALUE ; + } else { + /* Generate syntax error */ + sta = LINE_ERROR ; + } + return sta ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Parse an ini file and return an allocated dictionary object + @param ininame Name of the ini file to read. + @return Pointer to newly allocated dictionary + + This is the parser for ini files. This function is called, providing + the name of the file to be read. It returns a dictionary object that + should not be accessed directly, but through accessor functions + instead. + + The returned dictionary must be freed using iniparser_freedict(). + */ +/*--------------------------------------------------------------------------*/ +dictionary * iniparser_load(FILE* in, dictionary * dict ) +{ + char line [ASCIILINESZ+1] ; + char section [ASCIILINESZ+1] ; + char key [ASCIILINESZ+1] ; + char tmp [ASCIILINESZ+1] ; + char val [ASCIILINESZ+1] ; + + int last=0 ; + int len ; + int lineno=0 ; + int errs=0; +/* + if ((in=fopen(ininame, "r"))==NULL) { + fprintf(stderr, "iniparser: cannot open %s\n", ininame); + return dict ; + } +*/ + if( dict == NULL ) + dict = dictionary_new(0) ; + + if (!dict) { + // fclose(in); + return dict ; + } + + memset(line, 0, ASCIILINESZ); + memset(section, 0, ASCIILINESZ); + memset(key, 0, ASCIILINESZ); + memset(val, 0, ASCIILINESZ); + last=0 ; + + while (fgets(line+last, ASCIILINESZ-last, in)!=NULL) { + lineno++ ; + len = (int)strlen(line)-1; + /* Safety check against buffer overflows */ + if (line[len]!='\n') { + fprintf(stderr, + "iniparser: input line too long in file (line %d)\n", +// ininame, + lineno); + dictionary_del(dict); + dict = NULL; + // fclose(in); + return dict ; + } + /* Get rid of \n and spaces at end of line */ + while ((len>=0) && + ((line[len]=='\n') || (isspace(line[len])))) { + line[len]=0 ; + len-- ; + } + /* Detect multi-line */ + if (line[len]=='\\') { + /* Multi-line value */ + last=len ; + continue ; + } else { + last=0 ; + } + switch (iniparser_line(line, section, key, val)) { + case LINE_EMPTY: + case LINE_COMMENT: + break ; + + case LINE_SECTION: + errs = dictionary_set(dict, section, NULL, INI_SECTION, NULL,NULL) != NULL ? 0 : -1; + break ; + + case LINE_VALUE: + if (strcmp(section,"")!=0) + sprintf(tmp, "%s:%s", section, key); + else + strcpy(tmp,key); + errs = iniparser_setstring(dict, tmp, val); + // errs = dictionary_set(dict, tmp, val, UNKNOW, NULL) != NULL ? 0 : -1; + break ; + + case LINE_ERROR: + fprintf(stderr, "iniparser: syntax error in file (%d):\n", +// ininame, + lineno); + fprintf(stderr, "-> %s\n", line); + errs++ ; + break; + + default: + break ; + } + memset(line, 0, ASCIILINESZ); + last=0; + if (errs<0) { + fprintf(stderr, "iniparser: memory allocation failure\n"); + break ; + } + } + if (errs) { + dictionary_del(dict); + dict = NULL ; + } + // fclose(in); + return dict ; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Free all memory associated to an ini dictionary + @param d Dictionary to free + @return void + + Free all memory associated to an ini dictionary. + It is mandatory to call this function before the dictionary object + gets out of the current context. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_freedict(dictionary * d) +{ + dictionary_del(d); +} + +/* vim: set ts=4 et sw=4 tw=75 */ diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.h b/ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.h new file mode 100644 index 0000000..575b493 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/src/iniparser.h @@ -0,0 +1,325 @@ + +/*-------------------------------------------------------------------------*/ +/** + @file iniparser.h + @author N. Devillard + @date Sep 2007 + @version 3.0 + @brief Parser for ini files. +*/ +/*--------------------------------------------------------------------------*/ + +/* + $Id: iniparser.h,v 1.1.2.1 2010-02-12 10:19:23 kleplat Exp $ + $Revision: 1.1.2.1 $ +*/ + +#ifndef _INIPARSER_H_ +#define _INIPARSER_H_ + +/*--------------------------------------------------------------------------- + Includes + ---------------------------------------------------------------------------*/ + +#include +#include +#include + +/* + * The following #include is necessary on many Unixes but not Linux. + * It is not needed for Windows platforms. + * Uncomment it if needed. + */ +/* #include */ + +#include "dictionary.h" + +/*--------------------------------------------------------------------------- + Macros + ---------------------------------------------------------------------------*/ +/** For backwards compatibility only */ +#define iniparser_getstr(d, k) iniparser_getstring(d, k, NULL) +#define iniparser_setstr iniparser_setstring + +/*-------------------------------------------------------------------------*/ +/** + @brief Get number of sections in a dictionary + @param d Dictionary to examine + @return int Number of sections found in dictionary + + This function returns the number of sections found in a dictionary. + The test to recognize sections is done on the string stored in the + dictionary: a section name is given as "section" whereas a key is + stored as "section:key", thus the test looks for entries that do not + contain a colon. + + This clearly fails in the case a section name contains a colon, but + this should simply be avoided. + + This function returns -1 in case of error. + */ +/*--------------------------------------------------------------------------*/ + +int iniparser_getnsec(dictionary * d); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Get name for section n in a dictionary. + @param d Dictionary to examine + @param n Section number (from 0 to nsec-1). + @return Pointer to char string + + This function locates the n-th section in a dictionary and returns + its name as a pointer to a string statically allocated inside the + dictionary. Do not free or modify the returned string! + + This function returns NULL in case of error. + */ +/*--------------------------------------------------------------------------*/ + +char * iniparser_getsecname(dictionary * d, int n); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Save a dictionary to a loadable ini file + @param d Dictionary to dump + @param f Opened file pointer to dump to + @return void + + This function dumps a given dictionary into a loadable ini file. + It is Ok to specify @c stderr or @c stdout as output files. + */ +/*--------------------------------------------------------------------------*/ + +void iniparser_dump_ini(dictionary * d, FILE * f); +void iniparser_dump_ini_a3(dictionary * d, FILE * f , int flag_dump_k_shallows); +void iniparser_dump_ini_a4(dictionary * d, FILE * f , int flag_dump_k_shallows, int update_values_from_memory); + +/*-------------------------------------------------------------------------*/ +/** + @brief Dump a dictionary to an opened file pointer. + @param d Dictionary to dump. + @param f Opened file pointer to dump to. + @return void + + This function prints out the contents of a dictionary, one element by + line, onto the provided file pointer. It is OK to specify @c stderr + or @c stdout as output files. This function is meant for debugging + purposes mostly. + */ +/*--------------------------------------------------------------------------*/ + +void iniparser_dump(dictionary * d); + +/*-------------------------------------------------------------------------*/ +/** + @brief Initialise a key with a type and a pointer to the value. + @param d Dictionary to fill. + @param key Key string to look for + @param int type associated with this key + @param void* pointer to a valid data of the declared type + @return int 0 if Ok, -1 otherwise. + + This function is the basis of the introspection mechanism. It binds a + data type and a valid address to a key. If the key is not present and + ptr is NULL, the key is created. On failure (for example when you try + to bind a valid pointer to a non existing key) the function returns -1 + otherwise it returns 0. + */ +/*--------------------------------------------------------------------------*/ + +int iniparser_alias(dictionary * d, const char* kkey, int type, void* ptr,void (*cb)(void),char rw); +int iniparser_alias_ex(dictionary * d, const char* kkey, int type, void* ptr, void (*cb)(void), char rw,int scope); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key + @param d Dictionary to search + @param key Key string to look for + @param def Default value to return if key not found. + @return pointer to statically allocated character string + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the pointer passed as 'def' is returned. + The returned char pointer is pointing to a string allocated in + the dictionary, do not free or modify it. + */ +/*--------------------------------------------------------------------------*/ +char* iniparser_getstring(dictionary* d, const char* key, char* def); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to an int + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + Supported values for integers include the usual C notation + so decimal, octal (starting with 0) and hexadecimal (starting with 0x) + are supported. Examples: + + - "42" -> 42 + - "042" -> 34 (octal -> decimal) + - "0x42" -> 66 (hexa -> decimal) + + Warning: the conversion may overflow in various ways. Conversion is + totally outsourced to strtol(), see the associated man page for overflow + handling. + + Credits: Thanks to A. Becker for suggesting strtol() + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getint(dictionary * d, const char * key, int notfound); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a double + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return double + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + */ +/*--------------------------------------------------------------------------*/ +double iniparser_getdouble(dictionary * d, char * key, double notfound); + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key, convert to a boolean + @param d Dictionary to search + @param key Key string to look for + @param notfound Value to return in case of error + @return integer + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the notfound value is returned. + + A true boolean is found if one of the following is matched: + + - A string starting with 'y' + - A string starting with 'Y' + - A string starting with 't' + - A string starting with 'T' + - A string starting with '1' + + A false boolean is found if one of the following is matched: + + - A string starting with 'n' + - A string starting with 'N' + - A string starting with 'f' + - A string starting with 'F' + - A string starting with '0' + + The notfound value returned if no boolean is identified, does not + necessarily have to be 0 or 1. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_getboolean(dictionary * d, const char * key, int notfound); + + +/*-------------------------------------------------------------------------*/ +/** + @brief Set an entry in a dictionary. + @param ini Dictionary to modify. + @param entry Entry to modify (entry name) + @param val New value to associate to the entry. + @return int 0 if Ok, -1 otherwise. + + If the given entry can be found in the dictionary, it is modified to + contain the provided value. If it cannot be found, -1 is returned. + It is Ok to set val to NULL. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_setstring(dictionary * ini, const char * entry, const char * val); +int iniparser_setstring_a4(dictionary * ini, const char * entry, const char * val , int trigger_callback); + +/*-------------------------------------------------------------------------*/ +/** + @brief Set an entry in a dictionary. + @param ini Dictionary to modify. + @param entry Entry to modify (entry name) + @param val New value to associate to the entry. + @param int type associated with this key + @param void* pointer to a valid data of the declared type + @return int 0 if Ok, -1 otherwise. + + If the given entry can be found in the dictionary, it is modified to + contain the provided value. Type & ptr are binded If it cannot be found, -1 is returned. + It is Ok to set val to NULL. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_setvalue(dictionary* ini, char* entry, char* val, int type, void* ptr); + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete an entry in a dictionary + @param ini Dictionary to modify + @param entry Entry to delete (entry name) + @return void + + If the given entry can be found, it is deleted from the dictionary. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_unset(dictionary * ini, char * entry); + +/*-------------------------------------------------------------------------*/ +/** + @brief Finds out if a given entry exists in a dictionary + @param ini Dictionary to search + @param entry Name of the entry to look for + @return integer 1 if entry exists, 0 otherwise + + Finds out if a given entry exists in the dictionary. Since sections + are stored as keys with NULL associated values, this is the only way + of querying for the presence of sections in a dictionary. + */ +/*--------------------------------------------------------------------------*/ +int iniparser_find_entry(dictionary * ini, char * entry) ; + +/*-------------------------------------------------------------------------*/ +/** + @brief Parse an ini file and return an allocated dictionary object + @param fp ini file to read. + @param dict Pointer to an existing dictionnary. This parameter can be NULL. + @return Pointer to newly allocated dictionary. + + This is the parser for ini files. This function is called, providing + the name of the file to be read. It returns a dictionary object that + should not be accessed directly, but through accessor functions + instead. + + The returned dictionary must be freed using iniparser_freedict(). + */ +/*--------------------------------------------------------------------------*/ +dictionary * iniparser_load(FILE* fp, dictionary * dict); + +/*-------------------------------------------------------------------------*/ +/** + @brief Free all memory associated to an ini dictionary + @param d Dictionary to free + @return void + + Free all memory associated to an ini dictionary. + It is mandatory to call this function before the dictionary object + gets out of the current context. + */ +/*--------------------------------------------------------------------------*/ +void iniparser_freedict(dictionary * d); + +void iniparser_vals2ptrs(dictionary * d , int scope); +void iniparser_ptrs2vals(dictionary * d , int scope); + + +#endif diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/Makefile b/ARDroneLib/Soft/Lib/iniparser3.0b/test/Makefile new file mode 100644 index 0000000..1d7cbe3 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/Makefile @@ -0,0 +1,27 @@ +# +# iniparser tests Makefile +# + +CC = gcc +CFLAGS = -g -I../src +LFLAGS = -L.. -liniparser +AR = ar +ARFLAGS = rcv +RM = rm -f + + +default: all + +all: iniexample parse ardrone_essai + +iniexample: iniexample.c + $(CC) $(CFLAGS) -o iniexample iniexample.c -I../src -L.. -liniparser + +parse: parse.c + $(CC) $(CFLAGS) -o parse parse.c -I../src -L.. -liniparser + +clean veryclean: + $(RM) iniexample example.ini parse + + + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/iniexample.c b/ARDroneLib/Soft/Lib/iniparser3.0b/test/iniexample.c new file mode 100644 index 0000000..46eb3a0 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/iniexample.c @@ -0,0 +1,103 @@ +#include +#include +#include + +#ifndef _WIN32 +#include +#endif + +#include "iniparser.h" + +void create_example_ini_file(void); +int parse_ini_file(char * ini_name); + +int main(int argc, char * argv[]) +{ + int status ; + + if (argc<2) { + create_example_ini_file(); + status = parse_ini_file("example.ini"); + } else { + status = parse_ini_file(argv[1]); + } + return status ; +} + +void create_example_ini_file(void) +{ + FILE * ini ; + + ini = fopen("example.ini", "w"); + fprintf(ini, + "#\n" + "# This is an example of ini file\n" + "#\n" + "\n" + "[Pizza]\n" + "\n" + "Ham = yes ;\n" + "Mushrooms = TRUE ;\n" + "Capres = 0 ;\n" + "Cheese = Non ;\n" + "\n" + "\n" + "[Wine]\n" + "\n" + "Grape = Cabernet Sauvignon ;\n" + "Year = 1989 ;\n" + "Country = Spain ;\n" + "Alcohol = 12.5 ;\n" + "\n"); + fclose(ini); +} + + +int parse_ini_file(char * ini_name) +{ + dictionary * ini ; + + /* Some temporary variables to hold query results */ + int b ; + int i ; + double d ; + char * s ; + + ini = iniparser_load(ini_name); + if (ini==NULL) { + fprintf(stderr, "cannot parse file: %s\n", ini_name); + return -1 ; + } + iniparser_dump(ini, stderr); + + /* Get pizza attributes */ + printf("Pizza:\n"); + + b = iniparser_getboolean(ini, "pizza:ham", -1); + printf("Ham: [%d]\n", b); + b = iniparser_getboolean(ini, "pizza:mushrooms", -1); + printf("Mushrooms: [%d]\n", b); + b = iniparser_getboolean(ini, "pizza:capres", -1); + printf("Capres: [%d]\n", b); + b = iniparser_getboolean(ini, "pizza:cheese", -1); + printf("Cheese: [%d]\n", b); + + /* Get wine attributes */ + printf("Wine:\n"); + s = iniparser_getstring(ini, "wine:grape", NULL); + printf("Grape: [%s]\n", s ? s : "UNDEF"); + + i = iniparser_getint(ini, "wine:year", -1); + printf("Year: [%d]\n", i); + + s = iniparser_getstring(ini, "wine:country", NULL); + printf("Country: [%s]\n", s ? s : "UNDEF"); + + d = iniparser_getdouble(ini, "wine:alcohol", -1.0); + printf("Alcohol: [%g]\n", d); + + iniparser_freedict(ini); + return 0 ; +} + + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/parse.c b/ARDroneLib/Soft/Lib/iniparser3.0b/test/parse.c new file mode 100644 index 0000000..bc0b030 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/parse.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include + +#include "iniparser.h" + +int main(int argc, char * argv[]) +{ + dictionary * ini ; + char * ini_name ; + + if (argc<2) { + ini_name = "twisted.ini"; + } else { + ini_name = argv[1] ; + } + + ini = iniparser_load(ini_name); + iniparser_dump(ini, stdout); + iniparser_freedict(ini); + + return 0 ; +} diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-errors.ini b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-errors.ini new file mode 100644 index 0000000..7b74ce9 --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-errors.ini @@ -0,0 +1,9 @@ +# +# All of these should trigger syntax errors +# +#[section] +hello +world +hello \ +world +a + b ; diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-genhuge.py b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-genhuge.py new file mode 100644 index 0000000..570973c --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-genhuge.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +import os +import sys + +if __name__=="__main__": + f=open('twisted-massive.ini', 'w') + for i in range(100): + f.write('[%03d]\n' % i) + for j in range(100): + f.write('key-%03d=1;\n' % j) + f.close() + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofkey.ini b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofkey.ini new file mode 100644 index 0000000..4f2e72e --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofkey.ini @@ -0,0 +1,66 @@ +# Stress testing buffers for overflows +[long] +# Shitload key size +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1 + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofval.ini b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofval.ini new file mode 100644 index 0000000..2a3cedf --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted-ofval.ini @@ -0,0 +1,56 @@ +# Shitload data size +[long] +a=\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890; + diff --git a/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted.ini b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted.ini new file mode 100644 index 0000000..86e549f --- /dev/null +++ b/ARDroneLib/Soft/Lib/iniparser3.0b/test/twisted.ini @@ -0,0 +1,131 @@ +# +# Twisted.ini +# This file is meant for regression tests + +# Different blank settings around the equal sign +[blanks] +a=1 +b=1; +c=1; comment +d=1# comment + +e =1 +f =1; +g =1; comment +h =1# comment + +i= 1 +j= 1; +k= 1; comment +l= 1# comment + +m = 1 +n = 1; +o = 1; comment +p = 1# comment + +q=1 ; +r=1 ; comment +s=1 ;comment +t=1 #comment + +# Empty values +[empty] +a = '' +b = "" + +c = '' ; +d = "" ; + +e = '' ; comment +f = "" ; comment + +g = +h = ; +i = ; comment +j = # comment + +k= +l=; +m=;comment +n=# + +# Peculiar values +[peculiar] +a=';'; +b='#'# +c=';';comment +d='#'#comment +e=\; +f=\# +g=\;comment +h=\#comment +i=;; +j=## +k=;;;;;;;;;; +l=########## + +# Quotes +[quotes] +s1=' +s2='' +s3=''' +s4='''' + +d1=" +d2="" +d3=""" +d4="""" + +m1='"' +m2="'" + +h1=hello'world +h2='hello'world +h3='hello'world' + +h4=hello"world +h5="hello"world +h6="hello"world" + +# Section names +[a] +[ b] +[c ] +[ d ] +[ begin end ] +[ open[ ] + +# Multi-line inputs +[multi] +a = begin\ +end +b = begin \ +end +c = begin \ + end +d = 1\ +2\ +3\ +4 +e = 1 \ + 2 \ + 3 \ + 4 +f = 1 ; \ +hidden = because of the preceding backslash multi-lining the comment ; +visible = 1 +g = 1 #\ +and now this comment is hidden too \ +and this one too +h = 1 +multi \ +line \ +key = 1 +multi \ +line \ +key = \ +multi \ +line \ +value ; +# end of file diff --git a/ARDroneLib/Soft/Lib/utils/ardrone_crc_32.c b/ARDroneLib/Soft/Lib/utils/ardrone_crc_32.c new file mode 100644 index 0000000..aeed2b5 --- /dev/null +++ b/ARDroneLib/Soft/Lib/utils/ardrone_crc_32.c @@ -0,0 +1,58 @@ +/** + * Based on PNG CRC implementation + */ + +#include + +/* Table of CRCs of all 8-bit messages. */ +uint32_t crc_table[256]; + +/* Flag: has the table been computed? Initially false. */ +int32_t crc_table_computed = 0; + +/* Make the table for a fast CRC. */ +void ardrone_make_crc_table(void) +{ + uint32_t c; + int32_t n, k; + + for (n = 0; n < 256; n++) + { + c = n; + for (k = 0; k < 8; k++) + { + if (c & 1) + c = 0xedb88320L ^ (c >> 1); + else + c = c >> 1; + } + crc_table[n] = c; + } + crc_table_computed = 1; +} + +/* Update a running CRC with the bytes buf[0..len-1]--the CRC + should be initialized to all 1's, and the transmitted value + is the 1's complement of the final running CRC (see the + crc() routine below). */ + +uint32_t ardrone_update_crc(uint32_t crc, const uint8_t *buf, + int32_t len) +{ + uint32_t c = crc; + int32_t n; + + if (!crc_table_computed) + ardrone_make_crc_table(); + for (n = 0; n < len; n++) + { + c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); + } + return c; +} + +/* Return the CRC of the bytes buf[0..len-1]. */ +uint32_t ardrone_crc_32(const uint8_t *buf, int32_t len) +{ + return ardrone_update_crc(0xffffffffL, buf, len) ^ 0xffffffffL; +} diff --git a/ARDroneLib/Soft/Lib/utils/ardrone_crc_32.h b/ARDroneLib/Soft/Lib/utils/ardrone_crc_32.h new file mode 100644 index 0000000..828940e --- /dev/null +++ b/ARDroneLib/Soft/Lib/utils/ardrone_crc_32.h @@ -0,0 +1,8 @@ +#ifndef _ARDRONE_CRC_32_H_ +#define _ARDRONE_CRC_32_H_ + +#include + +uint32_t ardrone_crc_32 (const uint8_t *buf, int32_t len); + +#endif /* _ARDRONE_CRC_32_H_ */ diff --git a/ARDroneLib/Soft/Lib/utils/ardrone_ftp.c b/ARDroneLib/Soft/Lib/utils/ardrone_ftp.c new file mode 100644 index 0000000..eece261 --- /dev/null +++ b/ARDroneLib/Soft/Lib/utils/ardrone_ftp.c @@ -0,0 +1,1638 @@ +/** + * @file ardrone_ftp.c + * @author nicolas.brulez@parrot.com + * @date 2011/04/06 + * Copyright Parrot SA. 2011 + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* CONFIGURATION */ + +// All following macros MUST be defined ! +// To activate, define to (1) +// To deactivate, define to (0) + +#ifdef DEBUG // Debug options +#define _FTP_DEBUG (1) // Common debug informations +#define _FTP_VERBOSE (0) // Extended debug information (many outputs on ftpList) +#define _FTP_ERRORS_PRINT (1) // Display of error messages +#else // Release options +#define _FTP_DEBUG (0) +#define _FTP_VERBOSE (0) +#define _FTP_ERRORS_PRINT (1) +#endif + +#define FTP_PREFIX "FTP : " + +/* LOCAL PRINT MACROS */ + +#if _FTP_ERRORS_PRINT +#define FTP_ERROR(...) \ + do \ + { \ + fprintf (stderr, "Error in function %s at line %d : ", __FUNCTION__, __LINE__); \ + fprintf (stderr, __VA_ARGS__); \ + char errorBuffer [512] = {0}; \ + snprintf (errorBuffer, sizeof (errorBuffer)-1, __VA_ARGS__); \ + FTPlastErrorMessageSize = strlen (errorBuffer) + 1; \ + FTPlastErrorMessage = vp_os_realloc (FTPlastErrorMessage, FTPlastErrorMessageSize); \ + if (NULL != FTPlastErrorMessage) \ + { \ + strncpy (FTPlastErrorMessage, errorBuffer, FTPlastErrorMessageSize); \ + } \ + } while (0) +#else +#define FTP_ERROR(...) \ + do \ + { \ + char errorBuffer [512] = {0}; \ + snprintf (errorBuffer, sizeof (errorBuffer)-1, __VA_ARGS__); \ + FTPlastErrorMessageSize = strlen (errorBuffer) + 1; \ + FTPlastErrorMessage = vp_os_realloc (FTPlastErrorMessage, FTPlastErrorMessageSize); \ + if (NULL != FTPlastErrorMessage) \ + { \ + strncpy (FTPlastErrorMessage, errorBuffer, FTPlastErrorMessageSize); \ + } \ + } while (0) +#endif + +#if _FTP_DEBUG +#define FTP_DEBUG(...) \ + do \ + { \ + printf ("Debug from function %s at line %d : ", __FUNCTION__, __LINE__); \ + printf (__VA_ARGS__); \ + } while (0) +#else +#define FTP_DEBUG(...) +#endif + +#if _FTP_VERBOSE +#define FTP_PRINT(...) \ + do \ + { \ + printf (FTP_PREFIX); \ + printf (__VA_ARGS__); \ + } while (0) +#else +#define FTP_PRINT(...) +#endif + +/* SIZE MACROS */ + +#ifndef MAX_SIZE_MSG +#define MAX_SIZE_MSG 32768 +#endif +#define IP_STRING_SIZE 16 // IP strings goes from 8 ("w.x.y.z\0") to 16 ("www.xxx.yyy.zzz\0") chars +#define LIST_BUFFER_BLOCKSIZE 1024 +#define FILE_NAME_MAX_SIZE 512 + +/* TIMEOUT MACROS */ + +/* Total socket timeout : SOCK_TO_SEC + SOCK_TO_USEC */ +#define SOCK_TO_SEC 1 // Socket timeout (seconds) +#define SOCK_TO_USEC 0 // Socket timeout (useconds) + +/* GLOBAL ERROR MESSAGE STRING */ +char *FTPlastErrorMessage = NULL; +int FTPlastErrorMessageSize = 0; + +/* THREAD STRUCTURES */ + +typedef struct _ftp_list_param_s _ftp_list_param; +typedef struct _ftp_get_param_s _ftp_get_param; +typedef struct _ftp_put_param_s _ftp_put_param; + +struct _ftp_put_param_s +{ + _ftp_t *ftp; + char localName [FILE_NAME_MAX_SIZE]; + char remoteName [FILE_NAME_MAX_SIZE]; + int useResume; + ftp_callback callback; + char *fileList; +}; + +struct _ftp_get_param_s +{ + _ftp_t *ftp; + char localName [FILE_NAME_MAX_SIZE]; + char remoteName [FILE_NAME_MAX_SIZE]; + int useResume; + ftp_callback callback; + char *fileList; +}; + +struct _ftp_list_param_s +{ + _ftp_t *ftp; + char *fileList; + int listSize; + ftp_callback callback; +}; + +/* LOCAL FUNCTIONS PROTOTYPES */ +void emptyCallback (_ftp_status status, void *arg, _ftp_t *callingFtp); +_ftp_status waitFor226Answer (_ftp_t *ftp); +int setSockTimeout (int socket, int timeoutSec, int timeoutUsec); +_ftp_status goToBinaryMode (_ftp_t *ftp); +void flushFtp (_ftp_t *ftp); +int getFileSize (_ftp_t *ftp, const char *distPath); +int getLocalFileSize (const char *localPath); +int getResponseCode (const char *response); +_ftp_status getPassiveIpAndPort (const char *response, char *ip, int *port, int ipLen); +_ftp_status ftpTransfert (_ftp_t *ftp, const char *message, char *answer, int answSize); +_ftp_status ftpSend (_ftp_t *ftp, const char *message); +_ftp_status ftpRecv (_ftp_t *ftp, char *answer, int answSize); +DEFINE_THREAD_ROUTINE (ftpGet, param); +DEFINE_THREAD_ROUTINE (ftpPut, param); +DEFINE_THREAD_ROUTINE (ftpList, param); + +/* GLOBAL CALLBACK RESULT */ +_ftp_status lastStatusFromEmptyCallback = FTP_FAIL; +char *lastFileListFromEmptyCallback = NULL; + +/* FUNCTIONS IMPLEMENTATION */ + +void +emptyCallback (_ftp_status status, void *arg, _ftp_t *callingFtp) +{ + FTP_PRINT ("Called with status %d\n", status); +#if _FTP_VERBOSE + if (FTP_PROGRESS == status) + { + FTP_PRINT ("Trying float arg : %f\n", (NULL != arg) ? *(float *)arg : -1.0); + } +#endif + lastStatusFromEmptyCallback = status; + if(FTP_SUCCESS == status && NULL != arg) + { + lastFileListFromEmptyCallback = (char *)arg; + } +} + +#define FTP_MAX_NUM_RETRIES 5 +_ftp_status +waitFor226Answer (_ftp_t *ftp) +{ + char srvMsg[MAX_SIZE_MSG] = {0}; + int repCode = 0; + int numretries = FTP_MAX_NUM_RETRIES; + + _ftp_status ftp_result = FTP_SUCCESS; + while (226 != repCode && 0 < numretries) + { + ftp_result = ftpRecv (ftp, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + numretries--; + } + repCode = getResponseCode (srvMsg); + } + return ftp_result; +} + +int +setSockTimeout (int socket, int timeoutSec, int timeoutUsec) +{ +#ifdef _WIN32 + int winTO = (1000 * timeoutSec) + (timeoutUsec / 1000); +#else + struct timeval posixTO; + posixTO.tv_sec = timeoutSec; + posixTO.tv_usec = timeoutUsec; +#endif + + if (0 > setsockopt (socket, SOL_SOCKET, SO_RCVTIMEO, +#ifdef _WIN32 + (const char *)&winTO, sizeof (winTO) +#else + (const char *)&posixTO, sizeof (posixTO) +#endif + )) + { + FTP_ERROR ("Unable to set recv timeout\n"); + return -1; + } + + if (0 > setsockopt (socket, SOL_SOCKET, SO_SNDTIMEO, +#ifdef _WIN32 + (const char *)&winTO, sizeof (winTO) +#else + (const char *)&posixTO, sizeof (posixTO) +#endif + )) + { + FTP_ERROR ("Unable to set send timeout\n"); + return -1; + } + return 0; +} + +_ftp_status +goToBinaryMode (_ftp_t *ftp) +{ + char ftpAnswer[256] = {0}; + _ftp_status ftp_result = ftpTransfert (ftp, "TYPE I\r\n\0", ftpAnswer, 255); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Unable to go to binary mode\n"); + } + return ftp_result; +} + +void +flushFtp (_ftp_t *ftp) +{ + FTP_DEBUG ("Starting flush\n"); + char c = 0; + int bytes = 1; + int flushedBytes = 0; + VP_COM_SOCKET_BLOCKING_OPTIONS oldOptions = ftp->socket->block; + ftp->socket->block = VP_COM_DONTWAIT; + C_RESULT vp_result = ftp->readSock (ftp->socket, (int8_t *)&c, &bytes); + while (0 < bytes && VP_SUCCEEDED (vp_result)) + { + flushedBytes++; +#if _FTP_DEBUG + printf ("%c", c); +#endif + vp_result = ftp->readSock (ftp->socket, (int8_t *)&c, &bytes); + } + FTP_DEBUG ("Flushed %d bytes\n", flushedBytes); + ftp->socket->block = oldOptions; +} + +int +getFileSize (_ftp_t *ftp, const char *distPath) +{ + char ftpCommand[256] = {0}; + snprintf (ftpCommand, sizeof (ftpCommand)-1, "SIZE %s\r\n", distPath); + char ftpAnswer[256] = {0}; + _ftp_status ftp_result = ftpTransfert (ftp, ftpCommand, ftpAnswer, sizeof (ftpAnswer)-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Unable to get file size\n"); + return -1; + } + int size = -1; + int repCode = 0; + sscanf (ftpAnswer, "%d %d", &repCode, &size); + return size; +} + +int +getLocalFileSize (const char *localPath) +{ + FILE *localFile = fopen (localPath, "r"); + if (NULL == localFile) + { + FTP_DEBUG ("File %s does not exist\n", localPath); + return -1; + } + fseek (localFile, 0, SEEK_END); + int size = (int)ftell (localFile); + FTP_DEBUG ("Size of file %s : %d o\n", localPath, size); + fclose (localFile); + return size; +} + +int +getResponseCode (const char *response) +{ + int retVal = -1; + sscanf (response, "%d", &retVal); + return retVal; +} + +_ftp_status +getPassiveIpAndPort (const char *response, char *ip, int *port, int ipLen) +{ + int ip1, ip2, ip3, ip4, port1, port2; + int indexOfFirstIpField = 0; + char atIndex = '\0'; + int maxIndex = strlen (response); + while (indexOfFirstIpField < maxIndex && '(' != atIndex) + { + atIndex = response[indexOfFirstIpField++]; + } + int numread = sscanf (&response[indexOfFirstIpField], "%d,%d,%d,%d,%d,%d)", &ip1, &ip2, &ip3, &ip4, &port1, &port2); + _ftp_status result = FTP_SUCCESS; + if (6 == numread) + { + snprintf (ip, ipLen-1, "%d.%d.%d.%d", ip1, ip2, ip3, ip4); + *port = 256 * port1 + port2; + FTP_DEBUG ("IP : %s | Port : %d\n", ip, *port); + } + else + { + result = FTP_FAIL; + } + return result; +} + +_ftp_status +ftpTransfert (_ftp_t *ftp, const char *message, char *answer, int answSize) +{ + flushFtp (ftp); + _ftp_status ftp_result = ftpSend (ftp, message); + if (FTP_FAILED (ftp_result)) + { + return ftp_result; + } + return ftpRecv (ftp, answer, answSize); +} + +_ftp_status +ftpSend (_ftp_t *ftp, const char *message) +{ + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + FTP_DEBUG ("Sending %sto FTP at %s:%d\n", message, ftp->socket->serverHost, ftp->socket->port); + + int bytes = strlen (message); + C_RESULT vp_result = ftp->writeSock (ftp->socket, (int8_t *)message, &bytes); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Error while sending data\n"); + return FTP_FAIL; + } + if (0 == bytes) + { + FTP_ERROR ("Unable to send data\n"); + return FTP_TIMEOUT; + } + return FTP_SUCCESS; +} + +_ftp_status +ftpRecv (_ftp_t *ftp, char *answer, int answSize) +{ + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + + vp_os_memset (answer, 0x0, answSize); + int index = 0; + do + { + int bytes = 1; + C_RESULT vp_result = ftp->readSock (ftp->socket, (int8_t *)(&answer [index]), &bytes); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Error while reading data\n"); + return FTP_FAIL; + } + if (0 == bytes) + { + FTP_ERROR ("Recv timeout\n"); + return FTP_TIMEOUT; + } + } + while (index < answSize && '\n' != answer [index++]); + + FTP_DEBUG ("Answer:\n<---START--->\n%s\n<---END--->\n", answer); + return FTP_SUCCESS; +} + +_ftp_status +ftpClose (_ftp_t **ftp) +{ + FTP_DEBUG ("Closing ftp\n"); + _ftp_status retVal = FTP_FAIL; + if (NULL != *ftp) + { + FTP_DEBUG ("Not null ftp\n"); + if (NULL != (*ftp)->socket) + { + FTP_DEBUG ("Not null socket\n"); + if (1 == (*ftp)->connected) + { + if (FTP_SUCCESS == ftpAbort ((*ftp))) // An operation was in progress, abort and let time to cleanup. + { + usleep (100000); // 100ms + } + ftpSend ((*ftp), "QUIT\r\n\0"); + (*ftp)->connected = 0; + } + vp_com_close_socket ((*ftp)->socket); + vp_os_free ((*ftp)->socket); + (*ftp)->socket = NULL; + retVal = FTP_SUCCESS; + } + vp_os_free (*ftp); + *ftp = NULL; + } + return retVal; +} + +_ftp_t * +ftpConnectFromName (const char *name, int port, const char *username, const char *password, _ftp_status *status) +{ + struct hostent *hostent = gethostbyname(name); + return ftpConnect(inet_ntoa( *( struct in_addr*)( hostent->h_addr)), port, username, password, status); +} + +_ftp_t * +ftpConnect (const char *ip, int port, const char *username, const char *password, _ftp_status *status) +{ + if (NULL == ip || + NULL == username || + NULL == password || + NULL == status) + { + FTP_ERROR ("Must not pass NULL pointers to ftpConnect\n"); + if (NULL != status) { *status = FTP_FAIL; } + return NULL; + } + int isAnonymous = ((0 == strcmp (username, "anonymous")) || (0 == strcmp (username, ""))) ? 1 : 0; + if (1 == isAnonymous) + { + FTP_DEBUG ("Connecting to %s:%d, anonymous\n", ip, port); + } + else + { + FTP_DEBUG ("Connecting to %s:%d, USER = %s, Password = %s\n", ip, port, username, password); + } + + *status = FTP_FAIL; + _ftp_t *retFtp = vp_os_malloc (sizeof (_ftp_t)); + if (NULL == retFtp) + { + FTP_ERROR ("Unable to allocate a ftp structure\n"); + return NULL; + } + retFtp->socket = vp_os_malloc (sizeof (vp_com_socket_t)); + if (NULL == retFtp->socket) + { + FTP_ERROR ("Unable to allocate socket filed of the ftp structure\n"); + ftpClose (&retFtp); + return NULL; + } + + retFtp->connected = 0; + + retFtp->socket->type = VP_COM_CLIENT; + retFtp->socket->protocol = VP_COM_TCP; + retFtp->socket->port = port; + strncpy (retFtp->socket->serverHost, ip, VP_COM_NAME_MAXSIZE-1); + retFtp->socket->is_multicast = 0; + retFtp->socket->block = VP_COM_DEFAULT; + + C_RESULT vp_result = vp_com_open_socket (retFtp->socket, &(retFtp->readSock), &(retFtp->writeSock)); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to connect\n"); + ftpClose (&retFtp); + return NULL; + } + + int result = setSockTimeout ((int)retFtp->socket->priv, SOCK_TO_SEC, SOCK_TO_USEC); + if (0 > result) + { + FTP_ERROR ("Unable to set socket timeout\n"); + ftpClose (&retFtp); + return NULL; + } + + char srvMsg[MAX_SIZE_MSG] = {0}; + if (FTP_FAILED (ftpRecv (retFtp, srvMsg, MAX_SIZE_MSG-1))) + { + FTP_ERROR ("Unable to recieve data from server\n"); + ftpClose (&retFtp); + return NULL; + } + + int repCode = getResponseCode (srvMsg); + if (220 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 220)\n", repCode); + ftpClose (&retFtp); + return NULL; + } + + + char buffer[256] = {0}; + if (1 == isAnonymous) + { + snprintf (buffer, sizeof (buffer)-1, "USER anonymous\r\n"); + } + else + { + snprintf (buffer, sizeof (buffer)-1, "USER %s\r\n", username); + } + if (FTP_FAILED (ftpTransfert (retFtp, buffer, srvMsg, MAX_SIZE_MSG-1))) + { + FTP_ERROR ("Error while sending command\n"); + ftpClose (&retFtp); + return NULL; + } + repCode = getResponseCode (srvMsg); + int goodRepCode = 331; + if (1 == isAnonymous) + { + goodRepCode = 230; + } + if (goodRepCode != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected %d)\n", repCode, goodRepCode); + ftpClose (&retFtp); + return NULL; + } + + if (0 == isAnonymous) + { + vp_os_memset (buffer, 0x0, sizeof (buffer)); + snprintf (buffer, sizeof (buffer)-1, "PASS %s\r\n", password); + if (FTP_FAILED (ftpTransfert (retFtp, buffer, srvMsg, MAX_SIZE_MSG-1))) + { + FTP_ERROR ("Error while sending command\n"); + ftpClose (&retFtp); + return NULL; + } + repCode = getResponseCode (srvMsg); + if (230 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 230)\n", repCode); + ftpClose (&retFtp); + return NULL; + } + } + + *status = FTP_SUCCESS; + retFtp->connected = 1; + retFtp->opInProgress = 0; + retFtp->abortCurrentOp = 0; + return retFtp; +} + + +#undef CLEAN_PARAMS +#define CLEAN_PARAMS(status) CLEAN_PARAMS_WITH_ARG(status,NULL) +#undef CLEAN_PARAMS_WITH_ARG +#define CLEAN_PARAMS_WITH_ARG(status,arg) \ + do \ + { \ + params->ftp->opInProgress = 0; \ + CLEAN_PARAMS_ABORT (status,arg); \ + } while (0) +#undef CLEAN_PARAMS_ABORT +#define CLEAN_PARAMS_ABORT(status,arg) \ + do \ + { \ + _ftp_status locStat = (status); \ + if (NULL != localFile) fclose (localFile); \ + if (NULL != dataSocket) \ + { \ + vp_com_close_socket (dataSocket); \ + vp_os_free (dataSocket); \ + dataSocket = NULL; \ + } \ + params->callback (locStat, arg, params->ftp); \ + if (FTP_SUCCESS != status && NULL != params->fileList) \ + { \ + vp_os_free (params->fileList); \ + params->fileList = NULL; \ + } \ + vp_os_free (param); \ + FTP_DEBUG ("Returning from thread %s with status %d\n", __FUNCTION__, locStat); \ + THREAD_RETURN (locStat); \ + } \ + while (0) +#undef CHECK_ABORT +#define CHECK_ABORT \ + do \ + { \ + if (1 <= params->ftp->abortCurrentOp) \ + { \ + vp_os_memset (srvMsg, 0x0, MAX_SIZE_MSG); \ + if (NULL != dataSocket) \ + { \ + vp_com_close_socket (dataSocket); \ + vp_os_free (dataSocket); \ + dataSocket = NULL; \ + } \ + ftpTransfert (params->ftp, "ABOR\r\n\0", srvMsg, MAX_SIZE_MSG-1); \ + flushFtp (params->ftp); \ + params->ftp->abortCurrentOp = 0; \ + params->ftp->opInProgress = 0; \ + CLEAN_PARAMS_ABORT (FTP_ABORT, NULL); \ + } \ + } while (0) + +DEFINE_THREAD_ROUTINE (ftpList, param) +{ + FILE *localFile = NULL; // Compatibilty with macros + vp_com_socket_t *dataSocket = NULL; + Read dataRead = NULL; + Write dataWrite = NULL; + _ftp_list_param *params = (_ftp_list_param *)param; + if (NULL == params->ftp) + { + FTP_ERROR ("FTP not open\n"); + CLEAN_PARAMS (FTP_FAIL); + } + flushFtp (params->ftp); + + char srvMsg [MAX_SIZE_MSG] = {0}; + _ftp_status ftp_result = ftpTransfert (params->ftp, "PASV\r\n\0", srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending command\n"); + CLEAN_PARAMS (ftp_result); + } + int repCode = getResponseCode (srvMsg); + if (227 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 227)\n", repCode); + CLEAN_PARAMS (FTP_FAIL); + } + + char dataIp [IP_STRING_SIZE] = {0}; + int dataPort = 0; + getPassiveIpAndPort (srvMsg, dataIp, &dataPort, IP_STRING_SIZE); + + FTP_DEBUG ("Thread will connect to %s:%d\n", dataIp, dataPort); + dataSocket = vp_os_malloc (sizeof (vp_com_socket_t)); + if (NULL == dataSocket) + { + FTP_ERROR ("Unable to allocate socket structure\n"); + CLEAN_PARAMS (FTP_FAIL); + } + dataSocket->type = VP_COM_CLIENT; + dataSocket->protocol = VP_COM_TCP; + dataSocket->port = dataPort; + strncpy (dataSocket->serverHost, dataIp, VP_COM_NAME_MAXSIZE); + dataSocket->is_multicast = 0; + dataSocket->block = VP_COM_WAITALL; + + C_RESULT vp_result = vp_com_open_socket (dataSocket, &dataRead, &dataWrite); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to connect\n"); + CLEAN_PARAMS (FTP_FAIL); + } + + int result = setSockTimeout ((int)dataSocket->priv, SOCK_TO_SEC, SOCK_TO_USEC); + if (0 > result) + { + FTP_ERROR ("Unable to set data socket timeout\n"); + CLEAN_PARAMS (FTP_FAIL); + } + + CHECK_ABORT; + + ftp_result = ftpSend (params->ftp, "LIST\r\n\0"); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending LIST command\n"); + CLEAN_PARAMS (ftp_result); + } + + CHECK_ABORT; + char ftpData [2] = {0}; + int bytes = 1, totalBytes; + vp_os_memset (params->fileList, 0x0, params->listSize); + vp_result = dataRead (dataSocket, (int8_t *)ftpData, &bytes); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to receive data\n"); + CLEAN_PARAMS (FTP_FAIL); + } + if(0 == bytes) + { + FTP_DEBUG ("Empty folder\n"); + waitFor226Answer (params->ftp); + flushFtp (params->ftp); + CLEAN_PARAMS (FTP_SAMESIZE); + } + + if (strlen (ftpData) > params->listSize - 1) + { + params->listSize += LIST_BUFFER_BLOCKSIZE; + params->fileList = vp_os_realloc(params->fileList, params->listSize); + if(NULL == params->fileList) + { + FTP_ERROR ("Not enough space in response string, can't reallocate buffer list\n"); + CLEAN_PARAMS (FTP_FAIL); + } + } + snprintf (params->fileList, params->listSize-1, "%s", ftpData); + totalBytes = bytes; + while (1) // Loop is killed by a return or a break statement + { + CHECK_ABORT; + ftpData [0] = 0; + bytes = 1; + vp_result = dataRead (dataSocket, (int8_t *)ftpData, &bytes); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to receive data\n"); + CLEAN_PARAMS (FTP_FAIL); + } + if (0 == bytes && '\n' == params->fileList [totalBytes-1]) + { + FTP_DEBUG ("Got all listing !\n"); + // Timeouted. We got all the listing ! + // Timeout is voluntary, so still return FTP_SUCCESS + break; + } + else if (0 == bytes) + { + // Timeout + FTP_ERROR ("Recv timeout\n"); + CLEAN_PARAMS (FTP_TIMEOUT); + } + if (strlen (ftpData) > (params->listSize - 1 - strlen (params->fileList))) + { + params->listSize += LIST_BUFFER_BLOCKSIZE; + params->fileList = vp_os_realloc(params->fileList, params->listSize); + if(NULL == params->fileList) + { + FTP_ERROR ("Not enough space in response string, can't reallocate buffer list\n"); + CLEAN_PARAMS (FTP_FAIL); + } + } + strcat (params->fileList, ftpData); + totalBytes += bytes; + FTP_PRINT ("Progress of listing : finished ? %d : (%d->%d bytes) %s\n", (params->response [totalBytes -1] == '\n') ? 1: 0, bytes, totalBytes, params->response); + } + + ftp_result = ftpRecv (params->ftp, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while getting answer\n"); + CLEAN_PARAMS (ftp_result); + } + repCode = getResponseCode (srvMsg); + if (150 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 150)\n", repCode); + CLEAN_PARAMS (FTP_FAIL); + } + + /* Cleaning FTP */ + if (NULL != dataSocket) + { + vp_com_close_socket (dataSocket); + vp_os_free (dataSocket); + dataSocket = NULL; + } + waitFor226Answer (params->ftp); + flushFtp (params->ftp); + + + CLEAN_PARAMS_WITH_ARG (FTP_SUCCESS, (void *)params->fileList); +} + +DEFINE_THREAD_ROUTINE (ftpGet, param) +{ + vp_com_socket_t *dataSocket = NULL; + Read dataRead = NULL; + Write dataWrite = NULL; + FILE *localFile = NULL; + _ftp_get_param *params = (_ftp_get_param *)param; + FTP_DEBUG ("Downloading %s to %s [resume : %c]\n", params->remoteName, params->localName, params->useResume ? 'y' : 'n'); + if (NULL == params->ftp) + { + FTP_ERROR ("FTP not open\n"); + CLEAN_PARAMS (FTP_FAIL); + } + flushFtp (params->ftp); + + char buffer[512] = {0}; + char srvMsg[MAX_SIZE_MSG] = {0}; + snprintf (buffer, sizeof (buffer)-1, "PASV\r\n"); + _ftp_status ftp_result = ftpTransfert (params->ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while entering passive mode\n"); + CLEAN_PARAMS (ftp_result); + } + int repCode = getResponseCode (srvMsg); + if (227 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 227)\n", repCode); + CLEAN_PARAMS (FTP_FAIL); + } + + ftp_result = goToBinaryMode (params->ftp); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Unable to go to binary mode\n"); + CLEAN_PARAMS (ftp_result); + } + + int fileSize = getFileSize (params->ftp, params->remoteName); + if (0 >= fileSize) + { + FTP_ERROR ("File %s does not exist on server\n", params->remoteName); + CLEAN_PARAMS (FTP_FAIL); + } + int sizeToGet = fileSize; + int localFileSize = getLocalFileSize (params->localName); + int appendToFile = params->useResume; + int appendOffset = 0; + if (-1 == localFileSize && 1 == params->useResume) + { + FTP_DEBUG ("File does not exist ... full download\n"); + appendToFile = 0; + } + if (1 == appendToFile) + { + if (localFileSize == fileSize) + { + FTP_DEBUG ("File already downloaded\n"); + CLEAN_PARAMS (FTP_SAMESIZE); + } + else if (localFileSize > fileSize) + { + FTP_ERROR ("Local file (%s) is greater than distant file (%s)\n", params->localName, params->remoteName); + CLEAN_PARAMS (FTP_BADSIZE); + } + sizeToGet = fileSize - localFileSize; + + char buffer[50] = {0}; + appendOffset = fileSize - sizeToGet; + snprintf (buffer, sizeof (buffer)-1, "REST %d\r\n", appendOffset); + char srvAnsw[MAX_SIZE_MSG] = {0}; + _ftp_status ftp_result = ftpTransfert (params->ftp, buffer, srvAnsw, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Unable to set server offset\n"); + CLEAN_PARAMS (ftp_result); + } + } + + char dataIp [IP_STRING_SIZE] = {0}; + int dataPort = 0; + getPassiveIpAndPort (srvMsg, dataIp, &dataPort, IP_STRING_SIZE); + + FTP_DEBUG ("Thread will connect to %s:%d\n", dataIp, dataPort); + dataSocket = vp_os_malloc (sizeof (vp_com_socket_t)); + if (NULL == dataSocket) + { + FTP_ERROR ("Unable to allocate socket structure\n"); + CLEAN_PARAMS (FTP_FAIL); + } + dataSocket->type = VP_COM_CLIENT; + dataSocket->protocol = VP_COM_TCP; + dataSocket->port = dataPort; + strncpy (dataSocket->serverHost, dataIp, VP_COM_NAME_MAXSIZE); + dataSocket->is_multicast = 0; + dataSocket->block = VP_COM_WAITALL; + + C_RESULT vp_result = vp_com_open_socket (dataSocket, &dataRead, &dataWrite); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to connect\n"); + CLEAN_PARAMS (FTP_FAIL); + } + + int result = setSockTimeout ((int)dataSocket->priv, SOCK_TO_SEC, SOCK_TO_USEC); + if (0 > result) + { + FTP_ERROR ("Unable to set data socket timeout\n"); + CLEAN_PARAMS (FTP_FAIL); + } + + CHECK_ABORT; + + vp_os_memset (buffer, 0x0, sizeof (buffer)); + snprintf (buffer, sizeof (buffer)-1, "RETR %s\r\n", params->remoteName); + ftp_result = ftpSend (params->ftp, buffer); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending RETR command\n"); + CLEAN_PARAMS (ftp_result); + } + + int sizeGot = appendOffset; + float percentGot = (sizeGot * 100.0) / (fileSize *1.0); + params->callback (FTP_PROGRESS, (void *)&percentGot, params->ftp); + + char filePart [MAX_SIZE_MSG] = {0}; + + + if (1 == appendToFile) + { + localFile = fopen (params->localName, "ab"); + } + else + { + localFile = fopen (params->localName, "wb"); + } + if (NULL == localFile) + { + FTP_ERROR ("Unable to open dest file %s\n", params->localName); + CLEAN_PARAMS (FTP_FAIL); + } + while (sizeGot < fileSize) + { + CHECK_ABORT; + int bytes = MAX_SIZE_MSG-1; + C_RESULT vp_result = dataRead (dataSocket, (int8_t *)filePart, &bytes); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Error while receiving data\n"); + CLEAN_PARAMS (FTP_FAIL); + } + if (0 >= bytes) + { + FTP_ERROR ("Recv timeout\n"); + CLEAN_PARAMS (FTP_TIMEOUT); + } + if (0 > fwrite (filePart, 1, bytes, localFile)) + { + FTP_ERROR ("Unable to write to file\n"); + CLEAN_PARAMS (FTP_FAIL); + } + sizeGot += bytes; + percentGot = (sizeGot * 100.0) / (fileSize * 1.0); + params->callback (FTP_PROGRESS, (void *)&percentGot, params->ftp); + } + ftp_result = ftpRecv (params->ftp, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while getting answer\n"); + CLEAN_PARAMS (ftp_result); + } + repCode = getResponseCode (srvMsg); + if (150 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 150)\n", repCode); + CLEAN_PARAMS (FTP_FAIL); + } + + /* Cleaning FTP */ + if (NULL != dataSocket) + { + vp_com_close_socket (dataSocket); + vp_os_free (dataSocket); + dataSocket = NULL; + } + waitFor226Answer (params->ftp); + flushFtp (params->ftp); + + CLEAN_PARAMS (FTP_SUCCESS); +} + +DEFINE_THREAD_ROUTINE (ftpPut, param) +{ + vp_com_socket_t *dataSocket = NULL; + Read dataRead = NULL; + Write dataWrite = NULL; + FILE *localFile = NULL; + _ftp_put_param *params = (_ftp_put_param *)param; + FTP_DEBUG ("Uploading %s to %s [resume : %c]\n", params->localName, params->remoteName, params->useResume ? 'y' : 'n'); + if (NULL == params->ftp) + { + FTP_ERROR ("FTP not open\n"); + CLEAN_PARAMS (FTP_FAIL); + } + flushFtp (params->ftp); + + char buffer[512] = {0}; + char srvMsg[MAX_SIZE_MSG] = {0}; + snprintf (buffer, sizeof (buffer)-1, "PASV\r\n"); + _ftp_status ftp_result = ftpTransfert (params->ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while entering passive mode\n"); + CLEAN_PARAMS (ftp_result); + } + int repCode = getResponseCode (srvMsg); + if (227 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 227)\n", repCode); + CLEAN_PARAMS (FTP_FAIL); + } + + ftp_result = goToBinaryMode (params->ftp); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Unable to go to binary mode\n"); + CLEAN_PARAMS (ftp_result); + } + + int localFileSize = getLocalFileSize (params->localName); + if (0 >= localFileSize) + { + FTP_ERROR ("File %s does not exist on filesystem\n", params->localName); + CLEAN_PARAMS (FTP_FAIL); + } + int fileSize = getFileSize (params->ftp, params->remoteName); + int sizeToPut = localFileSize; + int appendToFile = params->useResume; + int appendOffset = 0; + if (-1 == fileSize && 1 == params->useResume) + { + FTP_DEBUG ("File does not exist on server ... full upload\n"); + appendToFile = 0; + } + if (1 == appendToFile) + { + if (localFileSize == fileSize) + { + FTP_DEBUG ("File already uploaded\n"); + CLEAN_PARAMS (FTP_SAMESIZE); + } + else if (localFileSize < fileSize) + { + FTP_ERROR ("Distant file (%s) is greather than local file (%s)\n", params->remoteName, params->localName); + CLEAN_PARAMS (FTP_BADSIZE); + } + sizeToPut = localFileSize - fileSize; + + char buffer [50] = {0}; + appendOffset = localFileSize - sizeToPut; + snprintf (buffer, sizeof (buffer)-1, "REST %d\r\n", appendOffset); + char srvAnswer[MAX_SIZE_MSG] = {0}; + ftp_result = ftpTransfert (params->ftp, buffer, srvAnswer, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Unable to set server offset\n"); + CLEAN_PARAMS (ftp_result); + } + } + + char dataIp [IP_STRING_SIZE] = {0}; + int dataPort = 0; + getPassiveIpAndPort (srvMsg, dataIp, &dataPort, IP_STRING_SIZE); + + FTP_DEBUG ("Thread will connect to %s:%d\n", dataIp, dataPort); + dataSocket = vp_os_malloc (sizeof (vp_com_socket_t)); + if (NULL == dataSocket) + { + FTP_ERROR ("Unable to allocate socket structure\n"); + CLEAN_PARAMS (FTP_FAIL); + } + dataSocket->type = VP_COM_CLIENT; + dataSocket->protocol = VP_COM_TCP; + dataSocket->port = dataPort; + strncpy (dataSocket->serverHost, dataIp, VP_COM_NAME_MAXSIZE); + dataSocket->is_multicast = 0; + dataSocket->block = VP_COM_DEFAULT; + + C_RESULT vp_result = vp_com_open_socket (dataSocket, &dataRead, &dataWrite); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to connect\n"); + CLEAN_PARAMS (FTP_FAIL); + } + + int result = setSockTimeout ((int)dataSocket->priv, SOCK_TO_SEC, SOCK_TO_USEC); + if (0 > result) + { + FTP_ERROR ("Unable to set data socket timeout\n"); + CLEAN_PARAMS (FTP_FAIL); + } + + CHECK_ABORT; + + vp_os_memset (buffer, 0x0, sizeof (buffer)); + snprintf (buffer, sizeof (buffer)-1, "STOR %s\r\n", params->remoteName); + ftp_result = ftpTransfert (params->ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending command\n"); + CLEAN_PARAMS (ftp_result); + } + repCode = getResponseCode (srvMsg); + if (150 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 150)\n", repCode); + CLEAN_PARAMS (FTP_FAIL); + } + + int sizeSent = appendOffset; + float percentSend = (sizeSent * 100.0) / (localFileSize *1.0); + params->callback (FTP_PROGRESS, (void *)&percentSend, params->ftp); + + int numberOfFullSendNeeded = (sizeToPut / (MAX_SIZE_MSG-1)); + int partialSendNeeded = (sizeToPut % (MAX_SIZE_MSG-1)); // Zero if not needed, non-zero if needed + char filePart [MAX_SIZE_MSG] = {0}; + + localFile = fopen (params->localName, "rb"); + if (NULL == localFile) + { + FTP_ERROR ("Unable to open source file %s\n", params->localName); + CLEAN_PARAMS (FTP_FAIL); + } + fseek (localFile, appendOffset, SEEK_SET); + + int numSend = 0; + for (numSend = 0; numSend < numberOfFullSendNeeded; numSend++) + { + CHECK_ABORT; + int bytes = fread (filePart, 1, MAX_SIZE_MSG-1, localFile); + if (0 > bytes) + { + FTP_ERROR ("Unable to read from file\n"); + CLEAN_PARAMS (FTP_FAIL); + } + bytes = MAX_SIZE_MSG-1; + C_RESULT vp_result = dataWrite (dataSocket, (int8_t *)filePart, &bytes); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to send data\n"); + CLEAN_PARAMS (FTP_FAIL); + } + if (MAX_SIZE_MSG-1 > bytes) + { + FTP_ERROR ("Send timeout\n"); + CLEAN_PARAMS (FTP_TIMEOUT); + } + sizeSent += MAX_SIZE_MSG-1; + percentSend = (sizeSent * 100.0) / (localFileSize * 1.0); + params->callback (FTP_PROGRESS, (void *)&percentSend, params->ftp); + } + + if (0 != partialSendNeeded) + { + CHECK_ABORT; + vp_os_memset (filePart, 0x0, MAX_SIZE_MSG); + int bytes = fread (filePart, 1, MAX_SIZE_MSG-1, localFile); + FTP_DEBUG ("Read %d bytes\n", bytes); + if (0 > bytes) + { + FTP_ERROR ("Unable to read from file\n"); + CLEAN_PARAMS (FTP_FAIL); + } + int sendBytes = bytes; + C_RESULT vp_result = dataWrite (dataSocket, (int8_t *)filePart, &sendBytes); + if (VP_FAILED (vp_result)) + { + FTP_ERROR ("Unable to send data\n"); + CLEAN_PARAMS (FTP_FAIL); + } + if (bytes > sendBytes) + { + FTP_ERROR ("Send timeout\n"); + CLEAN_PARAMS (FTP_TIMEOUT); + } + sizeSent += bytes; + percentSend = (sizeSent * 100.0) / (localFileSize * 1.0); + params->callback (FTP_PROGRESS, (void *)&percentSend, params->ftp); + } + + /* Cleaning FTP */ + if (NULL != dataSocket) + { + vp_com_close_socket (dataSocket); + vp_os_free (dataSocket); + dataSocket = NULL; + } + waitFor226Answer (params->ftp); + flushFtp (params->ftp); + + CLEAN_PARAMS (FTP_SUCCESS); +} + + +_ftp_status +ftpPut (_ftp_t *ftp, const char *localName, const char *remoteName, int useResume, ftp_callback callback) +{ + THREAD_HANDLE putThread; + ftp_callback actualCallback = (NULL != callback) ? callback : emptyCallback; + if (NULL == ftp) + { + actualCallback (FTP_FAIL, NULL, ftp); + return FTP_FAIL; + } + if (1 == ftp->opInProgress) + { + actualCallback (FTP_BUSY, NULL, ftp); + return FTP_BUSY; + } + ftp->opInProgress = 1; + + _ftp_put_param *param = vp_os_malloc (sizeof (_ftp_put_param)); + + if (NULL == param) + { + FTP_ERROR ("Unable to allocate thread param\n"); + actualCallback (FTP_FAIL, NULL, ftp); + ftp->opInProgress = 0; + return FTP_FAIL; + } + + param->ftp = ftp; + strncpy (param->localName, localName, FILE_NAME_MAX_SIZE); + param->localName [FILE_NAME_MAX_SIZE-1] = '\0'; + strncpy (param->remoteName, remoteName, FILE_NAME_MAX_SIZE); + param->remoteName [FILE_NAME_MAX_SIZE-1] = '\0'; + param->useResume = useResume; + param->callback = actualCallback; + param->fileList = NULL; + _ftp_status threadReturn = FTP_SUCCESS; + + vp_os_thread_create (thread_ftpPut, (THREAD_PARAMS)param, &putThread); + + if (NULL == callback) + { + vp_os_thread_join (putThread); + threadReturn = lastStatusFromEmptyCallback; + } + + return threadReturn; +} + +_ftp_status +ftpGet (_ftp_t *ftp, const char *remoteName, const char *localName, int useResume, ftp_callback callback) +{ + THREAD_HANDLE getThread; + ftp_callback actualCallback = (NULL != callback) ? callback : emptyCallback; + if (NULL == ftp) + { + actualCallback (FTP_FAIL, NULL, ftp); + return FTP_FAIL; + } + if (1 == ftp->opInProgress) + { + actualCallback (FTP_BUSY, NULL, ftp); + return FTP_BUSY; + } + ftp->opInProgress = 1; + + _ftp_get_param *param = vp_os_malloc (sizeof (_ftp_get_param)); + + if (NULL == param) + { + FTP_ERROR ("Unable to allocate thread param\n"); + actualCallback (FTP_FAIL, NULL, ftp); + ftp->opInProgress = 0; + return FTP_FAIL; + } + + param->ftp = ftp; + strncpy (param->localName, localName, FILE_NAME_MAX_SIZE); + param->localName [FILE_NAME_MAX_SIZE-1] = '\0'; + strncpy (param->remoteName, remoteName, FILE_NAME_MAX_SIZE); + param->remoteName [FILE_NAME_MAX_SIZE-1] = '\0'; + param->useResume = useResume; + param->callback = actualCallback; + param->fileList = NULL; + _ftp_status threadReturn = FTP_SUCCESS; + + vp_os_thread_create (thread_ftpGet, (THREAD_PARAMS)param, &getThread); + + if (NULL == callback) + { + vp_os_thread_join (getThread); + threadReturn = lastStatusFromEmptyCallback; + } + + return threadReturn; +} + +_ftp_status +ftpList (_ftp_t *ftp, char **fileList, ftp_callback callback) +{ + if (NULL == fileList && NULL == callback) + { + FTP_ERROR ("file list and callback pointer must not be both NULL\n"); + return FTP_FAIL; + } + THREAD_HANDLE listThread; + ftp_callback actualCallback = (NULL != callback) ? callback : emptyCallback; + if (NULL == ftp) + { + actualCallback (FTP_FAIL, NULL, ftp); + return FTP_FAIL; + } + if (1 == ftp->opInProgress) + { + actualCallback (FTP_BUSY, NULL, ftp); + return FTP_BUSY; + } + ftp->opInProgress = 1; + + _ftp_list_param *param = vp_os_malloc (sizeof (_ftp_list_param)); + + if (NULL == param) + { + FTP_ERROR ("Unable to allocate thread param\n"); + actualCallback (FTP_FAIL, NULL, ftp); + ftp->opInProgress = 0; + return FTP_FAIL; + } + + param->fileList = vp_os_malloc (sizeof (char) * LIST_BUFFER_BLOCKSIZE); + if (NULL == param->fileList) + { + FTP_ERROR ("Unable to allocate list buffer\n"); + actualCallback (FTP_FAIL, NULL, ftp); + ftp->opInProgress = 0; + vp_os_free (param); + return FTP_FAIL; + } + + param->ftp = ftp; + param->listSize = LIST_BUFFER_BLOCKSIZE; + param->callback = actualCallback; + _ftp_status threadReturn = FTP_SUCCESS; + + vp_os_thread_create (thread_ftpList, (THREAD_PARAMS)param, &listThread); + + if (NULL == callback) + { + vp_os_thread_join (listThread); + threadReturn = lastStatusFromEmptyCallback; + if (FTP_SUCCESS == threadReturn) + { + *fileList = lastFileListFromEmptyCallback; + lastFileListFromEmptyCallback = NULL; + } + } + + return threadReturn; +} + +_ftp_status +ftpRemove (_ftp_t *ftp, const char *remoteName) +{ + _ftp_status ftp_result = FTP_FAIL; + char buffer [256] = {0}; + char srvMsg [MAX_SIZE_MSG] = {0}; + if (NULL == remoteName) + { + FTP_ERROR ("remoteName must not be a NULL pointer\n"); + return FTP_FAIL; + } + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + snprintf (buffer, sizeof (buffer)-1, "DELE %s\r\n", remoteName); + ftp_result = ftpTransfert (ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending the delete command\n"); + return ftp_result; + } + int repCode = getResponseCode (srvMsg); + if (250 != repCode && 550 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 250 or 550)\n", repCode); + ftp_result = FTP_FAIL; + } + return ftp_result; +} + +_ftp_status +ftpRename (_ftp_t *ftp, const char *origin, const char *dest) +{ + _ftp_status ftp_result = FTP_FAIL; + char buffer [256] = {0}; + char srvMsg [MAX_SIZE_MSG] = {0}; + if (NULL == origin || + NULL == dest) + { + FTP_ERROR ("origin and dest pointers must not be NULL\n"); + return FTP_FAIL; + } + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + snprintf (buffer, sizeof (buffer)-1, "RNFR %s\r\n", origin); + ftp_result = ftpTransfert (ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending the RNFR command\n"); + return ftp_result; + } + int repCode = getResponseCode (srvMsg); + if (350 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 350)\n", repCode); + ftp_result = FTP_FAIL; + } + + vp_os_memset (buffer, 0x0, sizeof (buffer)); + vp_os_memset (srvMsg, 0x0, sizeof (srvMsg)); + + snprintf (buffer, sizeof (buffer)-1, "RNTO %s\r\n", dest); + ftp_result = ftpTransfert (ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending the RNTO command\n"); + return ftp_result; + } + repCode = getResponseCode (srvMsg); + if (250 == repCode) // Rename worked + { + ftp_result = FTP_SUCCESS; + } + else if (550 == repCode) // Source file don't exist + { + FTP_DEBUG ("File %s doest not exist on FTP\n", origin); + ftp_result = FTP_SAMESIZE; + } + else + { + FTP_ERROR ("Bad response from server (%d, expected 250 or 550)\n", repCode); + ftp_result = FTP_FAIL; + } + return ftp_result; +} + +_ftp_status +ftpCd (_ftp_t *ftp, const char *nextDir) +{ + _ftp_status ftp_result = FTP_FAIL; + char buffer [256] = {0}; + char srvMsg [MAX_SIZE_MSG] = {0}; + if (NULL == nextDir) + { + FTP_ERROR ("nextDir must not be NULL\n"); + return FTP_FAIL; + } + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + snprintf (buffer, sizeof (buffer)-1, "CWD %s\r\n", nextDir); + ftp_result = ftpTransfert (ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending the CWD command\n"); + return ftp_result; + } + int repCode = getResponseCode (srvMsg); + if (250 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 250)\n", repCode); + ftp_result = FTP_FAIL; + } + return ftp_result; +} + +_ftp_status +ftpPwd (_ftp_t *ftp, char *workingDir, int wdLen) +{ + _ftp_status ftp_result = FTP_FAIL; + char srvMsg [MAX_SIZE_MSG] = {0}; + if (NULL == workingDir) + { + FTP_ERROR ("workingDir must not be NULL\n"); + return FTP_FAIL; + } + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + ftp_result = ftpTransfert (ftp, "PWD\r\n\0", srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending the CWD command\n"); + return ftp_result; + } + int repCode = getResponseCode (srvMsg); + if (257 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 257)\n", repCode); + ftp_result = FTP_FAIL; + } + else + { + int pwdStartIndex = 0; + int pwdEndIndex = 0; + for (pwdStartIndex = 0; (pwdStartIndex < MAX_SIZE_MSG) && (srvMsg[pwdStartIndex] != '\"'); pwdStartIndex++); + for (pwdEndIndex = pwdStartIndex+1; (pwdEndIndex < MAX_SIZE_MSG) && (srvMsg[pwdEndIndex] != '\"'); pwdEndIndex++); + if (MAX_SIZE_MSG == pwdStartIndex || + MAX_SIZE_MSG == pwdEndIndex) + { + FTP_ERROR ("FTP Answer does not conains PWD\n"); + ftp_result = FTP_FAIL; + } + else + { + int srvLen = pwdEndIndex - (pwdStartIndex + 1); + int totalLen = (srvLen < wdLen) ? srvLen : wdLen; + strncpy (workingDir, &(srvMsg[pwdStartIndex+1]), totalLen); + FTP_DEBUG ("PWD is %s\n", workingDir); + } + } + return ftp_result; +} + +_ftp_status +ftpMkdir (_ftp_t *ftp, const char *dirName) +{ + _ftp_status ftp_result = FTP_FAIL; + char buffer [256] = {0}; + char srvMsg [MAX_SIZE_MSG] = {0}; + if (NULL == dirName) + { + FTP_ERROR ("dirName must not be NULL\n"); + return FTP_FAIL; + } + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + snprintf (buffer, sizeof (buffer)-1, "MKD %s\r\n", dirName); + ftp_result = ftpTransfert (ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending the MKD command\n"); + return ftp_result; + } + int repCode = getResponseCode (srvMsg); + if (257 != repCode) + { + FTP_ERROR ("Bad response from server (%d, expected 257)\n", repCode); + ftp_result = FTP_FAIL; + } + return ftp_result; +} + +_ftp_status +ftpRmdir (_ftp_t *ftp, const char *dirName) +{ + _ftp_status ftp_result = FTP_FAIL; + char buffer [256] = {0}; + char srvMsg [MAX_SIZE_MSG] = {0}; + if (NULL == dirName) + { + FTP_ERROR ("dirName must not be NULL\n"); + return FTP_FAIL; + } + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + return FTP_FAIL; + } + snprintf (buffer, sizeof (buffer)-1, "RMD %s\r\n", dirName); + ftp_result = ftpTransfert (ftp, buffer, srvMsg, MAX_SIZE_MSG-1); + if (FTP_FAILED (ftp_result)) + { + FTP_ERROR ("Error while sending the RMD command\n"); + return ftp_result; + } + int repCode = getResponseCode (srvMsg); + if (250 == repCode) // Deleted + { + FTP_DEBUG ("Successfully deleted %s directory\n", dirName); + ftp_result = FTP_SUCCESS; + } + else if (550 == repCode) // Didn't exist / not empty + { + FTP_DEBUG ("Did not delete directory %s : did not exist or was not empty\n", dirName); + ftp_result = FTP_BADSIZE; + } + else + { + FTP_ERROR ("Bad response from server (%d, expected 250 or 550)\n", repCode); + ftp_result = FTP_FAIL; + } + return ftp_result; +} + +_ftp_status ftpAbort (_ftp_t *ftp) +{ + _ftp_status retVal = FTP_FAIL; + if (NULL == ftp) + { + FTP_ERROR ("FTP not open\n"); + } + else + { + if (1 == ftp->opInProgress) + { + ftp->abortCurrentOp = 1; + retVal = FTP_SUCCESS; + } + else + { + retVal = FTP_SAMESIZE; + } + } + return retVal; +} diff --git a/ARDroneLib/Soft/Lib/utils/ardrone_ftp.h b/ARDroneLib/Soft/Lib/utils/ardrone_ftp.h new file mode 100644 index 0000000..bab67d1 --- /dev/null +++ b/ARDroneLib/Soft/Lib/utils/ardrone_ftp.h @@ -0,0 +1,246 @@ +/** + * @file ardrone_ftp.h + * @author nicolas.brulez@parrot.com + * @date 2011/04/06 + * Copyright Parrot SA. 2011 + */ + +#ifndef _ARDRONE_FTP_H_ +#define _ARDRONE_FTP_H_ + +#include + +/** + * Enum type for ftp function return/error codes + */ +typedef enum + { + FTP_FAIL=0, + FTP_BUSY, + FTP_SUCCESS, + FTP_TIMEOUT, + FTP_BADSIZE, + FTP_SAMESIZE, + FTP_PROGRESS, + FTP_ABORT, + } _ftp_status; + +/** + * Success test for _ftp_status + */ +static inline int +FTP_SUCCEDED (_ftp_status ftp_result) +{ + return ((FTP_SUCCESS == ftp_result) || + (FTP_SAMESIZE == ftp_result)); +} + +/** + * Failure test for _ftp_status + */ +static inline int +FTP_FAILED (_ftp_status ftp_result) +{ + return ((FTP_FAIL == ftp_result) || + (FTP_TIMEOUT == ftp_result) || + (FTP_BADSIZE == ftp_result) || + (FTP_ABORT == ftp_result) || + (FTP_BUSY == ftp_result)); +} + +/** + * FTP structure. Must be allocated by ftpConnect, and cleaned by ftpClose + */ +typedef struct _ftp_s +{ + vp_com_socket_t *socket; + Read readSock; + Write writeSock; + int connected; + int opInProgress; + int abortCurrentOp; +} _ftp_t; + +/** + * Last error message from ardrone_ftp lib + * (Useful when FTP_PRINT_ERROR is defined to 0 in ardrone_ftp.c) + */ +extern char *FTPlastErrorMessage; + +/** + * Callback type for all asynchronous operations on FTP. + * The callback may be called several times with "FTP_PROGRESS" as the status + * But only once with any other status. + * @param arg for ftpList : char *pointer to list string (or NULL in case of failure), for ftpGet/ftpPut, float *pointer to progression if status is FTP_PROGRESS, NULL otherwise + */ +typedef void (*ftp_callback)(_ftp_status status, void *arg, _ftp_t *callingFtp); + +/** + * @brief Connect to a FTP server + * @param ip IP address (ipv4, string format) of the server. (e.g. "192.168.1.1"). Must not be NULL. + * @param port Port of the FTP server (default ftp port is 21) + * @param username Username on the server (put "anonymous" for an anonymous connexion). Must not be NULL. + * @param password Password for the user (put "" for an anonymous connexion). Must not be NULL. + * @param status Pointer to a _ftp_status value which will hold error codes from this call. Must not be NULL. + * @return A pointer to the FTP structure allocated during the call, or NULL if the connexion failed. + */ +_ftp_t *ftpConnect (const char *ip, int port, const char *username, const char *password, _ftp_status *status); + +/** + * @brief Connect to a FTP server + * @param ip Host name (string format) of the server. (e.g. "www.google.fr"). Must not be NULL. + * @param port Port of the FTP server (default ftp port is 21) + * @param username Username on the server (put "anonymous" for an anonymous connexion). Must not be NULL. + * @param password Password for the user (put "" for an anonymous connexion). Must not be NULL. + * @param status Pointer to a _ftp_status value which will hold error codes from this call. Must not be NULL. + * @return A pointer to the FTP structure allocated during the call, or NULL if the connexion failed. + */ +_ftp_t *ftpConnectFromName (const char *name, int port, const char *username, const char *password, _ftp_status *status); + +/** + * @brief Close a connexion to a FTP server (Server disconnexion and cleanup) + * @param ftp Pointer to a FTP structure pointer (works with NULL FTP structure pointers). + * @return Returns FTP_SUCCESS if the connexion to the server was opened, else FTP_FAIL. In any case of failure, the ftp pointer is reset to NULL and all possible cleanup was done. + */ +_ftp_status ftpClose (_ftp_t **ftp); + +/** + * @brief Send a file to a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param localName Name of the file on the local filesystem (relative or absolute path). Must not be NULL. + * @param remoteName Name of the file that will be created on the FTP server (in server PWD !). Must not be NULL. + * @param useResume Flag for using or not the transfert resume function. If activated, this function will try to complete the distant file with bytes from local file. + * @param callback Callback that will be called upon progress/completion of the command. If NULL is specified, the function won't return until completion/failure (This functionnality is NOT thread safe !). + * @return If callback is not NULL, the return values can be : + * @return - FTP_SUCCESS : Operation is launched (Result of the operation will be passed as the "status" arg of callback) + * @return - FTP_BUSY : An operation is already in progress for this FTP connexion. + * @return - FTP_FAIL : Unexpected error (see error message) + * @return If callback is NULL, the return values can be : + * @return - FTP_SUCCESS : No errors, transfert was OK + * @return - FTP_TIMEOUT : Timeout during transfert (retry with useResume=1 to resume the transfert) + * @return - FTP_BADSIZE : useResume was set to 1 and the distant file is greater than the local file + * @return - FTP_SAMESIZE : useResume was set to 1 and the distant file has the same size as the local file (no data transfert was done) + * @return - FTP_FAIL : Unexpected error (see error message) + * @return - FTP_ABORT : Operation was aborted + */ +_ftp_status ftpPut (_ftp_t *ftp, const char *localName, const char *remoteName, int useResume, ftp_callback callback); + +/** + * @brief Get a file from a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param remoteName Name of the file that will be got from the FTP server (in server PWD !). Must not be NULL. + * @param localName Name of the file on the local filesystem (relative or absolute path). Must not be NULL. + * @param useResume Flag for using or not the transfert resume function. If activated, this function will try to complete the local file with bytes from distant file. + * @param callback Callback that will be called upon progress/completion of the command. If NULL is specified, the function won't return until completion/failure (This functionnality is NOT thread safe !). + * @return If callback is not NULL, the return values can be : + * @return - FTP_SUCCESS : Operation is launched (Result of the operation will be passed as the "status" arg of callback) + * @return - FTP_BUSY : An operation is already in progress for this FTP connexion. + * @return - FTP_FAIL : Unexpectee error (see error message) + * @return If callback is NULL, the return values can be : + * @return - FTP_SUCCESS : No errors, transfert was OK + * @return - FTP_TIMEOUT : Timeout during transfert (retry with useResume=1 to resume the transfert) + * @return - FTP_BADSIZE : useResume was set to 1 and the local file is greater than the distant file + * @return - FTP_SAMESIZE : useResume was set to 1 and the local file has the same size as the distant file (no data transfert was done) + * @return - FTP_FAIL : Unexpected error (see error message) + * @return - FTP_ABORT : Operation was aborted + */ +_ftp_status ftpGet (_ftp_t *ftp, const char *remoteName, const char *localName, int useResume, ftp_callback callback); + +/** + * @brief Get a list of the current directory on a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param fileList Must to be NULL if callback is NULL. This function allocate list result. YOU MUST TO DISALLOCATE THE POINTER + * @param callback Callback that will be called upon progress/completion of the command. If NULL is specified, the function won't return until completion/failure (This functionnality is NOT thread safe !). + * @return If callback is not NULL, the return values can be : + * @return - FTP_SUCCESS : Operation is launched (Result of the operation will be passed as the "status" arg of callback) + * @return - FTP_BUSY : An operation is already in progress for this FTP connexion. + * @return - FTP_FAIL : Unexpectee error (see error message) + * @return If callback is NULL, the return values can be : + * @return - FTP_SUCCESS : No errors, transfert was OK + * @return - FTP_TIMEOUT : Timeout during transfert + * @return - FTP_FAIL : Unexpected error (see error message) + * @return - FTP_ABORT : Operation was aborted + */ +_ftp_status ftpList (_ftp_t *ftp, char **fileList, ftp_callback callback); + +/** + * @brief Remove a file from a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param remoteName Name (in server PWD) of the file to remove. Must not be NULL. + * @return The return values can be : + * @return - FTP_SUCCESS : Deletion was OK (even if the file did not exist on server) + * @return - FTP_TIMEOUT : Timeout during command transfert + * @return - FTP_FAIL : Unexpected error (see error message) + */ +_ftp_status ftpRemove (_ftp_t *ftp, const char *remoteName); + +/** + * @brief Rename a file/directory on a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param origin Initial name of the file/directory on the server. Must not be NULL. + * @param dest New name of the file/directory on the server. Must not be NULL. + * @return The return values can be : + * @return - FTP_SUCCESS : Renaming was OK + * @return - FTP_SAMESIZE : origin file does not exist on server + * @return - FTP_TIMEOUT : Timeout during command transfert + * @return - FTP_FAIL : Unexpected error (see error message) + */ +_ftp_status ftpRename (_ftp_t *ftp, const char *origin, const char *dest); + +/** + * @brief Change working directory on a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param nextDir New working directory on server (relative path). Must not be NULL. + * @return The return values can be : + * @return - FTP_SUCCESS : Changed directory + * @return - FTP_TIMEOUT : Timeout during command transfert + * @return - FTP_FAIL : Unexpected error (see error message) + */ +_ftp_status ftpCd (_ftp_t *ftp, const char *nextDir); + +/** + * @brief Get the working directory of a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param workingDir Pointer that will hold the server PWD. Must not be NULL. + * @param wdLen Size of workingDir array (used internally for strncpy) + * @return The return values can be : + * @return - FTP_SUCCESS : Got server PWD in workingDir + * @return - FTP_TIMEOUT : Timeout during command transfert + * @return - FTP_FAIL : Unexpected error (see error message) + */ +_ftp_status ftpPwd (_ftp_t *ftp, char *workingDir, int wdLen); + +/** + * @brief Create a directory on a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param dirName Name of the directory to create (in server PWD). Must not be NULL. + * @return The return values can be : + * @return - FTP_SUCCESS : Successfully created dirName directory + * @return - FTP_TIMEOUT : Timeout during command transfert + * @return - FTP_FAIL : Unexpected error (see error message) + */ +_ftp_status ftpMkdir (_ftp_t *ftp, const char *dirName); + +/** + * @brief Remove a directory from a connected FTP server + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @param dirName Name of the directory to delete (in server PWD). Must not be NULL. + * @return The return values can be : + * @return - FTP_SUCCESS : Successfully deleted dirName directory + * @return - FTP_BADSIZE : dirName directory didn't exist, or was not empty + * @return - FTP_TIMEOUT : Timeout during command transfert + * @return - FTP_FAIL : Unexpected error (see error message) + */ +_ftp_status ftpRmdir (_ftp_t *ftp, const char *dirName); + +/** + * @brief Abort current FTP operation + * @param ftp A pointer to a connected (created by ftpConnect) FTP server. + * @return The return values can be : + * @return - FTP_SUCCESS : Successfully aborted and operation + * @return - FTP_SAMESIZE : FTP had no operation in progress + * @return - FTP_FAIL : FTP is not open/initialized + */ +_ftp_status ftpAbort (_ftp_t *ftp); + +#endif // _ARDRONE_FTP_H_ diff --git a/ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.c b/ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.c new file mode 100644 index 0000000..90762c2 --- /dev/null +++ b/ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.c @@ -0,0 +1,45 @@ +#include +#include +#include +#include + +#include +#include + +void +ardrone_gen_appid (const char *appName, const char *sdkVersion, char appId [9], char *appDesc, int descLen) +{ +#define _BUFFER_SIZE 512 + char appNamePlusSdk [_BUFFER_SIZE] = {0}; + snprintf (appNamePlusSdk, _BUFFER_SIZE, "%s:%s", appName, sdkVersion); +#undef _BUFFER_SIZE + uint32_t binaryId = ardrone_crc_32 ((uint8_t *)appNamePlusSdk, strlen (appNamePlusSdk)); + snprintf (appId, 9, "%08x", binaryId); + appId [8] = '\0'; + strncpy (appDesc, appName, descLen); +} + +void +ardrone_gen_usrid (const char *usrName, char usrId [9], char *usrDesc, int descLen) +{ + uint32_t binaryId = ardrone_crc_32 ((uint8_t *)usrName, strlen (usrName)); + snprintf (usrId, 9, "%08x", binaryId); + usrId [8] = '\0'; + strncpy (usrDesc, usrName, descLen); +} + +void +ardrone_gen_sessionid (char sessId [9], char *sessDesc, int descLen) +{ + static int runOnce = 1; + if (1 == runOnce) + { + srand (time (NULL)); + runOnce = 0; + } + uint32_t binaryId = (uint32_t)rand (); + binaryId = (0 != binaryId) ? binaryId : 1u; + snprintf (sessId, 9, "%08x", binaryId); + sessId [8] = '\0'; + snprintf (sessDesc, descLen, "Session %s", sessId); +} diff --git a/ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.h b/ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.h new file mode 100644 index 0000000..15475ee --- /dev/null +++ b/ARDroneLib/Soft/Lib/utils/ardrone_gen_ids.h @@ -0,0 +1,10 @@ +#ifndef _ARDRONE_GEN_APPID_H_ +#define _ARDRONE_GEN_APPID_H_ + +#include + +void ardrone_gen_appid (const char *appName, const char *sdkVersion, char appId [9], char *appDesc, int descLen); +void ardrone_gen_usrid (const char *usrName, char usrId [9], char *usrDesc, int descLen); +void ardrone_gen_sessionid (char sessId [9], char *sessDesc, int descLen); + +#endif /* _ARDRONE_GEN_APPID_H_ */ diff --git a/ARDroneLib/Soft/log b/ARDroneLib/Soft/log new file mode 100644 index 0000000..833ba5a --- /dev/null +++ b/ARDroneLib/Soft/log @@ -0,0 +1,4 @@ +-D_MOBILE -DGNU_LINUX -DTARGET_IPHONE_SIMULATOR -DAT_MESSAGES_HEADER="\"../Common/at_msgs.h\"" -DUSE_NEW_ATCODEC -DNO_ARDRONE_MAINLOOP -Wall -g -O0 -DDEBUG_MODE -DDEBUG -D_DEBUG -D__linux__ -D__MACOSX__ -arch i386 -std=gnu99 -DTARGET_CPU_ARM=0 -DTARGET_CPU_X86=1 -DUSE_WIFI -DUSE_VLIB + + + diff --git a/ARDroneLib/VLIB/Docs/uvlc.txt b/ARDroneLib/VLIB/Docs/uvlc.txt new file mode 100644 index 0000000..088140a --- /dev/null +++ b/ARDroneLib/VLIB/Docs/uvlc.txt @@ -0,0 +1,92 @@ +UVLC File Specification + +Picture Header + + Like in H.263 UVLC start with a PSC (Picture start code) which is 22 bits long + 0000 0000 0000 0000 1000 00 + A PSC is always byte aligned + The second information is the picture's format which can be one of following : CIF or VGA (2 bits) + 00 : forbidden + 01 : CIF + 10 : VGA + Then comes the picture resolution which is used in combination with the picture's format (3 bits) + 000 : forbidden + 001 : for CIF it means sub-QCIF + 010 : for CIF it means QCIF + 011 : for CIF it means CIF + 100 : for CIF it means 4-CIF + 101 : for CIF it means 16-CIF + Then comes the picture's type (3 bits) + 000 : INTRA picture + 001 : INTER picture + Then comes the quantizer's reference for the picture that ranges from 1 to 31 (5 bits) + Then comes the frame number (32 bits) + + Picture header is at least 67 bits long + +Group of Blocks Header + + Each GOB starts with a GOBSC (Group of Blocks start code) wich is 22 bits long + 0000 0000 0000 0000 1xxx xx + A GOBSC is always byte aligned. The least significant bytes represent the blockline's number. We can see that PSC + means first gob too. So for the first GOB, GOB's header is always omitted. + + Then comes the quantizer's reference for the GOB that ranges from 1 to 31 (5 bits) + + Group of Blocks Header is at least 27 bits long + +MacroBlock Header + + Coded Macroblock bit (1 bit) + bit 0 : 1 means there's a macoblock, 0 means macroblock is all zero + + Macrobock description code (7 bits) + bit 0 : 1 means there's non dc coefficients for block y0 + bit 1 : 1 means there's non dc coefficients for block y1 + bit 2 : 1 means there's non dc coefficients for block y2 + bit 3 : 1 means there's non dc coefficients for block y3 + bit 4 : 1 means there's non dc coefficients for block cb + bit 5 : 1 means there's non dc coefficients for block cr + bit 6 : 1 means there's a quantization value following this code + bit 7 : Always 1 to avoid a zero byte + + Then comes a differential value for the quantization (2 bits) + 00 : -1 + 01 : -2 + 10 : 1 + 11 : 2 + + +Block layer + + Codes used for uvlc encoding + + 1/ Run encoding + + coarse | additional | size | value of run | length of run + 1 | | 1 | 0 | 1 + 01 | | 2 | 1 | 1 + 001 | x | 4 | x + 2 (2:3) | 2 + 0001 | xx | 6 | xx + 4 (4:7) | 3 + 00001 | xxx | 8 | xxx + 8 (8:15) | 4 + 000001 | xxxx | 10 | xxxx + 16 (16:31) | 5 + 0000001 | xxxxx | 12 | xxxxx + 32 (32:63) | 6 + + 2/ Level encoding + + coarse | additional | size | value of level | length of level + 1 | s | 2 | 1 | 1 + 01 | | 2 | EOB | + 001 | xs | 5 | x + 2 | 2 + 0001 | xxs | 7 | xx + 4 | 3 + 00001 | xxxs | 9 | xxx + 8 | 4 + 000001 | xxxxs | 11 | xxxx + 16 | 5 + 0000001 | xxxxxs | 13 | xxxxx + 32 | 6 + 00000001 | xxxxxxs | 15 | xxxxxx + 64 | 7 + + (s stands for sign) + +End of Picture header + + A picture ends alwways with a code 0000 0000 0000 0000 1111 11 that is byte aligned and 22 bytes long + \ No newline at end of file diff --git a/ARDroneLib/VLIB/P263/p263_codec.c b/ARDroneLib/VLIB/P263/p263_codec.c new file mode 100644 index 0000000..5c0fa45 --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_codec.c @@ -0,0 +1,399 @@ +#include +#include + +#include +#include +#include +#include +#include "p263_codec.h" + +#include +#include + +static int32_t first_init = 1; + +const p263_codec_t p263_codec = { + p263_encode_blockline, + p263_decode_blockline, + p263_update, + p263_cache, + { 0 } +}; + +void p263_codec_alloc( video_controller_t* controller ) +{ + video_codec_t* video_codec; + + if( first_init == 1 ) + { + vlc_mcbpc_ipictures_tree = huffman_alloc(VLC_MCBPC_IPICTURES_NUM, VLC_MCBPC_IPICTURES_MAX_LENGTH); + huffman_add_codes( vlc_mcbpc_ipictures_tree, &vlc_mcbpc_ipictures[0], VLC_MCBPC_IPICTURES_NUM ); + huffman_sort_codes( vlc_mcbpc_ipictures_tree ); + + vlc_cbpy_standard_tree = huffman_alloc(VLC_CBPY_STANDARD_NUM, VLC_CBPY_STANDARD_MAX_LENGTH); + huffman_add_codes( vlc_cbpy_standard_tree, &vlc_cbpy_standard[0], VLC_CBPY_STANDARD_NUM ); + huffman_sort_codes( vlc_cbpy_standard_tree ); + + vlc_tcoeff_tree = huffman_alloc(VLC_TCOEFF_NUM, VLC_TCOEFF_MAX_LENGTH); + huffman_add_codes( vlc_tcoeff_tree, &vlc_tcoeff[0], VLC_TCOEFF_NUM ); + huffman_sort_codes( vlc_tcoeff_tree ); + + mvd_vlc_tree = huffman_alloc(MVD_VLC_NUM, MVD_VLC_MAX_LENGTH); + huffman_add_codes( mvd_vlc_tree, &mvd_vlc[0], MVD_VLC_NUM ); + huffman_sort_codes( mvd_vlc_tree ); + + first_init = 0; + } + + video_codec = (video_codec_t*) vp_os_malloc( sizeof(p263_codec) ); + + vp_os_memcpy(video_codec, &p263_codec, sizeof(p263_codec)); + + controller->video_codec = video_codec; +} + +void p263_codec_free( video_controller_t* controller ) +{ + p263_codec_t* p263_codec = (p263_codec_t*) controller->video_codec; + + vp_os_free( p263_codec ); +} + +static INLINE video_macroblock_t* p263_unquantize_idct( video_controller_t* controller, video_macroblock_t* mb, int32_t num_macro_blocks ) +{ + video_unquantize( controller, mb, num_macro_blocks ); + video_idct_compute(mb->data, mb->data, num_macro_blocks); + + return mb+num_macro_blocks; +} + +C_RESULT p263_packet( video_controller_t* controller ) +{ + uint32_t start_code = 0, num_mb; + bool_t picture_complete; + video_stream_t* stream = &controller->in_stream; + video_macroblock_t* mb; + p263_gob_layer_t* gob; + p263_codec_t* p263_codec = (p263_codec_t*) controller->video_codec; + p263_picture_layer_t* picture_layer = &p263_codec->picture_layer; + + switch( controller->mode ) + { + case VIDEO_ENCODE: + break; + + case VIDEO_DECODE: + // TODO Fill first gob with picture header's data + video_align8( stream ); + video_read_data( stream, &start_code, 22 ); + + controller->blockline = start_code & 0x1F; + start_code &= ~0x1F; // TODO Check if compiler use arm instruction bic + + if( start_code == PICTURE_START_CODE ) + { + picture_complete = TRUE; + if( controller->blockline == 0 ) + { + picture_complete = FALSE; + p263_read_picture_layer( controller, stream ); + + picture_layer->gobs = (p263_gob_layer_t*) controller->gobs; + gob = &picture_layer->gobs[controller->blockline]; + + gob->gquant = picture_layer->pquant; + } + else if( controller->blockline < 0x1F ) + { + picture_complete = FALSE; + p263_read_gob_layer( controller, stream ); + } + + controller->picture_complete = picture_complete; + + if( picture_complete != TRUE ) + { + num_mb = controller->mb_blockline; + mb = picture_layer->gobs[controller->blockline].macroblocks; + + for( ; num_mb > 0; num_mb-- ) + { + p263_read_mb_layer( controller, stream, mb++ ); + } + } + } + break; + + default: + break; + } + + return C_OK; +} + +C_RESULT p263_encode_blockline( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ) +{ + return C_OK; +} + +C_RESULT p263_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ) +{ + video_codec_t* video_codec; + vp_api_picture_t blockline = { 0 }; + int16_t *in = NULL; + int32_t num_macro_blocks = 0; + video_macroblock_t* macroblock = NULL; + video_picture_context_t blockline_ctx; + video_gob_t* gobs; + + controller->mode = VIDEO_DECODE; + video_codec = controller->video_codec; + + blockline = *picture; + blockline.height = MB_HEIGHT_Y; + blockline.complete = 1; + blockline.vision_complete = 0; + + picture->complete = controller->picture_complete; + + blockline_ctx.y_woffset = blockline.y_line_size; + blockline_ctx.c_woffset = blockline.cb_line_size; + blockline_ctx.y_hoffset = blockline.y_line_size * MCU_HEIGHT; + + // At least a complete blockline is found + while( !controller->picture_complete && controller->in_stream.index < (controller->in_stream.used >> 2) ) + { + p263_packet( controller ); + + if( !controller->picture_complete ) + { + blockline.blockline = controller->blockline; + + blockline_ctx.y_src = picture->y_buf + blockline.blockline * MB_HEIGHT_Y * picture->y_line_size; + blockline_ctx.cb_src = picture->cb_buf + blockline.blockline * MB_HEIGHT_C * picture->cb_line_size; + blockline_ctx.cr_src = picture->cr_buf + blockline.blockline * MB_HEIGHT_C * picture->cr_line_size; + + picture->blockline = controller->blockline; + num_macro_blocks = controller->mb_blockline; + + gobs = &controller->gobs[controller->blockline]; + macroblock = &controller->gobs[controller->blockline].macroblocks[0]; + in = macroblock->data; + + if( gobs->quant != controller->quant ) + { + controller->quant = gobs->quant; + video_quantizer_update( controller ); + } + + while( num_macro_blocks > MAX_NUM_MACRO_BLOCKS_PER_CALL ) + { + // These two calls are merged to allow specific optimization in case of a software decoder + macroblock = p263_unquantize_idct( controller, macroblock, MAX_NUM_MACRO_BLOCKS_PER_CALL ); + + num_macro_blocks -= MAX_NUM_MACRO_BLOCKS_PER_CALL; + } + + // These two calls are merged to allow specific optimization in case of a software decoder + p263_unquantize_idct( controller, macroblock, num_macro_blocks ); + + video_blockline_from_macro_blocks(&blockline_ctx, in, controller->mb_blockline, picture->format); + + // Update controller according to video statistics + video_controller_update( controller, controller->picture_complete ); + + // Perform motion compensation + if( controller->use_me == TRUE ) + { + } + } + } + + if( controller->picture_complete ) + { + picture->complete = controller->picture_complete; + picture->blockline = 0; + + controller->picture_complete = 0; + controller->in_stream.length = 32; + //controller->num_frames++; + + *got_image = TRUE; + } + else + { + controller->in_stream.used = 0; + controller->in_stream.index = 0; + } + + return C_OK; +} + +C_RESULT p263_update( video_controller_t* controller ) +{ + return C_OK; +} + +static C_RESULT p263_flush_stream( video_stream_t* out, video_stream_t* in ) +{ + // They are still data in cache + // Always copy a number of bytes that is a times of 4. + // Only for the last copy, we can have exactly the number of bytes left + int32_t offset, size; + uint32_t out_stream_size; + + if( in->length != 32 ) + { + // flush & reset internal stream + video_write_data( in, 0, in->length+1 ); + in->length = 32; + } + + out_stream_size = out->size & ~3; // Round to the highest times of 4 available + + offset = in->index - (in->used >> 2); + size = ( in->used < out_stream_size ) ? in->used : out_stream_size; + + vp_os_memcpy(out->bytes, in->bytes + offset, size); + + out->index = size >> 2; + out->used = size; + + in->used -= size; + + return C_OK; +} + +static C_RESULT p263_load_stream( video_stream_t* out, video_stream_t* in ) +{ + // We cache as many blockline as possible + C_RESULT res; + bool_t found, last_zero, last_zero_temp; + uint32_t *dst, *src; + + int32_t value, nb_dwords; + uint32_t in_index = (in->used >> 2) - 1; + + // -> start looking for last blockline's end + found = FALSE; + + if( in->index == 0 ) // First call, we look for full blocklines + { + last_zero = FALSE; + + while( (in_index > in->index) && !found ) + { + value = in->bytes[in_index]; + + last_zero_temp = (value & 0xFF) == 0; // 0x??????00 + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x????00?? + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x??00???? + found = last_zero_temp & last_zero; + + if( !found ) + { + in_index--; // Handle both the special case where blockline is dword aligned & + // blockline start is still not found + + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x00?????? + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + } + } + } + } + } + } + + in_index++; + + dst = &out->bytes[0]; + dst += out->used/4; + + src = &in->bytes[0]; + src += in->index; + + // configure parameters for memcpy + if( !found ) + { + // cache all data + // if out->used is non zero then we have already a partial blockline in cache + nb_dwords = (in->used >> 2) - in->index; + + res = C_FAIL; + } + else + { + // cache only data containing full blocklines + // if out->used is non zero then we have already a partial blockline in cache + nb_dwords = in_index - in->index; + + res = C_OK; + } + + if( out->used + nb_dwords*4 >= out->size ) + { // Saturates value + nb_dwords = out->size*4 - out->used; + } + + if( out->endianess == in->endianess ) + { + video_copy32( dst, src, nb_dwords ); + } + else + { + // swap copy + video_copy32_swap( dst, src, nb_dwords ); + } + + out->used += nb_dwords*4; + in->index = in_index; + + VP_OS_ASSERT( out->used <= out->size ); + + return res; +} + +C_RESULT p263_cache( video_controller_t* controller, video_stream_t* ex_stream) +{ + C_RESULT res; + + video_stream_t* in_stream = &controller->in_stream; + + switch( controller->mode ) + { + case VIDEO_ENCODE: + res = p263_flush_stream( ex_stream, in_stream ); + break; + + case VIDEO_DECODE: + res = p263_load_stream( in_stream, ex_stream ); + break; + + default: + res = C_FAIL; + break; + } + + return res; +} diff --git a/ARDroneLib/VLIB/P263/p263_codec.h b/ARDroneLib/VLIB/P263/p263_codec.h new file mode 100644 index 0000000..03089e6 --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_codec.h @@ -0,0 +1,29 @@ +#ifndef _P263_CODEC_H_ +#define _P263_CODEC_H_ + +#include +#include "p263_layers.h" +#include "p263_huffman.h" + +typedef struct _p263_codec_t { + // Compatibility with video_codec_t structure + encode_blockline_fc encode_blockline; + decode_blockline_fc decode_blockline; + update_fc update; + cache_stream_fc cache_stream; + + // Private data (see video source coding algorithm p.9) + p263_picture_layer_t picture_layer; + p263_mb_type_t* mb_types; + p263_cbpy_t* cbpys; +} p263_codec_t; + +void p263_codec_alloc( video_controller_t* controller ); +void p263_codec_free( video_controller_t* controller ); + +C_RESULT p263_encode_blockline( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ); +C_RESULT p263_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ); +C_RESULT p263_update( video_controller_t* controller ); +C_RESULT p263_cache( video_controller_t* controller, video_stream_t* ex_stream); + +#endif // _P263_CODEC_H_ diff --git a/ARDroneLib/VLIB/P263/p263_gob_layer.c b/ARDroneLib/VLIB/P263/p263_gob_layer.c new file mode 100644 index 0000000..af3dbce --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_gob_layer.c @@ -0,0 +1,29 @@ +#include + +#include "p263_codec.h" +#include "p263_layers.h" +#include "p263_huffman.h" + +C_RESULT p263_read_gob_layer( video_controller_t* controller, video_stream_t* stream ) +{ + p263_codec_t* p263_codec = (p263_codec_t*) controller->video_codec; + p263_picture_layer_t* picture_layer = &p263_codec->picture_layer; + p263_gob_layer_t* gob = &picture_layer->gobs[controller->blockline]; + uint32_t gn = 0, gfid = 0, gsbi = 0; + + // Read Group Number (GN) (5 bits) + video_read_data( stream, &gn, 5 ); + + // Read GOB Sub-Bitstream Indicator (GSBI) (2 bits) + video_read_data( stream, &gsbi, 2 ); + + // Read GOB Frame ID (GFID) (2 bits) + video_read_data( stream, &gfid, 2 ); + + // Read Quantizer Information (GQUANT) (5 bits) + video_read_data( stream, &gob->gquant, 5 ); + controller->Qp = gob->gquant; + + return C_OK; +} + diff --git a/ARDroneLib/VLIB/P263/p263_huffman.c b/ARDroneLib/VLIB/P263/p263_huffman.c new file mode 100644 index 0000000..f0d5926 --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_huffman.c @@ -0,0 +1,495 @@ +#include "p263_huffman.h" + + +/// Macroblock type & Coded Block Pattern for Chrominance (MCBPC) + +huffman_code_t vlc_mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM] = { + { 0, {{ 1, 0x1 }} }, // 1 + { 1, {{ 3, 0x1 }} }, // 001 + { 2, {{ 3, 0x2 }} }, // 010 + { 3, {{ 3, 0x3 }} }, // 011 + { 4, {{ 4, 0x1 }} }, // 0001 + { 5, {{ 6, 0x1 }} }, // 00 0001 + { 6, {{ 6, 0x2 }} }, // 00 0010 + { 7, {{ 6, 0x3 }} }, // 00 0011 + { 8, {{ 9, 0x1 }} }, // 0 0000 0001 +}; + +huffman_tree_t* vlc_mcbpc_ipictures_tree = NULL; + +p263_mcbpc_t mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM] = { + { 3, 0 }, + { 3, 1 }, + { 3, 2 }, + { 3, 3 }, + { 4, 0 }, + { 4, 1 }, + { 4, 2 }, + { 4, 3 }, + { 6, 0 }, +}; + + +/// Coded Block Pattern for luminance (CBPY) + +huffman_code_t vlc_cbpy_standard[VLC_CBPY_STANDARD_NUM] = { + { 0, {{ 4, 0x3 }} }, // 0011 + { 1, {{ 5, 0x5 }} }, // 0 0101 + { 2, {{ 5, 0x4 }} }, // 0 0100 + { 3, {{ 4, 0x9 }} }, // 1001 + { 4, {{ 5, 0x3 }} }, // 0 0011 + { 5, {{ 4, 0x7 }} }, // 0111 + { 6, {{ 6, 0x2 }} }, // 00 0010 + { 7, {{ 4, 0xB }} }, // 1011 + { 8, {{ 5, 0x2 }} }, // 0 0010 + { 9, {{ 6, 0x3 }} }, // 00 0011 + { 10, {{ 4, 0x5 }} }, // 0101 + { 11, {{ 4, 0xA }} }, // 1010 + { 12, {{ 4, 0x4 }} }, // 0100 + { 13, {{ 4, 0x8 }} }, // 1000 + { 14, {{ 4, 0x6 }} }, // 0110 + { 15, {{ 2, 0x3 }} }, // 11 +}; + +huffman_tree_t* vlc_cbpy_standard_tree = NULL; + +p263_cbpy_t cbpy_standard[VLC_CBPY_STANDARD_NUM - 1] = { + { CBPY_MAKE(0, 0), CBPY_MAKE( 3, 3) }, + { CBPY_MAKE(0, 1), CBPY_MAKE( 3, 2) }, + { CBPY_MAKE(0, 2), CBPY_MAKE( 3, 1) }, + { CBPY_MAKE(0, 3), CBPY_MAKE( 3, 0) }, + { CBPY_MAKE(1, 0), CBPY_MAKE( 2, 3) }, + { CBPY_MAKE(1, 1), CBPY_MAKE( 2, 2) }, + { CBPY_MAKE(1, 2), CBPY_MAKE( 2, 1) }, + { CBPY_MAKE(1, 3), CBPY_MAKE( 2, 0) }, + { CBPY_MAKE(2, 0), CBPY_MAKE( 1, 3) }, + { CBPY_MAKE(2, 1), CBPY_MAKE( 1, 2) }, + { CBPY_MAKE(2, 2), CBPY_MAKE( 1, 1) }, + { CBPY_MAKE(2, 3), CBPY_MAKE( 1, 0) }, + { CBPY_MAKE(3, 0), CBPY_MAKE( 0, 3) }, + { CBPY_MAKE(3, 1), CBPY_MAKE( 0, 2) }, + { CBPY_MAKE(3, 2), CBPY_MAKE( 0, 1) }, +}; + +// Transform Coefficient (TCOEF) + +huffman_code_t vlc_tcoeff[VLC_TCOEFF_NUM] = { + { 0, {{ 2, 0x02 }} }, // 3 10 s + { 1, {{ 4, 0x0F }} }, // 5 1111 s + { 2, {{ 6, 0x15 }} }, // 7 01 0101 s + { 3, {{ 7, 0x17 }} }, // 8 001 0111 s + { 4, {{ 8, 0x1F }} }, // 9 0001 1111 s + { 5, {{ 9, 0x25 }} }, // 10 0 0010 0101 s + { 6, {{ 9, 0x24 }} }, // 10 0 0010 0100 s + { 7, {{ 10, 0x21 }} }, // 11 00 0010 0001 s + { 8, {{ 10, 0x20 }} }, // 11 00 0010 0000 s + { 9, {{ 11, 0x07 }} }, // 12 000 0000 0111 s + { 10, {{ 11, 0x06 }} }, // 12 000 0000 0110 s + { 11, {{ 11, 0x20 }} }, // 12 000 0010 0000 s + { 12, {{ 3, 0x06 }} }, // 4 110 s + { 13, {{ 6, 0x14 }} }, // 7 01 0100 s + { 14, {{ 8, 0x1E }} }, // 9 0001 1110 s + { 15, {{ 10, 0x0F }} }, // 11 00 0000 1111 s + { 16, {{ 11, 0x21 }} }, // 12 000 0010 0001 s + { 17, {{ 12, 0x50 }} }, // 13 0000 0101 0000 s + { 18, {{ 4, 0x0E }} }, // 5 1110 s + { 19, {{ 8, 0x1D }} }, // 9 0001 1101 s + { 20, {{ 10, 0x0E }} }, // 11 00 0000 1110 s + { 21, {{ 12, 0x51 }} }, // 13 0000 0101 0001 s + { 22, {{ 5, 0x0D }} }, // 6 0 1101 s + { 23, {{ 9, 0x23 }} }, // 10 0 0010 0011 s + { 24, {{ 10, 0x0D }} }, // 11 00 0000 1101 s + { 25, {{ 5, 0x0C }} }, // 6 0 1100 s + { 26, {{ 9, 0x22 }} }, // 10 0 0010 0010 s + { 27, {{ 12, 0x52 }} }, // 13 0000 0101 0010 s + { 28, {{ 5, 0x0B }} }, // 6 0 1011 s + { 29, {{ 10, 0x0C }} }, // 11 00 0000 1100 s + { 30, {{ 12, 0x53 }} }, // 13 0000 0101 0011 s + { 31, {{ 6, 0x13 }} }, // 7 01 0011 s + { 32, {{ 10, 0x0B }} }, // 11 00 0000 1011 s + { 33, {{ 12, 0x54 }} }, // 13 0000 0101 0100 s + { 34, {{ 6, 0x12 }} }, // 7 01 0010 s + { 35, {{ 10, 0x0A }} }, // 11 00 0000 1010 s + { 36, {{ 6, 0x11 }} }, // 7 01 0001 s + { 37, {{ 10, 0x09 }} }, // 11 00 0000 1001 s + { 38, {{ 6, 0x10 }} }, // 7 01 0000 s + { 39, {{ 10, 0x08 }} }, // 11 00 0000 1000 s + { 40, {{ 7, 0x16 }} }, // 8 001 0110 s + { 41, {{ 12, 0x55 }} }, // 13 0000 0101 0101 s + { 42, {{ 7, 0x15 }} }, // 8 001 0101 s + { 43, {{ 7, 0x14 }} }, // 8 001 0100 s + { 44, {{ 8, 0x1C }} }, // 9 0001 1100 s + { 45, {{ 8, 0x1B }} }, // 9 0001 1011 s + { 46, {{ 9, 0x21 }} }, // 10 0 0010 0001 s + { 47, {{ 9, 0x20 }} }, // 10 0 0010 0000 s + { 48, {{ 9, 0x1F }} }, // 10 0 0001 1111 s + { 49, {{ 9, 0x1E }} }, // 10 0 0001 1110 s + { 50, {{ 9, 0x1D }} }, // 10 0 0001 1101 s + { 51, {{ 9, 0x1C }} }, // 10 0 0001 1100 s + { 52, {{ 9, 0x1B }} }, // 10 0 0001 1011 s + { 53, {{ 9, 0x1A }} }, // 10 0 0001 1010 s + { 54, {{ 11, 0x22 }} }, // 12 000 0010 0010 s + { 55, {{ 11, 0x23 }} }, // 12 000 0010 0011 s + { 56, {{ 12, 0x56 }} }, // 13 0000 0101 0110 s + { 57, {{ 12, 0x57 }} }, // 13 0000 0101 0111 s + { 58, {{ 4, 0x07 }} }, // 5 0111 s + { 59, {{ 9, 0x19 }} }, // 10 0 0001 1001 s + { 60, {{ 11, 0x05 }} }, // 12 000 0000 0101 s + { 61, {{ 6, 0x0F }} }, // 7 00 1111 s + { 62, {{ 11, 0x04 }} }, // 12 000 0000 0100 s + { 63, {{ 6, 0x0E }} }, // 7 00 1110 s + { 64, {{ 6, 0x0D }} }, // 7 00 1101 s + { 65, {{ 6, 0x0C }} }, // 7 00 1100 s + { 66, {{ 7, 0x13 }} }, // 8 001 0011 s + { 67, {{ 7, 0x12 }} }, // 8 001 0010 s + { 68, {{ 7, 0x11 }} }, // 8 001 0001 s + { 69, {{ 7, 0x10 }} }, // 8 001 0000 s + { 70, {{ 8, 0x1A }} }, // 9 0001 1010 s + { 71, {{ 8, 0x19 }} }, // 9 0001 1001 s + { 72, {{ 8, 0x18 }} }, // 9 0001 1000 s + { 73, {{ 8, 0x17 }} }, // 9 0001 0111 s + { 74, {{ 8, 0x16 }} }, // 9 0001 0110 s + { 75, {{ 8, 0x15 }} }, // 9 0001 0101 s + { 76, {{ 8, 0x14 }} }, // 9 0001 0100 s + { 77, {{ 8, 0x13 }} }, // 9 0001 0011 s + { 78, {{ 9, 0x18 }} }, // 10 0 0001 1000 s + { 79, {{ 9, 0x17 }} }, // 10 0 0001 0111 s + { 80, {{ 9, 0x16 }} }, // 10 0 0001 0110 s + { 81, {{ 9, 0x15 }} }, // 10 0 0001 0101 s + { 82, {{ 9, 0x14 }} }, // 10 0 0001 0100 s + { 83, {{ 9, 0x13 }} }, // 10 0 0001 0011 s + { 84, {{ 9, 0x12 }} }, // 10 0 0001 0010 s + { 85, {{ 9, 0x11 }} }, // 10 0 0001 0001 s + { 86, {{ 10, 0x07 }} }, // 11 00 0000 0111 s + { 87, {{ 10, 0x06 }} }, // 11 00 0000 0110 s + { 88, {{ 10, 0x05 }} }, // 11 00 0000 0101 s + { 89, {{ 10, 0x04 }} }, // 11 00 0000 0100 s + { 90, {{ 11, 0x24 }} }, // 12 000 0010 0100 s + { 91, {{ 11, 0x25 }} }, // 12 000 0010 0101 s + { 92, {{ 11, 0x26 }} }, // 12 000 0010 0110 s + { 93, {{ 11, 0x27 }} }, // 12 000 0010 0111 s + { 94, {{ 12, 0x58 }} }, // 13 0000 0101 1000 s + { 95, {{ 12, 0x59 }} }, // 13 0000 0101 1001 s + { 96, {{ 12, 0x5A }} }, // 13 0000 0101 1010 s + { 97, {{ 12, 0x5B }} }, // 13 0000 0101 1011 s + { 98, {{ 12, 0x5C }} }, // 13 0000 0101 1100 s + { 99, {{ 12, 0x5D }} }, // 13 0000 0101 1101 s + {100, {{ 12, 0x5E }} }, // 13 0000 0101 1110 s + {101, {{ 12, 0x5F }} }, // 13 0000 0101 1111 s + {102, {{ 7, 0x03 }} }, // 7 000 0011 +}; + +huffman_tree_t* vlc_tcoeff_tree = NULL; + +p263_tcoeff_t tcoeff[VLC_TCOEFF_NUM] = { + { 0, 1, 0 }, + { 0, 2, 0 }, + { 0, 3, 0 }, + { 0, 4, 0 }, + { 0, 5, 0 }, + { 0, 6, 0 }, + { 0, 7, 0 }, + { 0, 8, 0 }, + { 0, 9, 0 }, + { 0, 10, 0 }, + { 0, 11, 0 }, + { 0, 11, 0 }, + + { 1, 1, 0 }, + { 1, 2, 0 }, + { 1, 3, 0 }, + { 1, 4, 0 }, + { 1, 5, 0 }, + { 1, 6, 0 }, + + { 2, 1, 0 }, + { 2, 2, 0 }, + { 2, 3, 0 }, + { 2, 4, 0 }, + + { 3, 1, 0 }, + { 3, 2, 0 }, + { 3, 3, 0 }, + + { 4, 1, 0 }, + { 4, 2, 0 }, + { 4, 3, 0 }, + + { 5, 1, 0 }, + { 5, 2, 0 }, + { 5, 3, 0 }, + + { 6, 1, 0 }, + { 6, 2, 0 }, + { 6, 3, 0 }, + + { 7, 1, 0 }, + { 7, 2, 0 }, + + { 8, 1, 0 }, + { 8, 2, 0 }, + + { 9, 1, 0 }, + { 9, 2, 0 }, + + { 10, 1, 0 }, + { 10, 2, 0 }, + + { 11, 1, 0 }, + + { 12, 1, 0 }, + + { 13, 1, 0 }, + + { 14, 1, 0 }, + + { 15, 1, 0 }, + + { 16, 1, 0 }, + + { 17, 1, 0 }, + + { 18, 1, 0 }, + + { 19, 1, 0 }, + + { 20, 1, 0 }, + + { 21, 1, 0 }, + + { 22, 1, 0 }, + + { 23, 1, 0 }, + + { 24, 1, 0 }, + + { 25, 1, 0 }, + + { 26, 1, 0 }, + + { 0, 1, 1 }, + { 0, 2, 1 }, + { 0, 3, 1 }, + + { 1, 1, 1 }, + { 1, 2, 1 }, + + { 2, 1, 1 }, + + { 3, 1, 1 }, + + { 4, 1, 1 }, + + { 5, 1, 1 }, + + { 6, 1, 1 }, + + { 7, 1, 1 }, + + { 8, 1, 1 }, + + { 9, 1, 1 }, + + { 10, 1, 1 }, + + { 11, 1, 1 }, + + { 12, 1, 1 }, + + { 13, 1, 1 }, + + { 14, 1, 1 }, + + { 15, 1, 1 }, + + { 16, 1, 1 }, + + { 17, 1, 1 }, + + { 18, 1, 1 }, + + { 19, 1, 1 }, + + { 20, 1, 1 }, + + { 21, 1, 1 }, + + { 22, 1, 1 }, + + { 23, 1, 1 }, + + { 24, 1, 1 }, + + { 25, 1, 1 }, + + { 26, 1, 1 }, + + { 27, 1, 1 }, + + { 28, 1, 1 }, + + { 29, 1, 1 }, + + { 30, 1, 1 }, + + { 31, 1, 1 }, + + { 32, 1, 1 }, + + { 33, 1, 1 }, + + { 34, 1, 1 }, + + { 35, 1, 1 }, + + { 36, 1, 1 }, + + { 37, 1, 1 }, + + { 38, 1, 1 }, + + { 39, 1, 1 }, + + { 40, 1, 1 }, + + { 0, 0, VLC_TCOEFF_ESCAPE }, +}; + + +huffman_code_t mvd_vlc[MVD_VLC_NUM] = { + { 0, {{ 13, 0x05 }} }, // 13 0 0000 0000 0101 + { 1, {{ 13, 0x07 }} }, // 13 0 0000 0000 0111 + { 2, {{ 12, 0x05 }} }, // 12 0000 0000 0101 + { 3, {{ 12, 0x07 }} }, // 12 0000 0000 0111 + { 4, {{ 12, 0x09 }} }, // 12 0000 0000 1001 + { 5, {{ 12, 0x0B }} }, // 12 0000 0000 1011 + { 6, {{ 12, 0x0D }} }, // 12 0000 0000 1101 + { 7, {{ 12, 0x0F }} }, // 12 0000 0000 1111 + { 8, {{ 11, 0x09 }} }, // 11 000 0000 1001 + { 9, {{ 11, 0x0B }} }, // 11 000 0000 1011 + { 10, {{ 11, 0x0D }} }, // 11 000 0000 1101 + { 11, {{ 11, 0x0F }} }, // 11 000 0000 1111 + { 12, {{ 11, 0x11 }} }, // 11 000 0001 0001 + { 13, {{ 11, 0x13 }} }, // 11 000 0001 0011 + { 14, {{ 11, 0x15 }} }, // 11 000 0001 0101 + { 15, {{ 11, 0x17 }} }, // 11 000 0001 0111 + { 16, {{ 11, 0x19 }} }, // 11 000 0001 1001 + { 17, {{ 11, 0x1B }} }, // 11 000 0001 1011 + { 18, {{ 11, 0x1D }} }, // 11 000 0001 1101 + { 19, {{ 11, 0x1F }} }, // 11 000 0001 1111 + { 20, {{ 11, 0x21 }} }, // 11 000 0010 0001 + { 21, {{ 11, 0x23 }} }, // 11 000 0010 0011 + { 22, {{ 10, 0x13 }} }, // 10 00 0001 0011 + { 23, {{ 10, 0x15 }} }, // 10 00 0001 0101 + { 24, {{ 10, 0x17 }} }, // 10 00 0001 0111 + { 25, {{ 8, 0x07 }} }, // 8 0000 0111 + { 26, {{ 8, 0x09 }} }, // 8 0000 1001 + { 27, {{ 8, 0x0B }} }, // 8 0000 1011 + { 28, {{ 7, 0x07 }} }, // 7 000 0111 + { 29, {{ 5, 0x03 }} }, // 5 0 0011 + { 30, {{ 4, 0x03 }} }, // 4 0011 + { 31, {{ 3, 0x03 }} }, // 3 011 + { 32, {{ 1, 0x01 }} }, // 1 1 + { 33, {{ 3, 0x02 }} }, // 3 010 + { 34, {{ 4, 0x02 }} }, // 4 0010 + { 35, {{ 5, 0x02 }} }, // 5 0 0010 + { 36, {{ 7, 0x06 }} }, // 7 000 0110 + { 37, {{ 8, 0x0A }} }, // 8 0000 1010 + { 38, {{ 8, 0x08 }} }, // 8 0000 1000 + { 39, {{ 8, 0x06 }} }, // 8 0000 0110 + { 40, {{ 10, 0x16 }} }, // 10 00 0001 0110 + { 41, {{ 10, 0x14 }} }, // 10 00 0001 0100 + { 42, {{ 10, 0x12 }} }, // 10 00 0001 0010 + { 43, {{ 11, 0x22 }} }, // 11 000 0010 0010 + { 44, {{ 11, 0x20 }} }, // 11 000 0010 0000 + { 45, {{ 11, 0x1E }} }, // 11 000 0001 1110 + { 46, {{ 11, 0x1C }} }, // 11 000 0001 1100 + { 47, {{ 11, 0x1A }} }, // 11 000 0001 1010 + { 48, {{ 11, 0x18 }} }, // 11 000 0001 1000 + { 49, {{ 11, 0x16 }} }, // 11 000 0001 0110 + { 50, {{ 11, 0x14 }} }, // 11 000 0001 0100 + { 51, {{ 11, 0x12 }} }, // 11 000 0001 0010 + { 52, {{ 11, 0x10 }} }, // 11 000 0001 0000 + { 53, {{ 11, 0x0E }} }, // 11 000 0000 1110 + { 54, {{ 11, 0x0C }} }, // 11 000 0000 1100 + { 55, {{ 11, 0x0A }} }, // 11 000 0000 1010 + { 56, {{ 11, 0x08 }} }, // 11 000 0000 1000 + { 57, {{ 12, 0x0E }} }, // 12 0000 0000 1110 + { 58, {{ 12, 0x0C }} }, // 12 0000 0000 1100 + { 59, {{ 12, 0x0A }} }, // 12 0000 0000 1010 + { 60, {{ 12, 0x08 }} }, // 12 0000 0000 1000 + { 61, {{ 12, 0x06 }} }, // 12 0000 0000 0110 + { 62, {{ 12, 0x04 }} }, // 12 0000 0000 0100 + { 63, {{ 13, 0x06 }} }, // 13 00000 0000 0110 +}; + +huffman_tree_t* mvd_vlc_tree = NULL; + +#define MAKE_WORD(a) ((int)(a*65536.0f)) + +p263_mvd_t mvd[MVD_VLC_NUM] = { + { MAKE_WORD(-16 ), MAKE_WORD( 16 ) }, + { MAKE_WORD(-15.5), MAKE_WORD( 16.5) }, + { MAKE_WORD(-15 ), MAKE_WORD( 17 ) }, + { MAKE_WORD(-14.5), MAKE_WORD( 17.5) }, + { MAKE_WORD(-14 ), MAKE_WORD( 18 ) }, + { MAKE_WORD(-13.5), MAKE_WORD( 18.5) }, + { MAKE_WORD(-13 ), MAKE_WORD( 19 ) }, + { MAKE_WORD(-12.5), MAKE_WORD( 19.5) }, + { MAKE_WORD(-12 ), MAKE_WORD( 20 ) }, + { MAKE_WORD(-11.5), MAKE_WORD( 20.5) }, + { MAKE_WORD(-11 ), MAKE_WORD( 21 ) }, + { MAKE_WORD(-10.5), MAKE_WORD( 21.5) }, + { MAKE_WORD(-10 ), MAKE_WORD( 22 ) }, + { MAKE_WORD(-9.5 ), MAKE_WORD( 22.5) }, + { MAKE_WORD(-9 ), MAKE_WORD( 23 ) }, + { MAKE_WORD(-8.5 ), MAKE_WORD( 23.5) }, + { MAKE_WORD(-8 ), MAKE_WORD( 24 ) }, + { MAKE_WORD(-7.5 ), MAKE_WORD( 24.5) }, + { MAKE_WORD(-7 ), MAKE_WORD( 25 ) }, + { MAKE_WORD(-6.5 ), MAKE_WORD( 25.5) }, + { MAKE_WORD(-6 ), MAKE_WORD( 26 ) }, + { MAKE_WORD(-5.5 ), MAKE_WORD( 26.5) }, + { MAKE_WORD(-5 ), MAKE_WORD( 27 ) }, + { MAKE_WORD(-4.5 ), MAKE_WORD( 27.5) }, + { MAKE_WORD(-4 ), MAKE_WORD( 28 ) }, + { MAKE_WORD(-3.5 ), MAKE_WORD( 28.5) }, + { MAKE_WORD(-3 ), MAKE_WORD( 29 ) }, + { MAKE_WORD(-2.5 ), MAKE_WORD( 29.5) }, + { MAKE_WORD(-2 ), MAKE_WORD( 30 ) }, + { MAKE_WORD(-1.5 ), MAKE_WORD( 30.5) }, + { MAKE_WORD(-1 ), MAKE_WORD( 31 ) }, + { MAKE_WORD(-0.5 ), MAKE_WORD( 31.5) }, + { MAKE_WORD( 0 ), MAKE_WORD( 0 ) }, + { MAKE_WORD( 0.5 ), MAKE_WORD(-31.5) }, + { MAKE_WORD( 1 ), MAKE_WORD(-31 ) }, + { MAKE_WORD( 1.5 ), MAKE_WORD(-30.5) }, + { MAKE_WORD( 2 ), MAKE_WORD(-30 ) }, + { MAKE_WORD( 2.5 ), MAKE_WORD(-29.5) }, + { MAKE_WORD( 3 ), MAKE_WORD(-29 ) }, + { MAKE_WORD( 3.5 ), MAKE_WORD(-28.5) }, + { MAKE_WORD( 4 ), MAKE_WORD(-28 ) }, + { MAKE_WORD( 4.5 ), MAKE_WORD(-27.5) }, + { MAKE_WORD( 5 ), MAKE_WORD(-27 ) }, + { MAKE_WORD( 5.5 ), MAKE_WORD(-26.5) }, + { MAKE_WORD( 6 ), MAKE_WORD(-26 ) }, + { MAKE_WORD( 6.5 ), MAKE_WORD(-25.5) }, + { MAKE_WORD( 7 ), MAKE_WORD(-25 ) }, + { MAKE_WORD( 7.5 ), MAKE_WORD(-24.5) }, + { MAKE_WORD( 8 ), MAKE_WORD(-24 ) }, + { MAKE_WORD( 8.5 ), MAKE_WORD(-23.5) }, + { MAKE_WORD( 9 ), MAKE_WORD(-23 ) }, + { MAKE_WORD( 9.5 ), MAKE_WORD(-22.5) }, + { MAKE_WORD( 10 ), MAKE_WORD(-22 ) }, + { MAKE_WORD( 10.5), MAKE_WORD(-21.5) }, + { MAKE_WORD( 11 ), MAKE_WORD(-21 ) }, + { MAKE_WORD( 11.5), MAKE_WORD(-20.5) }, + { MAKE_WORD( 12 ), MAKE_WORD(-20 ) }, + { MAKE_WORD( 12.5), MAKE_WORD(-19.5) }, + { MAKE_WORD( 13 ), MAKE_WORD(-19 ) }, + { MAKE_WORD( 13.5), MAKE_WORD(-18.5) }, + { MAKE_WORD( 14 ), MAKE_WORD(-18 ) }, + { MAKE_WORD( 14.5), MAKE_WORD(-17.5) }, + { MAKE_WORD( 15 ), MAKE_WORD(-17 ) }, + { MAKE_WORD( 15.5), MAKE_WORD(-16.5) }, +}; diff --git a/ARDroneLib/VLIB/P263/p263_huffman.h b/ARDroneLib/VLIB/P263/p263_huffman.h new file mode 100644 index 0000000..f4f6356 --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_huffman.h @@ -0,0 +1,87 @@ +#ifndef _P263_HUFFMAN_H_ +#define _P263_HUFFMAN_H_ + +#include + + +/// Macroblock type & Coded Block Pattern for Chrominance (MCBPC) + +#define VLC_MCBPC_IPICTURES_NUM 9 +#define VLC_MCBPC_IPICTURES_MAX_LENGTH 9 + +#define CBPC_CB(mcbpc) (((mcbpc).cbpc) & 1) +#define CBPC_CR(mcbpc) (((mcbpc).cbpc) & 2) + +extern huffman_code_t vlc_mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM]; +extern huffman_tree_t* vlc_mcbpc_ipictures_tree; + +typedef struct _p263_mcbpc_t { + int32_t mb_type; + int32_t cbpc; +} p263_mcbpc_t; + +extern p263_mcbpc_t mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM]; + + +/// Coded Block Pattern for luminance (CBPY) + +#define VLC_CBPY_STANDARD_NUM 16 +#define VLC_CBPY_STANDARD_MAX_LENGTH 6 + +extern huffman_code_t vlc_cbpy_standard[VLC_CBPY_STANDARD_NUM]; +extern huffman_tree_t* vlc_cbpy_standard_tree; + +#define CBPY_MAKE( i12, i34 ) (((i34) << 2) | (i12)) + +#define CBPY_INTRA_Y0(cpby) ((((cbpy).intra) >> 0) & 1) +#define CBPY_INTRA_Y1(cpby) ((((cbpy).intra) >> 1) & 1) +#define CBPY_INTRA_Y2(cpby) ((((cbpy).intra) >> 2) & 1) +#define CBPY_INTRA_Y3(cpby) ((((cbpy).intra) >> 3) & 1) + +#define CBPY_INTER_Y0(cpby) ((((cbpy).inter) >> 0) & 1) +#define CBPY_INTER_Y1(cpby) ((((cbpy).inter) >> 1) & 1) +#define CBPY_INTER_Y2(cpby) ((((cbpy).inter) >> 2) & 1) +#define CBPY_INTER_Y3(cpby) ((((cbpy).inter) >> 3) & 1) + +typedef struct _p263_cbpy_t { + int32_t intra; + int32_t inter; +} p263_cbpy_t; + +extern p263_cbpy_t cbpy_standard[VLC_CBPY_STANDARD_NUM - 1]; + + +/// Transform Coefficient (TCOEF) + +#define VLC_TCOEFF_NUM 103 +#define VLC_TCOEFF_MAX_LENGTH 12 +#define VLC_TCOEFF_ESCAPE 2 + +extern huffman_code_t vlc_tcoeff[VLC_TCOEFF_NUM]; +extern huffman_tree_t* vlc_tcoeff_tree; + +typedef struct _p263_tcoeff_t { + int32_t run; + int32_t level; + int32_t last; +} p263_tcoeff_t; + +extern p263_tcoeff_t tcoeff[VLC_TCOEFF_NUM]; + + +/// VLC table for Motion Vector Data (MVD) + +#define MVD_VLC_NUM 64 +#define MVD_VLC_MAX_LENGTH 13 + +extern huffman_code_t mvd_vlc[MVD_VLC_NUM]; +extern huffman_tree_t* mvd_vlc_tree; + +typedef struct _p263_mvd_t { + int32_t vector; + int32_t differences; +} p263_mvd_t; + +extern p263_mvd_t mvd[MVD_VLC_NUM]; + +#endif // _P263_HUFFMAN_H_ diff --git a/ARDroneLib/VLIB/P263/p263_layers.h b/ARDroneLib/VLIB/P263/p263_layers.h new file mode 100644 index 0000000..d88df80 --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_layers.h @@ -0,0 +1,109 @@ +#ifndef _P263_LAYERS_H_ +#define _P263_LAYERS_H_ + +#include +#include + +#define MAKE_START_CODE(gob) ( 0x000020 | (gob) ) +#define PICTURE_START_CODE MAKE_START_CODE(0) + +#define PICTURE_FORMAT(a) ( (a) & 7 ) +#define PICTURE_TYPE(a) ( ((a) & 1) + ((a) & 16) ) /* This 'trick' works because if bit 1 is 0 */ + /* then bit 5 must be 0 */ +#define PICTURE_EXTENDED_TYPE(a) ( ((a) >> 6) & 7 ) + +#define HAS_CUSTOM_PICTURE_FORMAT(a) ( ((a) >> 15) == 6 ) +#define HAS_CUSTOM_PCF(a) ( ((a) >> 14) == 1 ) +#define HAS_UNRESTRICTED_MOTION_VECTOR(a) ( ((a) >> 13) == 1 ) +#define HAS_SYNTAX_BASED_ARITHMETIC_CODING(a) ( ((a) >> 12) == 1 ) +#define HAS_ADVANCED_PREDICTION(a) ( ((a) >> 11) == 1 ) +#define HAS_ADVANCED_INTRA_CODING(a) ( ((a) >> 10) == 1 ) +#define HAS_DEBLOCKING_FILTER(a) ( ((a) >> 9) == 1 ) +#define HAS_SLICE_STRUCTURED(a) ( ((a) >> 8) == 1 ) +#define HAS_REFERENCE_PICTURE_SELECTION(a) ( ((a) >> 7) == 1 ) +#define HAS_INDEPENDENT_SEGMENT_DECODING(a) ( ((a) >> 6) == 1 ) +#define HAS_ALTERNATIVE_INTER_VLC(a) ( ((a) >> 5) == 1 ) +#define HAS_MODIFIED_QUANTIZATION(a) ( ((a) >> 4) == 1 ) +#define HAS_REFERENCE_PICTURE_RESAMPLING(a) ( ((a) >> 5) == 1 ) + +typedef enum _p263_picture_format { + P263_PICTURE_FORMAT_FORBIDDEN = 0, + P263_PICTURE_FORMAT_SUBQCIF, + P263_PICTURE_FORMAT_QCIF, + P263_PICTURE_FORMAT_CIF, + P263_PICTURE_FORMAT_4QCIF, + P263_PICTURE_FORMAT_16CIF, + P263_PICTURE_FORMAT_RESERVED, + P263_PICTURE_FORMAT_EXTENDED +} p263_picture_format; + +typedef struct _p263_gob_layer_t { + video_macroblock_t* macroblocks; // macroblocks data + uint32_t gquant; // Quantizer Information (GQUANT) + //uint32_t gn; // Group Number (GN) + //uint32_t gsbi; // GOB Sub-Bitstream Indicator (GSBI) + //uint32_t gfid; // GOB Frame ID (GFID) +} p263_gob_layer_t; + +typedef struct _p263_picture_layer_t { + uint32_t opptype; // optional part of PLUSPTYPE (18 bits) + uint32_t tr; // Temporal reference (8 bits) + uint32_t cpcfc; // Custom Picture Clock Frequency Code (CPCFC) (8 bits) + uint32_t etr; // Extended Temporal Reference (ETR) (2 bits) + uint32_t uui; // Unlimited Unrestricted Motion Vectors Indicator (UUI) (Variable length) + uint32_t ptype; // Type information (8 ou 13 bits) + uint32_t epar; // Extended Pixel Aspect Ratio (EPAR) (16 bits) + uint32_t plusptype; // Type information extended (12 bits) + uint32_t cpfmt; // Custom Picture Format (CPFMT) (23 bits) + uint32_t trp; // Temporal Reference for Prediction (TRP) (10 bits) + uint32_t sss; // Slice Structured Submode bits (SSS) (2 bits) + uint32_t elnum; // Enhancement Layer Number (ELNUM) (4 bits) + uint32_t rlnum; // Reference Layer Number (RLNUM) (4 bits) + uint32_t rpsmf; // Reference Picture Selection Mode Flags (RPSMF) (3 bits) + uint32_t trpi; // Temporal Reference for Prediction Indication (TRPI) (1 bit) + uint32_t bci; // Back-Channel message Indication (BCI) (Variable length) + uint32_t bcm; // Back-Channel Message (BCM) (Variable length) + uint32_t rprp; // Reference Picture Resampling Parameters (RPRP) (Variable length) + uint32_t pquant; // Quantizer Information (PQUANT) (5 bits) + uint32_t cpm; // Continuous Presence Multipoint and Video Multiplex (CPM) (1 bit) + uint32_t psbi; // Picture Sub-Bitstream Indicator (PSBI) (2 bits) + uint32_t trb; // Temporal Reference for B-pictures in PB-frames (TRB) (3/5 bits) + uint32_t dbquant; // Quantization information for B-pictures in PB-frames (DBQUANT) (2 bits) + uint32_t pei; // Extra Insertion Information (PEI) (1 bit) + uint8_t* psupp; // Supplemental Enhancement Information (PSUPP) (0/8/16 ... bits) + p263_gob_layer_t* gobs; // List of gobs +} p263_picture_layer_t; + +// Macroblock types and included data elements for normal pictures +#define MB_TYPE_COD_BIT 0x01 +#define MB_TYPE_MCBPC_BIT 0x02 +#define MB_TYPE_CBPY_BIT 0x03 +#define MB_TYPE_DQUANT_BIT 0x04 +#define MB_TYPE_MVD_BIT 0x05 +#define MB_TYPE_MVD24_BIT 0x06 + +#define MAKE_MB_TYPE( COD, MCBPC, CBPY, DQUANT, MVD, MVD24 ) \ + ( (COD << MB_TYPE_COD_BIT ) | \ + (MCBPC << MB_TYPE_MCBPC_BIT ) | \ + (CBPY << MB_TYPE_CBPY_BIT ) | \ + (DQUANT << MB_TYPE_DQUANT_BIT ) | \ + (MVD << MB_TYPE_MVD_BIT ) | \ + (MVD24 << MB_TYPE_MVD24_BIT ) ) + +#define MB_TYPE_HAS_COD(t) ( (t) & ( 1 << MB_TYPE_COD_BIT )) +#define MB_TYPE_HAS_MCBPC(t) ( (t) & ( 1 << MB_TYPE_MCBPC_BIT )) +#define MB_TYPE_HAS_CBPY(t) ( (t) & ( 1 << MB_TYPE_CBPY_BIT )) +#define MB_TYPE_HAS_DQUANT(t) ( (t) & ( 1 << MB_TYPE_DQUANT_BIT)) +#define MB_TYPE_HAS_MVD(t) ( (t) & ( 1 << MB_TYPE_MVD_BIT )) +#define MB_TYPE_HAS_MVD24(t) ( (t) & ( 1 << MB_TYPE_MVD24_BIT )) + +#define STANDARD_MB_TYPES_NUM 7 + +typedef uint32_t p263_mb_type_t; +extern p263_mb_type_t standard_mb_types[STANDARD_MB_TYPES_NUM]; + +C_RESULT p263_read_picture_layer( video_controller_t* controller, video_stream_t* stream ); +C_RESULT p263_read_gob_layer( video_controller_t* controller, video_stream_t* stream ); +C_RESULT p263_read_mb_layer( video_controller_t* controller, video_stream_t* stream, video_macroblock_t* mb ); + +#endif // _P263_LAYERS_H_ diff --git a/ARDroneLib/VLIB/P263/p263_mb_layer.c b/ARDroneLib/VLIB/P263/p263_mb_layer.c new file mode 100644 index 0000000..0da3e0b --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_mb_layer.c @@ -0,0 +1,180 @@ +#include +#include + +#include "p263_codec.h" +#include "p263_layers.h" +#include "p263_huffman.h" + +p263_mb_type_t standard_mb_types[STANDARD_MB_TYPES_NUM] = { + MAKE_MB_TYPE( 1, 1, 1, 0, 1, 0 ), // INTER + MAKE_MB_TYPE( 1, 1, 1, 1, 1, 0 ), // INTER+Q + MAKE_MB_TYPE( 1, 1, 1, 0, 1, 1 ), // INTER4V + MAKE_MB_TYPE( 1, 1, 1, 0, 0, 0 ), // INTRA + MAKE_MB_TYPE( 1, 1, 1, 1, 0, 0 ), // INTRA+Q + MAKE_MB_TYPE( 1, 1, 1, 1, 1, 1 ), // INTER4V+Q + MAKE_MB_TYPE( 1, 1, 0, 0, 0, 0 ) // Stuffing +}; + +static C_RESULT p263_read_block( video_stream_t* stream, int16_t* data, int32_t* num_coeff ) +{ + int32_t* zztable; + int32_t index, code, run, last, nc, idx, sign; + p263_tcoeff_t* tc; + + zztable = &video_zztable_t81[0]; + + nc = *num_coeff; + + // DC coeff + code = run = last = 0; + video_read_data( stream, (uint32_t*) &code, 8 ); + data[0] = code; + + if( nc > 0 ) + { + // AC coeff + while( last == 0 ) + { + idx = huffman_stream_code( vlc_tcoeff_tree, stream ); + VP_OS_ASSERT(idx < 0 ); + + sign = 0; + tc = &tcoeff[idx]; + if( tc->last == VLC_TCOEFF_ESCAPE ) + { + code = run = last = 0; + + video_read_data( stream, (uint32_t*) &last, 1 ); + video_read_data( stream, (uint32_t*) &run, 6 ); + video_read_data( stream, (uint32_t*) &code, 8 ); + + // For level (variable code in this program) the code 0000 0000 is forbidden, + // and the code 1000 0000 is forbidden unless the Modified Quantization mode is + // in use (see Annex T). + + // Do sign extension for code. see Table 17/H.263 – FLC table for RUNs and LEVELs + code <<= 24; + code >>= 24; // This works because shift is signed & code can't be zero + } + else + { + // read sign + video_read_data( stream, (uint32_t*) &sign, 1 ); + } + + code = (sign == 0 ) ? tc->level : -tc->level; + run = tc->run; + last = tc->last; + + VP_OS_ASSERT( run < 64 ); + + if( last == 0 ) + { + zztable += (run+1); + index = *zztable; + data[index] = code; + + nc++; + } + } + + *num_coeff = nc; + } + + return C_OK; +} + +C_RESULT p263_read_mb_layer( video_controller_t* controller, video_stream_t* stream, video_macroblock_t* mb ) +{ + C_RESULT res = C_OK; + uint32_t cod = 0; + p263_mcbpc_t* mcbpc = NULL; + p263_cbpy_t cbpy; + p263_codec_t* p263_codec = (p263_codec_t*) controller->video_codec; + p263_mb_type_t mb_type = MAKE_MB_TYPE( 1, 0, 0, 0, 0, 0 ); // By default we have only cod + int32_t dquant = 0, idx = 0; + int16_t* data; + + if( controller->picture_type != VIDEO_PICTURE_INTRA ) + { + // Read Coded macroblock indication (COD) (1 bit) + video_read_data( stream, &cod, 1 ); + } + + if( cod == 0 ) // Macroblock is coded (see 5.3.1) + { + // Read Macroblock type & Coded Block Pattern for Chrominance (MCBPC) (Variable length) + idx = huffman_stream_code( vlc_mcbpc_ipictures_tree, stream ); + mcbpc = &mcbpc_ipictures[idx]; + + mb->num_coeff_cb = CBPC_CB(*mcbpc); + mb->num_coeff_cr = CBPC_CR(*mcbpc); + + mb_type = p263_codec->mb_types[mcbpc->mb_type]; + } + + if( MB_TYPE_HAS_CBPY(mb_type) ) + { + // Coded Block Pattern for luminance (CBPY) (Variable length) + idx = huffman_stream_code( vlc_cbpy_standard_tree, stream ); + cbpy = p263_codec->cbpys[idx]; + + switch( controller->picture_type ) + { + case VIDEO_PICTURE_INTRA: + mb->num_coeff_y0 = CBPY_INTRA_Y0(cbpy); + mb->num_coeff_y1 = CBPY_INTRA_Y1(cbpy); + mb->num_coeff_y2 = CBPY_INTRA_Y2(cbpy); + mb->num_coeff_y3 = CBPY_INTRA_Y3(cbpy); + break; + + case VIDEO_PICTURE_INTER: + mb->num_coeff_y0 = CBPY_INTER_Y0(cbpy); + mb->num_coeff_y1 = CBPY_INTER_Y1(cbpy); + mb->num_coeff_y2 = CBPY_INTER_Y2(cbpy); + mb->num_coeff_y3 = CBPY_INTER_Y3(cbpy); + break; + + default: + // Picture type not supported + break; + } + } + + if( MB_TYPE_HAS_DQUANT(mb_type) ) + { + mb->dquant = 0; + video_read_data( stream, (uint32_t*) &mb->dquant, 2 ); + + dquant = ( mb->dquant < 2 ) ? ~mb->dquant : (mb->dquant - 1); + } + + dquant += controller->Qp; + mb->dquant = dquant; + + /**************** Block Y0 ****************/ + data = mb->data; + p263_read_block( stream, data, &mb->num_coeff_y0 ); + + /**************** Block Y1 ****************/ + data += MCU_BLOCK_SIZE; + p263_read_block( stream, data, &mb->num_coeff_y1 ); + + /**************** Block Y2 ****************/ + data += MCU_BLOCK_SIZE; + p263_read_block( stream, data, &mb->num_coeff_y2 ); + + /**************** Block Y3 ****************/ + data += MCU_BLOCK_SIZE; + p263_read_block( stream, data, &mb->num_coeff_y3 ); + + /**************** Block CB ****************/ + data += MCU_BLOCK_SIZE; + p263_read_block( stream, data, &mb->num_coeff_cb ); + + /**************** Block CR ****************/ + data += MCU_BLOCK_SIZE; + p263_read_block( stream, data, &mb->num_coeff_cr ); + + return res; +} diff --git a/ARDroneLib/VLIB/P263/p263_picture_layer.c b/ARDroneLib/VLIB/P263/p263_picture_layer.c new file mode 100644 index 0000000..92a430c --- /dev/null +++ b/ARDroneLib/VLIB/P263/p263_picture_layer.c @@ -0,0 +1,215 @@ +#include + +#include +#include + +#include "p263_codec.h" +#include "p263_layers.h" +#include "p263_huffman.h" + +C_RESULT p263_read_picture_layer( video_controller_t* controller, video_stream_t* stream ) +{ + uint32_t pei = 0; + p263_codec_t* p263_codec = (p263_codec_t*) controller->video_codec; + p263_picture_layer_t* picture_layer = &p263_codec->picture_layer; + + p263_codec->mb_types = &standard_mb_types[0]; + p263_codec->cbpys = &cbpy_standard[0]; + + // Read Temporal Reference (TR) (8 bits) + picture_layer->tr = 0; + video_read_data( stream, &picture_layer->tr, 8 ); + + // Read Type Information (PTYPE) (Variable Length) + picture_layer->ptype = 0; + picture_layer->plusptype = 0; + picture_layer->opptype = 0; + video_read_data( stream, &picture_layer->ptype, 8 ); + + switch( PICTURE_FORMAT(picture_layer->ptype) ) + { + case P263_PICTURE_FORMAT_FORBIDDEN: + break; + + case P263_PICTURE_FORMAT_SUBQCIF: + video_controller_set_format( controller, 128, 96 ); + goto P263_PICTURE_FORMAT_NOT_EXTENDED; + + case P263_PICTURE_FORMAT_QCIF: + video_controller_set_format( controller, 176, 144 ); + goto P263_PICTURE_FORMAT_NOT_EXTENDED; + + case P263_PICTURE_FORMAT_CIF: + video_controller_set_format( controller, 352, 288 ); + goto P263_PICTURE_FORMAT_NOT_EXTENDED; + + case P263_PICTURE_FORMAT_4QCIF: + video_controller_set_format( controller, 704, 576 ); + goto P263_PICTURE_FORMAT_NOT_EXTENDED; + + case P263_PICTURE_FORMAT_16CIF: + video_controller_set_format( controller, 1408, 1152 ); + + P263_PICTURE_FORMAT_NOT_EXTENDED: + video_read_data( stream, &picture_layer->ptype, 5 ); + video_controller_set_picture_type( controller, PICTURE_TYPE(picture_layer->ptype) ); + break; + + case P263_PICTURE_FORMAT_RESERVED: + break; + + case P263_PICTURE_FORMAT_EXTENDED: + // Read Plus PTYPE (PLUSPTYPE) (Variable Length) -- Optionnal, see PTYPE + // Read UFEP + video_read_data( stream, &picture_layer->plusptype, 3 ); + if( picture_layer->plusptype == 1 ) + { + // Read OPPTYPE + video_read_data( stream, &picture_layer->opptype, 18 ); + } + + // Read MPPTYPE + video_read_data( stream, &picture_layer->plusptype, 9 ); + video_controller_set_picture_type( controller, PICTURE_EXTENDED_TYPE(picture_layer->plusptype) ); + break; + } + + if( picture_layer->plusptype ) + { + // Read Continuous Presence Multipoint and Video Multiplex (CPM) (1 bit, see Annex C) + video_read_data( stream, &picture_layer->cpm, 1 ); + + if( picture_layer->cpm ) + { + // Read Picture Sub-Bitstream Indicator (PSBI) (2 bits) + video_read_data( stream, &picture_layer->psbi, 2 ); + } + } + + if( picture_layer->opptype ) // eg UFEP == 001b + { + if( HAS_CUSTOM_PICTURE_FORMAT( picture_layer->opptype ) ) + { + // Read Custom Picture Format (CPFMT) (23 bits) + video_read_data( stream, &picture_layer->cpfmt, 23 ); + + if( (picture_layer->cpfmt >> 19) == 0xF ) + { + // Read Extended Pixel Aspect Ratio (EPAR) (16 bits) + video_read_data( stream, &picture_layer->epar, 16 ); + } + } + + if( HAS_CUSTOM_PCF(picture_layer->opptype) ) + { + // Read Custom Picture Clock Frequency Code (CPCFC) (8 bits) + video_read_data( stream, &picture_layer->cpcfc, 8 ); + + // Read Extended Temporal Reference (ETR) (2 bits) + video_read_data( stream, &picture_layer->etr, 2 ); + } + + if( HAS_UNRESTRICTED_MOTION_VECTOR(picture_layer->opptype) ) + { + // Read Unlimited Unrestricted Motion Vectors Indicator (UUI) (Variable length) -- Optionnal + video_read_data( stream, &picture_layer->uui, 1 ); + if( picture_layer->uui == 0 ) + video_read_data( stream, &picture_layer->uui, 1 ); + } + + if( HAS_SLICE_STRUCTURED(picture_layer->sss) ) + { + // Read Slice Structured Submode bits (SSS) (2 bits) -- Optionnal + video_read_data( stream, &picture_layer->sss, 2 ); + } + } + + if( controller->picture_type == VIDEO_PICTURE_EP ) + { + // Read Enhancement Layer Number (ELNUM) (4 bits) -- Optionnal + video_read_data( stream, &picture_layer->elnum, 4 ); + + if( picture_layer->opptype ) // eg UFEP == 001b + { + // Read Reference Layer Number (RLNUM) (4 bits) -- Optionnal + video_read_data( stream, &picture_layer->rlnum, 4 ); + } + } + + if( HAS_REFERENCE_PICTURE_SELECTION( picture_layer->opptype ) ) + { + // Read Reference Picture Selection Mode Flags (RPSMF) (3 bits) -- Optionnal + video_read_data( stream, &picture_layer->rpsmf, 3 ); + } + + if( picture_layer->rpsmf ) + { + // Read Temporal Reference for Prediction Indication (TRPI) (1 bit) -- Optionnal + video_read_data( stream, &picture_layer->trpi, 1 ); + + if( picture_layer->trpi ) + { + // Read Temporal Reference for Prediction (TRP) (10 bits) -- Optionnal + video_read_data( stream, &picture_layer->trp, 10 ); + } + + // Read Back-Channel message Indication (BCI) (Variable length, 1 or 2 bits) -- Optionnal + video_read_data( stream, &picture_layer->bci, 1 ); + + if( picture_layer->bci == 1 ) + { + // TODO + // Read Back-Channel Message (BCM) (Variable length, see N.4.2) -- Optionnal + } + else + { + video_read_data( stream, &picture_layer->bci, 1 ); // read '01' end of back channel message + } + } + + if( HAS_REFERENCE_PICTURE_RESAMPLING( picture_layer->plusptype ) ) + { + // TODO + // Read Reference Picture Resampling Parameters (RPRP) (Variable length, see Annex P) -- Optionnal + } + + // Read Quantizer Information (PQUANT) (5 bits) + video_read_data( stream, &picture_layer->pquant, 5 ); + controller->Qp = picture_layer->pquant; + + if( !picture_layer->plusptype ) + { + // Read Continuous Presence Multipoint and Video Multiplex (CPM) (1 bit, see Annex C) + video_read_data( stream, &picture_layer->cpm, 1 ); + + if( picture_layer->cpm ) + { + // Read Picture Sub-Bitstream Indicator (PSBI) (2 bits) + video_read_data( stream, &picture_layer->psbi, 2 ); + } + } + + if( controller->picture_type == VIDEO_PICTURE_PB ) + { + // TODO + // Read Temporal Reference for B-pictures in PB-frames (TRB) (3/5 bits) -- Optionnal + + // Read Quantization information for B-pictures in PB-frames (DBQUANT) (2 bits) + } + + // Read Extra Insertion Information (PEI) (1 bit) + picture_layer->pei = 0; + video_read_data( stream, &pei, 1 ); + + while( pei ) + { + // Read Supplemental Enhancement Information (PSUPP) (0/8/16 ... bits) -- Optionnal (See Annex L) + video_read_data( stream, &pei, 8 ); + + // picture_layer->psupp[picture_layer->pei++] = pei; TODO: Alloc psupp + + video_read_data( stream, &pei, 1 ); + } + + return C_OK; +} diff --git a/ARDroneLib/VLIB/P264/p264.c b/ARDroneLib/VLIB/P264/p264.c new file mode 100644 index 0000000..c5accad --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264.c @@ -0,0 +1,249 @@ +#include +#include + +#include + +#include + +#include + +#ifndef HAS_P264_ENCODE +//TODO: rename this file and this function (something like p264_entropic.c) + +#define PACK_BITS( bits_out, length_out, bits_in, length_in ) \ + bits_out <<= length_in; \ + length_out += length_in; \ + bits_out |= bits_in; + +void p264_encode_int(video_stream_t* const stream, int32_t code) +{ + int32_t sign, length, data, value_code, value_length; + + value_code = 0; + value_length = 0; + /// Encode level + data = code; + + if (data != 0) + { + // sign handling + sign = 0; + if( data < 0 ) + { + data = -data; + sign = 1; + } + + // TODO Check saturation & if level == -128 + length = 32 - clz(data); // number of bits used in level ( = length of level ) + if( length > 1 ) + { + data -= 1 << (length - 1); + length += 1; + } + + PACK_BITS( value_code, value_length, 1, length ); + + length -= 2; + if(length > 0) + { + PACK_BITS( value_code, value_length, data, length ); + } + + PACK_BITS( value_code, value_length, sign, 1 ); + + /// Write output + video_write_data( stream, value_code, value_length ); + } + else + { + video_write_data( stream, 0x01, 2 ); + } +} + +void p264_decode_int(video_stream_t* const stream, int32_t *code) +{ + uint32_t stream_code, stream_length; + int32_t r = 0, z, sign; + + stream_code = stream_length = 0; + + // Peek 32 bits from stream because we know our datas fit in + video_peek_data( stream, &stream_code, 32 ); + + /// Decode level / last + z = clz(stream_code); + + stream_code <<= z + 1; // Skip all zeros & 1 + stream_length += z + 1; + + if( z == 1 ) + { + *code = 0; + } + else + { + if( z == 0 ) + { + z = 1; + r = 1; + } + + stream_length += z; + + stream_code >>= (32 - z); + sign = stream_code & 1; + + if( z != 0 ) + { + r = stream_code >> 1; + r += 1 << (z-1); + } + + *code = sign ? -r : r; + } + + // Do the real Read in stream to consume what we used + video_read_data( stream, &stream_code, stream_length ); + +} + +void p264_encode( video_stream_t* const stream, int32_t level, int32_t run, int32_t not_last ) +{ + int32_t sign, length, data, value_code, value_length; + + /// Encode number of zeros + data = run; + + length = 0; + value_code = 1; + + if( data > 0 ) + { + length = 32 - clz(data); // compute number of bits used in run ( = length of run ) + data -= 1 << ( length - 1 ); // compute value of run + } + + value_length = length + 1; + + length -= 1; + if( length > 0 ) + { + PACK_BITS( value_code, value_length, data, length ); + } + + /// Encode level + data = level; + + // sign handling + sign = 0; + if( data < 0 ) + { + data = -data; + sign = 1; + } + + // TODO Check saturation & if level == -128 + length = 32 - clz(data); // number of bits used in level ( = length of level ) + if( length > 1 ) + { + data -= 1 << (length - 1); + length += 1; + } + + PACK_BITS( value_code, value_length, 1, length ); + + VP_OS_ASSERT( length != 2 ); + + length -= 2; + if(length > 0) + { + PACK_BITS( value_code, value_length, data, length ); + } + + PACK_BITS( value_code, value_length, sign, 1 ); + + /// Encode last + // add sequence for end of block if required + if( not_last == 0 ) + { + PACK_BITS( value_code, value_length, 0x5, 3 ); + } + + /// Write output + video_write_data( stream, value_code, value_length ); +} + +#endif // HAS_UVLC_ENCODE + +C_RESULT p264_decode( video_stream_t* const stream, int32_t* run, uint32_t* level, int32_t* last) +{ + uint32_t stream_code, stream_length; + int32_t r = 0, z, sign; + + stream_code = stream_length = 0; + + // Peek 32 bits from stream because we know our datas fit in + video_peek_data( stream, &stream_code, 32 ); + + + /// Decode number of zeros + z = clz(stream_code); + + stream_code <<= z + 1; // Skip all zeros & 1 + stream_length += z + 1; + + if( z > 1 ) + { + r = stream_code >> (32 - (z-1)); + + stream_code <<= (z-1); + stream_length += (z-1); + + *run = r + (1 << (z-1)); + } + else + { + *run = z; + } + + + /// Decode level / last + z = clz(stream_code); + + stream_code <<= z + 1; // Skip all zeros & 1 + stream_length += z + 1; + + if( z == 1 ) + { + *run = 0; + *last = 1; + } + else + { + if( z == 0 ) + { + z = 1; + r = 1; + } + + stream_length += z; + + stream_code >>= (32 - z); + sign = stream_code & 1; + + if( z != 0 ) + { + r = stream_code >> 1; + r += 1 << (z-1); + } + + *level = sign ? -r : r; + *last = 0; + } + + // Do the real Read in stream to consume what we used + video_read_data( stream, &stream_code, stream_length ); + + return C_OK; +} diff --git a/ARDroneLib/VLIB/P264/p264.h b/ARDroneLib/VLIB/P264/p264.h new file mode 100644 index 0000000..da683de --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264.h @@ -0,0 +1,13 @@ +#ifndef _P264_H_ +#define _P264_H_ + +#include +#include + +// not_last > 0 if this is not the last coefficient +// If last == 0, a special sequence is emitted +void p264_encode( video_stream_t* const stream, int32_t level, int32_t run, int32_t not_last ); +C_RESULT p264_decode( video_stream_t* const stream, int32_t* run, uint32_t* level, int32_t* last); +void p264_encode_int(video_stream_t* const stream, int32_t code); +void p264_decode_int(video_stream_t* const stream, int32_t *code); +#endif // _P264_H_ diff --git a/ARDroneLib/VLIB/P264/p264_Qp.c b/ARDroneLib/VLIB/P264/p264_Qp.c new file mode 100644 index 0000000..ecf8431 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_Qp.c @@ -0,0 +1,126 @@ +#include + +// define QP_core_table used to scale p264 4x4 transform coefficients +// QP is the quantizer parameter varying from 0 to 51. +// p264 rescaling rules : +// - luma 4x4 residual block -> use Coeff*QP%6_core_table * 2^(floor(QP/6)) +// +// - 4x4 luma DC block -> use Coeff*QP%6_core_table[0] * 2^(floor(QP/6)-2) (Qp>=12) +// -> use [Coeff*QP%6_core_table[0] + 2^(1-floor(QP/6)] >> (2-floor(QP/6)) (Qp<12) +// +// - 2x2 chroma DC block -> use Coeff*QP%6_core_table[0] / 2 (Qp<6) +// -> use Coeff*QP%6_core_table[0] * 2^(floor(QP/6)-1) (Qp>=6) + +static uint16_t QP_core_table[6][16] = { +// QP0 : Qstep0 * Si (* 2^6) +{ + 10, 13, 10, 13, + 13, 16, 13, 16, + 10, 13, 10, 13, + 13, 16, 13, 16 +}, +// QP1 : Qstep1 * Si (* 2^6) +{ + 11, 14, 11, 14, + 14, 18, 14, 18, + 11, 14, 11, 14, + 14, 18, 14, 18 +}, +// QP2 : Qstep2 * Si (* 2^6) +{ + 13, 16, 13, 16, + 16, 20, 16, 20, + 13, 16, 13, 16, + 16, 20, 16, 20 +}, +// QP3 : Qstep3 * Si (* 2^6) +{ + 14, 18, 14, 18, + 18, 23, 18, 23, + 14, 18, 14, 18, + 18, 23, 18, 23 +}, +// QP4 : Qstep4 * Si (* 2^6) +{ + 16, 20, 16, 20, + 20, 25, 20, 25, + 16, 20, 16, 20, + 20, 25, 20, 25 +}, +// QP5 : Qstep5 * Si (* 2^6) +{ + 18, 23, 18, 23, + 23, 29, 23, 29, + 18, 23, 18, 23, + 23, 29, 23, 29 +} +}; + + +void p264_4x4_residual_scale(int16_t* in, int16_t* out, uint32_t Qp) +// validate for several Qp on one value block +{ + // rescaling rules : + // - luma 4x4 residual block -> use Coeff*QP%6_core_table * 2^(floor(QP/6)) + uint32_t shift = Qp/6; + uint16_t* p_Qp_core_table = QP_core_table[Qp%6]; + uint32_t i = 16; + + while(i--) + { + *out++ = (((int32_t)(*in++))*((int32_t)*p_Qp_core_table++))< use Coeff*QP%6_core_table[0] / 2 (Qp<6) + // -> use Coeff*QP%6_core_table[0] * 2^(floor(QP/6)-1) (Qp>=6) + uint32_t shift = Qp/6-1; + uint32_t scale = QP_core_table[Qp%6][0]; + if (Qp < 6) + { + *out++ = (((int32_t)(*in++))*scale)>>1; + *out++ = (((int32_t)(*in++))*scale)>>1; + *out++ = (((int32_t)(*in++))*scale)>>1; + *out++ = (((int32_t)(*in++))*scale)>>1; + } + else + { + *out++ = (((int32_t)(*in++))*scale)< use Coeff*QP%6_core_table[0] * 2^(floor(QP/6)-2) (Qp>=12) + // -> use [Coeff*QP%6_core_table[0] + 2^(1-floor(QP/6)] >> (2-floor(QP/6)) (Qp<12) + uint32_t shift; + int32_t round; + uint32_t scale = QP_core_table[Qp%6][0]; + uint32_t i = 16; + if (Qp < 12) + { + // [QP%6_core_table[0] + 2^(1-floor(QP/6)] >> (2-floor(QP/6)) + shift = 2-Qp/6; + round = 2<<(1-Qp/6); + while(i--) + { + *out++ = (((int32_t)(*in++))*scale + round )>>shift; + } + } + else + { + shift = Qp/6-2; + while(i--) + { + *out++ = (((int32_t)(*in++))*scale)< + +// rescaling functions +void p264_4x4_residual_scale(int16_t* in, int16_t* out, uint32_t Qp); +void p264_2x2_chromaDC_scale(int16_t* in, int16_t* out, uint32_t Qp); +void p264_4x4_lumaDC_scale(int16_t* in, int16_t* out, uint32_t Qp); diff --git a/ARDroneLib/VLIB/P264/p264_codec.c b/ARDroneLib/VLIB/P264/p264_codec.c new file mode 100644 index 0000000..e89a27f --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_codec.c @@ -0,0 +1,683 @@ +#include +#include + +#include "video_p264.h" +#include +#include "p264_codec.h" +#include + +#include +#include +#include +#include + +#include + +#define NB_P_FRAMES 2 +#define P264_DEFAULT_QUANTIZATION 20 + +const p264_codec_t p264_codec = { + p264_encode_blockline, + p264_decode_blockline, + p264_update, + p264_cache, + { 0 } +}; + +void p264_codec_alloc( video_controller_t* controller ) +{ + video_codec_t* video_codec; + + video_codec = (video_codec_t*) vp_os_malloc( sizeof(p264_codec) ); + + vp_os_memcpy(video_codec, &p264_codec, sizeof(p264_codec)); + + controller->video_codec = video_codec; + +} + +void p264_realloc_ref (video_controller_t* controller) +{ + // realloc internal p264 buffers and make last decoded picture as the reference + p264_codec_t* video_codec; + video_codec = (p264_codec_t*)controller->video_codec; + if (controller->width != video_codec->ref_picture.width && controller->height != video_codec->ref_picture.height) + { + // resolution has changed, realloc buffers + video_codec->ref_picture.width = controller->width; + video_codec->ref_picture.height = controller->height; + video_codec->decoded_picture.width = controller->width; + video_codec->decoded_picture.height = controller->height; + + // allocate a YUV 4:2:0 ref frame + video_codec->ref_picture.y_buf = (uint8_t*)vp_os_realloc(video_codec->ref_picture.y_buf,controller->width*controller->height*3/2); + video_codec->decoded_picture.y_buf = (uint8_t*)vp_os_realloc(video_codec->decoded_picture.y_buf,controller->width*controller->height*3/2); + if (video_codec->ref_picture.y_buf == NULL || video_codec->decoded_picture.y_buf == NULL) + { + PRINT("p264 ref realloc failed\n"); + } + + // fill cb/cr fields + video_codec->ref_picture.cb_buf = video_codec->ref_picture.y_buf + video_codec->ref_picture.width*video_codec->ref_picture.height; + video_codec->ref_picture.cr_buf = video_codec->ref_picture.cb_buf + (video_codec->ref_picture.width*video_codec->ref_picture.height)/4; + video_codec->ref_picture.y_line_size = video_codec->ref_picture.width; + video_codec->ref_picture.cb_line_size = video_codec->ref_picture.width>>1; + video_codec->ref_picture.cr_line_size = video_codec->ref_picture.width>>1; + + video_codec->decoded_picture.cb_buf = video_codec->decoded_picture.y_buf + video_codec->decoded_picture.width*video_codec->decoded_picture.height; + video_codec->decoded_picture.cr_buf = video_codec->decoded_picture.cb_buf + (video_codec->decoded_picture.width*video_codec->decoded_picture.height)/4; + video_codec->decoded_picture.y_line_size = video_codec->decoded_picture.width; + video_codec->decoded_picture.cb_line_size = video_codec->decoded_picture.width>>1; + video_codec->decoded_picture.cr_line_size = video_codec->decoded_picture.width>>1; + + } + // swap decoded_picture and ref picture + uint8_t* p_swap; + // swap y + p_swap = video_codec->ref_picture.y_buf; + video_codec->ref_picture.y_buf = video_codec->decoded_picture.y_buf; + video_codec->decoded_picture.y_buf = p_swap; + // swap cb + p_swap = video_codec->ref_picture.cb_buf; + video_codec->ref_picture.cb_buf = video_codec->decoded_picture.cb_buf; + video_codec->decoded_picture.cb_buf = p_swap; + // swap cr + p_swap = video_codec->ref_picture.cr_buf; + video_codec->ref_picture.cr_buf = video_codec->decoded_picture.cr_buf; + video_codec->decoded_picture.cr_buf = p_swap; +} + +void p264_codec_free( video_controller_t* controller ) +{ + p264_codec_t* p264_codec = (p264_codec_t*) controller->video_codec; + + if( p264_codec != NULL ) + { + if (p264_codec->ref_picture.y_buf != NULL) + vp_os_free(p264_codec->ref_picture.y_buf); + if (p264_codec->decoded_picture.y_buf != NULL) + vp_os_free(p264_codec->decoded_picture.y_buf); + vp_os_free( p264_codec ); + controller->video_codec = NULL; + } +} + + +static C_RESULT p264_flush_stream( video_stream_t* out, video_stream_t* in ) +{ + // They are still data in cache + // Always copy a number of bytes that is a times of 4. + // Only for the last copy, we can have exactly the number of bytes left + int32_t offset, size; + uint32_t out_stream_size; + + if( in->length != 32 ) + { + // flush & reset internal stream + video_write_data( in, 0, in->length+1 ); + in->length = 32; + } + + out_stream_size = out->size & ~3; // Round to the highest times of 4 available + + offset = in->index - (in->used >> 2); + size = ( in->used < out_stream_size ) ? in->used : out_stream_size; + + vp_os_memcpy(out->bytes, in->bytes + offset, size); + + out->index = size >> 2; + out->used = size; + + in->used -= size; + + return C_OK; +} + +static C_RESULT p264_load_stream( video_stream_t* out, video_stream_t* in ) +{ + // We cache as many blockline as possible + C_RESULT res; + bool_t found, last_zero, last_zero_temp; + uint8_t *dst, *src; + + int32_t value, nb_bytes; + uint32_t in_index = (in->used >> 2) - 1; + + // -> start looking for last blockline's end + found = FALSE; + + if( in->index == 0 ) // First call, we look for full blocklines + { + last_zero = FALSE; + + while( (in_index > in->index) && !found ) + { + value = in->bytes[in_index]; + + last_zero_temp = (value & 0xFF) == 0; // 0x??????00 + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x????00?? + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x??00???? + found = last_zero_temp & last_zero; + + if( !found ) + { + in_index--; // Handle both the special case where blockline is dword aligned & + // blockline start is still not found + + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x00?????? + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + } + } + } + } + } + } + + in_index++; + + // configure parameters for memcpy + if( !found ) + { + // cache all data + nb_bytes = in->used - in->index * 4; + + res = C_FAIL; + } + else + { + // cache only data containing full blocklines + nb_bytes = (in_index - in->index) * 4; + + res = C_OK; + } + + // Realloc internal stream to have enough space to hold all required data + while( out->used + nb_bytes >= out->size ) + { + out->bytes = vp_os_realloc( out->bytes, out->size + 2048 ); // Add 2KB to internal stream + out->size += 2048; + } + + dst = (uint8_t*)&out->bytes[0]; + dst += out->used; + + src = (uint8_t*)&in->bytes[0]; + src += in->index*4; + + vp_os_memcpy( dst, src, nb_bytes ); + + out->used += nb_bytes; + in->index = in_index; + + VP_OS_ASSERT( out->used <= out->size ); + + return res; +} + +C_RESULT p264_pack_controller( video_controller_t* controller ) +{ + video_stream_t* stream = &controller->in_stream; + p264_codec_t* p264_codec = (p264_codec_t*) controller->video_codec; + p264_picture_layer_t* picture_layer; + p264_gob_layer_t* gob; + + gob = NULL; + picture_layer = &p264_codec->picture_layer; + + video_stuff8( stream ); + + picture_layer->gobs = (p264_gob_layer_t*) controller->gobs; + gob = &picture_layer->gobs[controller->blockline]; + + video_write_data( stream, MAKE_START_CODE(controller->blockline), 22 ); + + if( controller->blockline == 0 ) + { + picture_layer->quant = gob->quant; + p264_write_picture_layer( controller, stream ); + } + else + { + p264_write_gob_layer( stream, gob ); + } + + return C_OK; +} + +C_RESULT p264_unpack_controller( video_controller_t* controller ) +{ + uint32_t start_code = 0; + video_stream_t* stream = &controller->in_stream; + p264_codec_t* p264_codec = (p264_codec_t*) controller->video_codec; + p264_picture_layer_t* picture_layer; + p264_gob_layer_t* gob; + + gob = NULL; + picture_layer = &p264_codec->picture_layer; + + video_align8( stream ); + video_read_data( stream, &start_code, 22 ); + + controller->blockline = start_code & 0x1F; + start_code &= ~0x1F; // TODO Check if compiler use arm instruction bic + + VP_OS_ASSERT( controller->blockline == 0x1F || + controller->num_blockline == 0 || // Check if cache is allocated for current picture + (controller->num_blockline > 0 && controller->blockline < controller->num_blockline) ); + + if( start_code == PICTURE_START_CODE ) + { + if( controller->blockline == 0x1F ) + { + controller->picture_complete = TRUE; + } + else + { + if( controller->blockline == 0 ) + { + // new picture + p264_read_picture_layer( controller, stream ); + p264_realloc_ref(controller); + picture_layer->gobs = (p264_gob_layer_t*) controller->gobs; + gob = &picture_layer->gobs[controller->blockline]; + + gob->quant = picture_layer->quant; + } + else + { + picture_layer->gobs = (p264_gob_layer_t*) controller->gobs; + gob = &picture_layer->gobs[controller->blockline]; + + p264_read_gob_layer( stream, gob ); + } + } + } + + return C_OK; +} + +C_RESULT p264_encode_blockline( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ) +{ + video_codec_t* video_codec; + //int16_t *in = NULL;//, *out = NULL; + int32_t num_macro_blocks = 0; + video_macroblock_t* macroblock = NULL; + video_picture_context_t blockline_ctx; + video_gob_t* gobs; + + video_stream_t* stream = &controller->in_stream; + + if( stream->used*2 >= stream->size ) + { + uint32_t add = 32 - clz(stream->used/controller->blockline); // estimate the log2 size of a blockline in the stream + add = 1<<(add+1); // major and compute addition buffer size + stream->bytes = vp_os_realloc( stream->bytes, stream->size + add ); // Add some byte to internal stream + stream->size += add; + } + + video_codec = controller->video_codec; + controller->picture_complete = picture_complete; + controller->blockline = blockline->blockline; + + blockline_ctx.y_src = blockline->y_buf; + blockline_ctx.cb_src = blockline->cb_buf; + blockline_ctx.cr_src = blockline->cr_buf; + blockline_ctx.y_woffset = blockline->y_line_size; + blockline_ctx.c_woffset = blockline->cb_line_size; + blockline_ctx.y_hoffset = blockline->y_line_size * MCU_HEIGHT; + + gobs = &controller->gobs[controller->blockline]; + gobs->quant = controller->quant; + macroblock = &gobs->macroblocks[0]; + + if (blockline->blockline == 0) + { + if (controller->resolution_changed == TRUE) + { + // resolution changed, reset ip_counter to force I frame encoding + ((p264_codec_t*)video_codec)->ip_counter = 0; + } + if ((((p264_codec_t*)video_codec)->ip_counter%(NB_P_FRAMES+1))==0) + { + video_controller_set_picture_type( controller, VIDEO_PICTURE_INTRA ); + ((p264_codec_t*)(controller->video_codec))->picture_layer.picture_type = VIDEO_PICTURE_INTRA; + } + else + { + video_controller_set_picture_type( controller, VIDEO_PICTURE_INTER ); + ((p264_codec_t*)(controller->video_codec))->picture_layer.picture_type = VIDEO_PICTURE_INTER; + } + ((p264_codec_t*)video_codec)->ip_counter++; + + // it's a new picture, prepare slice + video_p264_prepare_slice (controller,blockline); + } + + p264_pack_controller( controller ); + + num_macro_blocks = controller->mb_blockline; + ///> + + if (blockline->blockline == 0) + // TODO: next line is possible only when full frame is available (i.e. blokline mode not enabled). should not assume that. + video_p264_encode_MB(controller->mb_blockline*controller->num_blockline,macroblock, gobs->quant); + + while (num_macro_blocks) + { + int32_t num_mb_ready = video_p264_get_encoded_MB(num_macro_blocks,macroblock); + if (num_mb_ready>0) + { + num_macro_blocks -= num_mb_ready; + p264_write_mb_layer(controller, stream, macroblock, num_mb_ready ); + macroblock += num_mb_ready; + } + } + ///< + + ///> Packetize Data to output buffer + RTMON_USTART(VIDEO_VLIB_PACKET); + macroblock = &gobs->macroblocks[0]; + + ///> Control Stream size + + if (controller->target_size > 0) + { + // compute i_p_ratio && target_size + uint32_t target_size; + float32_t i_p_ratio; + if (((p264_codec_t*)video_codec)->last_I_size !=0 && ((p264_codec_t*)video_codec)->last_P_size !=0) + i_p_ratio = (float32_t)((p264_codec_t*)video_codec)->last_P_size/(float32_t)((p264_codec_t*)video_codec)->last_I_size; + else + i_p_ratio = 3/5; + + if (controller->picture_type == VIDEO_PICTURE_INTRA) + target_size = (NB_P_FRAMES + 1)*controller->target_size/(1+NB_P_FRAMES*i_p_ratio); + else + target_size = (NB_P_FRAMES + 1)*controller->target_size*i_p_ratio/(1+NB_P_FRAMES*i_p_ratio); + + if ((controller->blockline+1) == controller->num_blockline) + { + // end of picture + if ((target_size > stream->used) && controller->quant > 1) + { + // last frame was too small increase overall quality (i.e. decrease quant) + controller->quant--; + } + else if ((target_size < stream->used) && controller->quant < 51) + { + // last frame was too large decrease overall quality (i.e. increase quant) + controller->quant++; + } + + // update las_x_size infos + if (controller->picture_type == VIDEO_PICTURE_INTRA) + { + ((p264_codec_t*)video_codec)->last_I_size = stream->used; + } + else + { + ((p264_codec_t*)video_codec)->last_P_size = stream->used; + } + } + } + else + controller->quant= P264_DEFAULT_QUANTIZATION; + + RTMON_USTOP(VIDEO_VLIB_PACKET); + ///< + + if( controller->picture_complete ) + { + video_stuff8( stream ); + video_write_data( stream, PICTURE_END_CODE, 22 ); + } + + // Update controller according to user inputs & video statistics + video_controller_update( controller, picture_complete ); + + return C_OK; +} + +#ifndef HAS_P264_DECODE_BLOCKLINE +C_RESULT p264_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ) +{ + p264_codec_t* video_codec; + vp_api_picture_t blockline = { 0 }; + int32_t num_macro_blocks = 0; + video_macroblock_t* macroblock = NULL; + MB_p264_t* p264_mb = NULL; + video_picture_context_t blockline_ctx; + video_picture_context_t blockline_src; + video_gob_t* gobs; + uint32_t x_luma=0,y_luma=0; + uint32_t x_chroma=0,y_chroma=0; + + controller->mode = VIDEO_DECODE; + video_codec = (p264_codec_t*)controller->video_codec; + + blockline = *picture; + blockline.height = MB_HEIGHT_Y; + blockline.complete = 1; + blockline.vision_complete = 0; + + picture->complete = controller->picture_complete; + + blockline_ctx.y_woffset = blockline.y_line_size; + blockline_ctx.c_woffset = blockline.cb_line_size; + blockline_ctx.y_hoffset = blockline.y_line_size * MCU_HEIGHT; + + // At least a complete blockline is found + while( !controller->picture_complete && controller->in_stream.index <= (controller->in_stream.used >> 2) ) + { + p264_unpack_controller( controller ); + // update controller picture type + controller->picture_type = video_codec->picture_layer.picture_type; + + if( !controller->picture_complete ) + { + blockline.blockline = controller->blockline; + + blockline_ctx.y_src = picture->y_buf + blockline.blockline * MB_HEIGHT_Y * picture->y_line_size; + blockline_ctx.cb_src = picture->cb_buf + blockline.blockline * MB_HEIGHT_C * picture->cb_line_size; + blockline_ctx.cr_src = picture->cr_buf + blockline.blockline * MB_HEIGHT_C * picture->cr_line_size; + + picture->blockline = controller->blockline; + num_macro_blocks = controller->mb_blockline; + + gobs = &controller->gobs[controller->blockline]; + // contrairement a UVLC, macroblock pointe dans le cache et non pas dans le cache_mbs + macroblock = gobs->macroblocks; + + if( gobs->quant != controller->quant ) + { + controller->quant = gobs->quant; + video_quantizer_update( controller ); + } + + // compute luma/chroma block (x,y) destination + x_luma = 0; + y_luma = blockline.blockline * MB_HEIGHT_Y; + x_chroma = 0; + y_chroma = blockline.blockline * MB_HEIGHT_C; + + while( num_macro_blocks > 0 ) + { + p264_mb = (MB_p264_t*)macroblock->data; + // entropic decoding + p264_read_mb_layer(controller, &controller->in_stream, controller->gobs, controller->blockline, controller->mb_blockline-num_macro_blocks); + + if (controller->picture_type == VIDEO_PICTURE_INTER) + { + video_p264_decode_inter_luma_MB ( video_codec->ref_picture.y_buf, + video_codec->decoded_picture.y_buf, + x_luma, y_luma, + video_codec->decoded_picture.width, video_codec->decoded_picture.height, + video_codec->decoded_picture.y_line_size, + macroblock->inter_MV, + macroblock->inter_partition_mode, + macroblock->nb_partition, + p264_mb->inter.AC_Y, + gobs->quant); + + video_p264_decode_inter_chroma_MB ( video_codec->ref_picture.cb_buf, + video_codec->decoded_picture.cb_buf, + x_chroma, y_chroma, + video_codec->decoded_picture.width>>1, video_codec->decoded_picture.height>>1, + video_codec->decoded_picture.cb_line_size, + macroblock->inter_MV, + macroblock->inter_partition_mode, + macroblock->nb_partition, + p264_mb->inter.DC_U, + p264_mb->inter.AC_U, + gobs->quant); + + video_p264_decode_inter_chroma_MB ( video_codec->ref_picture.cr_buf, + video_codec->decoded_picture.cr_buf, + x_chroma, y_chroma, + video_codec->decoded_picture.width>>1, video_codec->decoded_picture.height>>1, + video_codec->decoded_picture.cr_line_size, + macroblock->inter_MV, + macroblock->inter_partition_mode, + macroblock->nb_partition, + p264_mb->inter.DC_V, + p264_mb->inter.AC_V, + gobs->quant); + } + else if (macroblock->intra_type == INTRA_4x4) + { + video_p264_decode_intra_luma_4x4_MB (p264_mb->intra_4x4.AC_Y, + video_codec->decoded_picture.y_buf, video_codec->decoded_picture.width, + x_luma, y_luma, video_codec->decoded_picture.y_line_size, + macroblock->intra_4x4_mode, + gobs->quant); + + video_p264_decode_intra_chroma_8x8_MB (p264_mb->intra_4x4.DC_U, + p264_mb->intra_4x4.AC_U, + video_codec->decoded_picture.cb_buf, + x_chroma, y_chroma, video_codec->decoded_picture.cb_line_size, + macroblock->intra_chroma_8x8_mode, + gobs->quant); + + video_p264_decode_intra_chroma_8x8_MB (p264_mb->intra_4x4.DC_V, + p264_mb->intra_4x4.AC_V, + video_codec->decoded_picture.cr_buf, + x_chroma, y_chroma, video_codec->decoded_picture.cr_line_size, + macroblock->intra_chroma_8x8_mode, + gobs->quant); + } + else + { + video_p264_decode_intra_luma_16x16_MB (p264_mb->intra_16x16.DC_Y, + p264_mb->intra_16x16.AC_Y, + video_codec->decoded_picture.y_buf, + x_luma, y_luma, video_codec->decoded_picture.y_line_size, + macroblock->intra_luma_16x16_mode, + gobs->quant); + + video_p264_decode_intra_chroma_8x8_MB (p264_mb->intra_16x16.DC_U, + p264_mb->intra_16x16.AC_U, + video_codec->decoded_picture.cb_buf, + x_chroma, y_chroma, video_codec->decoded_picture.cb_line_size, + macroblock->intra_chroma_8x8_mode, + gobs->quant); + + video_p264_decode_intra_chroma_8x8_MB (p264_mb->intra_16x16.DC_V, + p264_mb->intra_16x16.AC_V, + video_codec->decoded_picture.cr_buf, + x_chroma, y_chroma, video_codec->decoded_picture.cr_line_size, + macroblock->intra_chroma_8x8_mode, + gobs->quant); + } + + // compute next block coordinates + x_luma += MB_HEIGHT_Y; + x_chroma += MB_HEIGHT_C; + macroblock++; + num_macro_blocks --; + } + + // prepare the source picture context + blockline_src.y_woffset = video_codec->decoded_picture.y_line_size; + blockline_src.c_woffset = video_codec->decoded_picture.cb_line_size; + blockline_src.y_hoffset = video_codec->decoded_picture.y_line_size * MCU_HEIGHT; + blockline_src.y_src = video_codec->decoded_picture.y_buf + blockline.blockline * MB_HEIGHT_Y * video_codec->decoded_picture.y_line_size; + blockline_src.cb_src = video_codec->decoded_picture.cb_buf + blockline.blockline * MB_HEIGHT_C * video_codec->decoded_picture.cb_line_size; + blockline_src.cr_src = video_codec->decoded_picture.cr_buf + blockline.blockline * MB_HEIGHT_C * video_codec->decoded_picture.cr_line_size; + // convert src to dest + video_blockline_from_blockline(&blockline_ctx, &blockline_src, controller->mb_blockline, picture->format); + + // Update controller according to video statistics + video_controller_update( controller, controller->picture_complete ); + } + } + + if( controller->picture_complete ) + { + picture->complete = controller->picture_complete; + picture->blockline = 0; + + controller->picture_complete = 0; + controller->in_stream.length = 32; + controller->num_frames++; + + *got_image = TRUE; + } + else + { + controller->in_stream.used = 0; + controller->in_stream.index = 0; + } + + return C_OK; +} +#endif + +C_RESULT p264_update( video_controller_t* controller ) +{ + return C_OK; +} + +C_RESULT p264_cache( video_controller_t* controller, video_stream_t* ex_stream) +{ + C_RESULT res; + + video_stream_t* in_stream = &controller->in_stream; + + switch( controller->mode ) + { + case VIDEO_ENCODE: + res = p264_flush_stream( ex_stream, in_stream ); + break; + + case VIDEO_DECODE: + res = p264_load_stream( in_stream, ex_stream ); + break; + + default: + res = C_FAIL; + break; + } + + return res; +} diff --git a/ARDroneLib/VLIB/P264/p264_codec.h b/ARDroneLib/VLIB/P264/p264_codec.h new file mode 100644 index 0000000..656ea84 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_codec.h @@ -0,0 +1,32 @@ + +#include + +#include +#include "p264_layers.h" + +typedef struct _p264_codec_t { + // Compatibility with video_codec_t structure + encode_blockline_fc encode_blockline; + decode_blockline_fc decode_blockline; + update_fc update; + cache_stream_fc cache_stream; + + // Private data (see video source coding algorithm p.9) + p264_picture_layer_t picture_layer; + vp_api_picture_t ref_picture; // contains the reference picture used to decode inter frames + vp_api_picture_t decoded_picture; // contains the current decoded picture + uint32_t ip_counter; // counter used to switch between P&I frames + uint32_t last_I_size; + uint32_t last_P_size; +} p264_codec_t; + +void p264_codec_alloc( video_controller_t* controller ); +void p264_codec_free( video_controller_t* controller ); + +C_RESULT p264_pack_controller( video_controller_t* controller ); +C_RESULT p264_unpack_controller( video_controller_t* controller ); + +C_RESULT p264_encode_blockline( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ); +C_RESULT p264_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ); +C_RESULT p264_update( video_controller_t* controller ); +C_RESULT p264_cache( video_controller_t* controller, video_stream_t* ex_stream); diff --git a/ARDroneLib/VLIB/P264/p264_common.h b/ARDroneLib/VLIB/P264/p264_common.h new file mode 100644 index 0000000..e6d770d --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_common.h @@ -0,0 +1,97 @@ +#ifndef _P264_COMMON_H_ +#define _P264_COMMON_H_ + +#include + +#define BLOCK_SIZE 4 +#define BLOCK_SIZE2 16 + +// P6 h264 coder out data +// MB data + +typedef struct _MB_intra_16x16_p264_t { +int16_t DC_Y[16]; +int16_t AC_Y[256]; +int16_t DC_U[4]; +int16_t dummy_DC_U[12]; // hardware fake result +int16_t DC_V[4]; +int16_t dummy_DC_V[12]; // hardware fake result +int16_t AC_U[64]; +int16_t AC_V[64]; +} MB_intra_16x16_p264_t; + +typedef struct _MB_intra_4x4_p264_t { + int16_t AC_Y[256]; + int16_t DC_U[4]; + int16_t dummy_DC_U[12]; // hardware fake result + int16_t DC_V[4]; + int16_t dummy_DC_V[12]; // hardware fake result + int16_t AC_U[64]; + int16_t AC_V[64]; +} MB_intra_4x4_p264_t; + +typedef MB_intra_4x4_p264_t MB_inter_p264_t; + +typedef union _MB_intra_p264_t { + MB_intra_16x16_p264_t intra_16x16; + MB_intra_4x4_p264_t intra_4x4; + MB_inter_p264_t inter; +}MB_p264_t; + +// intra types + +typedef enum _intra_type_t +{ + INTRA_4x4, + INTRA_16x16 +} intra_type_t; + +typedef enum _intra_4x4_mode_t +{ + VERTICAL_4x4_MODE=0, + HORIZONTAL_4x4_MODE, + DC_4x4_MODE, + DIAGONAL_DL_4x4_MODE, + DIAGONAL_DR_4x4_MODE, + VERTICAL_RIGHT_4x4_MODE, + HORIZONTAL_DOWN_4x4_MODE, + VERTICAL_LEFT_4x4_MODE, + HORIZONTAL_UP_4x4_MODE +} intra_4x4_mode_t; + +typedef enum _intra_16x16_luma_mode_t +{ + VERTICAL_16x16_LUMA_MODE=0, + HORIZONTAL_16x16_LUMA_MODE, + DC_16x16_LUMA_MODE, + PLANE_16x16_LUMA_MODE +} intra_16x16_luma_mode_t; + +typedef enum _intra_8x8_chroma_mode_t +{ + DC_8x8_CHROMA_MODE=0, + HORIZONTAL_8x8_CHROMA_MODE, + VERTICAL_8x8_CHROMA_MODE, + PLANE_8x8_CHROMA_MODE +} intra_8x8_chroma_mode_t; + +// inter types +#define NB_PARTITION 7 +typedef enum _inter_partition_mode_t +{ + INTER_PART_16x16 = 0, + INTER_PART_16x8 = 1, + INTER_PART_8x16 = 2, + INTER_PART_8x8 = 3, + INTER_PART_8x4 = 4, + INTER_PART_4x8 = 5, + INTER_PART_4x4 = 6 +} inter_partition_mode_t; + +// motion vector +typedef struct _MV_XY_t { + int8_t x; + int8_t y; +} MV_XY_t; + +#endif diff --git a/ARDroneLib/VLIB/P264/p264_gob_layer.c b/ARDroneLib/VLIB/P264/p264_gob_layer.c new file mode 100644 index 0000000..637ca63 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_gob_layer.c @@ -0,0 +1,21 @@ +#include +#include + +#include "p264_codec.h" +#include "p264_layers.h" + +C_RESULT p264_write_gob_layer( video_stream_t* stream, p264_gob_layer_t* gob ) +{ + video_write_data( stream, gob->quant, 6 ); + + return C_OK; +} + +C_RESULT p264_read_gob_layer( video_stream_t* stream, p264_gob_layer_t* gob ) +{ + gob->quant = 0; + + video_read_data( stream, &gob->quant, 6 ); + + return C_OK; +} diff --git a/ARDroneLib/VLIB/P264/p264_inter_mc.c b/ARDroneLib/VLIB/P264/p264_inter_mc.c new file mode 100644 index 0000000..1f58868 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_inter_mc.c @@ -0,0 +1,242 @@ +#include +#include +#include +// partition dimension +typedef struct _part_dim_t { + uint32_t x; + uint32_t y; +} part_dim_t; + +// LUT table to retrieve partition dimension. part_dim[inter_partition_mode_t] +static part_dim_t part_dim[NB_PARTITION] = +{ + {16,16},{16,8},{8,16},{8,8},{8,4},{4,8},{4,4} +}; + +// return pixel(i,j) from picture. if (i,j) is out of the image, boundary pixel are returned. +static uint8_t get_pixel(int32_t x, int32_t y, uint8_t* picture, uint32_t linesize, uint32_t picture_width, uint32_t picture_height) +{ + if (x<0 && y<0) + { + // return top left reference pixel + return *picture; + } + else if (x>=(int32_t)picture_width && y>=(int32_t)picture_height) + { + // return bottom right pixel + return *(picture + picture_height*linesize - 1); + } + else if (x>=(int32_t)picture_width && y<0) + { + // return top right ref pixel + return *(picture + picture_width - 1); + } + else if (x<0 && y>=(int32_t)picture_height) + { + // return bottom left ref pixel + return *(picture + (picture_height-1)*linesize ); + } + else if (x<0) + { + // return first column pixel + return *(picture+y*linesize); + } + else if (y<0) + { + // return first line pixel + return *(picture+x); + } + else if (x>=(int32_t)picture_width) + { + // return last column pixel + return *(picture + y*linesize + picture_width - 1); + } + else if (y>=(int32_t)picture_height) + { + // return last line pixel + return *(picture + (picture_height-1)*linesize + x); + } + else + { + //return ref pixel + return *(picture + y*linesize + x); + } +} + +// ________________ ________________ +// | ref_picture | picture being decoding +// | _________ | +// | | refblock| | +// | |_________| ===> | +// | | | _________ +// | | (mv) | | refblock| [Motion compensation] +// | V | |_________| +// |________________ |________________ + + +// move a block from picture_ref to picture at position (x,y). +void p264_inter_mc_luma (inter_partition_mode_t partition, MV_XY_t mv,uint8_t *picture_ref , uint8_t *picture, uint32_t x, uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize) +{ + // partition : partition mode of the block to be moved (16x16, 16x8, 8x16, ...) + // mv : motion vector (in half pixel unit) + // picture_ref : picture reference + // picture : the dest picture to be motion compensated. + // x, y : coordinates of the destination block + // picture_width, picture_height : picture dimensions + // linesize : pixel line length inside picture. (it is assumed that picture and picture_ref have the same resolution/format) + // Note : this function supports only integer MV on luma component + + uint8_t *picture_ref_start = picture_ref; + uint8_t *picture_start = picture; + //uint8_t temp_pixel; + // compute coordinates of ref_block + int32_t x_ref,y_ref; + int32_t block_dim_x,block_dim_y; + + x_ref = ((int32_t)x)+mv.x; + y_ref = ((int32_t)y)+mv.y; + + // retrieve block dimensions + block_dim_x = part_dim[partition].x; + block_dim_y = part_dim[partition].y; + + // jump to destination position in picture + picture = picture_start + y*linesize + x; + // jump to source position in picture_ref + picture_ref = picture_ref_start + y_ref*linesize + x_ref; + + if ( x_ref > 0 && + (x_ref+block_dim_x) <= (int32_t)picture_width && + y_ref > 0 && + (y_ref+block_dim_y) <= (int32_t)picture_height) + { + // ref block is not out of boundary + // make a simple copy on the luma sample + while (block_dim_y--) + { + // copy line + vp_os_memcpy(picture,picture_ref,block_dim_x); + // jump to next line + picture_ref += linesize; + picture += linesize; + } + } + else + { + // ref block is out of boundary + // ref picture boundary pixel are extended when necessary + int32_t i,j; + for (j=y_ref;j<(block_dim_y+y_ref);j++) + { + for (i=x_ref;i<(block_dim_x+x_ref);i++) + { + *picture++ = get_pixel(i,j,picture_ref_start,linesize,picture_width,picture_height); + } + picture += linesize - block_dim_x; + } + } +} + + +// chroma interpollation +// +// A - - - - - - - B +// - | +// - (dy) +// - | +// - <-dx-> a <-(8-dx)-> +// - | +// - (8-dy) +// - | +// C - - - - - - - D +// +// a = round([(8-dx)(8-dy)A + dx(8-dy)B + (8-dx)dyC + dxdyD]/64) +// if a is an half pel the formula is :// +// A a B +// b c +// C D +// +// a = round[(A+B)>>1] +// b = round[(A+C)>>1] +// c = round[(A+B+C+D)>>2] + +void p264_inter_mc_chroma (inter_partition_mode_t partition, MV_XY_t mv,uint8_t *picture_ref , uint8_t *picture, uint32_t x, uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize) +{ + // partition : partition mode of the block to be moved (16x16, 16x8, 8x16, ...) + // mv : motion vector (in 1/2 pixel) + // picture_ref : picture reference + // picture : the dest picture to be motion compensated. + // x,y : coordinates of the destination block + // linesize : pixel line length inside picture. (it is assumed that picture and picture_ref have the same resolution/format + // Note : this function supports only half pixel MV on chroma + + //uint8_t *picture_start = picture; + + // compute integer coordinates of ref_block + int32_t x_ref,y_ref; + bool_t x_half_pel,y_half_pel; + uint32_t scale=0; + int32_t block_dim_x,block_dim_y; + + if (mv.x > 0) + x_ref = ((int32_t)x)+mv.x/2; + else + x_ref = ((int32_t)x)+(mv.x-1)/2; + + if ((mv.x&0x01) == 0) + x_half_pel = FALSE; + else + { + scale++; + x_half_pel = TRUE; + } + + if (mv.y > 0) + y_ref = ((int32_t)y)+mv.y/2; + else + y_ref = ((int32_t)y)+(mv.y-1)/2; + + if ((mv.y&0x01) == 0) + y_half_pel = FALSE; + else + { + y_half_pel = TRUE; + scale++; + } + + // jump to destination position in picture + picture += y*linesize + x; + + // retrieve block dimensions + block_dim_x = part_dim[partition].x>>1; + block_dim_y = part_dim[partition].y>>1; + + // interpolate chroma from picture_ref to picture + int32_t i,j; + uint32_t pel; + for (j=y_ref;j<(block_dim_y+y_ref);j++) + { + for (i=x_ref;i<(block_dim_x+x_ref);i++) + { + // add pixel A + pel = get_pixel(i,j,picture_ref,linesize,picture_width,picture_height); + //pel = *picture_ref; + // add pixel B + if (x_half_pel == TRUE) + //pel += *(picture_ref+1); + pel += get_pixel(i+1,j,picture_ref,linesize,picture_width,picture_height); + // add pixel C + if (y_half_pel == TRUE) + //pel += *(picture_ref+linesize); + pel += get_pixel(i,j+1,picture_ref,linesize,picture_width,picture_height); + // add pixel D + if (y_half_pel == TRUE && x_half_pel == TRUE) + //pel += *(picture_ref+linesize+1); + pel += get_pixel(i+1,j+1,picture_ref,linesize,picture_width,picture_height); + + // scale pel and set picture pixel + *picture++ = pel>>scale; + } + picture += linesize - block_dim_x; + } +} diff --git a/ARDroneLib/VLIB/P264/p264_inter_mc.h b/ARDroneLib/VLIB/P264/p264_inter_mc.h new file mode 100644 index 0000000..e44616f --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_inter_mc.h @@ -0,0 +1,8 @@ +#include +#include "p264_common.h" + +void p264_inter_mc_luma (inter_partition_mode_t partition, MV_XY_t mv,uint8_t *picture_ref , uint8_t *picture, uint32_t x, uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize); +void p264_inter_mc_chroma (inter_partition_mode_t partition, MV_XY_t mv,uint8_t *picture_ref , uint8_t *picture, uint32_t x, uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize); + +void video_p264_decode_inter_chroma_MB (uint8_t * ref_picture, uint8_t* picture_out, uint32_t x,uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize, MV_XY_t* mv , inter_partition_mode_t * part, uint32_t nb_part, int16_t* DC, int16_t* AC, uint32_t qp); + diff --git a/ARDroneLib/VLIB/P264/p264_intra_pred.c b/ARDroneLib/VLIB/P264/p264_intra_pred.c new file mode 100644 index 0000000..baed5c3 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_intra_pred.c @@ -0,0 +1,1128 @@ +#include +#include +#include + +C_RESULT p264_intra_4x4_luma (intra_4x4_mode_t mode, uint8_t *picture, uint32_t picture_width, uint32_t x, uint32_t y, uint32_t linesize) +// all mode partially validated (not all availability cases for each mode) +{ +// A-M are the boundary pixels of the 4x4 block a-p +// +// M A B C D E F G H +// I a b c d +// J e f g h +// K i j k l +// L m n o p +// +// a-p = Pixel(x,y) + C_RESULT res = C_OK; + uint32_t A,B,C,D,E,F,G,H,I,J,K,L,M; + uint32_t IJKL; + uint32_t i; + uint32_t availability_flag=0; + uint8_t * picture_start; + + // determine block availability + if (x==0) + { + // block 4x4 is located in the first column of the frame, A pixels are not available + availability_flag |= A_UNAVAILABLE; + } + if (y==0) + { + // block 4x4 is located in the first row of the frame, B and C pixels are not available + availability_flag |= B_UNAVAILABLE | C_UNAVAILABLE; + } + if (x==picture_width-4) + { + // block 4x4 is located in the last column of the frame, C pixels are not available + availability_flag |= C_UNAVAILABLE; + } + if ((((x>>2)&0x01) == 1) && (((y>>2)&0x01) == 1)) + { + // block 4x4 is located at the 'x' position in the following MB representation: + // - - - - + // - x - x + // - - - - + // - x - x + // therefore C is not available. + availability_flag |= C_UNAVAILABLE; + } + else if ((((x>>2)&0x03) == 3) && (((y>>2)&0x03) == 2)) + { + // block 4x4 is located at the 'x' position in the following MB representation: + // - - - - + // - - - - + // - - - x + // - - - - + // therefore C is not available. + availability_flag |= C_UNAVAILABLE; + } + + // check availability and mode + switch (mode) + { + case VERTICAL_4x4_MODE : + case DIAGONAL_DL_4x4_MODE : + case VERTICAL_LEFT_4x4_MODE : + if (availability_flag & B_UNAVAILABLE) + { + PRINT("%s : could no compute intra 4x4 mode_%d prediction on (%d,%d), B unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + case HORIZONTAL_4x4_MODE : + case HORIZONTAL_UP_4x4_MODE : + if (availability_flag & A_UNAVAILABLE) + { + PRINT("%s : could no compute intra 4x4 mode_%d prediction on (%d,%d) A unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + case DC_4x4_MODE : + // no restriction + break; + + case DIAGONAL_DR_4x4_MODE : + case VERTICAL_RIGHT_4x4_MODE : + case HORIZONTAL_DOWN_4x4_MODE : + if (availability_flag & A_UNAVAILABLE) + { + PRINT("%s : could no compute intra 4x4 mode_%d prediction on (%d,%d) A unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + if (availability_flag & B_UNAVAILABLE) + { + PRINT("%s : could no compute intra 4x4 mode_%d prediction on (%d,%d) B unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + default : + PRINT ("%s : mode_%d at block (%d,%d) is not a valid intra 4x4 prediction mode\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + + if (SUCCEED(res)) + { + // make prediction + switch (mode) + { + case VERTICAL_4x4_MODE : + // jump to pixel A + picture += (linesize*(y-1)+x); + // load A-D pixel values + A = *picture++; + B = *picture++; + C = *picture++; + D = *picture++; + // extend ABCD line + for (i=0;i<4;i++) + { + // jump to next line + picture += (linesize-4); + // extend + *picture++ = A; + *picture++ = B; + *picture++ = C; + *picture++ = D; + } + break; + + case HORIZONTAL_4x4_MODE : + // jump to pixel I + picture += (linesize*y+x-1); + for (i=0; i<4; i++) + { + // extend I-L pixels to a-d,e-h,i-l,m-p; + IJKL = *picture++; + *picture++ = IJKL; + *picture++ = IJKL; + *picture++ = IJKL; + *picture = IJKL; + // jump to next row (pixel J,K,L) + picture += (linesize-4); + } + break; + + case DC_4x4_MODE : + picture_start = picture; + uint32_t mean=0; + // compute mean over A-D and I-L pixels if available + if (!(availability_flag & B_UNAVAILABLE)) + { + //jump to pixel A + picture += (linesize*(y-1)+x); + // sum pixel A-D + mean += *picture++; + mean += *picture++; + mean += *picture++; + mean += *picture; + } + if (!(availability_flag & A_UNAVAILABLE)) + { + picture = picture_start; + //jump to pixel I + picture += (linesize*y+x-1); + for (i=0;i<4;i++) + { + mean += *picture; + //jump to next pixel + picture += linesize; + } + } + + if (!(availability_flag & A_UNAVAILABLE) && !(availability_flag & B_UNAVAILABLE)) + mean = (mean+4)>>3; + else if (!(availability_flag & A_UNAVAILABLE) || !(availability_flag & B_UNAVAILABLE)) + mean = (mean+2)>>2; + else + mean=128; + + // jump to pixel a and make prediction + picture = picture_start+linesize*y+x; + for (i=0;i<4;i++) + { + *picture++ = mean; + *picture++ = mean; + *picture++ = mean; + *picture++ = mean; + // jump to next line + picture = picture+linesize-4; + } + break; + + case DIAGONAL_DL_4x4_MODE : + picture_start = picture; + // jump to pixel A + picture += (linesize*(y-1)+x); + // load A-D pixel values + A = *picture++; + B = *picture++; + C = *picture++; + D = *picture++; + // check block C availability + if (availability_flag & C_UNAVAILABLE) + { + // E,F,G,H not available, copy D value + E = F = G = H = D; + } + else + { + // load E-H pixel values + E = *picture++; + F = *picture++; + G = *picture++; + H = *picture++; + } + + // jump to pixel a + picture = picture_start + linesize*y+x; + + // make prediction + *picture++ = (A + C + 2*(B) + 2) >> 2; // a + *picture++ = (B + D + 2*(C) + 2) >> 2; // b + *picture++ = (C + E + 2*(D) + 2) >> 2; // c + *picture = (D + F + 2*(E) + 2) >> 2; // d + picture += linesize-3; + *picture++ = (B + D + 2*(C) + 2) >> 2; // e + *picture++ = (C + E + 2*(D) + 2) >> 2; // f + *picture++ = (D + F + 2*(E) + 2) >> 2; // g + *picture = (E + G + 2*(F) + 2) >> 2; // h + picture += linesize-3; + *picture++ = (C + E + 2*(D) + 2) >> 2; // i + *picture++ = (D + F + 2*(E) + 2) >> 2; // j + *picture++ = (E + G + 2*(F) + 2) >> 2; // k + *picture = (F + H + 2*(G) + 2) >> 2; // l + picture += linesize-3; + *picture++ = (D + F + 2*(E) + 2) >> 2; // m + *picture++ = (E + G + 2*(F) + 2) >> 2; // n + *picture++ = (F + H + 2*(G) + 2) >> 2; // o + *picture = (G + 3*(H) + 2) >> 2; // p + break; + + case DIAGONAL_DR_4x4_MODE : + picture_start = picture; + // jump to pixel M + picture += (linesize*(y-1)+x-1); + // load M-D pixel values + M = *picture++; + A = *picture++; + B = *picture++; + C = *picture++; + D = *picture; + // jump to pixel I & load it + picture += linesize-4; + I = *picture; + // jump to pixel J & load it + picture += linesize; + J = *picture; + // jump to pixel K & load it + picture += linesize; + K = *picture; + // jump to pixel L & load it + picture += linesize; + L = *picture; + // jump to pixel a + picture = picture_start + linesize*y+x; + // make prediction + *picture++ = (I + 2*M + A + 2) >> 2; // a + *picture++ = (M + 2*A + B + 2) >> 2; // b + *picture++ = (A + 2*B + C + 2) >> 2; // c + *picture = (B + 2*C + D + 2) >> 2; // d + picture += linesize-3; + *picture++ = (J + 2*I + M + 2) >> 2; // e + *picture++ = (I + 2*M + A + 2) >> 2; // f + *picture++ = (M + 2*A + B + 2) >> 2; // g + *picture = (A + 2*B + C + 2) >> 2; // h + picture += linesize-3; + *picture++ = (K + 2*J + I + 2) >> 2; // i + *picture++ = (J + 2*I + M + 2) >> 2; // j + *picture++ = (I + 2*M + A + 2) >> 2; // k + *picture = (M + 2*A + B + 2) >> 2; // l + picture += linesize-3; + *picture++ = (L + 2*K + J + 2) >> 2; // m + *picture++ = (K + 2*J + I + 2) >> 2; // n + *picture++ = (J + 2*I + M + 2) >> 2; // o + *picture = (I + 2*M + A + 2) >> 2; // p + break; + + case VERTICAL_RIGHT_4x4_MODE : + picture_start = picture; + // jump to pixel M + picture += (linesize*(y-1)+x-1); + // load M-D pixel values + M = *picture++; + A = *picture++; + B = *picture++; + C = *picture++; + D = *picture; + // jump to pixel I & load it + picture += linesize-4; + I = *picture; + // jump to pixel J & load it + picture += linesize; + J = *picture; + // jump to pixel K & load it + picture += linesize; + K = *picture; + // jump to pixel L & load it + picture += linesize; + L = *picture; + // jump to pixel a + picture = picture_start + linesize*y+x; + // make prediction + *picture++ = (M + A + 1) >> 1; // a + *picture++ = (A + B + 1) >> 1; // b + *picture++ = (B + C + 1) >> 1; // c + *picture = (C + D + 1) >> 1; // d + picture += linesize-3; + *picture++ = (I + 2*M + A + 2) >> 2; // e + *picture++ = (M + 2*A + B + 2) >> 2; // f + *picture++ = (A + 2*B + C + 2) >> 2; // g + *picture = (B + 2*C + D + 2) >> 2; // h + picture += linesize-3; + *picture++ = (M + 2*I + J + 2) >> 2; // i + *picture++ = (M + A + 1) >> 1; // j + *picture++ = (A + B + 1) >> 1; // k + *picture = (B + C + 1) >> 1; // l + picture += linesize-3; + *picture++ = (I + 2*J + K + 2) >> 2; // m + *picture++ = (I + 2*M + A + 2) >> 2; // n + *picture++ = (M + 2*A + B + 2) >> 2; // o + *picture = (A + 2*B + C + 2) >> 2; // p + break; + + case HORIZONTAL_DOWN_4x4_MODE : + picture_start = picture; + // jump to pixel M + picture += (linesize*(y-1)+x-1); + // load M-D pixel values + M = *picture++; + A = *picture++; + B = *picture++; + C = *picture++; + D = *picture; + // jump to pixel I & load it + picture += linesize-4; + I = *picture; + // jump to pixel J & load it + picture += linesize; + J = *picture; + // jump to pixel K & load it + picture += linesize; + K = *picture; + // jump to pixel L & load it + picture += linesize; + L = *picture; + // jump to pixel a + picture = picture_start + linesize*y+x; + // make prediction + *picture++ = (M + I + 1) >> 1; // a + *picture++ = (I + 2*M + A + 2) >> 2; // b + *picture++ = (M + 2*A + B + 2) >> 2; // c + *picture = (A + 2*B + C + 2) >> 2; // d + picture += linesize-3; + *picture++ = (I + J + 1) >> 1; // e + *picture++ = (M + 2*I + J + 2) >> 2; // f + *picture++ = (M + I + 1) >> 1; // g + *picture = (I + 2*M + A + 2) >> 2; // h + picture += linesize-3; + *picture++ = (J + K + 1) >> 1; // i + *picture++ = (I + 2*J + K + 2) >> 2; // j + *picture++ = (I + J + 1) >> 1; // k + *picture = (M + 2*I + J + 2) >> 2; // l + picture += linesize-3; + *picture++ = (K + L + 1) >> 1; // m + *picture++ = (J + 2*K + L + 2) >> 2; // n + *picture++ = (J + K + 1) >> 1; // o + *picture = (I + 2*J + K + 2) >> 2; // p + + break; + + case VERTICAL_LEFT_4x4_MODE : + picture_start = picture; + // jump to pixel A + picture += (linesize*(y-1)+x); + // load A-D pixel values + A = *picture++; + B = *picture++; + C = *picture++; + D = *picture++; + // check block C availability + if (availability_flag & C_UNAVAILABLE) + { + // E,F,G,H not available, copy D value + E = F = G = H = D; + } + else + { + // load E-H pixel values + E = *picture++; + F = *picture++; + G = *picture++; + H = *picture; + } + // jump to pixel a + picture = picture_start + linesize*y+x; + // make prediction + *picture++ = (A + B + 1) >> 1; // a + *picture++ = (B + C + 1) >> 1; // b + *picture++ = (C + D + 1) >> 1; // c + *picture = (D + E + 1) >> 1; // d + picture += linesize-3; + *picture++ = (A + 2*B + C + 2) >> 2; // e + *picture++ = (B + 2*C + D + 2) >> 2; // f + *picture++ = (C + 2*D + E + 2) >> 2; // g + *picture = (D + 2*E + F + 2) >> 2; // h + picture += linesize-3; + *picture++ = (B + C + 1) >> 1; // i + *picture++ = (C + D + 1) >> 1; // j + *picture++ = (D + E + 1) >> 1; // k + *picture = (E + F + 1) >> 1; // l + picture += linesize-3; + *picture++ = (B + 2*C + D + 2) >> 2; // m + *picture++ = (C + 2*D + E + 2) >> 2; // n + *picture++ = (D + 2*E + F + 2) >> 2; // o + *picture = (E + 2*F + G + 2) >> 2; // p + break; + + case HORIZONTAL_UP_4x4_MODE : + picture_start = picture; + // jump to pixel I & load it + picture += (linesize*y+x-1); + I = *picture; + // jump to pixel J & load it + picture += linesize; + J = *picture; + // jump to pixel K & load it + picture += linesize; + K = *picture; + // jump to pixel L & load it + picture += linesize; + L = *picture; + // jump to pixel a + picture = picture_start + linesize*y+x; + // make prediction + *picture++ = (I + J + 1) >> 1; // a + *picture++ = (I + 2*J + K + 2) >> 2; // b + *picture++ = (J + K + 1) >> 1; // c + *picture = (J + 2*K + L + 2) >> 2; // d + picture += linesize-3; + *picture++ = (J + K + 1) >> 1; // e + *picture++ = (J + 2*K + L + 2) >> 2; // f + *picture++ = (K + L + 1) >> 1; // g + *picture = (K + 2*L + L + 2) >> 2; // h + picture += linesize-3; + *picture++ = (K + L + 1) >> 1; // i + *picture++ = (K + 2*L + L + 2) >> 2; // j + *picture++ = L; // k + *picture = L; // l + picture += linesize-3; + *picture++ = L; // m + *picture++ = L; // n + *picture++ = L; // o + *picture = L; // p + break; + + default : + PRINT ("%s : mode_%d at block (%d,%d) is not a valid intra 4x4 prediction mode\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + } + return res; +} + +C_RESULT p264_intra_16x16_luma (intra_16x16_luma_mode_t mode, uint8_t *picture, uint32_t x, uint32_t y, uint32_t linesize) +// Hori,Verti, Plane mode validated, DC missing +{ +// Ai-Bi-M are the boundary pixels of the 16x16 block p(,) +// +// M B0 B1 ... B15 +// A0 p(0,0) p(0,1) p(0,15) +// A1 p(1,0) +// +// ... ... +// +// A15 p(15,0) p(15,15) +// + + C_RESULT res = C_OK; + uint32_t availability_flag=0; + uint8_t * picture_start; + uint32_t i,j; + + // determine block availability + if (x==0) + { + // block 16x16 is located in the first column of the frame, A pixels are not available + availability_flag |= A_UNAVAILABLE; + } + if (y==0) + { + // block 16x16 is located in the first row of the frame, B pixels are not available + availability_flag |= B_UNAVAILABLE; + } + + // check availability and mode + switch (mode) + { + case VERTICAL_16x16_LUMA_MODE : + if (availability_flag & B_UNAVAILABLE) + { + PRINT("%s : could no compute intra 16x16 mode_%d prediction on (%d,%d), B unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + case HORIZONTAL_16x16_LUMA_MODE : + if (availability_flag & A_UNAVAILABLE) + { + PRINT("%s : could no compute intra 16x16 mode_%d prediction on (%d,%d) A unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + case DC_16x16_LUMA_MODE : + // no restriction + break; + + case PLANE_16x16_LUMA_MODE : + if (availability_flag & A_UNAVAILABLE) + { + PRINT("%s : could no compute intra 16x16 mode_%d prediction on (%d,%d) A unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + if (availability_flag & B_UNAVAILABLE) + { + PRINT("%s : could no compute intra 16x16 mode_%d prediction on (%d,%d) B unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + default : + PRINT ("%s : mode_%d is not a valid intra 16x16 prediction mode\n",__FUNCTION__,mode); + res = C_FAIL; + } + + if (SUCCEED(res)) + { + // make prediction + switch (mode) + { + case DC_16x16_LUMA_MODE : + { + picture_start = picture; + uint32_t mean=0; + // compute mean over Ai and Bi pixels if available + if (!(availability_flag & B_UNAVAILABLE)) + { + //jump to pixel B0 + picture += (linesize*(y-1)+x); + // sum pixel Bi + i=16; + while(i--) + { + mean += *picture++; + } + } + + if (!(availability_flag & A_UNAVAILABLE)) + { + picture = picture_start; + //jump to pixel A0 + picture += (linesize*y+x-1); + // sum pixel Ai + i=16; + while(i--) + { + mean += *picture; + picture += linesize; + } + } + + if (!(availability_flag & A_UNAVAILABLE) && !(availability_flag & B_UNAVAILABLE)) + mean = (mean+16)>>5; + else if (!(availability_flag & A_UNAVAILABLE) || !(availability_flag & B_UNAVAILABLE)) + mean = (mean+8)>>4; + else + mean=128; + + // jump to pixel p(0,0) and make prediction + picture = picture_start+linesize*y+x; + j=16; + while(j--) + { + i=16; + while(i--) + { + *picture++ = mean; + } + picture += (linesize-16); + } + } + break; + + case HORIZONTAL_16x16_LUMA_MODE : + { + //jump to pixel A0 + picture += (linesize*y+x-1); + // extend pixel Ai horizontally + uint8_t pixel_buf; + j=16; + while(j--) + { + // load Ai + pixel_buf = *picture++; + // extend Ai + i=16; + while(i--) + { + *picture++ = pixel_buf; + } + // jump to Ai+1 + picture += (linesize-17); + } + } + break; + + case VERTICAL_16x16_LUMA_MODE : + { + // jump to pixel B0 + picture += (linesize*(y-1)+x); + uint8_t line_buf[16]; + // load Bi line + vp_os_memcpy(line_buf,picture,16*sizeof(uint8_t)); + // extend Bi line vertically + i=16; + while(i--) + { + // jump to next line + picture += linesize; + // copy line + vp_os_memcpy(picture,line_buf,16*sizeof(uint8_t)); + } + } + break; + + case PLANE_16x16_LUMA_MODE : + { + int32_t A15,B15; + picture_start = picture; + // compute H : + // H' = 1* (B8 - B6) + + // 2* (B9 - B5) + + // 3*(B10 - B4) + + // 4*(B11 - B3) + + // 5*(B12 - B2) + + // 6*(B13 - B1) + + // 7*(B14 - B0) + + // 8*(B15 - M) + // H = (5*H' + 32) / 64 + // jump to M + picture += (linesize*(y-1)+x-1); + int32_t H=0; + for (i=8;i>=1;i--) + { + H -= i*(*picture++); + } + for (i=1;i<=8;i++) + { + H += i*(*++picture); + } + B15 = *(picture); + H = (5*H + 32)>>6; + + // compute V : + // V' = 1* (A8 - A6) + + // 2* (A9 - A5) + + // 3*(A10 - A4) + + // 4*(A11 - A3) + + // 5*(A12 - A2) + + // 6*(A13 - A1) + + // 7*(A14 - A0) + + // 8*(A15 - M) + // V = (5*V' + 32) / 64 + int32_t V=0; + // jump to M + picture = picture_start + (linesize*(y-1)+x-1); + for (i=8;i>=1;i--) + { + V -= i*(*picture); + picture += linesize; + } + for (i=1;i<=8;i++) + { + picture += linesize; + V += i*(*picture); + } + A15 = *(picture); + V = (5*V + 32)>>6; + + // fill pixel p(i,j) of the 16x16 block with the following rule : + // a = 16 * (A15 + B15 + 1) - 7*(V+H) + // b(i,j) = a + V * j + H * i + // p(i,j) = SATURATE_U8(b(i,j) / 32) + // SATURATE_U8() function indicates that the result of the operation should be bounded to an unsigned 8-bit range (0..255) + + int32_t a = ((A15 + B15 + 1)<<4) - 7*(V+H); + + // jump to p(0,0) + picture = picture_start + (linesize*y+x); + // make prediction + int32_t pixel_buf; + for (j=0;j<16;j++) + { + for (i=0;i<16;i++) + { + pixel_buf = (a + V*j + H*i)>>5; + // saturation + if (pixel_buf > 0xFF) + pixel_buf = 0xFF; + else if (pixel_buf < 0) + pixel_buf = 0; + *picture++ = pixel_buf; + } + // jump to next line + picture += linesize - 16; + } + } + break; + + default : + PRINT ("%s : mode_%d is not a valid intra 16x16 prediction mode\n",__FUNCTION__,mode); + res = C_FAIL; + } + } + return res; +} + + +// DC_8x8_CHROMA_MODE is slightly different from DC_16x16_LUMA_MODE +// each 8x8 block is divided into 4 blocks +// ------------------- +// | all | single1 | +// --------- --------- +// | single2 | all | +// ------------------- +// +// In "all" block, adjacent 4x4 blocks A and B are used to compute the DC value as in DC_16x16_LUMA_MODE. +// If B is not available, A is used instead of B. +// If A is not available, B is used instead of A. +// If neither A nor B are available, DC is set to 128. +// In "single1" priority is given to B block to compute the DC value. If B is not available, A is used instead of B. +// If neither A nor B are available, DC is set to 128. +// In "single2" priority is given to A block to compute the DC value. If A is not available, B is used instead of A. +// If neither A nor B are available, DC is set to 128. +// +// Next scheme summarize the block used to compute the DC value in raster scan ordered image : +// B blocks +// A ----------------- +// | x x | A A | +// b | x x | A A | +// l -------- -------- ... +// o | B B | AB B | +// c | B B | A AB | +// k -------- -------- +// s ... + +static uint8_t chroma_DC_all(uint8_t *picture, uint32_t x, uint32_t y, uint32_t linesize) +{ + // this function assumes that (x,y) corresponds to a "all" DC block 4x4 + uint32_t mean=0; + uint8_t *picture_start = picture; + if (x<=4 && y<=4) + { + // top left 8x8 chroma block, A&B are not available + mean = 128; + } + else + { + if (y>4) + { + // 8x8 chroma block is not located in the first row + // sum B + picture = picture_start + linesize*((y&0xFFF8)-1) + x; + mean += *picture++; + mean += *picture++; + mean += *picture++; + mean += *picture; + } + if (x>4) + { + // 8x8 chroma block is not located in the first column + // sum A + picture = picture_start + linesize*y + (x&0xFFF8)-1; + mean += *picture; + picture += linesize; + mean += *picture; + picture += linesize; + mean += *picture; + picture += linesize; + mean += *picture; + } + if (x<=4 || y<=4) + { + // only one adjacent block (A or B) is used to compute DC value + mean = mean>>2; + } + else + { + // both A and B blocks are used to compute DC value + mean = mean>>3; + } + } + return mean; +} + +static uint8_t chroma_DC_single(uint8_t *picture, uint32_t x, uint32_t y, uint32_t linesize) +{ + // this function assumes that (x,y) corresponds to a "single" DC block 4x4 + uint32_t mean=0; + if (x<=4 && y<=4) + { + // top left 8x8 chroma block, A&B are not available + mean = 128; + } + else + { + if ((x<=4) || ((y>4) && ((y&0x07) == 0))) + { + // block 4x4 is located either on the first chroma 8x8 column or at the top right of a 8x8 chroma + // sum B + picture += linesize*((y&0xFFF8)-1) + x; + mean += *picture++; + mean += *picture++; + mean += *picture++; + mean += *picture; + mean = mean>>2; + } + else + { + // sum A + picture += linesize*y + (x&0xFFF8) - 1; + mean += *picture; + picture += linesize; + mean += *picture; + picture += linesize; + mean += *picture; + picture += linesize; + mean += *picture; + mean = mean>>2; + } + } + return mean; +} + +static void fill_4x4_DC(uint8_t* picture, uint32_t x, uint32_t y, uint32_t linesize, uint8_t value) +{ + picture += linesize*y+x; + uint32_t i; + for (i=0;i<4;i++) + { + *picture++ = value; + *picture++ = value; + *picture++ = value; + *picture++ = value; + // jump to next line + picture += linesize-4; + } +} + +C_RESULT p264_intra_8x8_chroma (intra_8x8_chroma_mode_t mode, uint8_t *picture, uint32_t x, uint32_t y, uint32_t linesize) +// CHROMA DC mode validated on one MB +{ +// Ai-Bi-M are the boundary pixels of the 16x16 block p(y,x) +// +// M B0 B1 ... B7 +// A0 p(0,0) p(0,1) p(0,7) +// A1 p(1,0) +// +// ... ... +// +// A7 p(7,0) p(7,7) +// + + C_RESULT res = C_OK; + uint32_t availability_flag=0; + uint8_t * picture_start; + int32_t i,j; + + // determine block availability + if (x==0) + { + // block 8x8 is located in the first column of the frame, A pixels are not available + availability_flag |= A_UNAVAILABLE; + } + if (y==0) + { + // block 8x8 is located in the first row of the frame, B pixels are not available + availability_flag |= B_UNAVAILABLE; + } + + // check availability and mode + switch (mode) + { + case VERTICAL_8x8_CHROMA_MODE : + if (availability_flag & B_UNAVAILABLE) + { + PRINT("%s : could no compute chroma intra 8x8 mode_%d prediction on (%d,%d), B unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + case HORIZONTAL_8x8_CHROMA_MODE : + if (availability_flag & A_UNAVAILABLE) + { + PRINT("%s : could no compute chroma intra 8x8 mode_%d prediction on (%d,%d) A unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + case DC_8x8_CHROMA_MODE : + // no restriction + break; + + case PLANE_8x8_CHROMA_MODE : + if (availability_flag & A_UNAVAILABLE) + { + PRINT("%s : could no compute chroma intra 8x8 mode_%d prediction on (%d,%d) A unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + if (availability_flag & B_UNAVAILABLE) + { + PRINT("%s : could no compute chroma intra 8x8 mode_%d prediction on (%d,%d) B unavailable\n",__FUNCTION__,mode,x,y); + res = C_FAIL; + } + break; + + default : + PRINT ("%s : mode_%d is not a valid chroma intra 8x8 prediction mode\n",__FUNCTION__,mode); + res = C_FAIL; + } + + if (SUCCEED(res)) + { + // make prediction + switch (mode) + { + case DC_8x8_CHROMA_MODE : + { + // DC_8x8_CHROMA_MODE is slightly different from DC_16x16_LUMA_MODE + // each 8x8 block is divided into 4 blocks + // ------------------- + // | all | single1 | + // --------- --------- + // | single2 | all | + // ------------------- + // + // In "all" block, adjacent 4x4 blocks A and B are used to compute the DC value as in DC_16x16_LUMA_MODE. + // If B is not available, A is used instead of B. + // If A is not available, B is used instead of A. + // If neither A nor B are available, DC is set to 128. + // In "single1" priority is given to B block to compute the DC value. If B is not available, A is used instead of B. + // If neither A nor B are available, DC is set to 128. + // In "single2" priority is given to A block to compute the DC value. If A is not available, B is used instead of A. + // If neither A nor B are available, DC is set to 128. + // + // Next scheme summarize the block used to compute the DC value in raster scan ordered image : + // B blocks + // A ----------------- + // | x x | A A | + // b | x x | A A | + // l -------- -------- ... + // o | B B | AB B | + // c | B B | A AB | + // k -------- -------- + // s ... + + uint32_t mean; + + // compute DC value of block_4x4(0,0) + mean = chroma_DC_all(picture,x,y,linesize); + // fill the block with DC + fill_4x4_DC(picture,x,y,linesize,mean); + + // compute DC value of block_4x4(4,0) + mean = chroma_DC_single(picture,x+4,y,linesize); + // fill the block with DC + fill_4x4_DC(picture,x+4,y,linesize,mean); + + // compute DC value of block_4x4(0,4) + mean = chroma_DC_single(picture,x,y+4,linesize); + // fill the block with DC + fill_4x4_DC(picture,x,y+4,linesize,mean); + + // compute DC value of block_4x4(4,4) + mean = chroma_DC_all(picture,x+4,y+4,linesize); + // fill the block with DC + fill_4x4_DC(picture,x+4,y+4,linesize,mean); + } + break; + + case HORIZONTAL_8x8_CHROMA_MODE : + { + //jump to pixel A0 + picture += (linesize*y+x-1); + // extend pixel Ai horizontally + uint8_t pixel_buf; + j=8; + while(j--) + { + // load Ai + pixel_buf = *picture++; + // extend Ai + i=8; + while(i--) + { + *picture++ = pixel_buf; + } + // jump to Ai+1 + picture += (linesize-9); + } + } + break; + + case VERTICAL_8x8_CHROMA_MODE : + { + // jump to pixel B0 + picture += (linesize*(y-1)+x); + uint8_t line_buf[8]; + // load Bi line + vp_os_memcpy(line_buf,picture,8*sizeof(uint8_t)); + // extend Bi line vertically + i=8; + while(i--) + { + // jump to next line + picture += linesize; + // copy line + vp_os_memcpy(picture,line_buf,8*sizeof(uint8_t)); + } + } + break; + + case PLANE_8x8_CHROMA_MODE : + { + int32_t A7,B7; + picture_start = picture; + // compute H : + // H' = 1* (B4 - B2) + + // 2* (B5 - B1) + + // 3* (B6 - B0) + + // 4* (B7 - M) + // H = (34*H' + 32) / 64 + // jump to M + picture += (linesize*(y-1)+x-1); + int32_t H=0; + for (i=4;i>=1;i--) + { + H -= i*(*picture++); + } + for (i=1;i<=4;i++) + { + H += i*(*++picture); + } + B7 = *(picture); + H = (34*H + 32)>>6; + + // compute V : + // V' = 1* (A4 - A2) + + // 2* (A5 - A1) + + // 3* (A6 - A0) + + // 4* (A7 - M) + // V = (34*V' + 32) / 64 + int32_t V=0; + // jump to M + picture = picture_start + (linesize*(y-1)+x-1); + for (i=4;i>=1;i--) + { + V -= i*(*picture); + picture += linesize; + } + for (i=1;i<=4;i++) + { + picture += linesize; + V += i*(*picture); + } + A7 = *(picture); + V = (34*V + 32)>>6; + + // fill pixel p(i,j) of the 16x16 block with the following rule : + // a = 16 * (A7 + B7 + 1) - 3*(V+H) + // b(i,j) = a + V * j + H * i + // p(i,j) = SATURATE_U8(b(i,j) / 32) + // SATURATE_U8() function indicates that the result of the operation should be bounded to an unsigned 8-bit range (0..255) + + int32_t a = ((A7 + B7 + 1)<<4) - 3*(V+H); + + // jump to p(0,0) + picture = picture_start + (linesize*y+x); + // make prediction + int32_t pixel_buf; + for (j=0;j<8;j++) + { + for (i=0;i<8;i++) + { + pixel_buf = (a + V*j + H*i)>>5; + // saturation + if (pixel_buf > 0xFF) + pixel_buf = 0xFF; + else if (pixel_buf < 0) + pixel_buf = 0; + *picture++ = pixel_buf; + } + // jump to next line + picture += linesize - 8; + } + } + break; + + default : + PRINT ("%s : mode_%d is not a valid chrome intra 8x8 prediction mode\n",__FUNCTION__,mode); + res = C_FAIL; + } + } + return res; +} diff --git a/ARDroneLib/VLIB/P264/p264_intra_pred.h b/ARDroneLib/VLIB/P264/p264_intra_pred.h new file mode 100644 index 0000000..efc5b67 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_intra_pred.h @@ -0,0 +1,82 @@ +#include +#include "p264_common.h" + + +// 4x4 block luma Availability : +// ------ ------ +// | | | +// | B | C | +// | | | +// ------ ------ ------ +// | | | +// | A | E | +// | | | +// ------ ------ +// +// E is the current block to be intra predicted based on block A,B,C. However depending on the location of E in the decoded frame +// A,B or C are not necessarily available (i.e. already decoded). +// Several cases are handled to make A,B,C available : +// - In DC_4x4_MODE, if A AND B are on a frame boundary => A,B are supposed to be a uniform block of 128 and becomes available. +// - In DIAGONAL_DL_4x4_MODE OR VERTICAL_LEFT_4x4_MODE, if C is not available => extend the down-right pixel of B on C. C becomes available. +// - in other cases, modes that use unavailable blocks are forbidden. + + +#define A_UNAVAILABLE (1<<0) +#define B_UNAVAILABLE (1<<1) +#define C_UNAVAILABLE (1<<2) + +// 4x4 intra block reconstruction order in luma MB +// ------------- +// | 0 1 4 5 | +// | 2 3 6 7 | +// | 8 9 12 13 | +// | 10 11 14 15 | +// ------------- + +// 4x4 block availability case in a frame (raster scan) +// case 0 : all available +// case 1 : A not available +// case 2 : B not available +// case 3 : A&B not available +// case 4 : C not available +// cases 1,2,3 affect DC_4x4_MODE +// case 4 affects DIAGONAL_DL_4x4_MODE and VERTICAL_LEFT_4x4_MODE +// --------- --------- --------- +// | 3 2 2 2 | 2 2 2 2 | | 2 2 2 2 | +// | 1 4 0 4 | 0 4 0 4 | ... | 0 4 0 4 | +// | 1 0 0 4 | 0 0 0 4 | | 0 0 0 4 | +// | 1 4 0 4 | 0 4 0 4 | | 0 4 0 4 | +// --------- --------- --------- +// | 1 0 0 0 | 0 0 0 0 | | 0 0 0 4 | +// | 1 4 0 4 | 0 4 0 4 | ... | 0 4 0 4 | +// | 1 0 0 4 | 0 0 0 4 | | 0 0 0 4 | +// | 1 4 0 4 | 0 4 0 4 | | 0 4 0 4 | +// --------- --------- --------- +// | | +// | ... | +// | | +// | | +// --------- --------- --------- + +C_RESULT p264_intra_4x4_luma (intra_4x4_mode_t mode, uint8_t *picture, uint32_t picture_width, uint32_t x, uint32_t y, uint32_t linesize); + +// luma 16x16 block and chroma 8x8 block availability in a frame (raster scan) +// the same rules apply as in 4x4 intra mode + +// 16x16 - 8x8 block availability mode in a frame (raster scan) +// case 0 : all available +// case 1 : A not available +// case 2 : B not available +// case 3 : A&B not available +// --- --- --- +// | 3 | 2 | ... | 2 | +// --- --- --- +// | 1 | 0 | ... | 0 | +// --- --- --- +// | ... | +// --- --- --- + +C_RESULT p264_intra_16x16_luma (intra_16x16_luma_mode_t mode, uint8_t *picture, uint32_t x, uint32_t y, uint32_t linesize); + +C_RESULT p264_intra_8x8_chroma (intra_8x8_chroma_mode_t mode, uint8_t *picture, uint32_t x, uint32_t y, uint32_t linesize); + diff --git a/ARDroneLib/VLIB/P264/p264_layers.h b/ARDroneLib/VLIB/P264/p264_layers.h new file mode 100644 index 0000000..df48940 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_layers.h @@ -0,0 +1,47 @@ +#ifndef _P264_LAYERS_H_ +#define _P264_LAYERS_H_ + +#include +#include + +#define MAKE_START_CODE(gob) ( P264_CODEC | (gob) ) +#define PICTURE_START_CODE MAKE_START_CODE(0) +#define PICTURE_END_CODE MAKE_START_CODE(0x1F) + +#define UVLC_FORMAT_CIF 1 +#define UVLC_FORMAT_VGA 2 +// +//#define UVLC_RESOLUTION_SUBQ 1 /* sub-QCIF */ +//#define UVLC_RESOLUTION_Q 2 /* QCIF */ +//#define UVLC_RESOLUTION_1 3 /* CIF */ +//#define UVLC_RESOLUTION_4 4 /* 4-CIF */ +//#define UVLC_RESOLUTION_16 5 /* 16-CIF */ + +typedef struct _p264_mb_layer_t { + uint32_t desc; + uint32_t dquant; +} p264_mb_layer_t; + +typedef struct _p264_gob_layer_t { + video_macroblock_t* macroblocks; + uint32_t quant; +} p264_gob_layer_t; + +typedef struct _p264_picture_layer_t { + uint32_t format; + uint32_t resolution; + uint32_t picture_type; + uint32_t quant; + p264_gob_layer_t* gobs; +} p264_picture_layer_t; + +C_RESULT p264_write_picture_layer( video_controller_t* controller, video_stream_t* stream ); +C_RESULT p264_read_picture_layer( video_controller_t* controller, video_stream_t* stream ); + +C_RESULT p264_write_gob_layer( video_stream_t* stream, p264_gob_layer_t* gob ); +C_RESULT p264_read_gob_layer( video_stream_t* stream, p264_gob_layer_t* gob ); + +C_RESULT p264_write_mb_layer(video_controller_t* controller, video_stream_t* stream, video_macroblock_t* mb, int32_t num_macro_blocks ); +C_RESULT p264_read_mb_layer(video_controller_t* controller, video_stream_t* stream, video_gob_t* gobs, uint32_t i_blockline, uint32_t i_mb); + +#endif // _UVLC_LAYERS_H_ diff --git a/ARDroneLib/VLIB/P264/p264_mb_layer.c b/ARDroneLib/VLIB/P264/p264_mb_layer.c new file mode 100644 index 0000000..7fd1a92 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_mb_layer.c @@ -0,0 +1,644 @@ +#include +#include +#include + +#include +#include + +#include "p264_codec.h" +#include "p264_layers.h" +#include "p264.h" +#include "p264_common.h" + +#include + +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) + +// macro helper to read an intra 4x4 mode using prediction +#define READ_INTRA_CODE(pred,dest_intra) \ + code = 0; \ + video_read_data (stream,&code,1); \ + if (code==0) \ + { \ + dest_intra = pred; \ + } \ + else \ + { \ + code = 0; \ + video_read_data (stream,&code,3); \ + if (code 0) + { + mb = &gobs[i_blockline-1].macroblocks[i_mb]; + up_intra_4x4 = mb->intra_4x4_mode; + // check whether it's an intra 4x4 mb or not + if (mb->intra_type != INTRA_4x4) + { + up_intra_4x4 = NULL; + } + } + else + up_boundary_block = TRUE; + + if (i_mb > 0) + { + mb = &gobs[i_blockline].macroblocks[i_mb-1]; + // check whether it's an intra 4x4 mb or not + left_intra_4x4 = mb->intra_4x4_mode; + if (mb->intra_type != INTRA_4x4) + { + left_intra_4x4 = NULL; + } + } + else + left_boundary_block = TRUE; + + // read intra(0,0) + pred = make_boundary_pred(left_intra_4x4,5,up_intra_4x4,10,up_boundary_block|left_boundary_block); + READ_INTRA_CODE(pred,current_intra_4x4[0]); + // read intra(1,0) + pred = make_boundary_pred(current_intra_4x4,0,up_intra_4x4,11,up_boundary_block); + READ_INTRA_CODE(pred,current_intra_4x4[1]); + // read intra(0,1) + pred = make_boundary_pred(left_intra_4x4,7,current_intra_4x4,0,left_boundary_block); + READ_INTRA_CODE(pred,current_intra_4x4[2]); + // read intra(1,1) + pred = min(current_intra_4x4[1],current_intra_4x4[2]); + READ_INTRA_CODE(pred,current_intra_4x4[3]); + + // read intra(2,0) + pred = make_boundary_pred(current_intra_4x4,1,up_intra_4x4,14,up_boundary_block); + READ_INTRA_CODE(pred,current_intra_4x4[4]); + // read intra(3,0) + pred = make_boundary_pred(current_intra_4x4,4,up_intra_4x4,15,up_boundary_block); + READ_INTRA_CODE(pred,current_intra_4x4[5]); + // read intra(2,1) + pred = min(current_intra_4x4[4],current_intra_4x4[3]); + READ_INTRA_CODE(pred,current_intra_4x4[6]); + // read intra(3,1) + pred = min(current_intra_4x4[5],current_intra_4x4[6]); + READ_INTRA_CODE(pred,current_intra_4x4[7]); + + // read intra(0,2) + pred = make_boundary_pred(left_intra_4x4,13,current_intra_4x4,2,left_boundary_block); + READ_INTRA_CODE(pred,current_intra_4x4[8]); + // read intra(1,2) + pred = min(current_intra_4x4[8],current_intra_4x4[3]); + READ_INTRA_CODE(pred,current_intra_4x4[9]); + // read intra(0,3) + pred = make_boundary_pred(left_intra_4x4,15,current_intra_4x4,8,left_boundary_block); + READ_INTRA_CODE(pred,current_intra_4x4[10]); + // read intra(1,3) + pred = min(current_intra_4x4[9],current_intra_4x4[10]); + READ_INTRA_CODE(pred,current_intra_4x4[11]); + + // read intra(2,2) + pred = min(current_intra_4x4[9],current_intra_4x4[6]); + READ_INTRA_CODE(pred,current_intra_4x4[12]); + // read intra(3,2) + pred = min(current_intra_4x4[12],current_intra_4x4[7]); + READ_INTRA_CODE(pred,current_intra_4x4[13]); + // read intra(2,3) + pred = min(current_intra_4x4[11],current_intra_4x4[12]); + READ_INTRA_CODE(pred,current_intra_4x4[14]); + // read intra(3,3) + pred = min(current_intra_4x4[13],current_intra_4x4[14]); + READ_INTRA_CODE(pred,current_intra_4x4[15]); + +} + +void p264_write_block( video_stream_t* const stream, int16_t* data, uint32_t length) +{ + int32_t code, run, num_coeff; + + // count number of DC coeff + num_coeff = 0; + int16_t * p_data = data; + + while (length--) + { + if (*p_data++ != 0) + num_coeff++; + } + + if (num_coeff == 0) + { + video_write_data( stream, 1, 1 ); // signal that there's no coeff + } + else + { + video_write_data( stream, 0, 1 ); // signal that there are coeffs + + run = 0; + while( num_coeff > 0 ) + { + code = *data++; + if( code == 0 ) + { + run ++; + } + else + { + num_coeff--; + p264_encode( stream, code, run, num_coeff ); + run = 0; + } + } + } +} + +void p264_read_block( video_stream_t* const stream, int16_t* data) +{ + int32_t index, run, last;//, nc; + uint32_t code; + + code = run = last = 0; + video_read_data( stream, &code, 1 ); // signal that there's no DC coeff + + if(code == 0) + { + index = -1; + while( last == 0 ) + { + code = run = last = 0; + p264_decode( stream, &run, &code, &last); + + if( last == 0 ) + { + index += (run+1); + data[index] = code; + } + } + } +} + +C_RESULT p264_write_mb_layer(video_controller_t* controller, video_stream_t* stream, video_macroblock_t* mb, int32_t num_macro_blocks ) +{ + int16_t* data; + //uint32_t code; + uint32_t i; + + + while( num_macro_blocks > 0 ) + { + //PRINT ("p264_write_mb_layer : stream size %d stream used %d\n",stream->size,stream->used); + + if (controller->picture_type == VIDEO_PICTURE_INTER) + { + // write all partition + for (i=0;inb_partition;i++) + { + video_write_data( stream,mb->inter_partition_mode[i],3); + } + + // write all motion vector + for (i=0;inb_partition;i++) + { + int32_t s_code; + s_code = (int32_t)mb->inter_MV[i].x; + p264_encode_int(stream, s_code); + s_code = (int32_t)mb->inter_MV[i].y; + p264_encode_int(stream, s_code); + } + + // write residual data as an intra4x4 + // write all 4x4 block luma AC coeff + i=16; + data = ((MB_p264_t*)mb->data)->inter.AC_Y; + while(i--) + { + p264_write_block( stream, data, 16); + data += BLOCK_SIZE2; + } + + // write 4 DC U coeff + p264_write_block(stream,((MB_p264_t*)mb->data)->inter.DC_U,4); + + // write AC U coeff + i=4; + data = &((MB_p264_t*)mb->data)->inter.AC_U[1]; + while(i--) + { + p264_write_block( stream, data, 15); + data += BLOCK_SIZE2; + } + + // write 4 DC V coeff + p264_write_block(stream,((MB_p264_t*)mb->data)->inter.DC_V,4); + + // write AC V coeff + i=4; + data = &((MB_p264_t*)mb->data)->inter.AC_V[1]; + while(i--) + { + p264_write_block( stream, data, 15); + data += BLOCK_SIZE2; + } + } + else + { + // write MB intra type (16x16 or 4x4) + video_write_data( stream, mb->intra_type, 1 ); + // write intra chroma type + video_write_data (stream, mb->intra_chroma_8x8_mode,2); + if (mb->intra_type == INTRA_4x4) + { + // write all luma 4x4 prediction modes + p264_write_intra_4x4(stream,mb->intra_4x4_mode); + + // write all 4x4 block luma AC coeff + i=16; + data = ((MB_p264_t*)mb->data)->intra_4x4.AC_Y; + while(i--) + { + p264_write_block( stream, data, 16); + data += BLOCK_SIZE2; + } + + // write 4 DC U coeff + p264_write_block(stream,((MB_p264_t*)mb->data)->intra_4x4.DC_U,4); + + // write AC U coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_4x4.AC_U[1]; + while(i--) + { + p264_write_block( stream, data, 15); + data += BLOCK_SIZE2; + } + + // write 4 DC V coeff + p264_write_block(stream,((MB_p264_t*)mb->data)->intra_4x4.DC_V,4); + + // write AC V coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_4x4.AC_V[1]; + while(i--) + { + p264_write_block( stream, data, 15); + data += BLOCK_SIZE2; + } + } + else + { + // write luma 16x16 prediction mode + video_write_data(stream, mb->intra_luma_16x16_mode,2); + + // write 16 DC luma + p264_write_block( stream, ((MB_p264_t*)mb->data)->intra_16x16.DC_Y, 16); + + // write 16 luma AC coeff block + i=16; + data = &((MB_p264_t*)mb->data)->intra_16x16.AC_Y[1]; + while(i--) + { + p264_write_block( stream, data, 15); + data += BLOCK_SIZE2; + } + + // write 4 DC U coeff + p264_write_block(stream,((MB_p264_t*)mb->data)->intra_16x16.DC_U,4); + + // write AC U coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_16x16.AC_U[1]; + while(i--) + { + p264_write_block( stream, data, 15); + data += BLOCK_SIZE2; + } + + // write 4 DC V coeff + p264_write_block(stream,((MB_p264_t*)mb->data)->intra_16x16.DC_V,4); + + // write AC V coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_16x16.AC_V[1]; + while(i--) + { + p264_write_block( stream, data, 15); + data += BLOCK_SIZE2; + } + } + } + mb ++; + num_macro_blocks --; + } + return C_OK; +} + + +C_RESULT p264_read_mb_layer(video_controller_t* controller, video_stream_t* stream, video_gob_t* gobs, uint32_t i_blockline, uint32_t i_mb) +{ + int16_t* data; + uint32_t code; + //int8_t mv; + uint32_t i; + video_macroblock_t* mb; + mb = &gobs[i_blockline].macroblocks[i_mb]; + + vp_os_memset( mb->data, 0, sizeof(MB_p264_t)); + + if (controller->picture_type == VIDEO_PICTURE_INTER) + { + // for now p264 supports only one partition per macroblock + mb->nb_partition = 1; + // read all partition + for (i=0;inb_partition;i++) + { + code = 0; + video_read_data( stream,&code,3); + mb->inter_partition_mode[i] = code; + } + + // read all motion vector + p264_read_mv(stream, gobs, i_blockline, i_mb,controller->mb_blockline); + + // read residual data as an intra 4x4 + // read 16 4x4 block luma AC coeff + i=16; + data = ((MB_p264_t*)mb->data)->inter.AC_Y; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + + // read 4 DC U coeff + p264_read_block(stream,((MB_p264_t*)mb->data)->inter.DC_U); + + // read AC U coeff + i=4; + data = &((MB_p264_t*)mb->data)->inter.AC_U[1]; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + + // read 4 DC V coeff + p264_read_block(stream,((MB_p264_t*)mb->data)->inter.DC_V); + + // read AC V coeff + i=4; + data = &((MB_p264_t*)mb->data)->inter.AC_V[1]; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + } + else + { + // read MB intra type + code = 0; + video_read_data(stream, &code, 1); + mb->intra_type = (intra_type_t)code; + + // read intra chroma type + code = 0; + video_read_data(stream, &code, 2); + mb->intra_chroma_8x8_mode = (intra_8x8_chroma_mode_t) code; + + if (mb->intra_type == INTRA_4x4) + { + // read all 4x4 modes + p264_read_intra_4x4(stream, gobs, i_blockline, i_mb); + + // read 16 4x4 block luma AC coeff + i=16; + data = ((MB_p264_t*)mb->data)->intra_4x4.AC_Y; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + + // read 4 DC U coeff + p264_read_block(stream,((MB_p264_t*)mb->data)->intra_4x4.DC_U); + + // read AC U coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_4x4.AC_U[1]; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + + // read 4 DC V coeff + p264_read_block(stream,((MB_p264_t*)mb->data)->intra_4x4.DC_V); + + // read AC V coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_4x4.AC_V[1]; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + } + else + { + // write luma 16x16 prediction mode + code = 0; + video_read_data(stream, &code ,2); + mb->intra_luma_16x16_mode = code; + + // read 16 DC luma + p264_read_block( stream, ((MB_p264_t*)mb->data)->intra_16x16.DC_Y); + + // write 256 luma AC coeff + // Normally only 15 AC coeff per block 4x4 has to be sent + i=16; + data = &((MB_p264_t*)mb->data)->intra_16x16.AC_Y[1]; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + + // read 4 DC U coeff + p264_read_block(stream,((MB_p264_t*)mb->data)->intra_16x16.DC_U); + + // read AC U coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_16x16.AC_U[1]; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + + // read 4 DC V coeff + p264_read_block(stream,((MB_p264_t*)mb->data)->intra_16x16.DC_V); + + // read AC V coeff + i=4; + data = &((MB_p264_t*)mb->data)->intra_16x16.AC_V[1]; + while(i--) + { + p264_read_block( stream, data); + data += BLOCK_SIZE2; + } + } + } + return C_OK; +} + diff --git a/ARDroneLib/VLIB/P264/p264_merge.c b/ARDroneLib/VLIB/P264/p264_merge.c new file mode 100644 index 0000000..9ca7f58 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_merge.c @@ -0,0 +1,42 @@ +#include + +// merge scaled residual data from iTransform and prediction data already located in the output picture +void p264_merge_4x4 (int16_t* residual,uint8_t* picture, uint32_t x, uint32_t y, uint32_t linesize) +{ + uint32_t i; + int16_t pixel; + picture += y*linesize+x; + for (i=0;i<4;i++) + { + pixel = (int16_t)(((int16_t)*picture) + (((*residual++)+32)>>6)); + if (pixel > 0xFF) + *picture++ = 0xFF; + else if (pixel < 0) + *picture++ = 0; + else + *picture++ = pixel; + pixel = (int16_t)(((int16_t)*picture) + (((*residual++)+32)>>6)); + if (pixel > 0xFF) + *picture++ = 0xFF; + else if (pixel < 0) + *picture++ = 0; + else + *picture++ = pixel; + pixel = (int16_t)(((int16_t)*picture) + (((*residual++)+32)>>6)); + if (pixel > 0xFF) + *picture++ = 0xFF; + else if (pixel < 0) + *picture++ = 0; + else + *picture++ = pixel; + pixel = (int16_t)(((int16_t)*picture) + (((*residual++)+32)>>6)); + if (pixel > 0xFF) + *picture = 0xFF; + else if (pixel < 0) + *picture = 0; + else + *picture = pixel; + // jump to next line + picture += linesize-3; + } +} diff --git a/ARDroneLib/VLIB/P264/p264_merge.h b/ARDroneLib/VLIB/P264/p264_merge.h new file mode 100644 index 0000000..068ed8b --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_merge.h @@ -0,0 +1,4 @@ +#include + +// merge unscaled residual data from itransform and prediction data already located in the output picture +void p264_merge_4x4 (int16_t* residual,uint8_t* picture, uint32_t x, uint32_t y, uint32_t linesize); diff --git a/ARDroneLib/VLIB/P264/p264_picture_layer.c b/ARDroneLib/VLIB/P264/p264_picture_layer.c new file mode 100644 index 0000000..d05dc23 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_picture_layer.c @@ -0,0 +1,83 @@ +#include +#include + +#include "p264_codec.h" +#include "p264_layers.h" +#include + +C_RESULT p264_write_picture_layer( video_controller_t* controller, video_stream_t* stream ) +{ + uint32_t format = 0, resolution = 0, width, height; + + p264_codec_t* p264_codec = (p264_codec_t*) controller->video_codec; + p264_picture_layer_t* picture_layer = &p264_codec->picture_layer; + + width = controller->width; + height = controller->height; + + while( format == 0 ) + { + if( width == QQCIF_WIDTH ) + format = UVLC_FORMAT_CIF; + + if( width == QQVGA_WIDTH ) + format = UVLC_FORMAT_VGA; + + width >>= 1; + height >>= 1; + + resolution ++; + } + + picture_layer->format = format; + picture_layer->resolution = resolution; + + video_write_data( stream, picture_layer->format, 2 ); + video_write_data( stream, picture_layer->resolution, 3 ); + video_write_data( stream, picture_layer->picture_type, 3 ); + video_write_data( stream, picture_layer->quant, 6 ); + video_write_data( stream, controller->num_frames, 32 ); + + return C_OK; +} + +C_RESULT p264_read_picture_layer( video_controller_t* controller, video_stream_t* stream ) +{ + uint32_t width, height; + + p264_codec_t* p264_codec = (p264_codec_t*) controller->video_codec; + p264_picture_layer_t* picture_layer = &p264_codec->picture_layer; + + picture_layer->format = 0; + picture_layer->resolution = 0; + picture_layer->picture_type = 0; + picture_layer->quant = 0; + + video_read_data( stream, &picture_layer->format, 2 ); + video_read_data( stream, &picture_layer->resolution, 3 ); + video_read_data( stream, &picture_layer->picture_type, 3 ); + video_read_data( stream, &picture_layer->quant, 6 ); + video_read_data( stream, &controller->num_frames, 32 ); + + switch( picture_layer->format ) + { + case UVLC_FORMAT_CIF: + width = QQCIF_WIDTH << (picture_layer->resolution-1); + height = QQCIF_HEIGHT << (picture_layer->resolution-1); + break; + + case UVLC_FORMAT_VGA: + width = QQVGA_WIDTH << (picture_layer->resolution-1); + height = QQVGA_HEIGHT << (picture_layer->resolution-1); + break; + + default: + width = 0; + height = 0; + break; + } + + video_controller_set_format( controller, width, height ); + + return C_OK; +} diff --git a/ARDroneLib/VLIB/P264/p264_transform.c b/ARDroneLib/VLIB/P264/p264_transform.c new file mode 100644 index 0000000..d0f50d7 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_transform.c @@ -0,0 +1,108 @@ +#include + +void p264_hadamard_2x2 (int16_t * in, int16_t * out) +// validated +{ + out[0] = in[0] + in[1] + in[2] + in[3]; + out[1] = in[0] - in[1] + in[2] - in[3]; + out[2] = in[0] + in[1] - in[2] - in[3]; + out[3] = in[0] - in[1] - in[2] + in[3]; +} + +void p264_ihadamard_4x4(int16_t *tblock, int16_t *block) +// validated +{ + int32_t i; + int16_t tmp[16]; + int16_t *pTmp = tmp;//, *pblock; + int16_t p0,p1,p2,p3; + int16_t t0,t1,t2,t3; + + // Horizontal + for (i = 0; i < 4; i++) + { + t0 = tblock[(i<<2)]; + t1 = tblock[(i<<2)+1]; + t2 = tblock[(i<<2)+2]; + t3 = tblock[(i<<2)+3]; + + p0 = t0 + t2; + p1 = t0 - t2; + p2 = t1 - t3; + p3 = t1 + t3; + + *(pTmp++) = p0 + p3; + *(pTmp++) = p1 + p2; + *(pTmp++) = p1 - p2; + *(pTmp++) = p0 - p3; + } + + // Vertical + for (i = 0; i < 4; i++) + { + pTmp = tmp + i; + t0 = *pTmp; + t1 = *(pTmp += 4); + t2 = *(pTmp += 4); + t3 = *(pTmp += 4); + + p0 = t0 + t2; + p1 = t0 - t2; + p2 = t1 - t3; + p3 = t1 + t3; + + block[0+i] = p0 + p3; + block[4+i] = p1 + p2; + block[8+i] = p1 - p2; + block[12+i] = p0 - p3; + } +} + +void p264_inverse_4x4(int16_t *tblock, int16_t *block) +// validated +{ + int32_t i;//, ii; + int16_t tmp[16]; + int16_t *pTmp = tmp;//, *pblock; + int16_t p0,p1,p2,p3; + int16_t t0,t1,t2,t3; + + // Horizontal + for (i = 0; i < 4; i++) + { + t0 = tblock[(i<<2)]; + t1 = tblock[(i<<2)+1]; + t2 = tblock[(i<<2)+2]; + t3 = tblock[(i<<2)+3]; + + p0 = t0 + t2; + p1 = t0 - t2; + p2 = (t1 >> 1) - t3; + p3 = t1 + (t3 >> 1); + + *(pTmp++) = p0 + p3; + *(pTmp++) = p1 + p2; + *(pTmp++) = p1 - p2; + *(pTmp++) = p0 - p3; + } + + // Vertical + for (i = 0; i < 4; i++) + { + pTmp = tmp + i; + t0 = *pTmp; + t1 = *(pTmp += 4); + t2 = *(pTmp += 4); + t3 = *(pTmp += 4); + + p0 = t0 + t2; + p1 = t0 - t2; + p2 =(t1 >> 1) - t3; + p3 = t1 + (t3 >> 1); + + block[0+i] = p0 + p3; + block[4+i] = p1 + p2; + block[8+i] = p1 - p2; + block[12+i] = p0 - p3; + } +} diff --git a/ARDroneLib/VLIB/P264/p264_transform.h b/ARDroneLib/VLIB/P264/p264_transform.h new file mode 100644 index 0000000..faee739 --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_transform.h @@ -0,0 +1,6 @@ +#include + +// hadamard_2x2 and ihadamard_2x2 are the same +void p264_hadamard_2x2 (int16_t * in, int16_t * out); +void p264_ihadamard_4x4 (int16_t *tblock, int16_t *block); +void p264_inverse_4x4(int16_t *tblock, int16_t *block); diff --git a/ARDroneLib/VLIB/P264/p264_zigzag.c b/ARDroneLib/VLIB/P264/p264_zigzag.c new file mode 100644 index 0000000..c134bff --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_zigzag.c @@ -0,0 +1,21 @@ +#include + +int32_t video_zztable_t41[16] = { + 0, 1, 4, 8, + 5, 2, 3, 6, + 9, 12, 13, 10, + 7, 11, 14, 15 +}; + +void zagzig_4x4 (int16_t * in, int16_t * out) +{ + int32_t* zztable; + uint32_t i; + + zztable = &video_zztable_t41[0]; + i = 16; + while (i--) + { + out[*zztable++] = *in++; + } +} diff --git a/ARDroneLib/VLIB/P264/p264_zigzag.h b/ARDroneLib/VLIB/P264/p264_zigzag.h new file mode 100644 index 0000000..291c43c --- /dev/null +++ b/ARDroneLib/VLIB/P264/p264_zigzag.h @@ -0,0 +1,6 @@ +#include + +// Default zigzag ordering matrix +extern int32_t video_zztable_t41[16]; + +void zagzig_4x4 (int16_t * in, int16_t * out); diff --git a/ARDroneLib/VLIB/P264/video_p264.c b/ARDroneLib/VLIB/P264/video_p264.c new file mode 100644 index 0000000..577067a --- /dev/null +++ b/ARDroneLib/VLIB/P264/video_p264.c @@ -0,0 +1,673 @@ +#include +#include +#include +#include +#include "p264_inter_mc.h" +#include "p264_intra_pred.h" +#include "p264_zigzag.h" +#include "p264_Qp.h" +#include + +//#define VP264_CHROMA_DEBUG +//#define VP264_LUMA_DEBUG +//#define VP264_LUMA_16x16_DEBUG +//#define VP264_PLUMA_DEBUG +//#define VP264_PCHROMA_DEBUG + +#ifndef HAS_P264_FTRANSFORM +//#warning "soft p264 encoding function not implemented" + +// prepare ip to encode a new frame +C_RESULT video_p264_prepare_slice ( video_controller_t* controller, const vp_api_picture_t* blockline) +{ + return C_FAIL; +} + +// encode num_macro_blocks MB +C_RESULT video_p264_encode_MB(uint32_t num_macro_blocks, video_macroblock_t* next_macroblock ,int32_t qp) +{ + return -1; +} + +// get encoded num_macro_blocks MB +int32_t video_p264_get_encoded_MB(uint32_t num_macro_blocks, video_macroblock_t* next_macroblock) +{ + return -1; +} +#endif + +// block_4x4 coordinates +typedef struct _block_XY_t { + uint32_t x; + uint32_t y; +} block_XY_t; + +// block_4x4 decoding order +static block_XY_t block_4x4_decoding_order[BLOCK_SIZE2] = { +{0,0},{4,0},{0,4},{4,4}, +{8,0},{12,0},{8,4},{12,4}, +{0,8},{4,8},{0,12},{4,12}, +{8,8},{12,8},{8,12},{12,12} +}; + +// intra +void video_p264_decode_intra_luma_4x4_MB (int16_t* AC, uint8_t* picture_out, uint32_t picture_width, uint32_t x,uint32_t y, uint32_t linesize,intra_4x4_mode_t * intra_mode,uint32_t qp) +{ + int16_t tmp_block_4x4[BLOCK_SIZE2]; + int16_t itransform_block_4x4[BLOCK_SIZE2]; + uint32_t diff_x=0,diff_y=0; + uint32_t i=16; + block_XY_t * p_block_4x4_decoding_order = block_4x4_decoding_order; + + while(i--) + { + // load relative coordinates of next 4x4 block to be decoded + diff_x = p_block_4x4_decoding_order->x; + diff_y = (p_block_4x4_decoding_order++)->y; +#ifdef VP264_LUMA_DEBUG + PRINT ("======= next 4x4 block : (%d,%d) with mode %d\n",diff_x,diff_y,*intra_mode); +#endif + + // do luma intra_4x4(0,0) prediction + p264_intra_4x4_luma((intra_4x4_mode_t)*intra_mode, + picture_out, picture_width, + x+diff_x,y+diff_y, linesize); +#ifdef VP264_LUMA_DEBUG + PRINT("frame after first block 4x4 prediction\n"); + mat_printf_16x16_inside_picture(picture_out,x,y,linesize); +#endif + // zag zig residual block_4x4 (0,0) + zagzig_4x4 (AC, tmp_block_4x4); + + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + + // itransform residual luma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x+diff_x,y+diff_y, linesize); +#ifdef VP264_LUMA_DEBUG + PRINT("frame after first block 4x4 merging\n"); + mat_printf_16x16_inside_picture(picture_out,x,y,linesize); +#endif + // jump to next residual data + AC += BLOCK_SIZE2; + // jump to next intra_4x4 mode + intra_mode++; + } +} + +void video_p264_decode_intra_luma_16x16_MB (int16_t* DC, int16_t* AC, uint8_t* picture_out,uint32_t x,uint32_t y, uint32_t linesize, intra_16x16_luma_mode_t intra_mode, uint32_t qp) +{ + // DC : the 16 DC coeffs of the current luma MB + // AC : the 16 AC[16] coeffs of the current chroma MB + int16_t ihadamard_luma_4x4[BLOCK_SIZE2]; + int16_t itransform_block_4x4[BLOCK_SIZE2]; + int16_t tmp_block_4x4[BLOCK_SIZE2]; + uint32_t diff_x=0,diff_y=0; + uint32_t i; + block_XY_t * p_block_4x4_decoding_order = block_4x4_decoding_order; + + // do prediction + p264_intra_16x16_luma (intra_mode, picture_out, x, y, linesize); +#ifdef VP264_LUMA_16x16_DEBUG + PRINT("frame after intra 16x16 prediction\n",diff_x,diff_y); + mat_printf_16x16_inside_picture(picture_out,x,y,linesize); +#endif + + // perform ihadamard on DC chroma + p264_ihadamard_4x4 (DC, ihadamard_luma_4x4); + + // scale DC luma coeff + p264_4x4_lumaDC_scale(ihadamard_luma_4x4,ihadamard_luma_4x4,qp); + + for (i=0;i<16;i++) + { + // load relative coordinates of next 4x4 block to be decoded + diff_x = p_block_4x4_decoding_order->x; + diff_y = (p_block_4x4_decoding_order++)->y; + + //// block 4x4 (x+diff_x, y+diff_y) + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_luma_4x4[diff_y + (diff_x>>2)]; + // itransform residual luma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x+diff_x,y+diff_y, linesize); +#ifdef VP264_LUMA_16x16_DEBUG + PRINT("frame after block(%d,%d) 4x4 merging\n",diff_x,diff_y); + mat_printf_16x16_inside_picture(picture_out,x,y,linesize); +#endif + // next block + AC += BLOCK_SIZE2; + } +} + +void video_p264_decode_intra_chroma_8x8_MB (int16_t* DC,int16_t* AC,uint8_t* picture_out,uint32_t x,uint32_t y, uint32_t linesize,intra_8x8_chroma_mode_t chroma_mode, uint32_t qp) +{ + // DC : the four DC coeffs of the current chroma MB + // AC : the four AC[16] coeffs of the current chroma MB + int16_t ihadamard_chroma_2x2[4]; + int16_t itransform_block_4x4[BLOCK_SIZE2]; + int16_t tmp_block_4x4[BLOCK_SIZE2]; + +#ifdef VP264_CHROMA_DEBUG + bool_t do_print = FALSE; + if (x==0 && y==0) + do_print = TRUE; + else + do_print = FALSE; +#endif + + // do chroma prediction + p264_intra_8x8_chroma (chroma_mode, picture_out, x, y, linesize); +#ifdef VP264_CHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after chroma 8x8 prediction\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + // perform ihadamard on DC chroma + p264_hadamard_2x2 (DC, ihadamard_chroma_2x2); + +#ifdef VP264_CHROMA_DEBUG + if (do_print == TRUE) + { + PRINT ("raw chroma DC[%d %d; %d %d]\n",DC[0],DC[1],DC[2],DC[3]); + } +#endif + // scale DC chroma coeff + p264_2x2_chromaDC_scale(ihadamard_chroma_2x2,ihadamard_chroma_2x2,qp); + +#ifdef VP264_CHROMA_DEBUG + if (do_print == TRUE) + { + PRINT ("scaled DC chroma coef [%d %d; %d %d]\n",ihadamard_chroma_2x2[0],ihadamard_chroma_2x2[1],ihadamard_chroma_2x2[2],ihadamard_chroma_2x2[3]); + } +#endif + + //// block 4x4 (0,0) + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[0]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x,y, linesize); +#ifdef VP264_CHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + //// block 4x4 (4,0) + AC += BLOCK_SIZE2; + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[1]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x+4,y, linesize); +#ifdef VP264_CHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + //// block 4x4 (0,4) + AC += BLOCK_SIZE2; + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[2]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x,y+4, linesize); +#ifdef VP264_CHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + //// block 4x4 (4,4) + AC += BLOCK_SIZE2; + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[3]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x+4,y+4, linesize); +#ifdef VP264_CHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif +} + +// inter +void video_p264_decode_inter_luma_MB (uint8_t * ref_picture, uint8_t* picture_out, uint32_t x,uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize, MV_XY_t* mv , inter_partition_mode_t * part, uint32_t nb_part, int16_t* AC, uint32_t qp) +{ + int16_t tmp_block_4x4[BLOCK_SIZE2]; + int16_t itransform_block_4x4[BLOCK_SIZE2]; + uint32_t diff_x=0,diff_y=0; + uint32_t i=16; + block_XY_t * p_block_4x4_decoding_order = block_4x4_decoding_order; + +#ifdef VP264_PLUMA_DEBUG + bool_t do_print = FALSE; + if (x==0 && y==0) + do_print = TRUE; + else + do_print = FALSE; +#endif + + // make motion compensation + while (nb_part--) + { + //TODO: this chunk of code is not complete, only 16x16 partition are supported + p264_inter_mc_luma (*part++, *mv++, ref_picture , picture_out, x, y,picture_width, picture_height, linesize); + } +#ifdef VP264_PLUMA_DEBUG + if (do_print == TRUE) + { + PRINT("block (%d,%d) ref picture\n",x,y); + mat_printf_16x16_inside_picture(ref_picture,x,y,linesize); + } +#endif + +#ifdef VP264_PLUMA_DEBUG + if (do_print == TRUE) + { + PRINT("block (%d,%d) after motion compensation - first mv [%d,%d]\n",x,y,(*(mv-1)).x,(*(mv-1)).y); + mat_printf_16x16_inside_picture(picture_out,x,y,linesize); + } +#endif + + // residual data processing + while(i--) + { + // load relative coordinates of next 4x4 block to be decoded + diff_x = p_block_4x4_decoding_order->x; + diff_y = (p_block_4x4_decoding_order++)->y; + + // zag zig residual block_4x4 (0,0) + zagzig_4x4 (AC, tmp_block_4x4); + + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + + // itransform residual luma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x+diff_x,y+diff_y, linesize); +#ifdef VP264_PLUMA_DEBUG + if (do_print == TRUE) + { + PRINT ("block merging\n"); + mat_printf_16x16_inside_picture(picture_out,x,y,linesize); + } +#endif + // jump to next residual data + AC += BLOCK_SIZE2; + } +} + +void video_p264_decode_inter_chroma_MB (uint8_t * ref_picture, uint8_t* picture_out, uint32_t x,uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize, MV_XY_t* mv , inter_partition_mode_t * part, uint32_t nb_part, int16_t* DC, int16_t* AC, uint32_t qp) +{ + // DC : the four DC coeffs of the current chroma MB + // AC : the four AC[16] coeffs of the current chroma MB + int16_t ihadamard_chroma_2x2[4]; + int16_t itransform_block_4x4[BLOCK_SIZE2]; + int16_t tmp_block_4x4[BLOCK_SIZE2]; + +#ifdef VP264_PCHROMA_DEBUG + static uint32_t toto=0; + toto++; + bool_t do_print = FALSE; + if (x==0 && y==0 && toto>400) + do_print = TRUE; + else + do_print = FALSE; +#endif + +#ifdef VP264_PCHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("block (%d,%d) ref picture\n",x,y); + mat_printf_8x8_inside_picture(ref_picture,x,y,linesize); + } +#endif + + // make motion compensation + while (nb_part--) + { + //TODO: this chunk of code is not complete, only 16x16 partition are supported + p264_inter_mc_chroma (*part++, *mv++, ref_picture , picture_out, x, y,picture_width, picture_height, linesize); + } + +#ifdef VP264_PCHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("block (%d,%d) after motion compensation - first mv [%d,%d]\n",x,y,(*(mv-1)).x,(*(mv-1)).y); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + + // perform ihadamard on DC chroma + p264_hadamard_2x2 (DC, ihadamard_chroma_2x2); + +#ifdef VP264_PCHROMA_DEBUG + if (do_print == TRUE) + { + PRINT ("raw chroma DC[%d %d; %d %d]\n",DC[0],DC[1],DC[2],DC[3]); + } +#endif + // scale DC chroma coeff + p264_2x2_chromaDC_scale(ihadamard_chroma_2x2,ihadamard_chroma_2x2,qp); + + //// block 4x4 (0,0) + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[0]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x,y, linesize); +#ifdef VP264_PCHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + //// block 4x4 (4,0) + AC += BLOCK_SIZE2; + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[1]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x+4,y, linesize); +#ifdef VP264_PCHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + //// block 4x4 (0,4) + AC += BLOCK_SIZE2; + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[2]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x,y+4, linesize); +#ifdef VP264_PCHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif + //// block 4x4 (4,4) + AC += BLOCK_SIZE2; + // zagzig + zagzig_4x4 (AC,tmp_block_4x4); + // scale residual block + p264_4x4_residual_scale(tmp_block_4x4,tmp_block_4x4,qp); + // insert DC coeff + *tmp_block_4x4 = ihadamard_chroma_2x2[3]; + // itransform residual chroma + p264_inverse_4x4(tmp_block_4x4,itransform_block_4x4); + // merge residual data and intra prediction + p264_merge_4x4 (itransform_block_4x4,picture_out,x+4,y+4, linesize); +#ifdef VP264_PCHROMA_DEBUG + if (do_print == TRUE) + { + PRINT("frame after block 4x4 merging\n"); + mat_printf_8x8_inside_picture(picture_out,x,y,linesize); + } +#endif +} + + +////////////// Debug functions //////////////// + +void mat_printf_2x2(int16_t * mat) +{ + uint32_t i,j; + PRINT("|------------------|\n"); + for (j=0;j<2;j++) + { + PRINT ("|"); + for (i=0;i<2;i++) + { + PRINT("%8d ",mat[i+(j<<1)]); + } + PRINT ("|\n"); + } + PRINT("|------------------|\n"); +} + +void mat_printf_4x4(int16_t * mat) +{ + uint32_t i,j; + PRINT("|------------------------------------|\n"); + for (j=0;j<4;j++) + { + PRINT ("|"); + for (i=0;i<4;i++) + { + PRINT("%8d ",mat[i+(j<<2)]); + } + PRINT ("|\n"); + } + PRINT("|------------------------------------|\n"); +} + +void mat_printf_16x16_inside_picture(uint8_t * picture,uint32_t x,uint32_t y, uint32_t linesize) +{ + uint32_t i,j; + uint8_t pixel; + PRINT("|------------------------------------|\n"); + picture += y*linesize+x; + for (j=0;j<16;j++) + { + PRINT ("|"); + for (i=0;i<16;i++) + { + pixel = *picture++; + PRINT("%4d ",pixel); + } + picture += linesize-16; + PRINT ("|\n"); + } + PRINT("|------------------------------------|\n"); +} + +void mat_printf_8x8_inside_picture(uint8_t * picture,uint32_t x,uint32_t y, uint32_t linesize) +{ + uint32_t i,j; + uint8_t pixel; + PRINT("|------------------------------------|\n"); + picture += y*linesize+x; + for (j=0;j<8;j++) + { + PRINT ("|"); + for (i=0;i<8;i++) + { + pixel = *picture++; + PRINT("%4d ",pixel); + } + picture += linesize-8; + PRINT ("|\n"); + } + PRINT("|------------------------------------|\n"); +} + +void print_MB_DCT(MB_p264_t* mb_intra,intra_type_t intra_4x4) +{ + if (intra_4x4 == INTRA_4x4) + { + PRINT("AC coeff\n"); + uint32_t intra_4x4_index,block_i,block_j; + for (intra_4x4_index=0;intra_4x4_index<16;intra_4x4_index++) + { + for (block_j=0;block_j<4;block_j++) + { + PRINT("\n"); + for (block_i=0;block_i<4;block_i++) + { + PRINT("%8d ",mb_intra->intra_4x4.AC_Y[intra_4x4_index*16+4*block_j+block_i]); + } + } + PRINT("\n--------------"); + } + PRINT("\n"); + PRINT("DC U coeff\n"); + PRINT ("%8d ",mb_intra->intra_4x4.DC_U[0]); + PRINT ("%8d ",mb_intra->intra_4x4.DC_U[1]); + PRINT ("%8d ",mb_intra->intra_4x4.DC_U[2]); + PRINT ("%8d \n",mb_intra->intra_4x4.DC_U[3]); + + + PRINT("DC V coeff\n"); + PRINT ("%8d ",mb_intra->intra_4x4.DC_V[0]); + PRINT ("%8d ",mb_intra->intra_4x4.DC_V[1]); + PRINT ("%8d ",mb_intra->intra_4x4.DC_V[2]); + PRINT ("%8d \n",mb_intra->intra_4x4.DC_V[3]); + + PRINT("AC U coeff\n"); + for (intra_4x4_index=0;intra_4x4_index<4;intra_4x4_index++) + { + for (block_j=0;block_j<4;block_j++) + { + PRINT("\n"); + for (block_i=0;block_i<4;block_i++) + { + PRINT("%8d ",mb_intra->intra_4x4.AC_U[intra_4x4_index*16+4*block_j+block_i]); + } + } + PRINT("\n--------------"); + } + PRINT("AC V coeff\n"); + for (intra_4x4_index=0;intra_4x4_index<4;intra_4x4_index++) + { + for (block_j=0;block_j<4;block_j++) + { + PRINT("\n"); + for (block_i=0;block_i<4;block_i++) + { + PRINT("%8d ",mb_intra->intra_4x4.AC_V[intra_4x4_index*16+4*block_j+block_i]); + } + } + PRINT("\n--------------"); + } + PRINT("\n"); + + } + else + { + uint32_t intra_16x16_index,block_i,block_j; + PRINT("intra 16x16 type\n"); + PRINT("DC Y\n"); + for (intra_16x16_index=0;intra_16x16_index<16;intra_16x16_index++) + PRINT ("%8d ",mb_intra->intra_16x16.DC_Y[intra_16x16_index]); + PRINT("\n"); + PRINT("AC Y\n"); + for (intra_16x16_index=0;intra_16x16_index<16;intra_16x16_index++) + { + for (block_j=0;block_j<4;block_j++) + { + PRINT("\n"); + for (block_i=0;block_i<4;block_i++) + { + PRINT("%8d ",mb_intra->intra_16x16.AC_Y[intra_16x16_index*16+4*block_j+block_i]); + } + } + PRINT("\n--------------"); + } + PRINT("\n"); + + + PRINT("DC U coeff\n"); + PRINT ("%8d ",mb_intra->intra_16x16.DC_U[0]); + PRINT ("%8d ",mb_intra->intra_16x16.DC_U[1]); + PRINT ("%8d ",mb_intra->intra_16x16.DC_U[2]); + PRINT ("%8d \n",mb_intra->intra_16x16.DC_U[3]); + + + PRINT("DC V coeff\n"); + PRINT ("%8d ",mb_intra->intra_16x16.DC_V[0]); + PRINT ("%8d ",mb_intra->intra_16x16.DC_V[1]); + PRINT ("%8d ",mb_intra->intra_16x16.DC_V[2]); + PRINT ("%8d \n",mb_intra->intra_16x16.DC_V[3]); + + PRINT("AC U coeff\n"); + for (intra_16x16_index=0;intra_16x16_index<4;intra_16x16_index++) + { + for (block_j=0;block_j<4;block_j++) + { + PRINT("\n"); + for (block_i=0;block_i<4;block_i++) + { + PRINT("%8d ",mb_intra->intra_16x16.AC_U[intra_16x16_index*16+4*block_j+block_i]); + } + } + PRINT("\n--------------"); + } + PRINT("AC V coeff\n"); + for (intra_16x16_index=0;intra_16x16_index<4;intra_16x16_index++) + { + for (block_j=0;block_j<4;block_j++) + { + PRINT("\n"); + for (block_i=0;block_i<4;block_i++) + { + PRINT("%8d ",mb_intra->intra_16x16.AC_V[intra_16x16_index*16+4*block_j+block_i]); + } + } + PRINT("\n--------------"); + } + PRINT("\n"); + + } +} diff --git a/ARDroneLib/VLIB/P264/video_p264.h b/ARDroneLib/VLIB/P264/video_p264.h new file mode 100644 index 0000000..3854e8c --- /dev/null +++ b/ARDroneLib/VLIB/P264/video_p264.h @@ -0,0 +1,33 @@ +#include +#include +#include + + +// prepare ip to encode a new frame +C_RESULT video_p264_prepare_slice ( video_controller_t* controller, const vp_api_picture_t* blockline); + +// encode num_macro_blocks MB +C_RESULT video_p264_encode_MB(uint32_t num_macro_blocks, video_macroblock_t* next_macroblock ,int32_t qp); + +// get encoded num_macro_blocks MB +int32_t video_p264_get_encoded_MB(uint32_t num_macro_blocks, video_macroblock_t* next_macroblock); + + +// inter decoding functions +void video_p264_decode_inter_luma_MB (uint8_t * ref_picture, uint8_t* picture_out, uint32_t x,uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize, MV_XY_t* mv , inter_partition_mode_t * part, uint32_t nb_part, int16_t* AC, uint32_t qp); + +void video_p264_decode_inter_chroma_MB (uint8_t * ref_picture, uint8_t* picture_out, uint32_t x,uint32_t y, uint32_t picture_width, uint32_t picture_height, uint32_t linesize, MV_XY_t* mv , inter_partition_mode_t * part, uint32_t nb_part, int16_t* DC, int16_t* AC, uint32_t qp); + +// intra decoding functions +void video_p264_decode_intra_luma_4x4_MB (int16_t* AC, uint8_t* picture_out, uint32_t picture_width, uint32_t x,uint32_t y, uint32_t linesize, intra_4x4_mode_t * intra_mode,uint32_t qp); + +void video_p264_decode_intra_chroma_8x8_MB (int16_t* DC,int16_t* AC,uint8_t* picture_out,uint32_t x,uint32_t y, uint32_t linesize,intra_8x8_chroma_mode_t chroma_mode, uint32_t qp); + +void video_p264_decode_intra_luma_16x16_MB (int16_t* DC,int16_t* AC, uint8_t* picture_out,uint32_t x,uint32_t y, uint32_t linesize, intra_16x16_luma_mode_t intra_mode,uint32_t qp); + +/////////////// Debug functions ///////////// +void print_MB_DCT(MB_p264_t* mb_intra,intra_type_t intra_4x4); +void mat_printf_4x4(int16_t * mat); +void mat_printf_2x2(int16_t * mat); +void mat_printf_16x16_inside_picture(uint8_t * picture,uint32_t x,uint32_t y,uint32_t linesize); +void mat_printf_8x8_inside_picture(uint8_t * picture,uint32_t x,uint32_t y, uint32_t linesize); diff --git a/ARDroneLib/VLIB/Platform/arm11/UVLC/uvlc_codec.c b/ARDroneLib/VLIB/Platform/arm11/UVLC/uvlc_codec.c new file mode 100644 index 0000000..cbd062d --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm11/UVLC/uvlc_codec.c @@ -0,0 +1,215 @@ +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#if TARGET_CPU_ARM == 1 + +#ifdef HAS_UVLC_DECODE_BLOCKLINE +C_RESULT uvlc_read_block_unquantize( video_controller_t* controller, int16_t* data, int32_t quant, int32_t nc ) +{ + video_stream_t* stream = &controller->in_stream; + int32_t* zztable; + int32_t index, code, run, last; + + zztable = &video_zztable_t81[0]; + code = run = last = 0; + + if (quant == TABLE_QUANTIZATION) + { + quant = TBL_QUANT_QUALITY; + } + // table quantization mode + video_read_data( stream, (uint32_t*) &code, 10 ); + code *= QUANT_I(0,quant); + data[0] = code; + + if( nc > 0 ) + { + uvlc_decode( stream, &run, &code, &last); + while (last == 0) + { + VP_OS_ASSERT( run < 64 ); + + zztable += (run+1); + index = *zztable; + code *= QUANT_I(index,quant); + data[index] = code; + uvlc_decode( stream, &run, &code, &last); + } + } + + return C_OK; +} + +uint16_t* uvlc_read_mb_layer_unquantize( video_controller_t* controller, video_macroblock_t* mb, uint16_t* out ) +{ + int16_t* data; + uint32_t code; + + video_zeromem32( (uint32_t*)mb->data, 6 * MCU_BLOCK_SIZE / 2 ); + + mb->azq = 0; + video_read_data( &controller->in_stream, (uint32_t*)&mb->azq, 1 ); + + if( mb->azq == 0 ) + { + video_read_data( &controller->in_stream, &code, 8 ); + + mb->num_coeff_y0 = (code >> 0) & 1; + mb->num_coeff_y1 = (code >> 1) & 1; + mb->num_coeff_y2 = (code >> 2) & 1; + mb->num_coeff_y3 = (code >> 3) & 1; + mb->num_coeff_cb = (code >> 4) & 1; + mb->num_coeff_cr = (code >> 5) & 1; + + mb->dquant = 0; + if( (code >> 6) & 1 ) + { + video_read_data( &controller->in_stream, &code, 2 ); + + mb->dquant = (code < 2) ? ~code : code; + } + + controller->quant += mb->dquant; + + /**************** Block Y0 ****************/ + data = mb->data; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y0 ); + idct(data, out); + out += MCU_BLOCK_SIZE; + + /**************** Block Y1 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y1 ); + idct(data, out); + out += MCU_BLOCK_SIZE; + + /**************** Block Y2 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y2 ); + idct(data, out); + out += MCU_BLOCK_SIZE; + + /**************** Block Y3 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y3 ); + idct(data, out); + out += MCU_BLOCK_SIZE; + + /**************** Block CB ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_cb ); + idct(data, out); + out += MCU_BLOCK_SIZE; + + /**************** Block CR ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_cr ); + idct(data, out); + out += MCU_BLOCK_SIZE; + } + + mb ++; + + return out; +} + +C_RESULT uvlc_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ) +{ + video_codec_t* video_codec; + vp_api_picture_t blockline = { 0 }; + int16_t *in = NULL; + uint16_t *out = NULL; + int32_t num_macro_blocks = 0; + video_macroblock_t* macroblock = NULL; + video_picture_context_t blockline_ctx; + video_gob_t* gobs; + + controller->mode = VIDEO_DECODE; + video_codec = controller->video_codec; + + blockline = *picture; + blockline.height = MB_HEIGHT_Y; + blockline.complete = 1; + blockline.vision_complete = 0; + + picture->complete = controller->picture_complete; + + blockline_ctx.y_woffset = blockline.y_line_size; + blockline_ctx.c_woffset = blockline.cb_line_size; + blockline_ctx.y_hoffset = blockline.y_line_size * MCU_HEIGHT; + + // At least a complete blockline is found + while( !controller->picture_complete && controller->in_stream.index <= (controller->in_stream.used >> 2) ) + { + uvlc_unpack_controller( controller ); + + if( !controller->picture_complete ) + { + blockline.blockline = controller->blockline; + + blockline_ctx.y_src = picture->y_buf + blockline.blockline * MB_HEIGHT_Y * picture->y_line_size; + blockline_ctx.cb_src = picture->cb_buf + blockline.blockline * MB_HEIGHT_C * picture->cb_line_size; + blockline_ctx.cr_src = picture->cr_buf + blockline.blockline * MB_HEIGHT_C * picture->cr_line_size; + + picture->blockline = controller->blockline; + num_macro_blocks = controller->mb_blockline; + + macroblock = &controller->cache_mbs[0]; + gobs = &controller->gobs[controller->blockline]; + out = (uint16_t*) gobs->macroblocks->data; + + if( gobs->quant != controller->quant ) + { + controller->quant = gobs->quant; + video_quantizer_update( controller ); + } + + while( num_macro_blocks > 0 ) + { + in = ¯oblock->data[0]; + + out = uvlc_read_mb_layer_unquantize( controller, macroblock, out ); + + num_macro_blocks --; + } + + video_blockline_from_macro_blocks(&blockline_ctx, gobs->macroblocks->data, controller->mb_blockline, picture->format); + + // Update controller according to video statistics + video_controller_update( controller, controller->picture_complete ); + } + } + + if( controller->picture_complete ) + { + picture->complete = controller->picture_complete; + picture->blockline = 0; + + controller->picture_complete = 0; + controller->in_stream.length = 32; + //controller->num_frames++; + + *got_image = TRUE; + } + else + { + controller->in_stream.used = 0; + controller->in_stream.index = 0; + } + + return C_OK; +} +#endif + +#endif // TARGET_CPU_ARM == 1 diff --git a/ARDroneLib/VLIB/Platform/arm11/video_config.h b/ARDroneLib/VLIB/Platform/arm11/video_config.h new file mode 100644 index 0000000..7d01f6f --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm11/video_config.h @@ -0,0 +1,18 @@ +#ifndef _VIDEO_CONFIG_ARM11_H_ +#define _VIDEO_CONFIG_ARM11_H_ + +#if TARGET_CPU_ARM == 1 + +/* Default configuration for ARM11 (like iphone) platform */ +#define DEFAULT_QUANTIZATION (6) + +#define MAX_NUM_MACRO_BLOCKS_PER_CALL (1) + +#define DEFAULT_INTERNAL_STREAM_SIZE (1024 * 8 * 2) + +#define VLIB_ALLOC_ALIGN (16) + +#endif // TARGET_CPU_ARM + +#endif // _VIDEO_CONFIG_ARM11_H_ + diff --git a/ARDroneLib/VLIB/Platform/arm11/video_utils.c b/ARDroneLib/VLIB/Platform/arm11/video_utils.c new file mode 100644 index 0000000..10835f8 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm11/video_utils.c @@ -0,0 +1,37 @@ +#include + +#include + +#include "video_utils.h" + +#if TARGET_CPU_ARM == 1 + +static uint32_t num_references = 0; + +C_RESULT video_utils_init( video_controller_t* controller ) +{ + if( num_references == 0 ) + { + } + + num_references ++; + + return C_OK; +} + +C_RESULT video_utils_close( video_controller_t* controller ) +{ + if( num_references > 0 ) + { + num_references --; + } + + return C_OK; +} + +C_RESULT video_utils_set_format( uint32_t width, uint32_t height ) +{ + return C_OK; +} + +#endif diff --git a/ARDroneLib/VLIB/Platform/arm11/video_utils.h b/ARDroneLib/VLIB/Platform/arm11/video_utils.h new file mode 100644 index 0000000..9b365b3 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm11/video_utils.h @@ -0,0 +1,16 @@ +#ifndef _VIDEO_UTILS_ARM11_H_ +#define _VIDEO_UTILS_ARM11_H_ + +#include + +#if TARGET_CPU_ARM == 1 + +#ifdef TARGET_OS_IPHONE + +#include "video_utils_iphone.h" + +#endif // TARGET_OS_IPHONE + +#endif // TARGET_CPU_ARM + +#endif // _VIDEO_UTILS_ARM11_H_ \ No newline at end of file diff --git a/ARDroneLib/VLIB/Platform/arm11/video_utils_iphone.h b/ARDroneLib/VLIB/Platform/arm11/video_utils_iphone.h new file mode 100644 index 0000000..7436bfa --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm11/video_utils_iphone.h @@ -0,0 +1,7 @@ +#ifndef _IPHONE_VIDEO_UTILS_H_ +#define _IPHONE_VIDEO_UTILS_H_ + +#define HAS_UVLC_DECODE_BLOCKLINE + +#endif // _IPHONE_VIDEO_UTILS_H_ + diff --git a/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.S b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.S new file mode 100644 index 0000000..b4cfcd8 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.S @@ -0,0 +1,146 @@ +#include "../video_utils_p5p.h" + +#ifdef HAS_UVLC_WRITE_BLOCK + +#ifdef _ECOS +#include "config-tcm.h" + + .section ".text.itcm","ax" +#endif // ! _ECOS + + + .global uvlc_write_block + .type uvlc_write_block, %function + +/* This code is an inline version of uvlc_write_block using video_zztable_t81 + +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff ) */ + +#define zz(num1, num2) \ +video_zztable_t81_next_##num1: ;\ + cmp r1, #0 ;\ + addeq r2, r2, #1; \ + ldreqsh r1, [r4, #2*num2]; \ + beq video_zztable_t81_next_##num2; \ + sub r3, r3, #1; \ + bl uvlc_encode; \ + cmp r3, #0; \ + ldrgtsh r1, [r4, #2*num2]; \ + ldmleia sp!, {r4, pc}; \ + mov r2, #0; + +uvlc_write_block: + stmdb sp!, {r4, lr} + + mov r4, r1 + ldrsh r1, [r1, #0] + sub r3, r2, #1 + mov r2, #10 + bl video_write_data + cmp r3, #0 + ldrgtsh r1, [r4, #2] + mov r2, #0 + ldmleia sp!, {r4, pc} + + zz(1, 8) + zz(8, 16) + zz(16, 9) + zz(9, 2) + zz(2, 3) + zz(3, 10) + zz(10, 17) + zz(17, 24) + zz(24, 32) + zz(32, 25) + zz(25, 18) + zz(18, 11) + zz(11, 4) + zz(4, 5) + zz(5, 12) + zz(12, 19) + zz(19, 26) + zz(26, 33) + zz(33, 40) + zz(40, 48) + zz(48, 41) + zz(41, 34) + zz(34, 27) + zz(27, 20) + zz(20, 13) + zz(13, 6) + zz(6, 7) + zz(7, 14) + zz(14, 21) + zz(21, 28) + zz(28, 35) + zz(35, 42) + zz(42, 49) + zz(49, 56) + zz(56, 57) + zz(57, 50) + zz(50, 43) + zz(43, 36) + zz(36, 29) + zz(29, 22) + zz(22, 15) + zz(15, 23) + zz(23, 30) + zz(30, 37) + zz(37, 44) + zz(44, 51) + zz(51, 58) + zz(58, 59) + zz(59, 52) + zz(52, 45) + zz(45, 38) + zz(38, 31) + zz(31, 39) + zz(39, 46) + zz(46, 53) + zz(53, 60) + zz(60, 61) + zz(61, 54) + zz(54, 47) + zz(47, 55) + zz(55, 62) + zz(62, 63) + + +video_zztable_t81_next_63: + mov r3, #0 + ldmia sp!, {r4, lr} + b uvlc_encode + +/* This code is an optimized version of uvlc_write_block using video_zztable_t81 + +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff ) */ +/* +uvlc_write_block: + stmdb sp!, {r4, r5, r6, lr} + + mov r4, r1 + ldrsh r1, [r1, #0] + sub r3, r2, #1 + mov r2, #8 + bl video_write_data + mov r2, #0 + cmp r3, #0 + ldmleia sp!, {r4, r5, r6, pc} + ldr r5, =video_zztable_t81 + +video_zztable_t81_next_1: + ldr r6, [r5, #4]! + mov r6, r6, lsl #1 + ldrsh r1, [r4, r6] + cmp r1, #0 + addeq r2, r2, #1 + beq video_zztable_t81_next_1 + sub r3, r3, #1 + bl uvlc_encode + cmp r3, #0 + ldmleia sp!, {r4, r5, r6, pc} + mov r2, #0 + b video_zztable_t81_next_1 +*/ + +#endif // HAS_UVLC_WRITE_BLOCK diff --git a/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.h b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.h new file mode 100644 index 0000000..020746a --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_mb_layer_p5p.h @@ -0,0 +1,8 @@ +#ifndef _UVLC_MB_LAYER_P5P_H_ +#define _UVLC_MB_LAYER_P5P_H_ + +#include + +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff ); + +#endif // _UVLC_MB_LAYER_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.S b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.S new file mode 100644 index 0000000..5410830 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.S @@ -0,0 +1,68 @@ +#include "../video_utils_p5p.h" + +#ifdef HAS_UVLC_ENCODE + + .text + .align 4 + + + .global uvlc_encode + .type uvlc_encode, %function + +/* + Registers usage + r0 : stream + r1 : value_code + r2 : value_length + r3 : not_last (do not modify) + ip : run + lr : level +*/ +uvlc_encode: + stmdb sp!, {r4, r5, lr} /* save regiter on the stack */ + + mov ip, r2 /* ip = run */ + clz r4, ip /* r4 = clz(run) */ + + movs lr, r1 /* lr = level */ + rsbmi lr, lr, #0 /* lr = |level| */ + movmi r5, #1 + movpl r5, #0 /* save sign value */ + mov r1, #1 /* value_code = 1 */ + + /* Serialize run */ + + rsbs r4, r4, #31 /* length = 31 - clz(run) */ + subgt ip, ip, r1, lsl r4 /* run = run - (1 << length) */ + add r4, r4, #1 + add r2, r4, #1 /* value_length = length + 1 */ + subgt r4, r4, #1 + orrgt r1, ip, r1, lsl r4 + addgt r2, r2, r4 + + /* Serialize level */ + mov ip, #1 + clz r4, lr + rsbs r4, r4, #31 /* r4 = 31 - clz(level) number of bits used in level */ + subgt lr, ip, lsl r4 /* code -= (1 << length) */ + addgt r4, r4, #1 + add r4, r4, #1 + add r2, r2, r4 /* value_length += length */ + orr r1, ip, r1, lsl r4 /* value_code = 1 | (value_code << length) */ + subs r4, r4, #2 + addgt r2, r2, r4 /* value_length += length */ + orrgt r1, lr, r1, lsl r4 /* value_code = code | (value_code << length) */ + add r2, r2, #1 + orr r1, r5, r1, lsl #1 + + /* Serialize not_last if needed */ + ldmia sp!, {r4, r5, lr} /* restore saved registers */ + + cmp r3, #0 + addeq r2, r2, #3 /* value_length += 3 */ + moveq ip, #5 + orreq r1, ip, r1, lsl #3 /* value_code = 0x5 | (value_code << 3) */ + + b video_write_data /* jump to video_write_data to serialize data */ + +#endif diff --git a/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.h b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.h new file mode 100644 index 0000000..f4bea05 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/UVLC/uvlc_p5p.h @@ -0,0 +1,10 @@ +#ifndef _UVLC_P5P_H_ +#define _UVLC_P5P_H_ + +#include + +// not_last > 0 if this is not the last coefficient +// If last == 0, a special sequence is emitted +void uvlc_encode( video_stream_t* const stream, int32_t level, int32_t run, int32_t not_last ); + +#endif // _UVLC_ENCODE_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/video_config.h b/ARDroneLib/VLIB/Platform/arm9/video_config.h new file mode 100644 index 0000000..a8beacd --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_config.h @@ -0,0 +1,33 @@ +#ifndef _VIDEO_CONFIG_ARM9_H_ +#define _VIDEO_CONFIG_ARM9_H_ + +# define CACHE_DLINESIZE (32) + +/* Default configuration for P5+ platform */ + +#define VIDEO_DCT_INTERRUPT_ENABLE (0) + +#define VIDEO_DCT_USE_INTRAM (0) + +#define DEFAULT_QUANTIZATION (6) + +/* + Help on finding a good MAX_NUM_MACRO_BLOCKS_PER_CALL on P5P + Maximum is 10 macroblocks because P5P DCT can only handle 64 blocks at once + This parameter is important and has to be adapted to your resolution + (CIF, VGA,... ) in order to minimize waiting time between two calls. + For example case like a call with a lot of blocks followed by a call + with a small number of blocks need to be avoided. + Ex: In QVGA a value of 6 is not optimal because there's 20 macroblocks per GOB + so there will be 3 calls with 6 macroblocks and a call with 2 macroblocks + (you can check with RTMON to monitor the waiting time represendted by event VIDEO_VLIB_DCT_WAIT_UEVENT) + In the QVGA case this is a better choice to choose a value of 7 to have two calls for 7 macroblocks and + a call for 6 macroblocks (of course 10 seems to be the better value - 2 calls - from an hardware DCT point of view). +*/ +#define MAX_NUM_MACRO_BLOCKS_PER_CALL (6) + +#define DEFAULT_INTERNAL_STREAM_SIZE (1024 * 8) + +#define VLIB_ALLOC_ALIGN CACHE_DLINESIZE + +#endif // _VIDEO_CONFIG_ARM9_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.c b/ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.c new file mode 100644 index 0000000..d22987f --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.c @@ -0,0 +1,254 @@ +#include +#include // I/O macros +#include // cyg_interrupt +#include +#include + +#include "video_config.h" +#include "video_dct_p5p.h" +#include "video_utils_p5p.h" + +#if (MAX_NUM_MACRO_BLOCKS_PER_CALL > 10) +# error "MAX_NUM_MACRO_BLOCKS_PER_CALL must not be greater than 10 on P5P" +#endif + +#if (VIDEO_DCT_USE_INTRAM == 0) +#include +#endif + +static cyg_uint32 dct_in_progress; + +#if (VIDEO_DCT_INTERRUPT_ENABLE == 1) + +static cyg_interrupt dct_interrupt; +static cyg_handle_t dct_interrupt_handle; + +//! DCT driver interrupt service routine (ISR) +static cyg_uint32 dct_isr( cyg_vector_t vector, cyg_addrword_t data ) +{ + cyg_drv_interrupt_mask(vector); + cyg_drv_interrupt_acknowledge(vector); + + return CYG_ISR_CALL_DSR; // request DSR +} + +//! DCT driver deffered service routine (DSR) +static void dct_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + cyg_uint32 itack; + + RTMON_USTOP( VIDEO_VLIB_DCT_COMPUTE_UEVENT ); + + switch( dct_read_reg( DCT_STATUS ) ) + { + case DCT_STATUS_END_OK: + itack = DCT_ITACK_END_OK; + break; + + case DCT_STATUS_ERROR: + diag_printf("[DCT] DMA access failure\n"); + itack = DCT_ITACK_ERROR; + break; + + default: + itack = 0; + break; + } + + dct_write_reg( DCT_ITACK, itack ); + + cyg_drv_interrupt_unmask(vector); +} +#endif // VIDEO_DCT_INTERRUPT_ENABLE + + +C_RESULT video_dct_p5p_init(void) +{ + cyg_uint32 value; + + HAL_READ_UINT32( PARROT5_SYS + _SYS_CEN, value); + HAL_WRITE_UINT32( PARROT5_SYS + _SYS_CEN, (value | SYS_CEN_CAMIFCLK) ); + +#if (VIDEO_DCT_INTERRUPT_ENABLE == 1) + diag_printf("Configuring DCT with interrupt acknowledge\n"); + cyg_drv_interrupt_create( CYGNUM_HAL_INTERRUPT_DCT, + 1, + (cyg_addrword_t) 0, + dct_isr, + dct_dsr, + &dct_interrupt_handle, + &dct_interrupt ); + + cyg_drv_interrupt_attach(dct_interrupt_handle); + + cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_DCT); + + dct_write_reg( DCT_ITEN , DCT_ITEN_END_OK | DCT_ITEN_ERROR ); +#else + dct_write_reg ( DCT_ITEN, 0 ); +#endif // VIDEO_DCT_INTERRUPT_ENABLE + + dct_in_progress = 0; + + return C_OK; +} + +#ifdef HAS_FDCT_COMPUTE + +int16_t* video_fdct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks) +{ + cyg_uint32 ctrl = 0; +#if (VIDEO_DCT_INTERRUPT_ENABLE == 0) + cyg_uint32 itack = 0; +#endif + + num_macro_blocks *= 6; + +#if (VIDEO_DCT_USE_INTRAM == 0) +// arm_mmu_clean_dcache_range((CYG_ADDRESS)in, num_macro_blocks*MCU_BLOCK_SIZE*2 ); +// arm_mmu_invalidate_cache_range((CYG_ADDRESS)in, num_macro_blocks*MCU_BLOCK_SIZE*2 ); +// +// arm_mmu_clean_dcache_range((CYG_ADDRESS)out, num_macro_blocks*MCU_BLOCK_SIZE*2 ); +// arm_mmu_invalidate_cache_range((CYG_ADDRESS)out, num_macro_blocks*MCU_BLOCK_SIZE*2 ); + + arm_mmu_flush_dcache(); +#endif + +#if (VIDEO_DCT_INTERRUPT_ENABLE == 1) + cyg_drv_dsr_lock(); +#else + + if( dct_in_progress > 0 ) + { + RTMON_USTART( VIDEO_VLIB_DCT_WAIT_UEVENT ); + + // Check if we have to wait for a previous run to complete + while( dct_read_reg( DCT_STATUS ) == 0 ); + + RTMON_USTOP( VIDEO_VLIB_DCT_WAIT_UEVENT ); + } + + switch( dct_read_reg( DCT_STATUS ) ) + { + case DCT_STATUS_END_OK: + // diag_printf("DCT_STATUS_END_OK\n"); + itack = DCT_ITACK_END_OK; + break; + + case DCT_STATUS_ERROR: + diag_printf("[DCT] DMA access failure\n"); + itack = DCT_ITACK_ERROR; + break; + + default: + itack = 0; + break; + } + + if( itack > 0 ) + dct_write_reg( DCT_ITACK, itack ); // Acknowledge previous run + +#endif // VIDEO_DCT_INTERRUPT_ENABLE + + ctrl |= ((num_macro_blocks - 1) & 0x3F ) << 1; + ctrl |= DCT_CTRLMODE_FDCT; + + dct_write_reg ( DCT_ORIG_Y_ADDR , arm_mmu_v2p( (cyg_addrword_t)in ) ); + dct_write_reg ( DCT_ORIG_CU_ADDR, 0 ); + dct_write_reg ( DCT_ORIG_CV_ADDR, 0 ); + + dct_write_reg ( DCT_DEST_Y_ADDR , arm_mmu_v2p( (cyg_addrword_t)out ) ); + dct_write_reg ( DCT_DEST_CU_ADDR, 0 ); + dct_write_reg ( DCT_DEST_CV_ADDR, 0 ); + + dct_write_reg ( DCT_LINEOFFSET, 0 ); + + dct_write_reg ( DCT_CONTROL, ctrl ); + +#if (VIDEO_DCT_INTERRUPT_ENABLE == 1) + cyg_drv_dsr_unlock(); + + RTMON_USTART( VIDEO_VLIB_DCT_COMPUTE_UEVENT ); +#endif + + dct_in_progress = 1; + + return out + MCU_BLOCK_SIZE*num_macro_blocks; +} + +#endif // HAS_FDCT_COMPUTE + +#ifdef HAS_IDCT_COMPUTE + +int16_t* video_idct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks) +{ + cyg_uint32 ctrl = 0; +#if (VIDEO_DCT_INTERRUPT_ENABLE == 0) + cyg_uint32 itack = 0; +#endif + +#if (VIDEO_DCT_USE_INTRAM == 0) + arm_mmu_flush_dcache(); +#endif + + num_macro_blocks *= 6; + +#if (VIDEO_DCT_INTERRUPT_ENABLE == 1) + cyg_drv_dsr_lock(); +#else + + if( dct_in_progress > 0 ) + { + // Check if we have to wait for a previous run to complete + while( dct_read_reg( DCT_STATUS ) == 0 ); + } + + switch( dct_read_reg( DCT_STATUS ) ) + { + case DCT_STATUS_END_OK: + // diag_printf("DCT_STATUS_END_OK\n"); + itack = DCT_ITACK_END_OK; + break; + + case DCT_STATUS_ERROR: + diag_printf("[DCT] DMA access failure\n"); + itack = DCT_ITACK_ERROR; + break; + + default: + itack = 0; + break; + } + + if( itack > 0 ) + dct_write_reg( DCT_ITACK, itack ); // Acknowledge previous run + +#endif // VIDEO_DCT_INTERRUPT_ENABLE + + ctrl |= ((num_macro_blocks - 1) & 0x3F ) << 1; + ctrl |= DCT_CTRLMODE_IDCT; + + dct_write_reg ( DCT_ORIG_Y_ADDR , arm_mmu_v2p( (cyg_addrword_t)in ) ); + dct_write_reg ( DCT_ORIG_CU_ADDR, 0 ); + dct_write_reg ( DCT_ORIG_CV_ADDR, 0 ); + + dct_write_reg ( DCT_DEST_Y_ADDR , arm_mmu_v2p( (cyg_addrword_t)out ) ); + dct_write_reg ( DCT_DEST_CU_ADDR, 0 ); + dct_write_reg ( DCT_DEST_CV_ADDR, 0 ); + + dct_write_reg ( DCT_LINEOFFSET, 0 ); + + dct_write_reg ( DCT_CONTROL, ctrl ); + +#if (VIDEO_DCT_INTERRUPT_ENABLE == 1) + cyg_drv_dsr_unlock(); + + RTMON_USTART( VIDEO_VLIB_DCT_COMPUTE_UEVENT ); +#endif + + dct_in_progress = 1; + + return out + MCU_BLOCK_SIZE*num_macro_blocks; +} + +#endif // HAS_IDCT_COMPUTE diff --git a/ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.h b/ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.h new file mode 100644 index 0000000..2992e33 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_dct_p5p.h @@ -0,0 +1,66 @@ +#ifndef _VIDEO_DCT_P5P_H_ +#define _VIDEO_DCT_P5P_H_ + +// #include +#include + +//////////////////////////////////////////////////// +// Parrot proprietary DCT registers +//////////////////////////////////////////////////// + +// Parrot DCT address: 0xD00B0000 +#define DCT_STATUS 0x000 // Status Register +#define DCT_ITEN 0x004 // Interrupt Enable Register +#define DCT_ITACK 0x008 // Interrupt Acknowledge Register +#define DCT_CONTROL 0x00C // Control Register +#define DCT_DMA 0x010 // Dma Register +#define DCT_ORIG_Y_ADDR 0x014 // Address Register +#define DCT_ORIG_CU_ADDR 0x018 // Address Register +#define DCT_ORIG_CV_ADDR 0x01C // Address Register +#define DCT_DEST_Y_ADDR 0x020 // Address Register +#define DCT_DEST_CU_ADDR 0x024 // Address Register +#define DCT_DEST_CV_ADDR 0x028 // Address Register +#define DCT_LINEOFFSET 0x02C // Line size +#define DCT_DEBUG 0x030 // Debug register +#define DCT_SIGNATURE 0x034 // Signature Register + + +// Registers bitwise definitions +// Status register +#define DCT_STATUS_END_OK (1<<0) // DCT Done +#define DCT_STATUS_ERROR (1<<1) // DCT Error + +// Interrupt enable register +#define DCT_ITEN_END_OK (1<<0) // IT Done enable +#define DCT_ITEN_ERROR (1<<1) // IT Error enable + +// Interrupt Acknowledge register +#define DCT_ITACK_END_OK (1<<0) // IT Done acknowledge +#define DCT_ITACK_ERROR (1<<1) // IT Error acknowledge + +// DCT control mode (forward or inverse dct) +#define DCT_CTRLMODE_FDCT 0 +#define DCT_CTRLMODE_IDCT 1 + + +//! write to a DCT register +#define dct_write_reg( _reg_, _value_ ) \ + (*((volatile CYG_WORD32 *)(PARROT5_DCT +(_reg_))) = (CYG_WORD32)(_value_)) + +//! read a DCT register +#define dct_read_reg(_reg_ ) \ + (*((volatile CYG_WORD32 *)(PARROT5_DCT+(_reg_)))) + +typedef enum { + DCT_DMA_INCR = 0, //!< 4 bytes DMA burst + DCT_DMA_INCR4 = 1, //!< 16 bytes DMA burst + DCT_DMA_INCR8 = 2, //!< 32 bytes DMA burst + DCT_DMA_INCR16 = 3, //!< 64 bytes DMA burst +} DCT_DMA_BURST_MODE; + +C_RESULT video_dct_p5p_init(void); + +int16_t* video_fdct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks); +int16_t* video_idct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks); + +#endif // ! _VIDEO_DCT_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.c b/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.c new file mode 100644 index 0000000..8437851 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.c @@ -0,0 +1,167 @@ +#include +#include "video_gen_sad.h" + + +sad_fn gen_sad( uint32_t* buffer, uint32_t buffer_length, + uint32_t bytes_per_entry_ref, uint32_t bytes_per_entry_src, + uint16_t offset_ref, uint16_t offset_src, + uint32_t square_length ) +{ + + /* Register usage in generated code + lr/r14 : sad accumulation + r0 : ref - r2 : data read with r0 + r1 : src - r3 : data read with r1 + ip : counter + */ + + uint32_t *b; + int8_t *buffer_save, *buffer_current; + sad_fn sad = (sad_fn) NULL; + + uint32_t prologue[] = { + 0xe52de004, // str lr, [sp, #-4]! + 0xe3a0c000, // mov ip, 0x0 + 0xe3a0e000 // mov lr, 0x0 + }; + + uint32_t epilogue[] = { + 0xe1a0000e, // mov r0, lr + 0xe49df004 // ldr pc, [sp], #4 + }; + + uint32_t sad_acc[] = { + 0xe0732002, // rsbs r2, r3, r2 + 0xb2622000, // rsblt r2, r2, #0 + 0xe08ee002 // add lr, lr, r2 + }; + + uint32_t dec_count[] = { + 0xe25cc001 // subs ip, ip, #1 + }; + + offset_ref += ( 1 - square_length ); + offset_src += ( 1 - square_length ); + + if( offset_ref < 1024 && offset_src < 1024 ) + { + sad = (sad_fn) buffer; + + b = &buffer[0]; + buffer = emit_buffer( buffer, prologue, sizeof(prologue) ); + b[1] |= square_length; + + switch( bytes_per_entry_ref ) + { + case MEM_FMT_8: + buffer = emit_load8_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_0, ARM_REG_2, 1 ); + break; + + case MEM_FMT_16: + buffer = emit_load16_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_0, ARM_REG_2, 1 ); + break; + + case MEM_FMT_32: + buffer = emit_load32_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_0, ARM_REG_2, 1 ); + break; + } + + switch( bytes_per_entry_src ) + { + case MEM_FMT_8: + buffer = emit_load8_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_1, ARM_REG_3, 1 ); + break; + + case MEM_FMT_16: + buffer = emit_load16_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_1, ARM_REG_3, 1 ); + break; + + case MEM_FMT_32: + buffer = emit_load32_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_1, ARM_REG_3, 1 ); + break; + } + + buffer_save = (int8_t*)&buffer[0]; + + square_length --; + + while( square_length > 0 ) + { + emit_buffer( buffer, sad_acc, sizeof(sad_acc) ); + + switch( bytes_per_entry_ref ) + { + case MEM_FMT_8: + buffer = emit_load8_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_0, ARM_REG_2, 1 ); + break; + + case MEM_FMT_16: + buffer = emit_load16_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_0, ARM_REG_2, 1 ); + break; + + case MEM_FMT_32: + buffer = emit_load32_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_0, ARM_REG_2, 1 ); + break; + } + + switch( bytes_per_entry_src ) + { + case MEM_FMT_8: + buffer = emit_load8_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_1, ARM_REG_3, 1 ); + break; + + case MEM_FMT_16: + buffer = emit_load16_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_1, ARM_REG_3, 1 ); + break; + + case MEM_FMT_32: + buffer = emit_load32_pi( COND_FIELD_ALWAYS, buffer, ARM_REG_1, ARM_REG_3, 1 ); + break; + } + + square_length --; + } + + buffer = emit_buffer( buffer, sad_acc, sizeof(sad_acc) ); + buffer = emit_buffer( buffer, dec_count, sizeof(dec_count) ); + + switch( bytes_per_entry_ref ) + { + case MEM_FMT_8: + buffer = emit_load8_pi( COND_FIELD_NE, buffer, ARM_REG_0, ARM_REG_2, offset_ref ); + break; + + case MEM_FMT_16: + buffer = emit_load16_pi( COND_FIELD_NE, buffer, ARM_REG_0, ARM_REG_2, offset_ref ); + break; + + case MEM_FMT_32: + buffer = emit_load32_pi( COND_FIELD_NE, buffer, ARM_REG_0, ARM_REG_2, offset_ref ); + break; + } + + switch( bytes_per_entry_src ) + { + case MEM_FMT_8: + buffer = emit_load8_pi( COND_FIELD_NE, buffer, ARM_REG_1, ARM_REG_3, offset_src ); + break; + + case MEM_FMT_16: + buffer = emit_load16_pi( COND_FIELD_NE, buffer, ARM_REG_1, ARM_REG_3, offset_src ); + break; + + case MEM_FMT_32: + buffer = emit_load32_pi( COND_FIELD_NE, buffer, ARM_REG_1, ARM_REG_3, offset_src ); + break; + } + + buffer_current = (int8_t*)&buffer[0]; + buffer = emit_branch( COND_FIELD_NE, buffer, buffer_save - buffer_current - 8 ); + + buffer = emit_buffer( buffer, epilogue, sizeof(epilogue) ); + + arm_mmu_flush_dcache(); + } + + return sad; +} diff --git a/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h b/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h new file mode 100644 index 0000000..226ce85 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h @@ -0,0 +1,46 @@ +#ifndef _VIDEO_GEN_SAD_H_ +#define _VIDEO_GEN_SAD_H_ + +// Returns the sum of absolute difference between reference and source +typedef uint32_t (*sad_fn)(void* ref, void* src); + +// +// bytes1 : number of bytes for ref (1-bytes) +// offset_ref : number of elements to skip to process next row ( 176 in QCIF for example, or at least row_length for a contiguous array ) +// square_length : number of elements per row or column +// offset_ref & offset_src must be less than 1024 +// +sad_fn gen_sad( uint32_t* buffer, uint32_t buffer_length, + uint32_t bytes_per_entry_ref, uint32_t bytes_per_entry_src, + uint16_t offset_ref, uint16_t offset_src, + uint32_t square_length); + +/* + Usage: + +int32_t sad_ref[] = { 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8 }; + +int16_t sad_mem[] = { 9, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 12, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8 }; + + uint32_t ramcode_buffer_sad[256]; + sad_fn sad_8_32_16 = gen_sad( ramcode_buffer_sad, 256, MEM_FMT_32, MEM_FMT_16, 8, 8, 8); + + uint32_t sum = sad_8_32_16(sad_ref, sad_mem); +*/ + + +#endif // _VIDEO_GENSAD_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.S b/ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.S new file mode 100644 index 0000000..5547346 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.S @@ -0,0 +1,51 @@ +#include "video_utils_p5p.h" + +#ifdef HAS_VIDEO_WRITE_DATA + + .text + .align 4 + + + .global video_write_data + .type video_write_data, %function + +/* Registers usage for video_write_data (r0 & r3 must be preserved) + r0 = stream + r1 = code + r2 = length + r3 = video_stream->code + r4 = video_stream->used + r5 = video_stream->bytes + ip = video_stream->length + lr = video_stream->index +*/ + +video_write_data: + ldr ip, [r0] + stmdb sp!, {r3, r4, r5, lr} /* save regiter on the stack */ + cmp r2, ip /* length > stream->length ? */ + ldmib r0, {r3, r4, r5, lr} + + ble video_write_data_1 + add r4, r4, #4 /* stream->used += 4 */ + str r4, [r0, #8] /* write back stream->used */ + mov r3, r3, lsl ip /* stream->code <<= stream->length */ + mov r4, #1 + sub r2, r2, ip /* length -= stream->length */ + rsb r4, r4, r4, lsl r2 /* code &= (1 << length) - 1 (rd = shifter operand - rn) */ + orr r3, r3, r1, lsr r2 /* stream->code |= code >> (length - stream->length) */ + and r1, r1, r4 /* code &= (1 << length) - 1 */ + str r3, [r5, lr, lsl #2] /* stream->bytes[stream->index] = stream->code */ + add lr, lr, #1 /* stream->index++ */ + str lr, [r0, #16] /* write back stream->index */ + mov r3, #0 /* stream->code = 0 */ + mov ip, #32 /* stream->length = 32 */ + +video_write_data_1: + cmp r2, #0 + orrne r3, r1, r3, lsl r2 /* stream->code = (stream->code << length) | code */ + rsbne r2, r2, ip /* stream->length -= length */ + stmia r0, {r2, r3} + ldmia sp!, {r3, r4, r5, pc} + +#endif // HAS_VIDEO_WRITE_DATA diff --git a/ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.h b/ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.h new file mode 100644 index 0000000..90034c3 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_packetizer_p5p.h @@ -0,0 +1,8 @@ +#ifndef _VIDEO_PACKETIZER_P5P_H_ +#define _VIDEO_PACKETIZER_P5P_H_ + +#include + +void video_write_data( video_stream_t* const stream, uint32_t code, int32_t length ); + +#endif // _VIDEO_PACKETIZER_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/video_picture_p5p.S b/ARDroneLib/VLIB/Platform/arm9/video_picture_p5p.S new file mode 100644 index 0000000..b636516 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_picture_p5p.S @@ -0,0 +1,330 @@ +#include "video_utils_p5p.h" +#include + +#ifdef HAS_VIDEO_BLOCKLINE_TO_MACRO_BLOCKS + +#include "config-tcm.h" + + .section ".text.itcm","ax" + .global video_blockline_to_macro_blocks + .global video_blockline_patch_block_1 + .global video_blockline_patch_block_2_start + .global video_blockline_patch_block_2 + .global video_blockline_patch_block_3_start + .global video_blockline_patch_block_3 + .global video_blockline_patch_block_4_start + .global video_blockline_patch_block_4 + .global video_blockline_patch_fix_y + .global video_blockline_patch_block_cb + .global video_blockline_patch_fix_cb + .global video_blockline_patch_block_cr + .global video_blockline_patch_fix_cr + .type video_blockline_to_macro_blocks, %function + +/* Registers usage + r0 : ctx + r1 : dst + r2 : num_macro_blocks + r3 : y_src + r4 : cb_src + r5 : cr_src + r6, r7, r8, r9 : Pixels in 16 bits format (write in dst) + r10, r11 : Pixels in 8 bits format (read from y_src, cb_src or cr_src) + ip/r12 : not used for instance + lr/r14 : line counter in internal loop (8 lines per block) +*/ + +video_blockline_to_macro_blocks: + stmdb sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr} + ldm r0, { r3, r4, r5 } + +video_blockline_to_macro_blocks_loop: + + @@ Luminances + @@ Copy first block + mov lr, #8 + +copy_block_1: @ data conversion from 8 bits to 16 bits + + ldmia r3!, {r10-r11} @ Get 8 pixels from y_src + + @ isolate the first four pixel + and r6, r10, #0x00FF + and r8, r10, #0xFF00 + + mov r10, r10, LSR #16 + + and r7, r10, #0x00FF + and r9, r10, #0xFF00 + + @ Combine them + orr r6, r8, LSL #8 + orr r7, r9, LSL #8 + + @ isolate next four pixels + and r8, r11, #0x00FF + and r10, r11, #0xFF00 + + mov r11, r11, LSR #16 + + and r9, r11, #0x00FF + and r11, r11, #0xFF00 + + @ Combine them + orr r8, r10, LSL #8 + orr r9, r11, LSL #8 + + @ Store result of conversion to dst + stmia r1!, {r6-r9} + + subs lr, lr, #1 + + @ Proceed to next line +video_blockline_patch_block_1: + addne r3, #(0) + bne copy_block_1 + + + @@ Copy second block +video_blockline_patch_block_2_start: + sub r3, #(0) + mov lr, #8 + +copy_block_2: @ data conversion from 8 bits to 16 bits + + ldm r3, {r10-r11} @ Get 8 pixels from y_src + + @ isolate the first four pixel + and r6, r10, #0x00FF + and r8, r10, #0xFF00 + + mov r10, r10, LSR #16 + + and r7, r10, #0x00FF + and r9, r10, #0xFF00 + + @ Combine them + orr r6, r8, LSL #8 + orr r7, r9, LSL #8 + + @ isolate next four pixels + and r8, r11, #0x00FF + and r10, r11, #0xFF00 + + mov r11, r11, LSR #16 + + and r9, r11, #0x00FF + and r11, r11, #0xFF00 + + @ Combine them + orr r8, r10, LSL #8 + orr r9, r11, LSL #8 + + @ Store result of conversion to dst + stmia r1!, {r6-r9} + + subs lr, lr, #1 + + @ Proceed to next line +video_blockline_patch_block_2: + addne r3, #(0) + bne copy_block_2 + + + @@ Copy third block +video_blockline_patch_block_3_start: + add r3, #(0) + mov lr, #8 + +copy_block_3: @ data conversion from 8 bits to 16 bits + + ldmia r3!, {r10-r11} @ Get 8 pixels from y_src + + @ isolate the first four pixel + and r6, r10, #0x00FF + and r8, r10, #0xFF00 + + mov r10, r10, LSR #16 + + and r7, r10, #0x00FF + and r9, r10, #0xFF00 + + @ Combine them + orr r6, r8, LSL #8 + orr r7, r9, LSL #8 + + @ isolate next four pixels + and r8, r11, #0x00FF + and r10, r11, #0xFF00 + + mov r11, r11, LSR #16 + + and r9, r11, #0x00FF + and r11, r11, #0xFF00 + + @ Combine them + orr r8, r10, LSL #8 + orr r9, r11, LSL #8 + + @ Store result of conversion to dst + stmia r1!, {r6-r9} + + subs lr, lr, #1 + + @ Proceed to next line +video_blockline_patch_block_3: + addne r3, #(0) + bne copy_block_3 + + + @@ Copy fourth block +video_blockline_patch_block_4_start: + sub r3, #(0) + mov lr, #8 + +copy_block_4: @ data conversion from 8 bits to 16 bits + + ldmia r3!, {r10-r11} @ Get 8 pixels from y_src + + @ isolate the first four pixel + and r6, r10, #0x00FF + and r8, r10, #0xFF00 + + mov r10, r10, LSR #16 + + and r7, r10, #0x00FF + and r9, r10, #0xFF00 + + @ Combine them + orr r6, r8, LSL #8 + orr r7, r9, LSL #8 + + @ isolate next four pixels + and r8, r11, #0x00FF + and r10, r11, #0xFF00 + + mov r11, r11, LSR #16 + + and r9, r11, #0x00FF + and r11, r11, #0xFF00 + + @ Combine them + orr r8, r10, LSL #8 + orr r9, r11, LSL #8 + + @ Store result of conversion to dst + stmia r1!, {r6-r9} + + subs lr, lr, #1 + + @ Proceed to next line +video_blockline_patch_block_4: + addne r3, #(0) + bne copy_block_4 + +video_blockline_patch_fix_y: + sub r3, #(0) @ Fix r3 for next iteration + + + @@ Chrominances + @@ Copy fifth block + mov lr, #8 + +copy_block_cb: @ data conversion from 8 bits to 16 bits + + ldmia r4!, {r10-r11} @ Get 8 pixels from cb_src + + @ isolate the first four pixel + and r6, r10, #0x00FF + and r8, r10, #0xFF00 + + mov r10, r10, LSR #16 + + and r7, r10, #0x00FF + and r9, r10, #0xFF00 + + @ Combine them + orr r6, r8, LSL #8 + orr r7, r9, LSL #8 + + @ isolate next four pixels + and r8, r11, #0x00FF + and r10, r11, #0xFF00 + + mov r11, r11, LSR #16 + + and r9, r11, #0x00FF + and r11, r11, #0xFF00 + + @ Combine them + orr r8, r10, LSL #8 + orr r9, r11, LSL #8 + + @ Store result of conversion to dst + stmia r1!, {r6-r9} + + subs lr, lr, #1 + + @ Proceed to next line +video_blockline_patch_block_cb: + addne r4, #(0) + bne copy_block_cb + +video_blockline_patch_fix_cb: + sub r4, #(0) @ Fix r4 for next iteration + + + @@ Copy sixth block + mov lr, #8 + +copy_block_cr: @ data conversion from 8 bits to 16 bits + + ldmia r5!, {r10-r11} @ Get 8 pixels from cr_src + + @ isolate the first four pixel + and r6, r10, #0x00FF + and r8, r10, #0xFF00 + + mov r10, r10, LSR #16 + + and r7, r10, #0x00FF + and r9, r10, #0xFF00 + + @ Combine them + orr r6, r8, LSL #8 + orr r7, r9, LSL #8 + + @ isolate next four pixels + and r8, r11, #0x00FF + and r10, r11, #0xFF00 + + mov r11, r11, LSR #16 + + and r9, r11, #0x00FF + and r11, r11, #0xFF00 + + @ Combine them + orr r8, r10, LSL #8 + orr r9, r11, LSL #8 + + @ Store result of conversion to dst + stmia r1!, {r6-r9} + + subs lr, lr, #1 + + @ Proceed to next line +video_blockline_patch_block_cr: + addne r5, #(0) + bne copy_block_cr + +video_blockline_patch_fix_cr: + sub r5, #(0) @ Fix r5 for next iteration + + + subs r2, r2, #1 + bne video_blockline_to_macro_blocks_loop + + stm r0, { r3, r4, r5 } + ldmia sp!, {r4, r5, r6, r7, r8, r9, r10, r11, pc} + +#endif // HAS_VIDEO_BLOCKLINE_TO_MACRO_BLOCKS diff --git a/ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.S b/ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.S new file mode 100644 index 0000000..3aa0da6 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.S @@ -0,0 +1,88 @@ +#include "video_utils_p5p.h" + +#ifdef HAS_DO_QUANTIZE_INTRA_MB + +#ifdef _ECOS +#include "config-tcm.h" + + .section ".text.itcm","ax" +#endif // ! _ECOS + + .global do_quantize_intra_mb + .type do_quantize_intra_mb, %function + +/* This implementation compute two quantizations at a time + using ARM926EJ-S DSP extension (smul = 1 cycle if no dependency follow) + + Registers usage + r0 : [in ptr] data ptr + r1 : [in] quantification factor (16 bits) + r2 : [out ptr] number of non zero factor + r3 : data read from memory [r0] & value quantified from lsb of r3 + r4 : value quantified from msb of r3 + r5 : number of non zero factor + ip/r12 : bloc counter (a macroblock has 6 blocks) + lr/r14 : number of coefficient in block left to compute (there's 64 coefficiens per block (1 dc et 63 ac) + */ +do_quantize_intra_mb: + stmdb sp!, {r4, r5, lr} + mov ip, #6 /* initialize bloc counter i = 6 */ + ldr r3, [r0] /* read dc coefficient & first ac coefficient */ + +do_quantize_intra_l0: + mov r5, #1 /* last = 1 */ + smulbt r4, r1, r3 /* coeff *= invQuant */ + mov r3, r3, lsl #16 /* set r3 msb to zero */ + add r3, r3, #0x40000 /* coeff = (*ptr + 4) >> 3 */ + movs r3, r3, asr #19 + moveq r3, #1 /* if( coeff == 0 ) coeff = 1 */ + cmp r4, #0 + beq do_quantize_intra_l01 + rsblt r4, r4, #0 + mov r4, r4, asr #16 /* |coeff| >>= 16 */ + rsblt r4, r4, #0 + cmp r4, #0 + addne r5, r5, #1 /* if( coeff != 0 ) last++ */ + orrne r3, r3, r4, lsl #16 +do_quantize_intra_l01: + str r3, [r0] + ldr r3, [r0, #4]! /* read ac(3) & ac(2) coefficients */ + mov lr, #31 /* 31 pairs to read */ + +do_quantize_intra_l1: + cmp r3, #0 /* do nothing if both coefficients are zero */ + beq do_quantize_intra_l2 + smulbt r4, r1, r3 /* coeff *= invQuant */ + smulbb r3, r1, r3 /* coeff *= invQuant */ + cmp r4, #0 + beq do_quantize_intra_l11 + rsblt r4, r4, #0 + mov r4, r4, asr #16 /* |coeff| >>= 16 */ + rsblt r4, r4, #0 + movs r4, r4, lsl #16 /* keep only 16 lower significant bits */ + addne r5, r5, #1 /* if( coeff != 0 ) last++ */ +do_quantize_intra_l11: + cmp r3, #0 + beq do_quantize_intra_l12 + rsblt r3, r3, #0 + mov r3, r3, asr #16 + rsblt r3, r3, #0 + movs r3, r3, lsl #16 /* keep only 16 lower significant bits */ + addne r5, r5, #1 /* if( coeff != 0 ) last++ */ +do_quantize_intra_l12: + orr r3, r4, r3, lsr #16 + str r3, [r0] +do_quantize_intra_l2: + subs lr, lr, #1 + ldrne r3, [r0, #4]! /* read ac(i+1) & ac(i) coefficients */ + bne do_quantize_intra_l1 + + str r5, [r2], #4 /* store number of non zero coefficient for current bloc */ + subs ip, ip, #1 /* i-- */ + ldrne r3, [r0, #4]! /* read dc coefficient & first ac coefficient */ + bne do_quantize_intra_l0 +do_quantize_intra_exit: + add r0, #4 /* keep consistency because last reads are conditionals */ + ldmia sp!, {r4, r5, pc} + +#endif // HAS_DO_QUANTIZE_INTRA_MB diff --git a/ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.h b/ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.h new file mode 100644 index 0000000..874222f --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_quantizer_p5p.h @@ -0,0 +1,8 @@ +#ifndef _VIDEO_QUANTIZER_P5P_H_ +#define _VIDEO_QUANTIZER_P5P_H_ + +#include + +int16_t* do_quantize_intra_mb(int16_t* ptr, int32_t invQuant, int32_t* last_ptr); + +#endif // _VIDEO_QUANTIZER_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/video_utils.c b/ARDroneLib/VLIB/Platform/arm9/video_utils.c new file mode 100644 index 0000000..b5df6fa --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_utils.c @@ -0,0 +1,74 @@ +#include +#include + +#include +#include + +#include + +static uint32_t num_references = 0; + +#if (VIDEO_DCT_USE_INTRAM == 1) +// Put DMA buffer into INTRAM, this should avoid bus contention with CAMIF +static int16_t dct_buffer[2*DCT_BUFFER_SIZE] __attribute__((aligned(CACHE_DLINESIZE), section(".data.fast"))); +#endif + +C_RESULT video_utils_init( video_controller_t* controller ) +{ + if( num_references == 0 ) + { +#if (VIDEO_DCT_USE_INTRAM == 1) + // Put in non cached INTRAM + controller->blockline_cache = (int16_t*) (((CYG_ADDRESS) &dct_buffer[0]) + CYGMEM_REGION_intram_SHADOW - CYGMEM_REGION_intram); +#endif + } + + num_references ++; + + return C_OK; +} + +C_RESULT video_utils_close( video_controller_t* controller ) +{ + if( num_references > 0 ) + { + num_references --; + + if( num_references == 0 ) + { +#if (VIDEO_DCT_USE_INTRAM == 1) + // Put in non cached INTRAM + controller->blockline_cache = NULL; +#endif + } + } + + return C_OK; +} + +uint32_t ramcode_format_shifter_op_imm(uint32_t imm) +{ + uint32_t shifter, imm8; + + shifter = 32/2; + imm8 = imm; + + while( (imm8 & 0xFF) != imm8 ) + { + imm8 >>= 2; + shifter --; + } + + if( (imm8 << (32-shifter*2)) != imm ) + return 0xFFFFFFFF; + + if( shifter == 16 ) + shifter = 0; + + return (shifter << 8 | imm8); +} + +C_RESULT video_utils_set_format( uint32_t width, uint32_t height ) +{ + return C_OK; +} diff --git a/ARDroneLib/VLIB/Platform/arm9/video_utils.h b/ARDroneLib/VLIB/Platform/arm9/video_utils.h new file mode 100644 index 0000000..a24bf8c --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_utils.h @@ -0,0 +1,19 @@ +#ifndef _VIDEO_UTILS_ARM9_H_ +#define _VIDEO_UTILS_ARM9_H_ + +#include + +#if TARGET_CPU_ARM == 1 + +#include + +#include "video_utils_p5p.h" +#include "video_dct_p5p.h" +#include "video_quantizer_p5p.h" +#include "video_packetizer_p5p.h" +#include "UVLC/uvlc_p5p.h" +#include "UVLC/uvlc_mb_layer_p5p.h" + +#endif // TARGET_CPU_ARM + +#endif // _VIDEO_UTILS_ARM9_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9/video_utils_p5p.h b/ARDroneLib/VLIB/Platform/arm9/video_utils_p5p.h new file mode 100644 index 0000000..a8e8d5a --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9/video_utils_p5p.h @@ -0,0 +1,12 @@ +#ifndef _ARM_VIDEO_UTILS_H_ +#define _ARM_VIDEO_UTILS_H_ + +#define HAS_UVLC_ENCODE + +#define HAS_UVLC_WRITE_BLOCK + +#define HAS_VIDEO_WRITE_DATA + +#define HAS_DO_QUANTIZE_INTRA_MB + +#endif // _ARM_VIDEO_UTILS_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/P6_h264_reg.h b/ARDroneLib/VLIB/Platform/arm9_P6/P6_h264_reg.h new file mode 100644 index 0000000..7219faf --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/P6_h264_reg.h @@ -0,0 +1,118 @@ +//////////////////////////////////////////////////// +// Parrot proprietary DCT registers +//////////////////////////////////////////////////// + +// Parrot DCT address: 0xD00B0000 +#define P6_BASE_ADDRESS 0xD00B0000 + +// H264 general registers +#define H264_STATUS 0x000 // Status Register +#define H264_ITEN 0x004 // Interrupt Enable Register +#define H264_ITACK 0x008 // Interrupt Acknowledge Register +#define H264_DMA 0x010 // Dma Register +#define H264_DMAINT 0x02C +#define H264_RESET 0x03C +#define H264_START 0x00C +#define H264_CONFIG 0x028 +#define H264_LINESIZE 0x01C +#define H264_FRAMESIZE 0x020 +#define H264_MB_ADDR 0x024 +#define H264_QP 0x018 // ME/MC Y/CC quantizer + +// DCT registers +#define DCT_CONTROL 0x040 // Control Register +#define DCT_ORIG_Y_ADDR 0x044 // Address Register +#define DCT_ORIG_CU_ADDR 0x048 // Address Register +#define DCT_ORIG_CV_ADDR 0x04C // Address Register +#define DCT_DEST_Y_ADDR 0x050 // Address Register +#define DCT_DEST_CU_ADDR 0x054 // Address Register +#define DCT_DEST_CV_ADDR 0x058 // Address Register +#define DCT_LINEOFFSET 0x05C // Line size +#define DCT_Q_ADDR 0x064 // quantization table +//#define DCT_DEBUG 0x030? // Debug register +//#define DCT_SIGNATURE 0x034? // Signature Register + + +// Registers bitwise definitions +// Status register +#define DCT_STATUS_END_OK (1<<0) // DCT Done +//#define DCT_STATUS_ERROR (1<<1) // DCT Error ? + +// Interrupt enable register +#define DCT_ITEN_END_OK (1<<0) // IT Done enable +//#define DCT_ITEN_ERROR (1<<1) // IT Error enable ? + +// Interrupt Acknowledge register +#define DCT_ITACK_END_OK (1<<0) // IT Done acknowledge +//#define DCT_ITACK_ERROR (1<<1) // IT Error acknowledge ? + +// DCT control mode (forward or inverse dct) +#define DCT_CTRLMODE_FDCT 0 +#define DCT_CTRLMODE_IDCT 1 + +typedef enum { + DCT_DMA_INCR = 0, //!< 4 bytes DMA burst + DCT_DMA_INCR4 = 1, //!< 16 bytes DMA burst + DCT_DMA_INCR8 = 2, //!< 32 bytes DMA burst + DCT_DMA_INCR16 = 3, //!< 64 bytes DMA burst +} DCT_DMA_BURST_MODE; + + +// ME registers +#define ME_ALGORITHM 0x100 // I/P frame choice, disable/enable pred_intra +#define ME_RESULT 0x148 // in I-frame mode : intra mode result (intra 16x16 mod0/1/2/3 or intra 4x4) +#define ME_CMB_FRAME_ADDRY 0x11C // input frame (to be encoded) Y addr +#define ME_CMB_FRAME_ADDRCU 0x120 // input frame (to be encoded) U addr +#define ME_CMB_FRAME_ADDRCV 0x124 // input frame (to be encoded) V addr +#define ME_IPRED0 0x16C // intra4*4 pred mode results (first 8 4*4 blocks) +#define ME_IPRED1 0x170 // intra4*4 pred mode results (last 8 4*4 blocks) +#define ME_ANALYSIS 0x118 // define MB split pattern (P-frame) +#define ME_PAT_LIST 0x104 // define/enable search patterns (P-frame) +#define ME_PAT_RESIZE 0x108 // +#define ME_SW_FRAME_ADDRY 0x128 // luma reference frame for P-frame +#define ME_SW_FRAME_ADDRCC 0x12C // chroma reference frame for P-frame +#define ME_SW_CONFIG 0x140 // search window size +#define ME_PRED_BASE_REG 0x14C // MV result +#define ME_RD 0x114 + +// ME values +#define ME_ALGO_DIS_MVP_INTRA_PRED (1<<5) // diasable intra pred and inter MV pred +#define ME_ALGO_I_FRAME (1<<4) // configure ME to encode en I frame +#define ME_ALGO_P_FRAME (0<<4) // configure ME to encode en I frame + +#define ME_ANAL_4x4 (1<<22) +#define ME_ANAL_4x8 (1<<21) +#define ME_ANAL_8x4 (1<<20) +#define ME_ANAL_8x8 (1<<19) +#define ME_ANAL_8x16 (1<<18) +#define ME_ANAL_16x8 (1<<17) +#define ME_ANAL_16x16 (1<<16) + +#define ME_PAT_SMALL_DIAMOND 0x08 +#define ME_PAT_BIG_DIAMOND 0x09 +#define ME_PAT_SMALL_SQUARE 0x0A +#define ME_PAT_BIG_SQUARE 0x0B + +//DEB registers +#define DEB_ME_FRAME_ADDRY 0x0A0 // deb reconstructed picture (reference) +#define DEB_ME_FRAME_ADDRCC 0x0A4 // deb reconstructed picture (reference) +#define DEB_ME_TMP_ADDR 0x0A8 +#define DEB_MC_TMP_ADDR 0x0AC +#define DEB_CONFIG 0x080 +#define DEB_PARAM 0x084 +#define DEB_QPS_LEFT 0x08C +#define DEB_QPS_TOP 0x090 + +//MC registers +#define MC_MB_INFO 0x200 + +#define IS_INTRA_4x4(a) ((a&0x1F) == 0) +#define IS_INTRA_16x16(a) ((a&0x1F) != 0) +#define CHROMA_MODE(a) ((a>>16)&0x03) +#define INTRA_16x16_MODE(a) ((a&0x1F)-1 ) +#define INTER_16_8_PARTITION(a) (a&0x1F) + +#define I_MB_COMPLETION_FLAG 0x0010101 +#define I_MB_COMPLETION_MASK 0x00FFFFF +#define P_MB_COMPLETION_FLAG 0x1010101 +#define P_MB_COMPLETION_MASK 0xFFFFFFF diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.S b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.S new file mode 100644 index 0000000..4eb9ae6 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.S @@ -0,0 +1,146 @@ +#include "../video_utils_p6.h" + +#ifdef HAS_UVLC_WRITE_BLOCK + + .global uvlc_write_block + .type uvlc_write_block, %function + +/* This code is an inline version of uvlc_write_block using video_zztable_t81 + +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff ) */ + +#define zz(num1, num2) \ +video_zztable_t81_next_##num1: ;\ + cmp r1, #0 ;\ + addeq r2, r2, #1; \ + ldreqsh r1, [r4, #2*num2]; \ + beq video_zztable_t81_next_##num2; \ + sub r3, r3, #1; \ + bl uvlc_encode; \ + cmp r3, #0; \ + ldrgtsh r1, [r4, #2*num2]; \ + ldmleia sp!, {r4, pc}; \ + mov r2, #0; + +uvlc_write_block: + stmdb sp!, {r4, lr} + + mov r4, r1 + ldrsh r1, [r1, #0] + sub r3, r2, #1 + mov r2, #10 + bl video_write_data + cmp r3, #0 + ldrgtsh r1, [r4, #2] + mov r2, #0 + ldmleia sp!, {r4, pc} +/* +r1 = code +r2 = run +r3 = num_coeff +*/ + + zz(1,2) + zz(2,3) + zz(3,4) + zz(4,5) + zz(5,6) + zz(6,7) + zz(7,8) + zz(8,9) + zz(9,10) + zz(10,11) + zz(11,12) + zz(12,13) + zz(13,14) + zz(14,15) + zz(15,16) + zz(16,17) + zz(17,18) + zz(18,19) + zz(19,20) + zz(20,21) + zz(21,22) + zz(22,23) + zz(23,24) + zz(24,25) + zz(25,26) + zz(26,27) + zz(27,28) + zz(28,29) + zz(29,30) + zz(30,31) + zz(31,32) + zz(32,33) + zz(33,34) + zz(34,35) + zz(35,36) + zz(36,37) + zz(37,38) + zz(38,39) + zz(39,40) + zz(40,41) + zz(41,42) + zz(42,43) + zz(43,44) + zz(44,45) + zz(45,46) + zz(46,47) + zz(47,48) + zz(48,49) + zz(49,50) + zz(50,51) + zz(51,52) + zz(52,53) + zz(53,54) + zz(54,55) + zz(55,56) + zz(56,57) + zz(57,58) + zz(58,59) + zz(59,60) + zz(60,61) + zz(61,62) + zz(62,63) + + + + +video_zztable_t81_next_63: + mov r3, #0 + ldmia sp!, {r4, lr} + b uvlc_encode + +/* This code is an optimized version of uvlc_write_block using video_zztable_t81 + +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff ) */ +/* +uvlc_write_block: + stmdb sp!, {r4, r5, r6, lr} + + mov r4, r1 + ldrsh r1, [r1, #0] + sub r3, r2, #1 + mov r2, #8 + bl video_write_data + mov r2, #0 + cmp r3, #0 + ldmleia sp!, {r4, r5, r6, pc} + ldr r5, =video_zztable_t81 + +video_zztable_t81_next_1: + ldr r6, [r5, #4]! + mov r6, r6, lsl #1 + ldrsh r1, [r4, r6] + cmp r1, #0 + addeq r2, r2, #1 + beq video_zztable_t81_next_1 + sub r3, r3, #1 + bl uvlc_encode + cmp r3, #0 + ldmleia sp!, {r4, r5, r6, pc} + mov r2, #0 + b video_zztable_t81_next_1 +*/ + +#endif // HAS_UVLC_WRITE_BLOCK diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.c b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.c new file mode 100644 index 0000000..34be901 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.c @@ -0,0 +1,30 @@ +#include "../video_utils_p6.h" +#include "uvlc_mb_layer_p6.h" + +#ifdef HAS_UVLC_WRITE_BLOCK +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff) +{ + int32_t code, run; + + // DC coeff + code = *data++; + video_write_data( stream, code, 10 ); + num_coeff--; + // AC coeff + run = 0; + while( num_coeff > 0 ) + { + code = *data++; + if( code == 0 ) + { + run ++; + } + else + { + num_coeff--; + uvlc_encode( stream, code, run, num_coeff ); + run = 0; + } + } +} +#endif // HAS_UVLC_WRITE_BLOCK diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.h b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.h new file mode 100644 index 0000000..b4a0d16 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.h @@ -0,0 +1,8 @@ +#ifndef _UVLC_MB_LAYER_P6_H_ +#define _UVLC_MB_LAYER_P6_H_ + +#include + +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff ); + +#endif // _UVLC_MB_LAYER_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.S b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.S new file mode 100644 index 0000000..063d052 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.S @@ -0,0 +1,68 @@ +#include "../video_utils_p6.h" + +#ifdef HAS_UVLC_ENCODE + + .text + .align 4 + + + .global uvlc_encode + .type uvlc_encode, %function + +/* + Registers usage + r0 : stream + r1 : value_code + r2 : value_length + r3 : not_last (do not modify) + ip : run + lr : level +*/ +uvlc_encode: + stmdb sp!, {r4, r5, lr} /* save regiter on the stack */ + + mov ip, r2 /* ip = run */ + clz r4, ip /* r4 = clz(run) */ + + movs lr, r1 /* lr = level */ + rsbmi lr, lr, #0 /* lr = |level| */ + movmi r5, #1 + movpl r5, #0 /* save sign value */ + mov r1, #1 /* value_code = 1 */ + + /* Serialize run */ + + rsbs r4, r4, #31 /* length = 31 - clz(run) */ + subgt ip, ip, r1, lsl r4 /* run = run - (1 << length) */ + add r4, r4, #1 + add r2, r4, #1 /* value_length = length + 1 */ + subgt r4, r4, #1 + orrgt r1, ip, r1, lsl r4 + addgt r2, r2, r4 + + /* Serialize level */ + mov ip, #1 + clz r4, lr + rsbs r4, r4, #31 /* r4 = 31 - clz(level) number of bits used in level */ + subgt lr, ip, lsl r4 /* code -= (1 << length) */ + addgt r4, r4, #1 + add r4, r4, #1 + add r2, r2, r4 /* value_length += length */ + orr r1, ip, r1, lsl r4 /* value_code = 1 | (value_code << length) */ + subs r4, r4, #2 + addgt r2, r2, r4 /* value_length += length */ + orrgt r1, lr, r1, lsl r4 /* value_code = code | (value_code << length) */ + add r2, r2, #1 + orr r1, r5, r1, lsl #1 + + /* Serialize not_last if needed */ + ldmia sp!, {r4, r5, lr} /* restore saved registers */ + + cmp r3, #0 + addeq r2, r2, #3 /* value_length += 3 */ + moveq ip, #5 + orreq r1, ip, r1, lsl #3 /* value_code = 0x5 | (value_code << 3) */ + + b video_write_data /* jump to video_write_data to serialize data */ + +#endif diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.h b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.h new file mode 100644 index 0000000..932100f --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_p6.h @@ -0,0 +1,10 @@ +#ifndef _UVLC_P6_H_ +#define _UVLC_P6_H_ + +#include + +// not_last > 0 if this is not the last coefficient +// If last == 0, a special sequence is emitted +void uvlc_encode( video_stream_t* const stream, int32_t level, int32_t run, int32_t not_last ); + +#endif // _UVLC_ENCODE_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_config.h b/ARDroneLib/VLIB/Platform/arm9_P6/video_config.h new file mode 100644 index 0000000..fdc000f --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_config.h @@ -0,0 +1,40 @@ +#ifndef _VIDEO_CONFIG_ARM9_P6_H_ +#define _VIDEO_CONFIG_ARM9_P6_H_ + +#ifdef _ELINUX + +# define CACHE_DLINESIZE (32) + +/* Default configuration for P5+ platform */ + +#define VIDEO_DCT_INTERRUPT_ENABLE (0) + +#define VIDEO_DCT_USE_INTRAM (0) + +//TODO: DEFAULT_QUANTIZATION has to be TABLE_QUANTIZATION for UVLC. In case of P264 the default quant should be something like 25. +//TODO: Here TABLE_QUANTIZATION (==31) is also used as the default QP for P264. This is dirty. +#define DEFAULT_QUANTIZATION (TABLE_QUANTIZATION) + + +/* + Help on finding a good MAX_NUM_MACRO_BLOCKS_PER_CALL on P5P + Maximum is 10 macroblocks because P5P DCT can only handle 64 blocks at once + This parameter is important and has to be adapted to your resolution + (CIF, VGA,... ) in order to minimize waiting time between two calls. + For example case like a call with a lot of blocks followed by a call + with a small number of blocks need to be avoided. + Ex: In QVGA a value of 6 is not optimal because there's 20 macroblocks per GOB + so there will be 3 calls with 6 macroblocks and a call with 2 macroblocks + (you can check with RTMON to monitor the waiting time represendted by event VIDEO_VLIB_DCT_WAIT_UEVENT) + In the QVGA case this is a better choice to choose a value of 7 to have two calls for 7 macroblocks and + a call for 6 macroblocks (of course 10 seems to be the better value - 2 calls - from an hardware DCT point of view). +*/ +#define MAX_NUM_MACRO_BLOCKS_PER_CALL (10) + +#define DEFAULT_INTERNAL_STREAM_SIZE (1024 * 8) + +#define VLIB_ALLOC_ALIGN CACHE_DLINESIZE + +#endif // _ELINUX + +#endif // _VIDEO_CONFIG_ARM9_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.c b/ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.c new file mode 100644 index 0000000..ca5aeb1 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.c @@ -0,0 +1,181 @@ +#include "libuiomap.h" +#include "dma_malloc.h" +#include "video_config.h" +#include "video_dct_p6.h" +#include "video_utils_p6.h" +#include +#include +#include +#include + +#if (MAX_NUM_MACRO_BLOCKS_PER_CALL > 10) +# error "MAX_NUM_MACRO_BLOCKS_PER_CALL must not be greater than 10 on P6" +#endif + +#if (VIDEO_DCT_USE_INTRAM != 0) +#error "intram not supported" +#endif + +#if (VIDEO_DCT_INTERRUPT_ENABLE == 1) +#error "dct_interrupt not supported" +#endif + + +struct uiomap ui_h264_reg; +struct uiomap ui_sysc_reg; + +static uint16_t* local_quant_table; +static uint32_t local_address_quant_table; +static int32_t actual_quant; + +static uint32_t dct_in_progress; + +C_RESULT video_dct_p6_init(void) +{ + int32_t err; + //reset some variables + local_quant_table=NULL; + local_address_quant_table=0; + actual_quant = -1; + + err= uiomap_ioremap(&ui_h264_reg, 0xd0060000, 0x10000); + if (err) + { + PRINT("error remapping h264 regs: %s\n", strerror(-err)); + return C_FAIL; + } + err= uiomap_ioremap(&ui_sysc_reg, 0xd0000000, 0x10); + if (err) + { + PRINT("error activating h264 clock : %s\n", strerror(-err)); + return C_FAIL; + } + + // allocate local buffer + if (local_quant_table == NULL) + { + local_quant_table = (uint16_t*) dma_malloc (MCU_BLOCK_SIZE*sizeof (uint16_t)); + } + + if (local_quant_table == NULL) + { + PRINT ("dct p6 error during local buffers allocation\n"); + return C_FAIL; + } + + local_address_quant_table = (int32_t) dma_virt2phy(local_quant_table); + if (local_address_quant_table == 0) + { + PRINT ("dct p6 error when retrieving local physic address\n"); + return C_FAIL; + } + + // active h264 clock + uint32_t value; + value = uiomap_readl(&ui_sysc_reg, 0x0C); + uiomap_writel(&ui_sysc_reg,value | (1<<4) ,0x0C); + + // reset IP + uiomap_writel(&ui_h264_reg, 0x1, DCT_RESET); + + // registers configuration + //uiomap_writel(&ui_h264_reg, 0, DCT_CONFIG); // DCT + uiomap_writel(&ui_h264_reg, (1<<1)|(1<<6), DCT_CONFIG); // DCT+Quantization + uiomap_writel (&ui_h264_reg, 0, DCT_ITEN ); // no interrupt + uiomap_writel(&ui_h264_reg, 0x33, DCT_DMA); + uiomap_writel(&ui_h264_reg, 0x33, DCT_DMAINT); + uiomap_writel(&ui_h264_reg, local_address_quant_table, DCT_Q_ADDR); // quantization table + + uiomap_writel (&ui_h264_reg,0, DCT_ORIG_CU_ADDR); + uiomap_writel (&ui_h264_reg,0, DCT_ORIG_CV_ADDR); + uiomap_writel (&ui_h264_reg,0, DCT_DEST_CU_ADDR); + uiomap_writel (&ui_h264_reg,0, DCT_DEST_CV_ADDR); + uiomap_writel (&ui_h264_reg,0, DCT_LINEOFFSET); + + dct_in_progress = 0; + + + return C_OK; +} + +#ifdef HAS_FDCT_QUANT_COMPUTE +int16_t* video_fdct_quant_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks,int32_t quant) +{ + uint32_t status = 0; + uint32_t ctrl = 0; + uint32_t itack = 0; + num_macro_blocks *= 6; + + if( dct_in_progress > 0 ) + { + // Check if we have to wait for a previous run to complete + do + { + status = uiomap_readl(&ui_h264_reg,DCT_STATUS); + } + while( status == 0 ); + } + + switch( status ) + { + case DCT_STATUS_END_OK: + itack = DCT_ITACK_END_OK; + break; + + /*case DCT_STATUS_ERROR: + itack = DCT_ITACK_ERROR; + break;*/ + + default: + PRINT("dct status 0x%X\n",status); + itack = 0; + break; + } + + + // check if we have to update quantization table + if (actual_quant != quant) + { + actual_quant = quant; + + // VLIB backward compatibility + if (quant == TABLE_QUANTIZATION) + quant = TBL_QUANT_QUALITY; + + // build quantization table + // P6 DCT quantization table = 2^14/iquant_tab + uint32_t i; + uint16_t* p = local_quant_table; + for (i=0;i<64;i++) + *p++ = (2<<14) / QUANT_I(i,quant); + dma_flush_inv((uint32_t)local_quant_table, MCU_BLOCK_SIZE*sizeof(int16_t)); + } + + ctrl |= ((num_macro_blocks - 1) & 0x3F ) << 1; + ctrl |= DCT_CTRLMODE_FDCT; + + uiomap_writel (&ui_h264_reg,(uint32_t)dma_virt2phy(in), DCT_ORIG_Y_ADDR); + uiomap_writel (&ui_h264_reg,(uint32_t)dma_virt2phy(out), DCT_DEST_Y_ADDR); + + uiomap_writel (&ui_h264_reg, ctrl, DCT_CONTROL); + + dma_flush_inv( (uint32_t)in, 2*num_macro_blocks*MCU_BLOCK_SIZE); + uiomap_writel(&ui_h264_reg, 0, DCT_START); + dma_flush_inv( (uint32_t)out, 2*num_macro_blocks*MCU_BLOCK_SIZE); + dct_in_progress = 1; + + return out + MCU_BLOCK_SIZE*num_macro_blocks; +} +#endif // HAS_FDCT_COMPUTE + +C_RESULT video_dct_p6_close(void) +{ + uiomap_iounmap(&ui_h264_reg); + uiomap_iounmap(&ui_sysc_reg); + dma_free(local_quant_table); + return C_OK; +} + +#ifdef HAS_IDCT_COMPUTE +#error "hardware idct not yet supported on P6" +#endif // HAS_IDCT_COMPUTE diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.h b/ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.h new file mode 100644 index 0000000..917a55d --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_dct_p6.h @@ -0,0 +1,75 @@ +#ifndef _VIDEO_DCT_P6_H_ +#define _VIDEO_DCT_P6_H_ + +// #include +#include + +//////////////////////////////////////////////////// +// Parrot proprietary DCT registers +//////////////////////////////////////////////////// + +// Parrot DCT address: 0xD00B0000 +#define DCT_STATUS 0x000 // Status Register +#define DCT_ITEN 0x004 // Interrupt Enable Register +#define DCT_ITACK 0x008 // Interrupt Acknowledge Register +#define DCT_CONTROL 0x040 // Control Register +#define DCT_DMA 0x010 // Dma Register +#define DCT_DMAINT 0x02C +#define DCT_RESET 0x03C +#define DCT_START 0x00C +#define DCT_CONFIG 0x028 +#define DCT_ORIG_Y_ADDR 0x044 // Address Register +#define DCT_ORIG_CU_ADDR 0x048 // Address Register +#define DCT_ORIG_CV_ADDR 0x04C // Address Register +#define DCT_DEST_Y_ADDR 0x050 // Address Register +#define DCT_DEST_CU_ADDR 0x054 // Address Register +#define DCT_DEST_CV_ADDR 0x058 // Address Register +#define DCT_LINEOFFSET 0x05C // Line size +#define DCT_Q_ADDR 0x064 // quantization table +//#define DCT_DEBUG 0x030? // Debug register +//#define DCT_SIGNATURE 0x034? // Signature Register + + +// Registers bitwise definitions +// Status register +#define DCT_STATUS_END_OK (1<<0) // DCT Done +//#define DCT_STATUS_ERROR (1<<1) // DCT Error ? + +// Interrupt enable register +#define DCT_ITEN_END_OK (1<<0) // IT Done enable +//#define DCT_ITEN_ERROR (1<<1) // IT Error enable ? + +// Interrupt Acknowledge register +#define DCT_ITACK_END_OK (1<<0) // IT Done acknowledge +//#define DCT_ITACK_ERROR (1<<1) // IT Error acknowledge ? + +// DCT control mode (forward or inverse dct) +#define DCT_CTRLMODE_FDCT 0 +#define DCT_CTRLMODE_IDCT 1 + + +//! write to a DCT register +#define dct_write_reg( _reg_, _value_ ) \ + (*((volatile CYG_WORD32 *)(PARROT5_DCT +(_reg_))) = (CYG_WORD32)(_value_)) + +//! read a DCT register +#define dct_read_reg(_reg_ ) \ + (*((volatile CYG_WORD32 *)(PARROT5_DCT+(_reg_)))) + +typedef enum { + DCT_DMA_INCR = 0, //!< 4 bytes DMA burst + DCT_DMA_INCR4 = 1, //!< 16 bytes DMA burst + DCT_DMA_INCR8 = 2, //!< 32 bytes DMA burst + DCT_DMA_INCR16 = 3, //!< 64 bytes DMA burst +} DCT_DMA_BURST_MODE; + +C_RESULT video_dct_p6_init(void); +C_RESULT video_dct_p6_close(void); + +C_RESULT video_dct_p6p_init(void); + + +int16_t* video_fdct_quant_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks,int32_t quant); +//int16_t* video_idct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks); + +#endif // ! _VIDEO_DCT_P6P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.c b/ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.c new file mode 100644 index 0000000..35dbdc0 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.c @@ -0,0 +1,335 @@ +#include +#include "libuiomap.h" +#include "dma_malloc.h" +#include "video_config.h" +#include "video_p264_p6.h" +#include "video_utils_p6.h" +#include +#include "P6_h264_reg.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define CHECK_P264_IOCTL(a) if((a)<0) { PRINT("p264 ioctl failed (%s)\n",#a); return C_FAIL;} +//#define H264_P6_DEBUG +//#define H264_P6_PFRAME_DEBUG + +// h264 picture parameters +static uint8_t* current_Y; +static uint8_t* current_Cb; +static uint8_t* current_Cr; +static uint32_t current_width; +static uint32_t current_height; +static bool_t I_encoding; + +static uint8_t* h264_ref_frame; // frame decoded by encoder as a reference +static uint8_t* h264_deb_frame; // frame decoded by encoder as a reference +static p264_p6_raw_reg_results_t h264_raw_result[400]; // chroma_mode, intra_mode, MV, ... + +static int h264_fd = -1; + +C_RESULT video_p264_p6_init(void) +{ + C_RESULT res = C_OK; + h264_fd = open("/dev/p264_p6", O_RDWR|O_NONBLOCK); + if (!h264_fd) + { + PRINT("p264 driver not found...\n"); + res = C_FAIL; + } + + // init local variable + // h264 picture parameters + current_Y = NULL; + current_Cb = NULL; + current_Cr = NULL; + current_width = 0; + current_height = 0; + h264_deb_frame = NULL; + h264_ref_frame = NULL; + + return res; +} + +#ifdef HAS_P264_FTRANSFORM +C_RESULT video_p264_prepare_slice ( video_controller_t* controller, const vp_api_picture_t* blockline) +{ + // picture dimensions change ? + if (controller->width != current_width || controller->height != current_height) + { + // realloc a YUV 4:2:0 reference frame + h264_ref_frame = (uint8_t*)dma_realloc(h264_ref_frame,controller->width*controller->height*3/2); + h264_deb_frame = (uint8_t*)dma_realloc(h264_deb_frame,controller->width*controller->height*3/2); + current_width = controller->width; + current_height = controller->height; + + if (current_width > CIF_WIDTH || current_height > CIF_HEIGHT) + PRINT("resolutions above CIF are not supported by P6 h264 ip\n"); + // set search window size + // ... use default value + + uint32_t value = P264_RES(current_width,current_height); + CHECK_P264_IOCTL(ioctl(h264_fd, P264_SET_DIM, &value)) + +#ifdef H264_P6_DEBUG + PRINT ("H264 IP : new frame dimensions %dx%d\n",current_width,current_height); +#endif + } + + // swap DEB and ref frames + uint8_t* p_tmp; + p_tmp = h264_deb_frame; + h264_deb_frame = h264_ref_frame; + h264_ref_frame = p_tmp; + + // set DEB new frame + uint32_t value = (uint32_t)dma_virt2phy(h264_deb_frame); + CHECK_P264_IOCTL(ioctl(h264_fd, P264_SET_DEB_FRAME, &value)) + + dma_flush_inv( (uint32_t)h264_deb_frame, current_width*current_height*3/2); + + // set reference frame + value = (uint32_t)dma_virt2phy(h264_ref_frame); + CHECK_P264_IOCTL(ioctl(h264_fd, P264_SET_REF_FRAME, &value)) + dma_flush_inv( (uint32_t)h264_ref_frame, current_width*current_height*3/2); + + CHECK_P264_IOCTL(ioctl(h264_fd, P264_SET_FRAME_TYPE, &(controller->picture_type))) + + // devrait pouvoir sauter + if (controller->picture_type == VIDEO_PICTURE_INTRA) + I_encoding = TRUE; + else + I_encoding = FALSE; + + // retrieve picture pointers + current_Y = blockline->y_buf; + current_Cb = blockline->cb_buf; + current_Cr = blockline->cr_buf; + + p264_p6_input_buf_t input_buf; + input_buf.phys_Y = (uint32_t)dma_virt2phy(current_Y); + input_buf.phys_Cb = (uint32_t)dma_virt2phy(current_Cb); + input_buf.phys_Cr = (uint32_t)dma_virt2phy(current_Cr); + CHECK_P264_IOCTL(ioctl(h264_fd, P264_SET_INPUT_BUF, &input_buf)) + + // flush input frame + dma_flush_inv( (uint32_t)current_Y, current_width*current_height); + dma_flush_inv( (uint32_t)current_Cb, (current_width*current_height>>2)); + dma_flush_inv( (uint32_t)current_Cr, (current_width*current_height>>2)); + + // flush output data + dma_flush_inv( (uint32_t)controller->cache, (controller->width>>4) * (controller->height>>4) * sizeof(MB_p264_t)); + + return C_OK; +} + +static void intra_pred_4x4_p6_to_list (uint32_t intra_pred_4x4_0, uint32_t intra_pred_4x4_1, intra_4x4_mode_t* out) +{ + uint32_t i; + for (i=0;i<8;i++) + { + *out++ = (intra_4x4_mode_t) (intra_pred_4x4_0 & 0x0F); + intra_pred_4x4_0 = intra_pred_4x4_0>>4; + } + for (i=0;i<8;i++) + { + *out++ = (intra_4x4_mode_t) (intra_pred_4x4_1 & 0x0F); + intra_pred_4x4_1 = intra_pred_4x4_1>>4; + } +} + +void P6_get_MV (MV_XY_t *mv,uint32_t num_mv, uint32_t* raw_mv_tab) +{ + uint32_t mv_2k_result; + mv_2k_result = raw_mv_tab[(num_mv&0x0E)>>1]; + if ((num_mv&0x01) == 0) + { + mv->x = (mv_2k_result&0x000000FF)>>0; + mv->x >>= 2; + mv->y = (mv_2k_result&0x0000FF00)>>8; + mv->y >>= 2; + } + else + { + mv->x = (mv_2k_result&0x00FF0000)>>16; + mv->x >>= 2; + mv->y = (mv_2k_result&0xFF000000)>>24; + mv->y >>= 2; + } +} + + +// encode num_macro_blocks MB +C_RESULT video_p264_encode_MB(uint32_t num_macro_blocks, video_macroblock_t* macroblock ,int32_t qp) +{ + if (num_macro_blocks > 0) + { + // launch (num_macro_block - num_pending) encoding + MB_p264_t* MB_P6 = (MB_p264_t*)macroblock->data; + + // set qp + CHECK_P264_IOCTL(ioctl(h264_fd, P264_SET_QP, &qp)) + + // set output data addr + p264_p6_output_buf_t output_buf; + output_buf.phys_output = (uint32_t)dma_virt2phy(MB_P6); + output_buf.reg_output = h264_raw_result; + CHECK_P264_IOCTL(ioctl(h264_fd, P264_SET_OUTPUT_BUF, &output_buf)) + + // launch encoding + CHECK_P264_IOCTL(ioctl(h264_fd, P264_ENCODE_NEXT_MB, &num_macro_blocks)) + + return C_OK; + } + else + return C_FAIL; +} + +// get encoded num_macro_blocks MB +int32_t video_p264_get_encoded_MB(uint32_t num_macro_blocks, video_macroblock_t* macroblock) +{ + // retrieve and process available MBs + if (num_macro_blocks > 0) + { + // wait hardware completion + CHECK_P264_IOCTL(ioctl(h264_fd, P264_WAIT_ENCODE, &num_macro_blocks)) + + if (num_macro_blocks != 0) + { + // at this point num_macro_block h264_raw_result is filled with me_result and MV + uint32_t i; + for (i=0;iinter.DC_U[3] = MB_P6->inter.dummy_DC_U[0]; + MB_P6->inter.DC_V[3] = MB_P6->inter.dummy_DC_V[0]; + + #ifdef H264_P6_PFRAME_DEBUG + uint32_t i; + for (i=0;inb_partition;i++) + { + PRINT ("partition[%d]=%d - MV (%d,%d)\n",i,macroblock[i].inter_partition_mode[i],macroblock[i].inter_MV[i].x,macroblock[i].inter_MV[i].y); + } + #endif + } + else + { + #ifdef H264_P6_DEBUG + PRINT ("me result 0x%x\n",h264_raw_result[i].me_result); + PRINT ("--> Y intra mode %d\n",(h264_raw_result[i].me_result&0x1F)); + PRINT ("--> Chroma intra mode %d\n",CHROMA_MODE(h264_raw_result[i].me_result)); + #endif + + if (IS_INTRA_4x4(h264_raw_result[i].me_result)) + { + // patch DC chroma coeff + // P6 h264 IP performs a zigzag on DC coeff. It should not. + MB_P6->intra_4x4.DC_U[3] = MB_P6->intra_4x4.dummy_DC_U[0]; + MB_P6->intra_4x4.DC_V[3] = MB_P6->intra_4x4.dummy_DC_V[0]; + // set macroblock type + macroblock[i].intra_type = INTRA_4x4; + // save 4x4 intra luma result + intra_pred_4x4_p6_to_list (h264_raw_result[i].intra_pred_4x4_0, h264_raw_result[i].intra_pred_4x4_1, macroblock[i].intra_4x4_mode); + #ifdef H264_P6_DEBUG + PRINT ("intra 4x4 pred result 0x%x\n",h264_raw_result[i].intra_pred_4x4_0); + PRINT ("intra 4x4 pred result 0x%x\n",h264_raw_result[i].intra_pred_4x4_1); + #endif + } + else + { + // patch DC chroma coeff + // P6 h264 IP performs a zigzag on DC coeff. It should not. + MB_P6->intra_16x16.DC_U[3] = MB_P6->intra_16x16.dummy_DC_U[0]; + MB_P6->intra_16x16.DC_V[3] = MB_P6->intra_16x16.dummy_DC_V[0]; + // set macroblock type + macroblock[i].intra_type = INTRA_16x16; + // save 16x16 luma result + macroblock[i].intra_luma_16x16_mode = INTRA_16x16_MODE(h264_raw_result[i].me_result); + #ifdef H264_P6_DEBUG + printf("luma 16x16 pred %d\n",INTRA_16x16_MODE(h264_raw_result[i].me_result)); + #endif + + // zagzig DC luma (P6 bug fix) + int16_t tmp_zagzig[16]; + zagzig_4x4 (MB_P6->intra_16x16.DC_Y, tmp_zagzig); + vp_os_memcpy(MB_P6->intra_16x16.DC_Y,tmp_zagzig,16*sizeof(int16_t)); + } + + // save chroma mode + macroblock[i].intra_chroma_8x8_mode = CHROMA_MODE(h264_raw_result[i].me_result); + } + } + } + } + return num_macro_blocks; +} +#endif + + +C_RESULT video_p264_p6_close(void) +{ + if (h264_ref_frame != NULL) + dma_free (h264_ref_frame); + h264_ref_frame = NULL; + if (h264_deb_frame != NULL) + dma_free (h264_deb_frame); + + if (h264_fd) + close(h264_fd); + + h264_deb_frame = NULL; + current_Y = NULL; + current_Cb = NULL; + current_Cr = NULL; + current_width = 0; + current_height = 0; + return C_OK; +} diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.h b/ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.h new file mode 100644 index 0000000..0078ad8 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_p264_p6.h @@ -0,0 +1,16 @@ +#include +#include +#include + +// init h264 ip +C_RESULT video_p264_p6_init(void); + +// prepare ip to encode a new frame +C_RESULT video_p264_prepare_slice ( video_controller_t* controller, const vp_api_picture_t* blockline); + +// encode a MB +int32_t video_p264_encode_MB(uint32_t num_macro_blocks,video_macroblock_t* next_macroblock ,int32_t qp); + + +// release h264 ip +C_RESULT video_p264_p6_close(void); diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.S b/ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.S new file mode 100644 index 0000000..9c22bdc --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.S @@ -0,0 +1,51 @@ +#include "video_utils_p6.h" + +#ifdef HAS_VIDEO_WRITE_DATA + + .text + .align 4 + + + .global video_write_data + .type video_write_data, %function + +/* Registers usage for video_write_data (r0 & r3 must be preserved) + r0 = stream + r1 = code + r2 = length + r3 = video_stream->code + r4 = video_stream->used + r5 = video_stream->bytes + ip = video_stream->length + lr = video_stream->index +*/ + +video_write_data: + ldr ip, [r0] + stmdb sp!, {r3, r4, r5, lr} /* save regiter on the stack */ + cmp r2, ip /* length > stream->length ? */ + ldmib r0, {r3, r4, r5, lr} + + ble video_write_data_1 + add r4, r4, #4 /* stream->used += 4 */ + str r4, [r0, #8] /* write back stream->used */ + mov r3, r3, lsl ip /* stream->code <<= stream->length */ + mov r4, #1 + sub r2, r2, ip /* length -= stream->length */ + rsb r4, r4, r4, lsl r2 /* code &= (1 << length) - 1 (rd = shifter operand - rn) */ + orr r3, r3, r1, lsr r2 /* stream->code |= code >> (length - stream->length) */ + and r1, r1, r4 /* code &= (1 << length) - 1 */ + str r3, [r5, lr, lsl #2] /* stream->bytes[stream->index] = stream->code */ + add lr, lr, #1 /* stream->index++ */ + str lr, [r0, #16] /* write back stream->index */ + mov r3, #0 /* stream->code = 0 */ + mov ip, #32 /* stream->length = 32 */ + +video_write_data_1: + cmp r2, #0 + orrne r3, r1, r3, lsl r2 /* stream->code = (stream->code << length) | code */ + rsbne r2, r2, ip /* stream->length -= length */ + stmia r0, {r2, r3} + ldmia sp!, {r3, r4, r5, pc} + +#endif // HAS_VIDEO_WRITE_DATA diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.h b/ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.h new file mode 100644 index 0000000..a43fefa --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_packetizer_p6.h @@ -0,0 +1,8 @@ +#ifndef _VIDEO_PACKETIZER_P6_H_ +#define _VIDEO_PACKETIZER_P6_H_ + +#include + +void video_write_data( video_stream_t* const stream, uint32_t code, int32_t length ); + +#endif // _VIDEO_PACKETIZER_P5P_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.c b/ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.c new file mode 100644 index 0000000..3673bae --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.c @@ -0,0 +1,47 @@ +#include "video_quantizer_p6.h" +#include "video_utils_p6.h" +#include "video_config.h" + +#ifdef HAS_DO_QUANTIZE_INTRA_MB +// when quantization is done by P6 hardware, do_quantize_intra_mb just count the number of coefficient and find the last one +int16_t* do_quantize_intra_mb(int16_t* ptr, int32_t invQuant, int32_t* last_ptr) +{ + int32_t i, num_coeff; + int32_t last; + uint32_t* ptr32 = (uint32_t*)ptr; + + for( i = 6; i > 0; i-- ) + { + last=0; + ptr = (int16_t*)ptr32; + if( *ptr == 0 ) + { + *ptr = 1; + } + + num_coeff = MCU_BLOCK_SIZE/4; + + while( num_coeff > 0 ) + { + // we load 2 coeff at a time + uint32_t coeff2 = *ptr32++; + num_coeff--; + if (coeff2 > 0x0000FFFF) + last++; + if ((coeff2<<16) > 0x0000FFFF) + last++; + // next 2 coeffs (gcc will unroll the loop) + coeff2 = *ptr32++; + if (coeff2 > 0x0000FFFF) + last++; + if ((coeff2<<16) > 0x0000FFFF) + last++; + } + + *last_ptr++ = last; + } + + + return (int16_t*)ptr32; +} +#endif // HAS_DO_QUANTIZE_INTRA_MB diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.h b/ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.h new file mode 100644 index 0000000..54c1c09 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_quantizer_p6.h @@ -0,0 +1,8 @@ +#ifndef _VIDEO_QUANTIZER_P6_H_ +#define _VIDEO_QUANTIZER_P6_H_ + +#include + +int16_t* do_quantize_intra_mb(int16_t* ptr, int32_t invQuant, int32_t* last_ptr); + +#endif // _VIDEO_QUANTIZER_P6_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_utils.c b/ARDroneLib/VLIB/Platform/arm9_P6/video_utils.c new file mode 100644 index 0000000..bc70177 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_utils.c @@ -0,0 +1,85 @@ +#include +#include + +#include +#include +#include + +#include +#include + +#include + +static uint32_t num_references = 0; + +C_RESULT video_utils_init( video_controller_t* controller ) +{ + if( num_references == 0 ) + { + switch(controller->codec_type) + { + case UVLC_CODEC : + video_dct_p6_init(); + break; + case P264_CODEC : + video_p264_p6_init(); + break; + default : + PRINT ("%s unknown codec %d\n",__FUNCTION__,controller->codec_type); + return C_FAIL; + } + } + + num_references ++; + + return C_OK; +} + +C_RESULT video_utils_close( video_controller_t* controller ) +{ + if( num_references > 0 ) + { + switch(controller->codec_type) + { + case UVLC_CODEC : + video_dct_p6_close(); + break; + case P264_CODEC : + video_p264_p6_close(); + break; + default : + PRINT ("%s unknown codec %d\n",__FUNCTION__,controller->codec_type); + return C_FAIL; + } + num_references --; + } + + return C_OK; +} + +uint32_t ramcode_format_shifter_op_imm(uint32_t imm) +{ + uint32_t shifter, imm8; + + shifter = 32/2; + imm8 = imm; + + while( (imm8 & 0xFF) != imm8 ) + { + imm8 >>= 2; + shifter --; + } + + if( (imm8 << (32-shifter*2)) != imm ) + return 0xFFFFFFFF; + + if( shifter == 16 ) + shifter = 0; + + return (shifter << 8 | imm8); +} + +C_RESULT video_utils_set_format( uint32_t width, uint32_t height ) +{ + return C_OK; +} diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_utils.h b/ARDroneLib/VLIB/Platform/arm9_P6/video_utils.h new file mode 100644 index 0000000..f8f6af7 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_utils.h @@ -0,0 +1,19 @@ +#ifndef _VIDEO_UTILS_ARM9_P6_H_ +#define _VIDEO_UTILS_ARM9_P6_H_ + +#include + +#if TARGET_CPU_ARM == 1 + +#include + +#include "video_utils_p6.h" +#include "video_dct_p6.h" +#include "video_quantizer_p6.h" +#include "video_packetizer_p6.h" +#include "UVLC/uvlc_p6.h" +#include "UVLC/uvlc_mb_layer_p6.h" + +#endif // TARGET_CPU_ARM + +#endif // _VIDEO_UTILS_ARM9_H_ diff --git a/ARDroneLib/VLIB/Platform/arm9_P6/video_utils_p6.h b/ARDroneLib/VLIB/Platform/arm9_P6/video_utils_p6.h new file mode 100644 index 0000000..ae85176 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/arm9_P6/video_utils_p6.h @@ -0,0 +1,26 @@ +#ifndef _ARM_VIDEO_UTILS_H_ +#define _ARM_VIDEO_UTILS_H_ + +#define HAS_P264_FTRANSFORM + +#define HAS_UVLC_ENCODE + +#define HAS_UVLC_WRITE_BLOCK + +#define HAS_VIDEO_WRITE_DATA + +#define HAS_DO_QUANTIZE_INTRA_MB + +#ifdef _ELINUX + +////#define HAS_VIDEO_BLOCKLINE_TO_MACRO_BLOCKS + +////#define HAS_IDCT_COMPUTE + +#define HAS_FDCT_QUANT_COMPUTE + +#endif // ! _ELINUX + +#endif // _ARM_VIDEO_UTILS_H_ + + diff --git a/ARDroneLib/VLIB/Platform/video_config.h b/ARDroneLib/VLIB/Platform/video_config.h new file mode 100644 index 0000000..21263fa --- /dev/null +++ b/ARDroneLib/VLIB/Platform/video_config.h @@ -0,0 +1,38 @@ +#ifndef _VIDEO_CONFIG_H_ +#define _VIDEO_CONFIG_H_ + +#include + +//////////////////////////////////////////// +// Configuration for ARM Platforms +//////////////////////////////////////////// +#if TARGET_CPU_ARM == 1 +// IPhone +#if defined (USE_ANDROID) || defined (TARGET_OS_IPHONE) + +#include "arm11/video_config.h" +#endif // TARGET_OS_IPHONE + +// Parrot6 +#ifdef _ELINUX +#include "arm9_P6/video_config.h" +#endif +#endif // TARGET_CPU_ARM + +//////////////////////////////////////////// +// Configuration for x86 Platforms +//////////////////////////////////////////// + +#if (TARGET_CPU_X86 == 1) || defined (_WIN32) + +#include "x86/video_config.h" + +#endif // TARGET_CPU_X86 + +//////////////////////////////////////////// + +#define DCT_BUFFER_SIZE ( MAX_NUM_MACRO_BLOCKS_PER_CALL * 6 * MCU_BLOCK_SIZE ) + +#endif // _VIDEO_CONFIG_H_ + + diff --git a/ARDroneLib/VLIB/Platform/video_utils.h b/ARDroneLib/VLIB/Platform/video_utils.h new file mode 100644 index 0000000..8a10182 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/video_utils.h @@ -0,0 +1,35 @@ +#ifndef _VIDEO_UTILS_H_ +#define _VIDEO_UTILS_H_ + +#include + +//////////////////////////////////////////// +// Configuration for ARM Platforms +//////////////////////////////////////////// + +#if TARGET_CPU_ARM == 1 + +// IPhone +#ifdef TARGET_OS_IPHONE +#include "arm11/video_utils.h" +#endif // TARGET_OS_IPHONE + +// P6 +#ifdef _ELINUX +#include "arm9_P6/video_utils.h" +#endif + +#endif // TARGET_CPU_ARM + +//////////////////////////////////////////// +// Configuration for x86 Platforms +//////////////////////////////////////////// + +#if (TARGET_CPU_X86 == 1) || defined (_WIN32) +#include "x86/video_utils.h" +#endif // TARGET_CPU_X86 + +//////////////////////////////////////////// + +#endif // _VIDEO_UTILS_H_ + diff --git a/ARDroneLib/VLIB/Platform/x86/UVLC/uvlc_codec.c b/ARDroneLib/VLIB/Platform/x86/UVLC/uvlc_codec.c new file mode 100644 index 0000000..1d94e94 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/x86/UVLC/uvlc_codec.c @@ -0,0 +1,234 @@ +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#if TARGET_CPU_X86 == 1 + +#ifdef HAS_UVLC_DECODE_BLOCKLINE +C_RESULT uvlc_read_block_unquantize( video_controller_t* controller, int16_t* data, int32_t quant, int32_t nc ) +{ + video_stream_t* stream = &controller->in_stream; + int32_t* zztable; + int32_t index, code, run, last; + + zztable = &video_zztable_t81[0]; + + // DC coeff + code = run = last = 0; + video_read_data( stream, (uint32_t*) &code, 10 ); + + if( controller->picture_type == VIDEO_PICTURE_INTRA ) // intra + { + code <<= 3; + } + else + { + code = quant*( 2*code + 1 ); + if( quant & 1 ) + code -= 1; + } + data[0] = code; + + if( nc > 0 ) + { + // AC coeff + while( last == 0 ) + { + code = run = last = 0; + uvlc_decode( stream, &run, &code, &last); + + VP_OS_ASSERT( run < 64 ); + + if( last == 0 ) + { + zztable += (run+1); + index = *zztable; + + code = quant*( 2*code + 1 ); + if( quant & 1 ) + code -= 1; + + data[index] = code; + } + } + } + + return C_OK; +} + +C_RESULT uvlc_read_mb_layer_unquantize( video_controller_t* controller, video_macroblock_t* mb, int32_t num_macro_blocks ) +{ + int16_t* data; + uint32_t code; + + video_zeromem32( (uint32_t*)mb->data, num_macro_blocks * 6 * MCU_BLOCK_SIZE / 2 ); + + while( num_macro_blocks > 0 ) + { + mb->azq = 0; + video_read_data( &controller->in_stream, (uint32_t*)&mb->azq, 1 ); + + if( mb->azq == 0 ) + { + video_read_data( &controller->in_stream, &code, 8 ); + + mb->num_coeff_y0 = (code >> 0) & 1; + mb->num_coeff_y1 = (code >> 1) & 1; + mb->num_coeff_y2 = (code >> 2) & 1; + mb->num_coeff_y3 = (code >> 3) & 1; + mb->num_coeff_cb = (code >> 4) & 1; + mb->num_coeff_cr = (code >> 5) & 1; + + mb->dquant = 0; + if( (code >> 6) & 1 ) + { + video_read_data( &controller->in_stream, &code, 2 ); + + mb->dquant = (code < 2) ? ~code : code; + } + + controller->quant += mb->dquant; + + /**************** Block Y0 ****************/ + data = mb->data; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y0 ); + + /**************** Block Y1 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y1 ); + + /**************** Block Y2 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y2 ); + + /**************** Block Y3 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_y3 ); + + /**************** Block CB ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_cb ); + + /**************** Block CR ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block_unquantize( controller, data, controller->quant, mb->num_coeff_cr ); + } + + mb ++; + num_macro_blocks --; + } + + return C_OK; +} + +C_RESULT uvlc_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ) +{ + video_codec_t* video_codec; + vp_api_picture_t blockline = { 0 }; + int16_t *in = NULL, *out = NULL; + int32_t num_macro_blocks = 0; + video_macroblock_t* macroblock = NULL; + video_picture_context_t blockline_ctx; + video_gob_t* gobs; + + controller->mode = VIDEO_DECODE; + video_codec = controller->video_codec; + + blockline = *picture; + blockline.height = MB_HEIGHT_Y; + blockline.complete = 1; + blockline.vision_complete = 0; + + picture->complete = controller->picture_complete; + + blockline_ctx.y_woffset = blockline.y_line_size; + blockline_ctx.c_woffset = blockline.cb_line_size; + blockline_ctx.y_hoffset = blockline.y_line_size * MCU_HEIGHT; + + // At least a complete blockline is found + while( !controller->picture_complete && controller->in_stream.index <= (controller->in_stream.used >> 2) ) + { + uvlc_unpack_controller( controller ); + + if( !controller->picture_complete ) + { + blockline.blockline = controller->blockline; + + blockline_ctx.y_src = picture->y_buf + blockline.blockline * MB_HEIGHT_Y * picture->y_line_size; + blockline_ctx.cb_src = picture->cb_buf + blockline.blockline * MB_HEIGHT_C * picture->cb_line_size; + blockline_ctx.cr_src = picture->cr_buf + blockline.blockline * MB_HEIGHT_C * picture->cr_line_size; + + picture->blockline = controller->blockline; + num_macro_blocks = controller->mb_blockline; + + macroblock = &controller->cache_mbs[0]; + gobs = &controller->gobs[controller->blockline]; + out = gobs->macroblocks->data; + + if( gobs->quant != controller->quant ) + { + controller->quant = gobs->quant; + video_quantizer_update( controller ); + } + + while( num_macro_blocks > MAX_NUM_MACRO_BLOCKS_PER_CALL ) + { + in = ¯oblock->data[0]; + + uvlc_read_mb_layer_unquantize( controller, macroblock, MAX_NUM_MACRO_BLOCKS_PER_CALL ); + + out = video_idct_compute( in, out, MAX_NUM_MACRO_BLOCKS_PER_CALL ); + + if( macroblock == &controller->cache_mbs[0] ) + macroblock += MAX_NUM_MACRO_BLOCKS_PER_CALL; + else + macroblock -= MAX_NUM_MACRO_BLOCKS_PER_CALL; + + num_macro_blocks -= MAX_NUM_MACRO_BLOCKS_PER_CALL; + } + + in = macroblock->data; + + uvlc_read_mb_layer_unquantize( controller, macroblock, num_macro_blocks ); + + video_idct_compute( in, out, num_macro_blocks ); + + video_blockline_from_macro_blocks(&blockline_ctx, gobs->macroblocks->data, controller->mb_blockline, picture->format); + + // Update controller according to video statistics + video_controller_update( controller, controller->picture_complete ); + } + } + + if( controller->picture_complete ) + { + picture->complete = controller->picture_complete; + picture->blockline = 0; + + controller->picture_complete = 0; + controller->in_stream.length = 32; + //controller->num_frames++; + + *got_image = TRUE; + } + else + { + controller->in_stream.used = 0; + controller->in_stream.index = 0; + } + + return C_OK; +} +#endif + +#endif // TARGET_CPU_X86 == 1 diff --git a/ARDroneLib/VLIB/Platform/x86/video_config.h b/ARDroneLib/VLIB/Platform/x86/video_config.h new file mode 100644 index 0000000..33ce8a2 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/x86/video_config.h @@ -0,0 +1,18 @@ +#ifndef _VIDEO_CONFIG_X86_H_ +#define _VIDEO_CONFIG_X86_H_ + +/* Default configuration for x86 platform */ + +#if (TARGET_CPU_X86 == 1) || defined (_WIN32) + +#define DEFAULT_QUANTIZATION (6) + +#define MAX_NUM_MACRO_BLOCKS_PER_CALL (1) + +#define DEFAULT_INTERNAL_STREAM_SIZE (1024 * 8) + +#define VLIB_ALLOC_ALIGN (16) /* Default alignement for using SIMD instruction */ + +#endif // TARGET_CPU_X86 + +#endif // _VIDEO_CONFIG_X86_H_ diff --git a/ARDroneLib/VLIB/Platform/x86/video_utils.c b/ARDroneLib/VLIB/Platform/x86/video_utils.c new file mode 100644 index 0000000..16de518 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/x86/video_utils.c @@ -0,0 +1,37 @@ +#include + +#include + +#include "video_utils.h" + +#if TARGET_CPU_X86 == 1 || defined (_WIN32) + +static uint32_t num_references = 0; + +C_RESULT video_utils_init( video_controller_t* controller ) +{ + if( num_references == 0 ) + { + } + + num_references ++; + + return C_OK; +} + +C_RESULT video_utils_close( video_controller_t* controller ) +{ + if( num_references > 0 ) + { + num_references --; + } + + return C_OK; +} + +C_RESULT video_utils_set_format( uint32_t width, uint32_t height ) +{ + return C_OK; +} + +#endif diff --git a/ARDroneLib/VLIB/Platform/x86/video_utils.h b/ARDroneLib/VLIB/Platform/x86/video_utils.h new file mode 100644 index 0000000..8b87bbc --- /dev/null +++ b/ARDroneLib/VLIB/Platform/x86/video_utils.h @@ -0,0 +1,12 @@ +#ifndef _VIDEO_UTILS_X86_H_ +#define _VIDEO_UTILS_X86_H_ + +#if TARGET_CPU_X86 == 1 + +#include + +#include "video_utils_x86.h" + +#endif // TARGET_CPU_X86 == 1 + +#endif // _VIDEO_UTILS_X86__H_ diff --git a/ARDroneLib/VLIB/Platform/x86/video_utils_x86.h b/ARDroneLib/VLIB/Platform/x86/video_utils_x86.h new file mode 100644 index 0000000..a43fa67 --- /dev/null +++ b/ARDroneLib/VLIB/Platform/x86/video_utils_x86.h @@ -0,0 +1,6 @@ +#ifndef _X86_VIDEO_UTILS_H_ +#define _X86_VIDEO_UTILS_H_ + +// #define HAS_UVLC_DECODE_BLOCKLINE + +#endif // _X86_VIDEO_UTILS_H_ diff --git a/ARDroneLib/VLIB/Stages/vlib_stage_decode.c b/ARDroneLib/VLIB/Stages/vlib_stage_decode.c new file mode 100644 index 0000000..0d11bf3 --- /dev/null +++ b/ARDroneLib/VLIB/Stages/vlib_stage_decode.c @@ -0,0 +1,119 @@ +#include +#include +#include + + +#define FRAME_MODE_BUFFER_SIZE 256 + +static video_stream_t stream; + +const vp_api_stage_funcs_t vlib_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vlib_stage_decoding_open, + (vp_api_stage_transform_t) vlib_stage_decoding_transform, + (vp_api_stage_close_t) vlib_stage_decoding_close +}; + +C_RESULT vlib_stage_decoding_open(vlib_stage_decoding_config_t *cfg) +{ + // init video decoder with NULL_CODEC + video_codec_open( &cfg->controller, NULL_CODEC ); + + if(cfg->block_mode_enable) + { + vp_os_free( cfg->controller.in_stream.bytes ); + } + else + { + stream.bytes = (uint32_t*)vp_os_malloc(FRAME_MODE_BUFFER_SIZE*sizeof(uint32_t)); + stream.index = 0; + stream.used = 0; + stream.size = FRAME_MODE_BUFFER_SIZE*sizeof(uint32_t); + } + + cfg->num_picture_decoded = 0; + + return C_OK; +} + +C_RESULT vlib_stage_decoding_transform(vlib_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)(int8_t*)cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) { + out->status = in->status; + } + + if(out->status == VP_API_STATUS_PROCESSING ) + { + // If out->size == 1 it means picture is ready + out->size = 0; + + cfg->picture->vision_complete = 0; + cfg->picture->complete = 0; + cfg->picture->blockline = 0; + + got_image = FALSE; + + if(cfg->block_mode_enable) + { + cfg->controller.in_stream.bytes = (uint32_t*)in->buffers[0]; + cfg->controller.in_stream.used = in->size; + cfg->controller.in_stream.size = in->size; + cfg->controller.in_stream.index = 0; + cfg->controller.in_stream.length = 32; + cfg->controller.in_stream.code = 0; + + video_decode_blockline( &cfg->controller, cfg->picture, &got_image ); + } + else + { + stream.index = 0; + stream.used = in->size; + vp_os_memcpy(&stream.bytes[0], (uint32_t*)in->buffers[0], in->size); + + video_decode_picture( &cfg->controller, cfg->picture, &stream, &got_image ); + } + + if( got_image ) + { + // we got one picture + out->size = 1; + cfg->picture->complete = 1; + cfg->num_picture_decoded++; + + if( cfg->luma_only ) + { + int32_t i; + for(i = 0; i < (int32_t)cfg->picture->width * (int32_t)cfg->picture->height / 4; i++ ) + { + cfg->picture->cr_buf[i] = 0x80; + cfg->picture->cb_buf[i] = 0x80; + } + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT vlib_stage_decoding_close(vlib_stage_decoding_config_t *cfg) +{ + if(!cfg->block_mode_enable) + vp_os_free(stream.bytes); + return video_codec_close( &cfg->controller ); +} diff --git a/ARDroneLib/VLIB/Stages/vlib_stage_decode.h b/ARDroneLib/VLIB/Stages/vlib_stage_decode.h new file mode 100644 index 0000000..5cd257a --- /dev/null +++ b/ARDroneLib/VLIB/Stages/vlib_stage_decode.h @@ -0,0 +1,27 @@ +#ifndef _VLIB_STAGE_DECODE_H_ +#define _VLIB_STAGE_DECODE_H_ + +#include +#include + +typedef struct _vlib_stage_decoding_config_t +{ + uint32_t width; + uint32_t height; + uint32_t num_picture_decoded; + + video_controller_t controller; + vp_api_picture_t* picture; + + bool_t block_mode_enable; + bool_t luma_only; // true if you want only luminance (chrominances will be overwritten with a neutral value (0x80)) + +} vlib_stage_decoding_config_t; + +C_RESULT vlib_stage_decoding_open(vlib_stage_decoding_config_t *cfg); +C_RESULT vlib_stage_decoding_transform(vlib_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT vlib_stage_decoding_close(vlib_stage_decoding_config_t *cfg); + +extern const vp_api_stage_funcs_t vlib_decoding_funcs; + +#endif // _VLIB_STAGE_DECODE_H_ diff --git a/ARDroneLib/VLIB/Stages/vlib_stage_encode.c b/ARDroneLib/VLIB/Stages/vlib_stage_encode.c new file mode 100644 index 0000000..3fe469e --- /dev/null +++ b/ARDroneLib/VLIB/Stages/vlib_stage_encode.c @@ -0,0 +1,115 @@ +/** + * \brief vlib Stage + * \author Sylvain Gaeremynck + * \version 1.0 + * \date first release 06/12/2007 + */ +#include +#include + +#include +#include + +///*******************************************************************************************************************/// + +const vp_api_stage_funcs_t vlib_encoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vlib_stage_encoding_open, + (vp_api_stage_transform_t) vlib_stage_encoding_transform, + (vp_api_stage_close_t) vlib_stage_encoding_close +}; + +///*******************************************************************************************************************/// + +C_RESULT vlib_stage_encoding_open(vlib_stage_encoding_config_t *cfg) +{ + video_codec_open( &cfg->controller, cfg->codec_type ); + video_controller_set_mode( &cfg->controller, VIDEO_ENCODE ); + video_controller_set_format( &cfg->controller, cfg->width, cfg->height ); + video_controller_set_motion_estimation( &cfg->controller, FALSE ); + video_controller_set_target_size( &cfg->controller, cfg->target_size ); + return C_OK; +} + +C_RESULT vlib_stage_encoding_transform(vlib_stage_encoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + static int32_t local_subsampl = 0; + + vp_os_mutex_lock(&out->lock); + + if( out->status == VP_API_STATUS_INIT ) + { + out->numBuffers = 1; + out->buffers = (int8_t**)(int8_t*)&cfg->controller.in_stream.bytes; + out->indexBuffer = 0; + + out->status = VP_API_STATUS_PROCESSING; + + cfg->current_size = 0; + } + + if( local_subsampl == 0 && out->status == VP_API_STATUS_PROCESSING ) + { + // check video_codec didn't change + if (cfg->controller.codec_type != cfg->codec_type) + { + video_codec_open( &cfg->controller, cfg->codec_type ); + video_controller_set_mode( &cfg->controller, VIDEO_ENCODE ); + video_controller_set_format( &cfg->controller, cfg->width, cfg->height ); + video_controller_set_motion_estimation( &cfg->controller, FALSE ); + } + + // update target size + video_controller_set_target_size( &cfg->controller, cfg->target_size ); + RTMON_USTART(VIDEO_VLIB_ENCODE_EVENT); + if(cfg->block_mode_enable) + video_encode_blockline( &cfg->controller, cfg->picture, cfg->picture->complete ); + else + video_encode_picture( &cfg->controller, cfg->picture, (bool_t*)&cfg->picture->complete ); + RTMON_USTOP(VIDEO_VLIB_ENCODE_EVENT); + + if(cfg->picture->complete) + { + RTMON_UVAL(ENCODED_PICTURE_UVAL, cfg->controller.num_frames); + local_subsampl++; + } + + cfg->current_size = cfg->controller.in_stream.used; + + if( cfg->controller.in_stream.length != 32 ) + { + // flush & reset internal stream + video_write_data( &cfg->controller.in_stream, 0, cfg->controller.in_stream.length+1 ); + cfg->controller.in_stream.length = 32; + } + out->size = cfg->controller.in_stream.used; + + RTMON_UVAL(ENCODED_BLOCKLINE_SIZE_UVAL, out->size); + + cfg->controller.in_stream.used = 0; + cfg->controller.in_stream.index = 0; + } + else + { + out->size = 0; + + if( cfg->picture->complete ) + { + local_subsampl++; + } + } + + if(local_subsampl >= (int32_t)cfg->subsampl) + local_subsampl = 0; + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT vlib_stage_encoding_close(vlib_stage_encoding_config_t *cfg) +{ + return video_codec_close( &cfg->controller ); +} + + +///*******************************************************************************************************************/// diff --git a/ARDroneLib/VLIB/Stages/vlib_stage_encode.h b/ARDroneLib/VLIB/Stages/vlib_stage_encode.h new file mode 100644 index 0000000..5d12663 --- /dev/null +++ b/ARDroneLib/VLIB/Stages/vlib_stage_encode.h @@ -0,0 +1,78 @@ +/** + * \brief VLIB Stage + * \author Sylvain Gaeremynck + * \version 1.0 + * \date first release 05/01/2009 + */ + +#ifndef _VLIB_STAGE_ENCODE_H_ +#define _VLIB_STAGE_ENCODE_H_ + +#include + +#include + +/////////////////////////////////////////////// +// DECLARATIONS + +enum { + VLIB_ENCODER +}; + +extern const vp_api_stage_funcs_t vlib_encoding_funcs; + + +/////////////////////////////////////////////// +// TYPEDEFS + +typedef struct _vlib_stage_encoding_config_t +{ + uint32_t subsampl; + uint32_t target_size; + + uint32_t width; + uint32_t height; + + video_controller_t controller; + vp_api_picture_t* picture; + + uint32_t current_size; + + bool_t block_mode_enable; + + uint32_t codec_type; + +} vlib_stage_encoding_config_t; + + +/////////////////////////////////////////////// +// FUNCTIONS + +/** + * @fn vlib_stage_encoding_open + * @param vlib_stage_encoding_config_t *cfg + * @todo Open the encoding vlib stage + * @return VP_SUCCESS + */ +C_RESULT vlib_stage_encoding_open(vlib_stage_encoding_config_t *cfg); + + +/** + * @fn Transform the input com stage + * @param vlib_stage_encoding_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo Encode picture in config to fill output data stream + * @return VP_SUCCESS + */ +C_RESULT vlib_stage_encoding_transform(vlib_stage_encoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn vlib_stage_encoding_close + * @param vlib_stage_encoding_config_t *cfg + * @todo Close the encoding stage + * @return VP_SUCCESS + */ +C_RESULT vlib_stage_encoding_close(vlib_stage_encoding_config_t *cfg); + +#endif // _vlib_STAGE_ENCODE_H_ diff --git a/ARDroneLib/VLIB/UVLC/uvlc.c b/ARDroneLib/VLIB/UVLC/uvlc.c new file mode 100644 index 0000000..4f80c9f --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc.c @@ -0,0 +1,155 @@ +#include +#include + +#include + +#include + +#include + +#ifndef HAS_UVLC_ENCODE + +#define PACK_BITS( bits_out, length_out, bits_in, length_in ) \ + bits_out <<= length_in; \ + length_out += length_in; \ + bits_out |= bits_in; + +void uvlc_encode( video_stream_t* const stream, int32_t level, int32_t run, int32_t not_last ) +{ + int32_t sign, length, data, value_code, value_length; + + /// Encode number of zeros + data = run; + + length = 0; + value_code = 1; + + if( data > 0 ) + { + length = 32 - clz(data); // compute number of bits used in run ( = length of run ) + data -= 1 << ( length - 1 ); // compute value of run + } + + value_length = length + 1; + + length -= 1; + if( length > 0 ) + { + PACK_BITS( value_code, value_length, data, length ); + } + + /// Encode level + data = level; + + // sign handling + sign = 0; + if( data < 0 ) + { + data = -data; + sign = 1; + } + + // TODO Check saturation & if level == -128 + length = 32 - clz(data); // number of bits used in level ( = length of level ) + if( length > 1 ) + { + data -= 1 << (length - 1); + length += 1; + } + + PACK_BITS( value_code, value_length, 1, length ); + + VP_OS_ASSERT( length != 2 ); + + length -= 2; + if(length > 0) + { + PACK_BITS( value_code, value_length, data, length ); + } + + PACK_BITS( value_code, value_length, sign, 1 ); + + /// Encode last + // add sequence for end of block if required + if( not_last == 0 ) + { + PACK_BITS( value_code, value_length, 0x5, 3 ); + } + + /// Write output + video_write_data( stream, value_code, value_length ); +} + +#endif // HAS_UVLC_ENCODE + +C_RESULT uvlc_decode( video_stream_t* const stream, int32_t* run, int32_t* level, int32_t* last) +{ + uint32_t stream_code, stream_length; + int32_t r = 0, z, sign; + + stream_code = stream_length = 0; + + // Peek 32 bits from stream because we know our datas fit in + video_peek_data( stream, &stream_code, 32 ); + + + /// Decode number of zeros + z = clz(stream_code); + + stream_code <<= z + 1; // Skip all zeros & 1 + stream_length += z + 1; + + if( z > 1 ) + { + r = stream_code >> (32 - (z-1)); + + stream_code <<= (z-1); + stream_length += (z-1); + + *run = r + (1 << (z-1)); + } + else + { + *run = z; + } + + + /// Decode level / last + z = clz(stream_code); + + stream_code <<= z + 1; // Skip all zeros & 1 + stream_length += z + 1; + + if( z == 1 ) + { + *run = 0; + *last = 1; + } + else + { + if( z == 0 ) + { + z = 1; + r = 1; + } + + stream_length += z; + + stream_code >>= (32 - z); + sign = stream_code & 1; + + if( z != 0 ) + { + r = stream_code >> 1; + r += 1 << (z-1); + } + + *level = sign ? -r : r; + *last = 0; + } + + // Do the real Read in stream to consume what we used + video_read_data( stream, &stream_code, stream_length ); + + return C_OK; +} diff --git a/ARDroneLib/VLIB/UVLC/uvlc.h b/ARDroneLib/VLIB/UVLC/uvlc.h new file mode 100644 index 0000000..64cc310 --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc.h @@ -0,0 +1,12 @@ +#ifndef _UVLC_H_ +#define _UVLC_H_ + +#include +#include + +// not_last > 0 if this is not the last coefficient +// If last == 0, a special sequence is emitted +void uvlc_encode( video_stream_t* const stream, int32_t level, int32_t run, int32_t not_last ); +C_RESULT uvlc_decode( video_stream_t* const stream, int32_t* run, int32_t* level, int32_t* last); + +#endif // _UVLC_H_ diff --git a/ARDroneLib/VLIB/UVLC/uvlc_codec.c b/ARDroneLib/VLIB/UVLC/uvlc_codec.c new file mode 100644 index 0000000..a3d71da --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc_codec.c @@ -0,0 +1,529 @@ +#include +#include + +#include +#include +#include +#include "uvlc_codec.h" + +#include +#include +#include + +const uvlc_codec_t uvlc_codec = { + uvlc_encode_blockline, + uvlc_decode_blockline, + uvlc_update, + uvlc_cache, + { 0 } +}; + +void uvlc_codec_alloc( video_controller_t* controller ) +{ + video_codec_t* video_codec; + + video_codec = (video_codec_t*) vp_os_malloc( sizeof(uvlc_codec) ); + + vp_os_memcpy(video_codec, &uvlc_codec, sizeof(uvlc_codec)); + + controller->video_codec = video_codec; +} + +void uvlc_codec_free( video_controller_t* controller ) +{ + uvlc_codec_t* uvlc_codec = (uvlc_codec_t*) controller->video_codec; + + if( uvlc_codec != NULL ) + { + vp_os_free( uvlc_codec ); + controller->video_codec = NULL; + } +} + +static C_RESULT uvlc_flush_stream( video_stream_t* out, video_stream_t* in ) +{ + // They are still data in cache + // Always copy a number of bytes that is a times of 4. + // Only for the last copy, we can have exactly the number of bytes left + int32_t offset, size; + uint32_t out_stream_size; + + if( in->length != 32 ) + { + // flush & reset internal stream + video_write_data( in, 0, in->length+1 ); + in->length = 32; + } + + out_stream_size = out->size & ~3; // Round to the highest times of 4 available + + offset = in->index - (in->used >> 2); + size = ( in->used < out_stream_size ) ? in->used : out_stream_size; + + vp_os_memcpy(out->bytes, in->bytes + offset, size); + + out->index = size >> 2; + out->used = size; + + in->used -= size; + + return C_OK; +} + +static C_RESULT uvlc_load_stream( video_stream_t* out, video_stream_t* in ) +{ + // We cache as many blockline as possible + C_RESULT res; + bool_t found, last_zero, last_zero_temp; + uint8_t *dst, *src; + + int32_t value, nb_bytes; + uint32_t in_index = (in->used >> 2) - 1; + + // -> start looking for last blockline's end + found = FALSE; + + if( in->index == 0 ) // First call, we look for full blocklines + { + last_zero = FALSE; + + while( (in_index > in->index) && !found ) + { + value = in->bytes[in_index]; + + last_zero_temp = (value & 0xFF) == 0; // 0x??????00 + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x????00?? + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x??00???? + found = last_zero_temp & last_zero; + + if( !found ) + { + in_index--; // Handle both the special case where blockline is dword aligned & + // blockline start is still not found + + last_zero = last_zero_temp; + value >>= 8; + + last_zero_temp = (value & 0xFF) == 0; // 0x00?????? + found = last_zero_temp & last_zero; + + if( !found ) + { + last_zero = last_zero_temp; + } + } + } + } + } + } + + in_index++; + + // configure parameters for memcpy + if( !found ) + { + // cache all data + nb_bytes = in->used - in->index * 4; + + res = C_FAIL; + } + else + { + // cache only data containing full blocklines + nb_bytes = (in_index - in->index) * 4; + + res = C_OK; + } + + // Realloc internal stream to have enough space to hold all required data + while( out->used + nb_bytes >= out->size ) + { + out->bytes = vp_os_realloc( out->bytes, out->size + 2048 ); // Add 2KB to internal stream + out->size += 2048; + } + + dst = (uint8_t*)&out->bytes[0]; + dst += out->used; + + src = (uint8_t*)&in->bytes[0]; + src += in->index*4; + + vp_os_memcpy( dst, src, nb_bytes ); + + out->used += nb_bytes; + in->index = in_index; + + VP_OS_ASSERT( out->used <= out->size ); + + return res; +} + +C_RESULT uvlc_pack_controller( video_controller_t* controller ) +{ + video_stream_t* stream = &controller->in_stream; + uvlc_codec_t* uvlc_codec = (uvlc_codec_t*) controller->video_codec; + uvlc_picture_layer_t* picture_layer; + uvlc_gob_layer_t* gob; + + gob = NULL; + picture_layer = &uvlc_codec->picture_layer; + + video_stuff8( stream ); + + picture_layer->gobs = (uvlc_gob_layer_t*) controller->gobs; + gob = &picture_layer->gobs[controller->blockline]; + + video_write_data( stream, MAKE_START_CODE(controller->blockline), 22 ); + + if( controller->blockline == 0 ) + { + picture_layer->quant = gob->quant; + uvlc_write_picture_layer( controller, stream ); + } + else + { + uvlc_write_gob_layer( stream, gob ); + } + + return C_OK; +} + +C_RESULT uvlc_unpack_controller( video_controller_t* controller ) +{ + uint32_t start_code = 0; + video_stream_t* stream = &controller->in_stream; + uvlc_codec_t* uvlc_codec = (uvlc_codec_t*) controller->video_codec; + uvlc_picture_layer_t* picture_layer; + uvlc_gob_layer_t* gob; + + gob = NULL; + picture_layer = &uvlc_codec->picture_layer; + + video_align8( stream ); + video_read_data( stream, &start_code, 22 ); + + controller->blockline = start_code & 0x1F; + start_code &= ~0x1F; // TODO Check if compiler use arm instruction bic + + VP_OS_ASSERT( controller->blockline == 0x1F || + controller->num_blockline == 0 || // Check if cache is allocated for current picture + (controller->num_blockline > 0 && controller->blockline < controller->num_blockline) ); + + if( start_code == PICTURE_START_CODE ) + { + if( controller->blockline == 0x1F ) + { + controller->picture_complete = TRUE; + } + else + { + if( controller->blockline == 0 ) + { + uvlc_read_picture_layer( controller, stream ); + + picture_layer->gobs = (uvlc_gob_layer_t*) controller->gobs; + gob = &picture_layer->gobs[controller->blockline]; + + gob->quant = picture_layer->quant; + } + else + { + picture_layer->gobs = (uvlc_gob_layer_t*) controller->gobs; + gob = &picture_layer->gobs[controller->blockline]; + + uvlc_read_gob_layer( stream, gob ); + } + } + } + + return C_OK; +} + +C_RESULT uvlc_encode_blockline( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ) +{ + video_codec_t* video_codec; + int16_t *in = NULL, *out = NULL; + int32_t num_macro_blocks = 0; + video_macroblock_t* macroblock = NULL; + video_picture_context_t blockline_ctx; + video_gob_t* gobs; + static uint32_t mean_Q = 2; + + video_stream_t* stream = &controller->in_stream; + + if( stream->used*2 >= stream->size ) + { + uint32_t add = 32 - clz(stream->used/controller->blockline); // estimate the log2 size of a blockline in the stream + add = 1<<(add+1); // major and compute addition buffer size + stream->bytes = vp_os_realloc( stream->bytes, stream->size + add ); // Add some byte to internal stream + stream->size += add; + } + + video_codec = controller->video_codec; + controller->picture_complete = picture_complete; + controller->blockline = blockline->blockline; + + blockline_ctx.y_src = blockline->y_buf; + blockline_ctx.cb_src = blockline->cb_buf; + blockline_ctx.cr_src = blockline->cr_buf; + blockline_ctx.y_woffset = blockline->y_line_size; + blockline_ctx.c_woffset = blockline->cb_line_size; + blockline_ctx.y_hoffset = blockline->y_line_size * MCU_HEIGHT; + + gobs = &controller->gobs[controller->blockline]; + gobs->quant = controller->quant; + macroblock = &gobs->macroblocks[0]; + + uvlc_pack_controller( controller ); + + in = controller->blockline_cache; + out = macroblock->data; + + num_macro_blocks = controller->mb_blockline; + + ///> Cache blockline in dct format & perform dct + while( num_macro_blocks > MAX_NUM_MACRO_BLOCKS_PER_CALL ) + { + RTMON_USTART(VIDEO_VLIB_BLOCKLINE_TO_MB); + video_blockline_to_macro_blocks(&blockline_ctx, in, MAX_NUM_MACRO_BLOCKS_PER_CALL); + RTMON_USTOP(VIDEO_VLIB_BLOCKLINE_TO_MB); + + +#ifdef HAS_FDCT_QUANT_COMPUTE + out = video_fdct_quant_compute(in, out, MAX_NUM_MACRO_BLOCKS_PER_CALL,gobs->quant); +#else + out = video_fdct_compute(in, out, MAX_NUM_MACRO_BLOCKS_PER_CALL); +#endif + if( in == controller->blockline_cache ) + in += DCT_BUFFER_SIZE; + else + in -= DCT_BUFFER_SIZE; + + num_macro_blocks -= MAX_NUM_MACRO_BLOCKS_PER_CALL; + } + + RTMON_USTART(VIDEO_VLIB_BLOCKLINE_TO_MB); + video_blockline_to_macro_blocks(&blockline_ctx, in, num_macro_blocks); + RTMON_USTOP(VIDEO_VLIB_BLOCKLINE_TO_MB); + + RTMON_USTOP(VIDEO_VLIB_BLOCKLINE_TO_MB); + +#ifdef HAS_FDCT_QUANT_COMPUTE + video_fdct_quant_compute(in, out, num_macro_blocks,gobs->quant); +#else + video_fdct_compute(in, out, num_macro_blocks); +#endif + ///< + + ///> Do quantification on each macroblock + RTMON_USTART(VIDEO_VLIB_QUANTIZE); + video_quantize( controller, &controller->gobs[controller->blockline].macroblocks[0], controller->mb_blockline ); + RTMON_USTOP(VIDEO_VLIB_QUANTIZE); + ///< + + ///> Packetize Data to output buffer + RTMON_USTART(VIDEO_VLIB_PACKET); + uvlc_write_mb_layer( stream, macroblock, controller->mb_blockline ); + + ///> Control Stream size + + if (controller->target_size > 0) + { + if ((controller->blockline+1) == controller->num_blockline) + { + if ((controller->target_size > stream->used) && mean_Q > 2) + { + // last frame was too small increase overall quality (i.e. decrease quant) + mean_Q--; + } + else if ((controller->target_size < stream->used) && mean_Q < 31) + { + // last frame was too large decrease overall quality (i.e. increase quant) + mean_Q++; + } + } + + if (stream->used > ((controller->blockline+1)*controller->target_size*1.05/controller->num_blockline)) + { + // stream too large, reduce quality + controller->quant = mean_Q + 1; + } + else if (stream->used < ((controller->blockline+1)*controller->target_size*0.95/controller->num_blockline)) + { + // stream too low, increase quality + controller->quant = mean_Q - 1; + } + else + controller->quant = mean_Q; + + // quant saturation, 31 is reserved for old TABLE_QUANTIZATION mode (backward compatibility) + // TODO: quant == 1 doesn't work, find why + if (controller->quant > 30) + controller->quant=30; + else if (controller->quant < 2) + controller->quant=2; + } + else + controller->quant= DEFAULT_QUANTIZATION; + RTMON_USTOP(VIDEO_VLIB_PACKET); + ///< + + if( controller->picture_complete ) + { + video_stuff8( stream ); + video_write_data( stream, PICTURE_END_CODE, 22 ); + } + + // Update controller according to user inputs & video statistics + video_controller_update( controller, picture_complete ); + + return C_OK; +} + +#ifndef HAS_UVLC_DECODE_BLOCKLINE +C_RESULT uvlc_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ) +{ + video_codec_t* video_codec; + vp_api_picture_t blockline = { 0 }; + int16_t *in = NULL, *out = NULL; + int32_t num_macro_blocks = 0; + video_macroblock_t* macroblock = NULL; + video_picture_context_t blockline_ctx; + video_gob_t* gobs; + + controller->mode = VIDEO_DECODE; + video_codec = controller->video_codec; + + blockline = *picture; + blockline.height = MB_HEIGHT_Y; + blockline.complete = 1; + blockline.vision_complete = 0; + + picture->complete = controller->picture_complete; + + blockline_ctx.y_woffset = blockline.y_line_size; + blockline_ctx.c_woffset = blockline.cb_line_size; + blockline_ctx.y_hoffset = blockline.y_line_size * MCU_HEIGHT; + + // At least a complete blockline is found + while( !controller->picture_complete && controller->in_stream.index <= (controller->in_stream.used >> 2) ) + { + uvlc_unpack_controller( controller ); + + if( !controller->picture_complete ) + { + blockline.blockline = controller->blockline; + + blockline_ctx.y_src = picture->y_buf + blockline.blockline * MB_HEIGHT_Y * picture->y_line_size; + blockline_ctx.cb_src = picture->cb_buf + blockline.blockline * MB_HEIGHT_C * picture->cb_line_size; + blockline_ctx.cr_src = picture->cr_buf + blockline.blockline * MB_HEIGHT_C * picture->cr_line_size; + + picture->blockline = controller->blockline; + num_macro_blocks = controller->mb_blockline; + + macroblock = &controller->cache_mbs[0]; + gobs = &controller->gobs[controller->blockline]; + out = gobs->macroblocks->data; + + if( gobs->quant != controller->quant ) + { + controller->quant = gobs->quant; + video_quantizer_update( controller ); + } + + while( num_macro_blocks > MAX_NUM_MACRO_BLOCKS_PER_CALL ) + { + in = ¯oblock->data[0]; + + uvlc_read_mb_layer( &controller->in_stream, macroblock, MAX_NUM_MACRO_BLOCKS_PER_CALL ); + + video_unquantize( controller, macroblock, MAX_NUM_MACRO_BLOCKS_PER_CALL ); + + out = video_idct_compute( in, out, MAX_NUM_MACRO_BLOCKS_PER_CALL ); + + if( macroblock == &controller->cache_mbs[0] ) + macroblock += MAX_NUM_MACRO_BLOCKS_PER_CALL; + else + macroblock -= MAX_NUM_MACRO_BLOCKS_PER_CALL; + + num_macro_blocks -= MAX_NUM_MACRO_BLOCKS_PER_CALL; + } + + in = macroblock->data; + + uvlc_read_mb_layer( &controller->in_stream, macroblock, num_macro_blocks ); + + video_unquantize( controller, macroblock, num_macro_blocks ); + + video_idct_compute( in, out, num_macro_blocks ); + + video_blockline_from_macro_blocks(&blockline_ctx, gobs->macroblocks->data, controller->mb_blockline, picture->format); + + // Update controller according to video statistics + video_controller_update( controller, controller->picture_complete ); + } + } + + if( controller->picture_complete ) + { + picture->complete = controller->picture_complete; + picture->blockline = 0; + + controller->picture_complete = 0; + controller->in_stream.length = 32; + controller->num_frames++; + + *got_image = TRUE; + } + else + { + controller->in_stream.used = 0; + controller->in_stream.index = 0; + } + + return C_OK; +} +#endif + +C_RESULT uvlc_update( video_controller_t* controller ) +{ + return C_OK; +} + +C_RESULT uvlc_cache( video_controller_t* controller, video_stream_t* ex_stream) +{ + C_RESULT res; + + video_stream_t* in_stream = &controller->in_stream; + + switch( controller->mode ) + { + case VIDEO_ENCODE: + res = uvlc_flush_stream( ex_stream, in_stream ); + break; + + case VIDEO_DECODE: + res = uvlc_load_stream( in_stream, ex_stream ); + break; + + default: + res = C_FAIL; + break; + } + + return res; +} diff --git a/ARDroneLib/VLIB/UVLC/uvlc_codec.h b/ARDroneLib/VLIB/UVLC/uvlc_codec.h new file mode 100644 index 0000000..08bb8de --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc_codec.h @@ -0,0 +1,31 @@ +#ifndef _UVLC_CODEC_H_ +#define _UVLC_CODEC_H_ + +#include + +#include +#include "uvlc_layers.h" + +typedef struct _uvlc_codec_t { + // Compatibility with video_codec_t structure + encode_blockline_fc encode_blockline; + decode_blockline_fc decode_blockline; + update_fc update; + cache_stream_fc cache_stream; + + // Private data (see video source coding algorithm p.9) + uvlc_picture_layer_t picture_layer; +} uvlc_codec_t; + +void uvlc_codec_alloc( video_controller_t* controller ); +void uvlc_codec_free( video_controller_t* controller ); + +C_RESULT uvlc_pack_controller( video_controller_t* controller ); +C_RESULT uvlc_unpack_controller( video_controller_t* controller ); + +C_RESULT uvlc_encode_blockline( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ); +C_RESULT uvlc_decode_blockline( video_controller_t* controller, vp_api_picture_t* picture, bool_t* got_image ); +C_RESULT uvlc_update( video_controller_t* controller ); +C_RESULT uvlc_cache( video_controller_t* controller, video_stream_t* ex_stream); + +#endif // _UVLC_CODEC_H_ diff --git a/ARDroneLib/VLIB/UVLC/uvlc_gob_layer.c b/ARDroneLib/VLIB/UVLC/uvlc_gob_layer.c new file mode 100644 index 0000000..2fed3bd --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc_gob_layer.c @@ -0,0 +1,21 @@ +#include +#include + +#include "uvlc_codec.h" +#include "uvlc_layers.h" + +C_RESULT uvlc_write_gob_layer( video_stream_t* stream, uvlc_gob_layer_t* gob ) +{ + video_write_data( stream, gob->quant, 5 ); + + return C_OK; +} + +C_RESULT uvlc_read_gob_layer( video_stream_t* stream, uvlc_gob_layer_t* gob ) +{ + gob->quant = 0; + + video_read_data( stream, &gob->quant, 5 ); + + return C_OK; +} diff --git a/ARDroneLib/VLIB/UVLC/uvlc_layers.h b/ARDroneLib/VLIB/UVLC/uvlc_layers.h new file mode 100644 index 0000000..c8fcecc --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc_layers.h @@ -0,0 +1,47 @@ +#ifndef _UVLC_LAYERS_H_ +#define _UVLC_LAYERS_H_ + +#include +#include + +#define MAKE_START_CODE(gob) ( UVLC_CODEC | (gob) ) +#define PICTURE_START_CODE MAKE_START_CODE(0) +#define PICTURE_END_CODE MAKE_START_CODE(0x1F) + +#define UVLC_FORMAT_CIF 1 +#define UVLC_FORMAT_VGA 2 + +#define UVLC_RESOLUTION_SUBQ 1 /* sub-QCIF */ +#define UVLC_RESOLUTION_Q 2 /* QCIF */ +#define UVLC_RESOLUTION_1 3 /* CIF */ +#define UVLC_RESOLUTION_4 4 /* 4-CIF */ +#define UVLC_RESOLUTION_16 5 /* 16-CIF */ + +typedef struct _uvlc_mb_layer_t { + uint32_t desc; + uint32_t dquant; +} uvlc_mb_layer_t; + +typedef struct _uvlc_gob_layer_t { + video_macroblock_t* macroblocks; + uint32_t quant; +} uvlc_gob_layer_t; + +typedef struct _uvlc_picture_layer_t { + uint32_t format; + uint32_t resolution; + uint32_t picture_type; + uint32_t quant; + uvlc_gob_layer_t* gobs; +} uvlc_picture_layer_t; + +C_RESULT uvlc_write_picture_layer( video_controller_t* controller, video_stream_t* stream ); +C_RESULT uvlc_read_picture_layer( video_controller_t* controller, video_stream_t* stream ); + +C_RESULT uvlc_write_gob_layer( video_stream_t* stream, uvlc_gob_layer_t* gob ); +C_RESULT uvlc_read_gob_layer( video_stream_t* stream, uvlc_gob_layer_t* gob ); + +C_RESULT uvlc_write_mb_layer( video_stream_t* stream, video_macroblock_t* mb, int32_t num_macro_blocks ); +C_RESULT uvlc_read_mb_layer( video_stream_t* stream, video_macroblock_t* mb, int32_t num_macro_blocks ); + +#endif // _UVLC_LAYERS_H_ diff --git a/ARDroneLib/VLIB/UVLC/uvlc_mb_layer.c b/ARDroneLib/VLIB/UVLC/uvlc_mb_layer.c new file mode 100644 index 0000000..035375d --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc_mb_layer.c @@ -0,0 +1,211 @@ +#include +#include +#include + +#include +#include + +#include "uvlc_codec.h" +#include "uvlc_layers.h" +#include "uvlc.h" + +#ifndef HAS_UVLC_WRITE_BLOCK + +void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff ) +{ + int32_t* zztable; + int32_t index, code, run; + + zztable = &video_zztable_t81[1]; + + // DC coeff + code = *data; + video_write_data( stream, code, 10 ); + num_coeff--; + + // AC coeff + run = 0; + while( num_coeff > 0 ) + { + index = *zztable++; + code = data[index]; + if( code == 0 ) + { + run ++; + } + else + { + num_coeff--; + uvlc_encode( stream, code, run, num_coeff ); + run = 0; + } + } +} + +#endif // HAS_UVLC_WRITE_BLOCK + +#ifndef HAS_UVLC_READ_BLOCK + +C_RESULT uvlc_read_block( video_stream_t* stream, int16_t* data, int32_t* num_coeff ) +{ + int32_t* zztable; + int32_t index, code, run, last, nc; + + zztable = &video_zztable_t81[0]; + + nc = *num_coeff; + + // DC coeff + code = run = last = 0; + video_read_data( stream, (uint32_t*) &code, 10 ); + data[0] = code; + + if( nc > 0 ) + { + // AC coeff + while( last == 0 ) + { + code = run = last = 0; + uvlc_decode( stream, &run, &code, &last); + + VP_OS_ASSERT( run < 64 ); + + if( last == 0 ) + { + zztable += (run+1); + index = *zztable; + data[index] = code; + + nc++; + } + } + + *num_coeff = nc; + } + + return C_OK; +} + +#endif + +C_RESULT uvlc_write_mb_layer( video_stream_t* stream, video_macroblock_t* mb, int32_t num_macro_blocks ) +{ + int16_t* data; + uint32_t code; + + while( num_macro_blocks > 0 ) + { + video_write_data( stream, mb->azq, 1 ); + if( !mb->azq ) + { + code = 0x80; + code |= (mb->num_coeff_y0 > 1) << 0; + code |= (mb->num_coeff_y1 > 1) << 1; + code |= (mb->num_coeff_y2 > 1) << 2; + code |= (mb->num_coeff_y3 > 1) << 3; + code |= (mb->num_coeff_cb > 1) << 4; + code |= (mb->num_coeff_cr > 1) << 5; + code |= (mb->dquant != 0) << 6; + + video_write_data( stream, code, 8 ); + + if( mb->dquant != 0 ) + { + code = ( mb->dquant < 0 ) ? ~mb->dquant : mb->dquant; + video_write_data( stream, code, 2 ); + } + + /**************** Block Y0 ****************/ + data = mb->data; + uvlc_write_block( stream, data, mb->num_coeff_y0 ); + + /**************** Block Y1 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_write_block( stream, data, mb->num_coeff_y1 ); + + /**************** Block Y2 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_write_block( stream, data, mb->num_coeff_y2 ); + + /**************** Block Y3 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_write_block( stream, data, mb->num_coeff_y3 ); + + /**************** Block CB ****************/ + data += MCU_BLOCK_SIZE; + uvlc_write_block( stream, data, mb->num_coeff_cb ); + + /**************** Block CR ****************/ + data += MCU_BLOCK_SIZE; + uvlc_write_block( stream, data, mb->num_coeff_cr ); + } + + mb ++; + num_macro_blocks --; + } + + return C_OK; +} + +C_RESULT uvlc_read_mb_layer( video_stream_t* stream, video_macroblock_t* mb, int32_t num_macro_blocks ) +{ + int16_t* data; + uint32_t code; + + vp_os_memset( mb->data, 0, num_macro_blocks * 6 * MCU_BLOCK_SIZE * sizeof(int16_t) ); + while( num_macro_blocks > 0 ) + { + mb->azq = 0; + video_read_data( stream, (uint32_t*)&mb->azq, 1 ); + + if( mb->azq == 0 ) + { + video_read_data( stream, &code, 8 ); + + mb->num_coeff_y0 = (code >> 0) & 1; + mb->num_coeff_y1 = (code >> 1) & 1; + mb->num_coeff_y2 = (code >> 2) & 1; + mb->num_coeff_y3 = (code >> 3) & 1; + mb->num_coeff_cb = (code >> 4) & 1; + mb->num_coeff_cr = (code >> 5) & 1; + + mb->dquant = 0; + if( (code >> 6) & 1 ) + { + video_read_data( stream, &code, 2 ); + + mb->dquant = (code < 2) ? ~code : code; + } + + /**************** Block Y0 ****************/ + data = mb->data; + uvlc_read_block( stream, data, &mb->num_coeff_y0 ); + + /**************** Block Y1 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block( stream, data, &mb->num_coeff_y1 ); + + /**************** Block Y2 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block( stream, data, &mb->num_coeff_y2 ); + + /**************** Block Y3 ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block( stream, data, &mb->num_coeff_y3 ); + + /**************** Block CB ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block( stream, data, &mb->num_coeff_cb ); + + /**************** Block CR ****************/ + data += MCU_BLOCK_SIZE; + uvlc_read_block( stream, data, &mb->num_coeff_cr ); + + } + + mb ++; + num_macro_blocks --; + } + + return C_OK; +} diff --git a/ARDroneLib/VLIB/UVLC/uvlc_picture_layer.c b/ARDroneLib/VLIB/UVLC/uvlc_picture_layer.c new file mode 100644 index 0000000..74a80d3 --- /dev/null +++ b/ARDroneLib/VLIB/UVLC/uvlc_picture_layer.c @@ -0,0 +1,82 @@ +#include +#include + +#include "uvlc_codec.h" +#include "uvlc_layers.h" + +C_RESULT uvlc_write_picture_layer( video_controller_t* controller, video_stream_t* stream ) +{ + uint32_t format = 0, resolution = 0, width, height; + + uvlc_codec_t* uvlc_codec = (uvlc_codec_t*) controller->video_codec; + uvlc_picture_layer_t* picture_layer = &uvlc_codec->picture_layer; + + width = controller->width; + height = controller->height; + + while( format == 0 ) + { + if( width == QQCIF_WIDTH ) + format = UVLC_FORMAT_CIF; + + if( width == QQVGA_WIDTH ) + format = UVLC_FORMAT_VGA; + + width >>= 1; + height >>= 1; + + resolution ++; + } + + picture_layer->format = format; + picture_layer->resolution = resolution; + + video_write_data( stream, picture_layer->format, 2 ); + video_write_data( stream, picture_layer->resolution, 3 ); + video_write_data( stream, picture_layer->picture_type, 3 ); + video_write_data( stream, picture_layer->quant, 5 ); + video_write_data( stream, controller->num_frames, 32 ); + + return C_OK; +} + +C_RESULT uvlc_read_picture_layer( video_controller_t* controller, video_stream_t* stream ) +{ + uint32_t width, height; + + uvlc_codec_t* uvlc_codec = (uvlc_codec_t*) controller->video_codec; + uvlc_picture_layer_t* picture_layer = &uvlc_codec->picture_layer; + + picture_layer->format = 0; + picture_layer->resolution = 0; + picture_layer->picture_type = 0; + picture_layer->quant = 0; + + video_read_data( stream, &picture_layer->format, 2 ); + video_read_data( stream, &picture_layer->resolution, 3 ); + video_read_data( stream, &picture_layer->picture_type, 3 ); + video_read_data( stream, &picture_layer->quant, 5 ); + video_read_data( stream, &controller->num_frames, 32 ); + + switch( picture_layer->format ) + { + case UVLC_FORMAT_CIF: + width = QQCIF_WIDTH << (picture_layer->resolution-1); + height = QQCIF_HEIGHT << (picture_layer->resolution-1); + break; + + case UVLC_FORMAT_VGA: + width = QQVGA_WIDTH << (picture_layer->resolution-1); + height = QQVGA_HEIGHT << (picture_layer->resolution-1); + break; + + default: + width = 0; + height = 0; + break; + } + + video_controller_set_format( controller, width, height ); + + return C_OK; +} diff --git a/ARDroneLib/VLIB/Utils/video_bin_dct.c b/ARDroneLib/VLIB/Utils/video_bin_dct.c new file mode 100644 index 0000000..f1bad8e --- /dev/null +++ b/ARDroneLib/VLIB/Utils/video_bin_dct.c @@ -0,0 +1,190 @@ +#include + +static void bin_fdct(const uint16_t* data_in, int16_t* data_out) +{ +} + +static void bin_idct(const int16_t* data_in, uint16_t* data_out) +{ + int i; + int16_t x0, x1, x2, x3, x4, x5, x6, x7; + int16_t tx0, tx3, tx4, tx5; + const int16_t* in = data_in; + int16_t* out = (int16_t*) data_out; + + // Compute lines + for( i = 8; i > 0; i-- ) + { + x0 = in[0]; x1 = in[1]; x2 = in[2]; x3 = in[3]; + x4 = in[4]; x5 = in[5]; x6 = in[6]; x7 = in[7]; + + // First step + x4 = x0/2 - x4; + x2 = x2 - 3*x6/8; + x3 = x3 + x5/2; + + // Second step + x0 = x0 - x4; + x6 = x6 + 3*x2/8; + x7 = x7 + x1/8; + x5 = x5 - 7*x3/8; + + // Third step + x0 = x0 + x2; + x2 = x0 - x2*2; + x4 = x4 + x6; + x6 = x4 - x6*2; + x7 = x7 + x5; + x5 = x7 - x5*2; + x1 = x1 + x3; + x3 = x1 - x3*2; + + // Fourth step + x5 = 5*x3/8 - x5; + + // Fifth step + x3 = x3 - 3*x5/8; + + // Final step + out[0] = (x0 + x1) >> 1; + out[1] = (x4 + x3) >> 1; + out[2] = (x6 + x5) >> 1; + out[3] = (x2 + x7) >> 1; + out[4] = (x2 - x7) >> 1; + out[5] = (x6 - x5) >> 1; + out[6] = (x4 - x3) >> 1; + out[7] = (x0 - x1) >> 1; + + in += 8; + out += 8; + } + + in = (const int16_t*) data_out; + out = (int16_t*) data_out; + + // Compute columns + for( i = 8; i > 0; i-- ) + { + tx0 = in[0]; x1 = in[8]; x2 = in[16]; tx3 = in[24]; + tx4 = in[32]; tx5 = in[40]; x6 = in[48]; x7 = in[56]; + + // First step + x4 = tx0/2 - tx4; + x0 = tx0/2 + tx4; + x3 = tx5/2 + tx3; + x5 = tx5/2 - tx3; + + x2 = x2 - 3*x6/8; + x6 = 3*x2/8 + x6; + + x7 += x1/8; + x5 += x3/8; + + // Second step + x0 = x0 + x2; + x2 = x0 - x2*2; + x4 = x4 + x6; + x6 = x4 - x6*2; + x7 = x7 + x5; + x5 = x7 - x5*2; + x1 = x1 + x3; + x3 = x1 - x3*2; + + // Third step + x5 = 5*x3/8 - x5; + x3 = x3 - 3*x5/8; + + // Final step - TODO Check if we can replace out by data_out + out[0] = x0 + x1; + out[8] = x4 + x3; + out[16] = x6 + x5; + out[24] = x2 + x7; + out[32] = x2 - x7; + out[40] = x6 - x5; + out[48] = x4 - x3; + out[56] = x0 - x1; + + in += 1; + out += 1; + } +} + +int16_t* video_fdct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks) +{ + while( num_macro_blocks > 0 ) + { + bin_fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + num_macro_blocks--; + } + + return out; +} + +int16_t* video_idct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks) +{ + while( num_macro_blocks > 0 ) + { + bin_idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + bin_idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + num_macro_blocks--; + } + + return out; +} diff --git a/ARDroneLib/VLIB/Utils/video_bin_dct.h b/ARDroneLib/VLIB/Utils/video_bin_dct.h new file mode 100644 index 0000000..a539864 --- /dev/null +++ b/ARDroneLib/VLIB/Utils/video_bin_dct.h @@ -0,0 +1,8 @@ +#ifndef _VIDEO_BIN_DCT_H_ +#define _VIDEO_BIN_DCT_H_ + +#include + +// Alternative DCT computation + +#endif // _VIDEO_BIN_DCT_H_ diff --git a/ARDroneLib/VLIB/video_codec.c b/ARDroneLib/VLIB/video_codec.c new file mode 100644 index 0000000..94fec70 --- /dev/null +++ b/ARDroneLib/VLIB/video_codec.c @@ -0,0 +1,260 @@ +#include +#include +#include +#include +#include + +#include +#include + +#ifdef _ELINUX +#include "dma_malloc.h" +#define vp_os_aligned_malloc(A,B) dma_malloc(A) +#define vp_os_aligned_free(A) dma_free(A) +#endif + +extern C_RESULT video_utils_init( video_controller_t* controller ); +extern C_RESULT video_utils_close( video_controller_t* controller ); + +extern void uvlc_codec_alloc( video_controller_t* controller ); +extern void uvlc_codec_free( video_controller_t* controller ); + +extern void p263_codec_alloc( video_controller_t* controller ); +extern void p263_codec_free( video_controller_t* controller ); + +extern void p264_codec_alloc( video_controller_t* controller ); +extern void p264_codec_free( video_controller_t* controller ); + +static C_RESULT video_codec_open_private( video_controller_t* controller, codec_type_t codec_type, bool_t keep_stream ); +static C_RESULT video_codec_close_private( video_controller_t* controller, bool_t keep_stream ); + +static C_RESULT video_codec_open_private( video_controller_t* controller, codec_type_t codec_type, bool_t keep_stream ) +{ + C_RESULT res; + // Data used to initialize macroblock's cache + int32_t i; + int16_t* cache; + video_macroblock_t* mb; + + // Close any previously allocated codec for this controller + video_codec_close_private( controller, keep_stream); + + controller->mode = 0; + controller->use_me = FALSE; + controller->do_azq = FALSE; + controller->aq = 0; + controller->bq = 0; + controller->target_bitrate = VLIB_DEFAULT_BITRATE; + controller->num_frames = 0; + controller->picture_type = 0; + controller->width = 0; + controller->height = 0; + controller->resolution_changed = FALSE; + controller->num_blockline = 0; + controller->mb_blockline = 0; + controller->blockline = 0; + controller->picture_complete= 0; + controller->quant = DEFAULT_QUANTIZATION; + controller->dquant = 0; + controller->Qp = 0; + controller->invQp = 1; + controller->gobs = NULL; + controller->cache = NULL; + controller->codec_type = 0; + controller->video_codec = NULL; + + if( controller->blockline_cache == NULL ) + { + // We alloc two buffers to be compatible with an asynchronous DCT + // When a DCT will be performed on one buffer, we will be able to use the other for caching or computing purpose + // DCT_BUFFER_SIZE = MAX_NUM_MACRO_BLOCKS_PER_CALL * 6 * MCU_BLOCK_SIZE + controller->blockline_cache = (int16_t*)vp_os_aligned_malloc( 2*DCT_BUFFER_SIZE*sizeof(int16_t), VLIB_ALLOC_ALIGN ); + } + if (controller->cache_mbs == NULL) + { + controller->cache_mbs = vp_os_malloc( 2 * MAX_NUM_MACRO_BLOCKS_PER_CALL * sizeof(video_macroblock_t) ); + mb = &controller->cache_mbs[0]; + cache = controller->blockline_cache; + for(i = 2*MAX_NUM_MACRO_BLOCKS_PER_CALL; i > 0; i-- ) + { + mb->data = cache; + cache += MCU_BLOCK_SIZE*6; + mb ++; + } + } + + if (keep_stream == FALSE) + video_packetizer_init( controller ); + video_quantizer_init( controller ); + + switch( codec_type ) + { + case UVLC_CODEC: + uvlc_codec_alloc( controller ); + break; + + case P263_CODEC: + p263_codec_alloc( controller ); + break; + + case P264_CODEC: + p264_codec_alloc( controller ); + break; + + default: + controller->video_codec = NULL; + break; + } + + if( controller->video_codec != NULL ) + { + controller->codec_type = codec_type; + res = C_OK; + } + else + { + res = C_FAIL; + } + + video_utils_init( controller ); + + return res; +} + +C_RESULT video_codec_open( video_controller_t* controller, codec_type_t codec_type ) +{ + return video_codec_open_private(controller, codec_type, FALSE ); +} + +static C_RESULT video_codec_close_private( video_controller_t* controller, bool_t keep_stream ) +{ + video_utils_close( controller ); + + if( controller->blockline_cache != NULL ) + { + vp_os_aligned_free( controller->blockline_cache ); + controller->blockline_cache = NULL; + } + + if (controller->cache_mbs != NULL) + { + vp_os_free( controller->cache_mbs ); + controller->cache_mbs = NULL; + } + + + if( keep_stream == FALSE && controller->in_stream.bytes != NULL ) + video_packetizer_close( controller ); + + switch( controller->codec_type ) + { + case UVLC_CODEC: + uvlc_codec_free( controller ); + break; + + case P263_CODEC: + p263_codec_free( controller ); + break; + + case P264_CODEC: + p264_codec_free( controller ); + break; + + default: + break; + } + + // Cleanup caches + video_controller_cleanup( controller ); + + return C_OK; +} + +C_RESULT video_codec_close ( video_controller_t* controller) +{ + return video_codec_close_private(controller, FALSE); +} + +C_RESULT video_codec_type_select(video_controller_t* controller, video_stream_t* stream) +{ + uint32_t codec_type = 0; + video_align8( stream ); + video_peek_data( stream, &codec_type, 22 ); + // extract codec tag + //codec_type = codec_type>>5; + + if (codec_type != controller->codec_type) + { + PRINT("VLIB new codec %d\n",codec_type); + // video codec has changed, load a new codec + video_codec_open_private( controller, codec_type, TRUE ); + + } + return C_OK; +} + +C_RESULT video_encode_picture( video_controller_t* controller, const vp_api_picture_t* picture, bool_t* got_image ) +{ + vp_api_picture_t blockline = { 0 }; + + controller->mode = VIDEO_ENCODE; + + video_controller_set_format( controller, picture->width, picture->height ); + + blockline = *picture; + blockline.height = MB_HEIGHT_Y; + blockline.complete = 1; + blockline.vision_complete = 0; + + // Reset internal stream for new blockline/picture + controller->in_stream.used = 0; + controller->in_stream.index = 0; + + while( !controller->picture_complete ) + { + video_encode_blockline( controller, &blockline, blockline.blockline == (controller->num_blockline-1) ); + + blockline.y_buf += MB_HEIGHT_Y * picture->y_line_size; + blockline.cb_buf += MB_HEIGHT_C * picture->cb_line_size; + blockline.cr_buf += MB_HEIGHT_C * picture->cr_line_size; + + blockline.blockline++; + } + + if( picture->complete ) + { + video_write_data( &controller->in_stream, 0, controller->in_stream.length+1 ); + controller->in_stream.length = 32; + controller->picture_complete = 0; + *got_image = TRUE; + } + + return C_OK; +} + +C_RESULT video_decode_picture( video_controller_t* controller, vp_api_picture_t* picture, video_stream_t* ex_stream, bool_t* got_image ) +{ + vp_api_picture_t blockline = { 0 }; + + controller->mode = VIDEO_DECODE; // mandatory because of video_cache_stream + + blockline = *picture; + blockline.height = MB_HEIGHT_Y; + blockline.complete = 1; + blockline.vision_complete = 0; + + while( VP_SUCCEEDED(video_cache_stream( controller, ex_stream )) ) + { + video_codec_type_select(controller,ex_stream); // to be verified + video_decode_blockline( controller, &blockline, got_image ); + } + + return C_OK; +} + + +C_RESULT video_decode_blockline( video_controller_t* controller, vp_api_picture_t* blockline, bool_t* got_image ) +{ + video_codec_type_select(controller,&controller->in_stream); + return controller->video_codec->decode_blockline( controller, blockline, got_image ); +} diff --git a/ARDroneLib/VLIB/video_codec.h b/ARDroneLib/VLIB/video_codec.h new file mode 100644 index 0000000..8664ffb --- /dev/null +++ b/ARDroneLib/VLIB/video_codec.h @@ -0,0 +1,40 @@ +#ifndef _VLIB_H_ +#define _VLIB_H_ + +#include + +#define VLIB_DEFAULT_BITRATE (0) /* In bytes/frame, 0 means bitrate control disabled*/ + +struct _video_codec_t { + encode_blockline_fc encode_blockline; + decode_blockline_fc decode_blockline; + update_fc update; + cache_stream_fc cache_stream; +}; + +/******** Available codecs ********/ +typedef enum _codec_type_t { + NULL_CODEC = 0, + UVLC_CODEC = 0x20, // codec_type value is used for START_CODE + MJPEG_CODEC, // not used + P263_CODEC, // not used + P264_CODEC = 0x40 +} codec_type_t; + +/******** API ********/ +C_RESULT video_codec_open( video_controller_t* controller, codec_type_t codec_type ); +C_RESULT video_codec_close( video_controller_t* controller ); + +// Encode/Decode a complete picture given +C_RESULT video_encode_picture( video_controller_t* controller, const vp_api_picture_t* picture, bool_t* got_image ); +C_RESULT video_decode_picture( video_controller_t* controller, vp_api_picture_t* picture, video_stream_t* ex_stream, bool_t* got_image ); + +// Encode/Decode a blockline +static INLINE C_RESULT video_encode_blockline( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ) +{ + return controller->video_codec->encode_blockline( controller, blockline, picture_complete ); +} + +C_RESULT video_decode_blockline( video_controller_t* controller, vp_api_picture_t* blockline, bool_t* got_image ); + +#endif // _VLIB_H_ diff --git a/ARDroneLib/VLIB/video_controller.c b/ARDroneLib/VLIB/video_controller.c new file mode 100644 index 0000000..0906de1 --- /dev/null +++ b/ARDroneLib/VLIB/video_controller.c @@ -0,0 +1,180 @@ +#include +#include + +#include +#include +#include +#include +#include + +#ifdef _ELINUX +#include "dma_malloc.h" +#define vp_os_aligned_realloc(A,B,C) dma_realloc(A,B) +#define vp_os_aligned_free(A) dma_free(A) +#endif + +extern C_RESULT video_utils_set_format( uint32_t width, uint32_t height ); + +C_RESULT video_controller_update( video_controller_t* controller, bool_t complete ) +{ + video_codec_t* video_codec = controller->video_codec; + + controller->current_bits += controller->in_stream.index << 5; // Index is an index in a int32_t array (32 bits) + + if( complete ) + { + controller->num_frames += 1; + controller->output_bits = controller->current_bits; + controller->current_bits = 0; + } + + video_codec->update( controller ); + + return C_OK; +} + +C_RESULT video_controller_set_mode( video_controller_t* controller, uint32_t mode ) +{ + controller->mode = mode; + + return C_OK; +} + +C_RESULT video_controller_set_bitrate( video_controller_t* controller, uint32_t target ) +{ + controller->target_bitrate = target; + + return C_OK; +} + +C_RESULT video_controller_set_target_size( video_controller_t* controller, uint32_t target ) +{ + controller->target_size = target; + + return C_OK; +} + +static void video_realloc_buffers( video_controller_t* controller, int32_t num_prev_blockline ) +{ + int32_t i, j; + int16_t* cache; + video_gob_t* gob; + video_macroblock_t* mb; + + // Realloc global cache (YUV420 format) + if (controller->codec_type == P264_CODEC) + { + // realloc nb_macroblocks (MB_p264_t type) per picture + controller->cache = (int16_t*) vp_os_aligned_realloc( controller->cache, + (controller->width>>4) * (controller->height>>4) * sizeof(MB_p264_t), + VLIB_ALLOC_ALIGN ); + vp_os_memset( controller->cache, 0, (controller->width>>4) * (controller->height>>4) * sizeof(MB_p264_t)); + } + else + { + controller->cache = (int16_t*) vp_os_aligned_realloc( controller->cache, + 3 * controller->width * controller->height * sizeof(int16_t) / 2, + VLIB_ALLOC_ALIGN ); + vp_os_memset( controller->cache, 0, 3 * controller->width * controller->height * sizeof(int16_t) / 2 ); + } + + // Realloc buffers + cache = controller->cache; + i = controller->num_blockline; + j = controller->mb_blockline; + + controller->gobs = (video_gob_t*) vp_os_realloc(controller->gobs, i * sizeof(video_gob_t)); + vp_os_memset( controller->gobs, 0, i * sizeof(video_gob_t) ); + + gob = &controller->gobs[0]; + gob->macroblocks = (video_macroblock_t*) vp_os_realloc( gob->macroblocks, i * j * sizeof(video_macroblock_t)); + vp_os_memset( gob->macroblocks, 0, i * j * sizeof(video_gob_t) ); + + video_macroblock_t * macroblock_root = gob->macroblocks; + + for(; i > 0; i-- ) + { + j = controller->mb_blockline; + + gob->macroblocks = macroblock_root; + macroblock_root += controller->mb_blockline; + + mb = &gob->macroblocks[0]; + for(; j > 0; j-- ) + { + mb->data = cache; + + if (controller->codec_type == P264_CODEC) + { + cache += sizeof(MB_p264_t)/sizeof(mb->data[0]); + } + else + { + cache += MCU_BLOCK_SIZE*6; + } + mb ++; + } + + gob ++; + } +} + +C_RESULT video_controller_cleanup( video_controller_t* controller ) +{ + video_gob_t* gob; + + if( controller->gobs != NULL ) + { + gob = &controller->gobs[0]; + vp_os_free(gob->macroblocks); + vp_os_free( controller->gobs ); + } + + if( controller->cache != NULL ) + { + vp_os_aligned_free( controller->cache ); + } + + return C_OK; +} + +C_RESULT video_controller_set_format( video_controller_t* controller, int32_t width, int32_t height ) +{ + int32_t num_prev_blockline; + + VP_OS_ASSERT( (width != 0) && (height != 0) ); + + if( width != controller->width || controller->height != height ) + { + controller->resolution_changed = TRUE; + controller->width = width; + controller->height = height; + + num_prev_blockline = controller->num_blockline; + + controller->num_blockline = height >> 4; + controller->mb_blockline = width >> 4; + + video_realloc_buffers( controller, num_prev_blockline ); + + video_utils_set_format( width, height ); + } + else + controller->resolution_changed = FALSE; + + return C_OK; +} + +C_RESULT video_controller_set_picture_type( video_controller_t* controller, uint32_t type ) +{ + controller->picture_type = type; + + return C_OK; +} + +C_RESULT video_controller_set_motion_estimation( video_controller_t* controller, bool_t use_me ) +{ + controller->use_me = use_me; + + return C_OK; +} diff --git a/ARDroneLib/VLIB/video_controller.h b/ARDroneLib/VLIB/video_controller.h new file mode 100644 index 0000000..76357c0 --- /dev/null +++ b/ARDroneLib/VLIB/video_controller.h @@ -0,0 +1,125 @@ +#ifndef _VIDEO_CONTROLLER_H_ +#define _VIDEO_CONTROLLER_H_ + +#include +#include + +#include +#include + +enum { + VIDEO_ENCODE = 1, + VIDEO_DECODE = 2 +}; + +enum { + VIDEO_PICTURE_INTRA = 0, // Picture is a reference frame + VIDEO_PICTURE_INTER = 1, // Picture is encoded using motion estimation / compensation + VIDEO_PICTURE_PB = 2, // Picture is encoded using a PB frame + VIDEO_PICTURE_B = 3, + VIDEO_PICTURE_EI = 4, + VIDEO_PICTURE_EP = 5, +}; + +enum { + VIDEO_STREAM_LITTLE_ENDIAN = 1, + VIDEO_STREAM_BIG_ENDIAN = 2 +}; + +typedef struct _video_controller_t video_controller_t; +typedef struct _video_codec_t video_codec_t; +typedef struct _video_stream_t video_stream_t; + +struct _video_stream_t { + int32_t length; // Number of bits used in code (TODO why is it signed?) + uint32_t code; // Currently read/write data + uint32_t used; // Number of bytes used in stream + uint32_t* bytes; // Must be aligned on a 4-bytes boundary + uint32_t index; // Position of next dword available for reading/writing + uint32_t size; // Max size (in bytes, times of 4) of this stream + uint32_t endianess; // Endianess of the stream +}; + +typedef C_RESULT (*encode_blockline_fc)( video_controller_t* controller, const vp_api_picture_t* blockline, bool_t picture_complete ); +typedef C_RESULT (*decode_blockline_fc)( video_controller_t* controller, vp_api_picture_t* blockline, bool_t* got_image ); +typedef C_RESULT (*update_fc)( video_controller_t* controller ); +typedef C_RESULT (*cache_stream_fc)( video_controller_t* controller, video_stream_t* in ); + +struct _video_controller_t { + // Configuration Data + uint32_t mode; // encoding or decoding + bool_t use_me; // use motion estimation / compensation + bool_t do_azq; + int32_t aq, bq; + uint32_t target_bitrate; // Target bitrate in bit/s + uint32_t target_size; // Target size per image + + // External & internal buffer used by packetizer layer + // video_stream_t* ex_stream; // External buffer + video_stream_t in_stream; // Internal buffer + + // Internal statistics + uint32_t num_frames; // Frame index + int32_t current_bits; // Number of bits in the buffer + int32_t output_bits; // Number of bits occupied by the previous encoded picture + int32_t original_framerate; // Frame rate of the original video sequence in pictures per second + int32_t target_framerate; // Target frame rate in pictures per second (original_framerate / target_framerate must be an int) + + // Video Data for currently processed picture + uint32_t picture_type; + int32_t width; // Size of picture currently decoded + int32_t height; + bool_t resolution_changed; // if current frame resolution differs from previous one, this flag is set to TRUE + int32_t num_blockline; // Number of blocklines per picture + int32_t mb_blockline; // Number of macroblocks per blockline for this picture + int32_t blockline; // Current blockline in picture + bool_t picture_complete; // tells if picture is complete + + int32_t quant; + int32_t dquant; + int32_t Qp; + int32_t invQp; + + video_gob_t* gobs; // Description of the picture as an array of gob + int16_t* cache; // Cache that holds data for the whole picture (used internally by gobs) + + video_macroblock_t* cache_mbs; // Array of macroblocks describing blockline_cache (used for decoding) + int16_t* blockline_cache; // Cache used to hold intermediate results (for hardware DCT for example) + + // Codec specific functions + uint32_t codec_type; + video_codec_t* video_codec; +}; + +C_RESULT video_controller_update( video_controller_t* controller, bool_t complete ); + +C_RESULT video_controller_set_mode( video_controller_t* controller, uint32_t mode ); + +C_RESULT video_controller_cleanup( video_controller_t* controller ); + +// Configuration api +// video_controller_set_bitrate allows you to set the target bitrate +C_RESULT video_controller_set_bitrate( video_controller_t* controller, uint32_t target ); + +// video_controller_set_target_size allows you yo set a target size for each picture +C_RESULT video_controller_set_target_size( video_controller_t* controller, uint32_t target ); + +// Set format for picture to be decoded +// This function resize internal buffers if needed +C_RESULT video_controller_set_format( video_controller_t* controller, int32_t width, int32_t height ); + +// Set picture type ( INTRA or INTER ) +C_RESULT video_controller_set_picture_type( video_controller_t* controller, uint32_t type ); + +// Set motion estimation usage +C_RESULT video_controller_set_motion_estimation( video_controller_t* controller, bool_t use_me ); + +static INLINE uint8_t* video_controller_get_stream_ptr( video_controller_t* controller ) { + return (uint8_t*)&controller->in_stream.bytes[0]; +} + +static INLINE uint32_t video_controller_get_stream_size( video_controller_t* controller ) { + return controller->in_stream.used; +} + +#endif // _VIDEO_CONTROLLER_H_ diff --git a/ARDroneLib/VLIB/video_dct.c b/ARDroneLib/VLIB/video_dct.c new file mode 100644 index 0000000..c9a991e --- /dev/null +++ b/ARDroneLib/VLIB/video_dct.c @@ -0,0 +1,462 @@ +#include +#include +#include + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +#ifndef HAS_FDCT_COMPUTE +void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} +#endif // HAS_FDCT_COMPUTE + +#ifndef HAS_IDCT_COMPUTE +void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} +#endif // HAS_IDCT_COMPUTE + +#ifndef HAS_FDCT_COMPUTE +int16_t* video_fdct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks) +{ + while( num_macro_blocks > 0 ) + { + fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + fdct((uint16_t*)in, out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + num_macro_blocks--; + } + + return out; +} +#endif // HAS_FDCT_COMPUTE + +#ifndef HAS_IDCT_COMPUTE +int16_t* video_idct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks) +{ + while( num_macro_blocks > 0 ) + { + idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + idct(in, (uint16_t*)out); + + in += MCU_BLOCK_SIZE; + out += MCU_BLOCK_SIZE; + + num_macro_blocks--; + } + + return out; +} +#endif // HAS_IDCT_COMPUTE diff --git a/ARDroneLib/VLIB/video_dct.h b/ARDroneLib/VLIB/video_dct.h new file mode 100644 index 0000000..7cfc3a8 --- /dev/null +++ b/ARDroneLib/VLIB/video_dct.h @@ -0,0 +1,16 @@ +#ifndef _VIDEO_DCT_H_ +#define _VIDEO_DCT_H_ + +#include + +#define NUM_MAX_DCT_BLOCKS 64U /* Max number of blocks per dct calls */ + +// Default implementation for dct computation +void fdct(const unsigned short* in, short* out); +void idct(const short* in, unsigned short* out); + +int16_t* video_fdct_quant_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks, int32_t quant); +int16_t* video_fdct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks); +int16_t* video_idct_compute(int16_t* in, int16_t* out, int32_t num_macro_blocks); + +#endif // _VIDEO_DCT_H_ diff --git a/ARDroneLib/VLIB/video_gob.h b/ARDroneLib/VLIB/video_gob.h new file mode 100644 index 0000000..f4f6f55 --- /dev/null +++ b/ARDroneLib/VLIB/video_gob.h @@ -0,0 +1,17 @@ +#ifndef _VIDEO_GOB_H_ +#define _VIDEO_GOB_H_ + +#include +#include + +// +// Description of a group of block compatible with the h263 standard +// macroblocks is an array containing all the macroblocks of a blockline +// quant is the default quantization value for the blockline +// +typedef struct _video_gob_t { + video_macroblock_t* macroblocks; + int32_t quant; +} video_gob_t; + +#endif // _VIDEO_GOB_H_ diff --git a/ARDroneLib/VLIB/video_huffman.c b/ARDroneLib/VLIB/video_huffman.c new file mode 100644 index 0000000..6f5dd9f --- /dev/null +++ b/ARDroneLib/VLIB/video_huffman.c @@ -0,0 +1,128 @@ +#include + +#include +#include +#include + +huffman_tree_t* huffman_alloc( int32_t num_max_codes, int32_t max_code_length ) +{ + int32_t tree_size = sizeof(huffman_tree_t) + num_max_codes * sizeof(huffman_tree_data_t); + huffman_tree_t* tree = (huffman_tree_t*) vp_os_malloc( tree_size ); + + tree->num_used_codes = 0; + tree->num_max_codes = num_max_codes; + tree->max_code_length = max_code_length; + + return tree; +} + +void huffman_free( huffman_tree_t* tree ) +{ + vp_os_free( tree ); +} + +C_RESULT huffman_add_codes( huffman_tree_t* tree, huffman_code_t* codes, int32_t num_codes ) +{ + while( (tree->num_used_codes < tree->num_max_codes) && num_codes-- ) + { + tree->data[tree->num_used_codes].code = codes++; + tree->data[tree->num_used_codes].weight = 0; + + tree->num_used_codes ++; + } + + return C_OK; +} + +static inline int32_t compare_codes( huffman_code_t* c1, huffman_code_t* c2, int32_t max_length ) +{ + int32_t i1, i2; + + i1 = c1->vlc << (max_length - c1->length); + i2 = c2->vlc << (max_length - c2->length); + + return i1 < i2 ? -1 : 1; +} + +static C_RESULT huffman_sort_codes_internal( huffman_tree_data_t *begin, huffman_tree_data_t *end, int32_t max_length ) +{ + huffman_tree_data_t *pivot = begin; + huffman_tree_data_t *left = begin; + huffman_tree_data_t *right = end; + + while( right != left ) + { + if( compare_codes(right->code, left->code, max_length) < 0 ) + { + huffman_code_t* temp_code = right->code; + right->code = left->code; + left->code = temp_code; + + pivot = pivot == left ? right : left; + } + + pivot == left ? right-- : left++; + } + + if( begin < left - 1 ) + huffman_sort_codes_internal( begin, left - 1, max_length ); + if( end > right + 1 ) + huffman_sort_codes_internal( right + 1, end, max_length ); + + return C_OK; +} + +C_RESULT huffman_sort_codes( huffman_tree_t* tree ) +{ + int32_t i; + + // Sort codes (basic qsort implementation) + huffman_sort_codes_internal( &tree->data[0], &tree->data[tree->num_used_codes-1], tree->max_code_length); + + // Generates weight & counts for each code + for(i = 0; i < tree->num_used_codes; i++ ) + { + tree->data[i].weight = (1 << (1 + tree->max_code_length - tree->data[i].code->length)) - 1; + tree->data[i].weight += tree->data[i].code->vlc << (1 + tree->max_code_length - tree->data[i].code->length); + } + + return C_OK; +} + +C_RESULT huffman_check_code( huffman_tree_t* tree, uint32_t code, uint32_t length ) +{ + int32_t i; + uint32_t w; + + w = (1 << (1 + tree->max_code_length - length)) - 1; + w += code << (1 + tree->max_code_length - length); + + for(i = 0; i < tree->num_used_codes && w != tree->data[i].weight; i++ ); + + if( i == tree->num_used_codes ) + return C_FAIL; + + return tree->data[i].weight == w ? C_OK : C_FAIL; +} + +int32_t huffman_stream_code( huffman_tree_t* tree, video_stream_t* stream ) +{ + huffman_code_t* huffman_code; + int32_t i, w; + uint32_t c; + + c = 0; + + video_peek_data( stream, &c, tree->max_code_length ); + + w = (c << 1) + 1; + + for(i = 0; i < tree->num_used_codes && w > tree->data[i].weight; i++ ); + + huffman_code = tree->data[i].code; + + // Update stream with read data + video_read_data( stream, &c, huffman_code->length ); + + return tree->data[i].code->index; +} diff --git a/ARDroneLib/VLIB/video_huffman.h b/ARDroneLib/VLIB/video_huffman.h new file mode 100644 index 0000000..31de4b8 --- /dev/null +++ b/ARDroneLib/VLIB/video_huffman.h @@ -0,0 +1,44 @@ +#ifndef _VIDEO_HUFFMAN_H_ +#define _VIDEO_HUFFMAN_H_ + +#include +#include + +# pragma pack (1) + +typedef struct _huffman_code_t { + int32_t index; + union { + struct { + uint8_t length; + uint32_t vlc:24; + }; + int32_t code; + }; +} huffman_code_t; + +# pragma pack () // resets packsize to default value + +typedef struct _huffman_tree_data_t { + huffman_code_t* code; + int32_t weight; +} huffman_tree_data_t; + +typedef struct _huffman_tree_t { + int32_t num_used_codes; + int32_t num_max_codes; + int32_t max_code_length; + + huffman_tree_data_t data[]; +} huffman_tree_t; + +huffman_tree_t* huffman_alloc( int32_t num_max_codes, int32_t max_code_length ); +void huffman_free( huffman_tree_t* tree ); + +C_RESULT huffman_add_codes( huffman_tree_t* tree, huffman_code_t* codes, int32_t num_codes ); +C_RESULT huffman_sort_codes( huffman_tree_t* tree ); + +C_RESULT huffman_check_code( huffman_tree_t* tree, uint32_t code, uint32_t length ); +int32_t huffman_stream_code( huffman_tree_t* tree, video_stream_t* stream ); + +#endif // _VIDEO_HUFFMAN_H_ diff --git a/ARDroneLib/VLIB/video_macroblock.c b/ARDroneLib/VLIB/video_macroblock.c new file mode 100644 index 0000000..615ed6a --- /dev/null +++ b/ARDroneLib/VLIB/video_macroblock.c @@ -0,0 +1,12 @@ +#include + +int32_t video_zztable_t81[MCU_BLOCK_SIZE] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63, +}; diff --git a/ARDroneLib/VLIB/video_macroblock.h b/ARDroneLib/VLIB/video_macroblock.h new file mode 100644 index 0000000..976ec38 --- /dev/null +++ b/ARDroneLib/VLIB/video_macroblock.h @@ -0,0 +1,36 @@ +#ifndef _VIDEO_MACROBLOCK_H_ +#define _VIDEO_MACROBLOCK_H_ + +#include +#include +#include + +// Default zigzag ordering matrix +extern int32_t video_zztable_t81[MCU_BLOCK_SIZE]; + +typedef struct _video_macroblock_t { + int32_t azq; // All zero coefficients + int32_t dquant; + int32_t num_coeff_y0; // Number of non-zeros coefficients for block y0 + int32_t num_coeff_y1; // Number of non-zeros coefficients for block y1 + int32_t num_coeff_y2; // Number of non-zeros coefficients for block y2 + int32_t num_coeff_y3; // Number of non-zeros coefficients for block y3 + int32_t num_coeff_cb; // Number of non-zeros coefficients for block cb + int32_t num_coeff_cr; // Number of non-zeros coefficients for block cr + + // p264 additional data + // --> intra data + intra_type_t intra_type; + intra_4x4_mode_t intra_4x4_mode[16]; // when encoding, intra_4x4_mode[] use a special format (see P6 h264) to handle intra prediction. when decoding intra_4x4_mode[] contains the real intra mode + intra_16x16_luma_mode_t intra_luma_16x16_mode; + intra_8x8_chroma_mode_t intra_chroma_8x8_mode; + + // --> inter data + inter_partition_mode_t inter_partition_mode[16]; // max number of partition per MB is 16 block_4x4 + MV_XY_t inter_MV[16]; // motion vector array. when encoding inter_MV use MV prediction, when decoding the real MV are stored in this array + uint32_t nb_partition; // number of partitions [1:16] + + int16_t* data; // macroblock's data +} video_macroblock_t; + +#endif // _VIDEO_MACROBLOCK_H_ diff --git a/ARDroneLib/VLIB/video_mem32.c b/ARDroneLib/VLIB/video_mem32.c new file mode 100644 index 0000000..522fc83 --- /dev/null +++ b/ARDroneLib/VLIB/video_mem32.c @@ -0,0 +1,43 @@ +#include +#include + +#include + +// Default implementation + +C_RESULT video_zeromem32( uint32_t* dst, uint32_t length ) +{ + while( length ) + { + *dst = 0; + + dst ++; + length--; + } + + return C_OK; +} + +C_RESULT video_copy32(uint32_t* dst, uint32_t* src, uint32_t nb) +{ + uint32_t i; + + for( i = 0; i < nb; i++ ) + { + dst[i] = src[i]; + } + + return C_OK; +} + +C_RESULT video_copy32_swap(uint32_t* dst, uint32_t* src, uint32_t nb) +{ + uint32_t i; + + for( i = 0; i < nb; i++ ) + { + dst[i] = bswap( src[i] ); + } + + return C_OK; +} diff --git a/ARDroneLib/VLIB/video_mem32.h b/ARDroneLib/VLIB/video_mem32.h new file mode 100644 index 0000000..b9b3575 --- /dev/null +++ b/ARDroneLib/VLIB/video_mem32.h @@ -0,0 +1,13 @@ +#ifndef _VIDEO_COPY32_H_ +#define _VIDEO_COPY32_H_ + +#include + +// Reset length data at a specified dst memory location +// This is an optimized version that works with a dst aligned on a CACHELINE boundary +C_RESULT video_zeromem32( uint32_t* dst, uint32_t length ); + +C_RESULT video_copy32(uint32_t* dst, uint32_t* src, uint32_t nb); +C_RESULT video_copy32_swap(uint32_t* dst, uint32_t* src, uint32_t nb); + +#endif // _VIDEO_COPY32_H_ diff --git a/ARDroneLib/VLIB/video_packetizer.c b/ARDroneLib/VLIB/video_packetizer.c new file mode 100644 index 0000000..abcf768 --- /dev/null +++ b/ARDroneLib/VLIB/video_packetizer.c @@ -0,0 +1,174 @@ +#include +#include +#include +#include + +#include + +C_RESULT video_packetizer_init( video_controller_t* controller ) +{ + // Internal buffer configuration + controller->in_stream.bytes = vp_os_malloc( DEFAULT_INTERNAL_STREAM_SIZE ); + controller->in_stream.used = 0; + controller->in_stream.size = DEFAULT_INTERNAL_STREAM_SIZE; + controller->in_stream.index = 0; + controller->in_stream.length = 32; + controller->in_stream.code = 0; + controller->in_stream.endianess = VIDEO_STREAM_LITTLE_ENDIAN; + + return C_OK; +} + +C_RESULT video_packetizer_close( video_controller_t* controller ) +{ + vp_os_free( controller->in_stream.bytes ); + + controller->in_stream.bytes = NULL; + controller->in_stream.used = 0; + controller->in_stream.size = 0; + controller->in_stream.index = 0; + controller->in_stream.length = 0; + controller->in_stream.code = 0; + + return C_OK; +} + +C_RESULT video_cache_stream( video_controller_t* controller, video_stream_t* in ) +{ + video_codec_t* video_codec = controller->video_codec; + + return video_codec->cache_stream( controller, in ); +} + +#ifndef HAS_VIDEO_WRITE_DATA + +// Fill stream->code from right to left with data in parameters (code & length) +// New bits are always always inserted at the rigth of stream->code (least significant bits) +// This way old bits are put in most significant bits +// 31 .... 0 (length-1) .... 0 +// stream <= ------------ <= ----------------------- +// stream->bits code +void video_write_data( video_stream_t* const stream, uint32_t code, int32_t length ) +{ + while( length > stream->length ) + { + // code's length is bigger than number of our free bits + // we put as many bits in cache as possible + stream->code <<= stream->length; + stream->code |= code >> (length - stream->length); + + length -= stream->length; // Compute number of bits left + code &= (1 << length) - 1; // We keep only bits we didn't push in cache + + stream->bytes[stream->index] = stream->code; + stream->index++; + stream->used += 4; + + stream->code = 0; + stream->length = 32; + } + + if( length > 0 ) + { + // In this case, previous loop ended with case length < stream->length + stream->code <<= length; + stream->code |= code; + + stream->length -= length; + } +} + +#endif + +C_RESULT video_stuff8( video_stream_t* const stream ) +{ + uint32_t length8; + + length8 = (stream->length & ~7); // TODO: Check if generated code use bic on arm + + stream->code <<= ( stream->length - length8 ); + stream->length = length8; + + return C_OK; +} + +// Fill code from right to left with length bits from stream->code +// Next bits in stream->code to take are always at the left (most significant bits) +// This way new bits are put in least significant bits +// (length-1) .... 0 31 .... 0 +// ----------------------- <= ------------ <= stream +// code stream->bits +C_RESULT video_read_data( video_stream_t* const stream, uint32_t* code, int32_t length ) +{ + uint32_t out_code = *code; + + while( length > (32 - stream->length) ) + { + /// We need more bits than available in current read bits + + out_code = (out_code << (32 - stream->length)) | (stream->code >> stream->length); + length -= (32 - stream->length); + + stream->code = stream->bytes[stream->index]; + stream->length = 0; + stream->index++; + } + + if( length > 0 ) + { + out_code = (out_code << length) | (stream->code >> ( 32 - length )); + + stream->code <<= length; + stream->length += length; + } + + *code = out_code; + + return C_OK; +} + +C_RESULT video_peek_data( const video_stream_t* const stream, uint32_t* code, int32_t length ) +{ + uint32_t out_code = *code; + uint32_t stream_code = stream->code; + uint32_t stream_length = stream->length; + + while( length > (32 - (int32_t)stream_length) ) + { + /// We need more bits than available in current read bits + + out_code = (out_code << (32 - stream_length)) | (stream_code >> stream_length); + length -= (32 - stream_length); + + stream_code = stream->bytes[stream->index]; + stream_length = 0; + } + + if( length > 0 ) + { + out_code = (out_code << length) | (stream_code >> ( 32 - length )); + } + + *code = out_code; + + return C_OK; +} + +C_RESULT video_align8( video_stream_t* const stream ) +{ + uint32_t length8, length = stream->length; + + if( length > 0 ) + { + // Do alignment only when stream->length > 0 + length8 = ( length & ~7); // TODO: Check if generated code use bic on arm + if( length8 != length ) + { + length8 += 0x08; + stream->code <<= ( length8 - length ); + stream->length = length8; + } + } + + return C_OK; +} diff --git a/ARDroneLib/VLIB/video_packetizer.h b/ARDroneLib/VLIB/video_packetizer.h new file mode 100644 index 0000000..bf8d271 --- /dev/null +++ b/ARDroneLib/VLIB/video_packetizer.h @@ -0,0 +1,39 @@ +#ifndef _VIDEO_PACKETIZER_H_ +#define _VIDEO_PACKETIZER_H_ + +#include +#include + +C_RESULT video_packetizer_init( video_controller_t* controller ); +C_RESULT video_packetizer_close( video_controller_t* controller ); + + +/// Write to a stream + +// Fills a stream with length bits from code +void video_write_data( video_stream_t* const stream, uint32_t code, int32_t length ); + +// Updates stream as its length attributes is a multiple of 8 +// Updates is done by adding bits +C_RESULT video_stuff8( video_stream_t* const stream ); + + +/// Read from a stream + +// Takes length bit from stream and updates it +C_RESULT video_read_data( video_stream_t* const stream, uint32_t* code, int32_t length ); + +// Takes length bit from stream without updating it +C_RESULT video_peek_data( const video_stream_t* const stream, uint32_t* code, int32_t length ); + +// Updates stream as its length attributes is a multiple of 8 +// Updates is done by skipping bits +C_RESULT video_align8( video_stream_t* const stream ); + + +/// Copy a stream + +// Flush content of stream in into stream out +C_RESULT video_cache_stream( video_controller_t* controller, video_stream_t* in ); + +#endif // _VIDEO_PACKETIZER_H_ diff --git a/ARDroneLib/VLIB/video_picture.c b/ARDroneLib/VLIB/video_picture.c new file mode 100644 index 0000000..ae766ae --- /dev/null +++ b/ARDroneLib/VLIB/video_picture.c @@ -0,0 +1,722 @@ +#include + +#include +#include +#include + +#ifndef HAS_VIDEO_BLOCKLINE_TO_MACRO_BLOCKS + +// Convert a 8x8 block of 8 bits data to a 8x8 block of 16 bits data +static void copy_block_8_16(int16_t* dst, int32_t dst_offset, uint8_t* src, int32_t src_offset) +{ + uint32_t* src32 = (uint32_t*) src; + uint32_t* dst32 = (uint32_t*) dst; + + uint32_t src_offset32 = src_offset >> 2; + uint32_t dst_offset32 = dst_offset >> 1; + + uint32_t temp; + + int32_t i; + + for( i = 0; i < MCU_BLOCK_SIZE; i += MCU_WIDTH, src32 += src_offset32, dst32 += dst_offset32 ) + { + temp = *src32++; + + *dst32++ = ((temp << 8) & 0x00FF0000) | (temp & 0x000000FF); + *dst32++ = ((temp >> 8) & 0x00FF0000) | ((temp >> 16) & 0x000000FF); + + temp = *src32++; + + *dst32++ = ((temp << 8) & 0x00FF0000) | (temp & 0x000000FF); + *dst32++ = ((temp >> 8) & 0x00FF0000) | ((temp >> 16) & 0x000000FF); + } + +} + +#endif + +// Convert a 8x8 block of 16 bits data to a 8x8 block of 8 bits data +static void copy_block_16_8(uint8_t* dst, int32_t dst_offset, int16_t* src, int32_t src_offset) +{ + int32_t i; + int16_t temp; + + for( i = 0; i < MCU_BLOCK_SIZE; i += MCU_WIDTH, dst += dst_offset, src += src_offset ) + { + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + temp = *src++; if( temp > 0xff ) temp = 0xff; if(temp < 0) temp = 0; temp &= 0xff; *dst++ = (uint8_t) temp; + } +} + +// +// Transform blockline in macro blocks +// +// Blockline: +// _______ +// | 1 | 2 | +// |___|___| Y +// | 3 | 4 | +// |___|___| +// ___ +// | 5 | +// |___| Cb +// ___ +// | 6 | +// |___| Cr +// +// Dct cache: +// _______________________ +// | 1 | 2 | 3 | 4 | 5 | 6 | ... +// |___|___|___|___|___|___| +// + +#ifndef HAS_VIDEO_BLOCKLINE_TO_MACRO_BLOCKS + +C_RESULT video_blockline_to_macro_blocks(video_picture_context_t* ctx, int16_t* dst, int32_t num_macro_blocks) +{ + uint8_t* y_src = ctx->y_src; + uint8_t* cb_src = ctx->cb_src; + uint8_t* cr_src = ctx->cr_src; + + while( num_macro_blocks > 0 ) + { + // Current MB + copy_block_8_16( dst, + 0, + y_src, + ctx->y_woffset - MCU_WIDTH ); + + dst += MCU_BLOCK_SIZE; // skip block 1 + + copy_block_8_16( dst, + 0, + y_src + MCU_WIDTH, + ctx->y_woffset - MCU_WIDTH ); + + dst += MCU_BLOCK_SIZE; // skip block 2 + + copy_block_8_16( dst, + 0, + y_src + ctx->y_hoffset, + ctx->y_woffset - MCU_WIDTH ); + + dst += MCU_BLOCK_SIZE; // skip block 3 + + copy_block_8_16( dst, + 0, + y_src + ctx->y_hoffset + MCU_WIDTH, + ctx->y_woffset - MCU_WIDTH ); + + dst += MCU_BLOCK_SIZE; // skip block 4 + + copy_block_8_16( dst, + 0, + cb_src, + ctx->c_woffset - MCU_WIDTH ); + + dst += MCU_BLOCK_SIZE; // skip blocks 5 + + copy_block_8_16( dst, + 0, + cr_src, + ctx->c_woffset - MCU_WIDTH ); + + dst += MCU_BLOCK_SIZE; // skip blocks 6 + + y_src += MCU_WIDTH*2; + cb_src += MCU_WIDTH; + cr_src += MCU_WIDTH; + + num_macro_blocks --; + } + + ctx->y_src = y_src; + ctx->cb_src = cb_src; + ctx->cr_src = cr_src; + + return C_OK; +} + +#endif + +// Transform macro blocks in picture of specified format +static C_RESULT video_blockline_from_macro_blocks_yuv420(video_picture_context_t* ctx, int16_t* src, int32_t num_macro_blocks); +static C_RESULT video_blockline_from_macro_blocks_rgb565(video_picture_context_t* ctx, int16_t* src, int32_t num_macro_blocks); + +C_RESULT video_blockline_from_macro_blocks(video_picture_context_t* ctx, int16_t* src, int32_t num_macro_blocks, enum PixelFormat format) +{ + C_RESULT res; + + switch(format) + { + case PIX_FMT_YUV420P: + res = video_blockline_from_macro_blocks_yuv420(ctx, src, num_macro_blocks); + break; + case PIX_FMT_RGB565: + res = video_blockline_from_macro_blocks_rgb565(ctx, src, num_macro_blocks); + break; + + default: + PRINT("In file %s, in function %s, format %d not supported\n", __FILE__, __FUNCTION__, format); + res = C_FAIL; + break; + } + + return res; +} + +C_RESULT video_blockline_from_macro_blocks_yuv420(video_picture_context_t* ctx, int16_t* src, int32_t num_macro_blocks) +{ + uint8_t *y_dst, *cb_dst, *cr_dst; + + y_dst = ctx->y_src; + cb_dst = ctx->cb_src; + cr_dst = ctx->cr_src; + + while( num_macro_blocks > 0 ) + { + // Current MB + copy_block_16_8( y_dst, + ctx->y_woffset - MCU_WIDTH, + src, + 0 ); + + src += MCU_BLOCK_SIZE; + + copy_block_16_8( y_dst + MCU_WIDTH, + ctx->y_woffset - MCU_WIDTH, + src, + 0 ); + + src += MCU_BLOCK_SIZE; + + copy_block_16_8( y_dst + ctx->y_hoffset, + ctx->y_woffset - MCU_WIDTH, + src, + 0 ); + + src += MCU_BLOCK_SIZE; + + copy_block_16_8( y_dst + ctx->y_hoffset + MCU_WIDTH, + ctx->y_woffset - MCU_WIDTH, + src, + 0 ); + + src += MCU_BLOCK_SIZE; + + copy_block_16_8( cb_dst, + ctx->c_woffset - MCU_WIDTH, + src, + 0 ); + + src += MCU_BLOCK_SIZE; + + copy_block_16_8( cr_dst, + ctx->c_woffset - MCU_WIDTH, + src, + 0 ); + + src += MCU_BLOCK_SIZE; + + y_dst += MCU_WIDTH*2; + cb_dst += MCU_WIDTH; + cr_dst += MCU_WIDTH; + + num_macro_blocks--; + } + + ctx->y_src = y_dst; + ctx->cb_src = cb_dst; + ctx->cr_src = cr_dst; + + return C_OK; +} + +#define MAKE_RGBA_565(r, g, b) ( ((r) << 11) | ((g) << 5) | (b) ) + +#if TARGET_CPU_ARM == 1 && defined(TARGET_OS_IPHONE) +static inline int32_t saturate8(int32_t x) +{ + usat(x, 7, 8); + + return x; +} + +static inline uint32_t saturate5(int32_t x) +{ + usat(x, 5, 11); + + return x; +} + +static inline uint32_t saturate6(int32_t x) +{ + usat(x, 6, 10); + + return x; +} + +#else + +// To make sure that you are bounding your inputs in the range of 0 & 255 + +static inline int32_t saturate8(int32_t x) +{ + if( x < 0 ) + { + x = 0; + } + + x >>= 8; + + return x > 0xFF ? 0xFF : x; +} + +static inline uint16_t saturate5(int32_t x) +{ + if( x < 0 ) + { + x = 0; + } + + x >>= 11; + + return x > 0x1F ? 0x1F : x; +} + +static inline uint16_t saturate6(int32_t x) +{ + if( x < 0 ) + { + x = 0; + } + + x >>= 10; + + return x > 0x3F ? 0x3F : x; +} +#endif + + +static C_RESULT video_blockline_from_macro_blocks_rgb565(video_picture_context_t* ctx, int16_t* src, int32_t num_macro_blocks) +{ + uint32_t y_up_read, y_down_read, cr_current, cb_current; + int32_t u, v, vr, ug, vg, ub, r, g, b; + int16_t *y_buf1, *y_buf2, *cr_buf, *cb_buf; + uint16_t *dst_up, *dst_down; + + // Control variables + int32_t line_size, block_size, y_woffset, y_hoffset; + + y_buf1 = src; + y_buf2 = y_buf1 + MCU_WIDTH; + + cb_buf = y_buf1 + MCU_BLOCK_SIZE * 4; + cr_buf = cb_buf + MCU_BLOCK_SIZE; + + // Our ptrs are 16 bits + y_woffset = ctx->y_woffset / 2; + y_hoffset = ctx->y_hoffset / 2; + + dst_up = (uint16_t*) ctx->y_src; + dst_down = dst_up + y_woffset; + + line_size = MCU_WIDTH / 2; // We compute two pixels at a time + block_size = MCU_HEIGHT / 2; // We compute two lines at a time + + while( num_macro_blocks > 0 ) + { + // First quarter + cb_current = cb_buf[0]; + cr_current = cr_buf[0]; + + u = cb_current - 128; + ug = 88 * u; + ub = 454 * u; + v = cr_current - 128; + vg = 183 * v; + vr = 359 * v; + + y_up_read = y_buf1[0] << 8; + y_down_read = y_buf2[0] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[0] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[0] = MAKE_RGBA_565(r, g, b); + + y_up_read = y_buf1[1] << 8; + y_down_read = y_buf2[1] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[1] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[1] = MAKE_RGBA_565(r, g, b); + + // Second quarter + cr_current = cr_buf[MCU_WIDTH / 2]; + cb_current = cb_buf[MCU_WIDTH / 2]; + + u = cb_current - 128; + ug = 88 * u; + ub = 454 * u; + v = cr_current - 128; + vg = 183 * v; + vr = 359 * v; + + y_up_read = y_buf1[MCU_BLOCK_SIZE] << 8; + y_down_read = y_buf2[MCU_BLOCK_SIZE] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[MCU_WIDTH] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[MCU_WIDTH] = MAKE_RGBA_565(r, g, b); + + y_up_read = y_buf1[MCU_BLOCK_SIZE + 1] << 8; + y_down_read = y_buf2[MCU_BLOCK_SIZE + 1] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[MCU_WIDTH+1] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[MCU_WIDTH+1] = MAKE_RGBA_565(r, g, b); + + // Third quarter + cr_current = cr_buf[MCU_BLOCK_SIZE/2]; + cb_current = cb_buf[MCU_BLOCK_SIZE/2]; + + u = cb_current - 128; + ug = 88 * u; + ub = 454 * u; + v = cr_current - 128; + vg = 183 * v; + vr = 359 * v; + + y_up_read = y_buf1[MCU_BLOCK_SIZE*2] << 8; + y_down_read = y_buf2[MCU_BLOCK_SIZE*2] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[y_hoffset] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[y_hoffset] = MAKE_RGBA_565(r, g, b); + + y_up_read = y_buf1[MCU_BLOCK_SIZE*2 + 1] << 8; + y_down_read = y_buf2[MCU_BLOCK_SIZE*2 + 1] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[y_hoffset + 1] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[y_hoffset + 1] = MAKE_RGBA_565(r, g, b); + + // Fourth quarter + cr_current = cr_buf[MCU_BLOCK_SIZE/2 + MCU_WIDTH/2]; + cb_current = cb_buf[MCU_BLOCK_SIZE/2 + MCU_WIDTH/2]; + + u = cb_current - 128; + ug = 88 * u; + ub = 454 * u; + v = cr_current - 128; + vg = 183 * v; + vr = 359 * v; + + y_up_read = y_buf1[MCU_BLOCK_SIZE*3] << 8; + y_down_read = y_buf2[MCU_BLOCK_SIZE*3] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[y_hoffset + MCU_WIDTH] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[y_hoffset + MCU_WIDTH] = MAKE_RGBA_565(r, g, b); + + y_up_read = y_buf1[MCU_BLOCK_SIZE*3 + 1] << 8; + y_down_read = y_buf2[MCU_BLOCK_SIZE*3 + 1] << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + dst_up[y_hoffset + MCU_WIDTH + 1] = MAKE_RGBA_565(r, g, b); + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + dst_down[y_hoffset + MCU_WIDTH + 1] = MAKE_RGBA_565(r, g, b); + + cr_buf += 1; + cb_buf += 1; + y_buf1 += 2; + y_buf2 += 2; + dst_up += 2; + dst_down += 2; + + line_size--; + + if( line_size == 0 ) // We computed one line of a luma-block + { + dst_up += y_woffset*2 - MCU_WIDTH; + dst_down += y_woffset*2 - MCU_WIDTH; + + block_size--; + + if( block_size == 0 ) + { + y_buf1 = cr_buf + MCU_BLOCK_SIZE/2 + MCU_WIDTH/2; + y_buf2 = y_buf1 + MCU_WIDTH; + + cb_buf = y_buf1 + MCU_BLOCK_SIZE * 4; + cr_buf = cb_buf + MCU_BLOCK_SIZE; + + block_size = MCU_WIDTH / 2; // We compute two lines at a time + + dst_up += 2*MCU_WIDTH - y_hoffset; + dst_down = dst_up + y_woffset; + + num_macro_blocks--; + } + else + { + y_buf1 = y_buf2; + y_buf2 += MCU_WIDTH; + + cr_buf += MCU_WIDTH / 2; + cb_buf += MCU_WIDTH / 2; + } + + line_size = MCU_WIDTH / 2; // We compute two pixels at a time + } + } + + ctx->y_src = (uint8_t*) dst_up; + + return C_OK; +} + + + +// Transform a blockline YUV 4:2:0 in picture of specified format +static C_RESULT video_blockline_from_blockline_yuv420(video_picture_context_t* ctx, video_picture_context_t* src, int32_t num_macro_blocks); +static C_RESULT video_blockline_from_blockline_rgb565(video_picture_context_t* ctx, video_picture_context_t* src, int32_t num_macro_blocks); + +C_RESULT video_blockline_from_blockline(video_picture_context_t* ctx, video_picture_context_t* src, int32_t num_macro_blocks, enum PixelFormat format) +{ + C_RESULT res; + + switch(format) + { + case PIX_FMT_YUV420P: + res = video_blockline_from_blockline_yuv420(ctx, src, num_macro_blocks); + break; + case PIX_FMT_RGB565: + res = video_blockline_from_blockline_rgb565(ctx, src, num_macro_blocks); + break; + + default: + PRINT("In file %s, in function %s, format %d not supported\n", __FILE__, __FUNCTION__, format); + res = C_FAIL; + break; + } + + return res; +} + +static C_RESULT video_blockline_from_blockline_yuv420(video_picture_context_t* blockline_ctx, video_picture_context_t* blockline_src, int32_t num_macro_blocks) +{ + uint32_t line; + uint8_t* dest; + uint8_t* src; + uint32_t copy_line_size; + + // copy luma + copy_line_size = num_macro_blocks * MB_HEIGHT_Y; + dest = blockline_ctx->y_src; + src = blockline_src->y_src; + line = MB_HEIGHT_Y; + while (line--) + { + vp_os_memcpy(dest,src,copy_line_size); + dest += blockline_ctx->y_woffset; + src += blockline_src->y_woffset; + } + + // copy cb + copy_line_size = num_macro_blocks * MB_HEIGHT_C; + dest = blockline_ctx->cb_src; + src = blockline_src->cb_src; + line = MB_HEIGHT_C; + while (line--) + { + vp_os_memcpy(dest,src,copy_line_size); + dest += blockline_ctx->c_woffset; + src += blockline_src->c_woffset; + } + + // copy cr + copy_line_size = num_macro_blocks * MB_HEIGHT_C; + dest = blockline_ctx->cr_src; + src = blockline_src->cr_src; + line = MB_HEIGHT_C; + while (line--) + { + vp_os_memcpy(dest,src,copy_line_size); + dest += blockline_ctx->c_woffset; + src += blockline_src->c_woffset; + } + + return C_OK; +} + + +static C_RESULT +video_blockline_from_blockline_rgb565(video_picture_context_t* ctx, + video_picture_context_t* src, int32_t num_macro_blocks) +{ + uint32_t y_up_read, y_down_read, cr_current, cb_current; + int32_t u, v, vr, ug, vg, ub, r, g, b; + uint8_t *y_buf_up, *y_buf_down, *cr_buf, *cb_buf; + uint16_t *dst_up, *dst_down; + int32_t line_size,dest_y_woffset; + + // Control variables + uint32_t pixel,line; + + // In ptrs + y_buf_up = src->y_src; + y_buf_down = y_buf_up + src->y_woffset; + + cb_buf = src->cb_src; + cr_buf = src->cr_src; + + // Out ptrs are 16 bits + dest_y_woffset = ctx->y_woffset / 2; + + dst_up = (uint16_t*) ctx->y_src; + dst_down = dst_up + dest_y_woffset; + + // We compute two pixels at a time + line_size = MB_WIDTH_Y*num_macro_blocks; + + pixel = line_size>>1; + line = MB_WIDTH_Y>>1; + + while (line) + { + // load cb cr + cb_current = *cb_buf++; + cr_current = *cr_buf++; + + u = cb_current - 128; + ug = 88 * u; + ub = 454 * u; + v = cr_current - 128; + vg = 183 * v; + vr = 359 * v; + + // compute pixel(0,0) + y_up_read = (*y_buf_up++) << 8; + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + *dst_up++ = MAKE_RGBA_565(r, g, b); + + // compute pixel(1,0) + y_up_read = (*y_buf_up++) << 8; + + r = saturate5((y_up_read + vr)); + g = saturate6((y_up_read - ug - vg)); + b = saturate5((y_up_read + ub)); + + *dst_up++ = MAKE_RGBA_565(r, g, b); + + // compute pixel (0,1) + y_down_read = (*y_buf_down++) << 8; + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + *dst_down++ = MAKE_RGBA_565(r, g, b); + + // compute pixel (1,1) + y_down_read = (*y_buf_down++) << 8; + + r = saturate5((y_down_read + vr)); + g = saturate6((y_down_read - ug - vg)); + b = saturate5((y_down_read + ub)); + + *dst_down++ = MAKE_RGBA_565(r, g, b); + + pixel--; + if (pixel == 0) + { + // jump to next line + y_buf_up += 2*src->y_woffset - line_size; + y_buf_down += 2*src->y_woffset - line_size; + cb_buf += src->c_woffset - (line_size>>1); + cr_buf += src->c_woffset - (line_size>>1); + + dst_up += 2*dest_y_woffset - line_size; + dst_down += 2*dest_y_woffset - line_size; + + pixel = line_size>>1; + line--; + } + } + + return C_OK; +} diff --git a/ARDroneLib/VLIB/video_picture.h b/ARDroneLib/VLIB/video_picture.h new file mode 100644 index 0000000..34793c8 --- /dev/null +++ b/ARDroneLib/VLIB/video_picture.h @@ -0,0 +1,30 @@ +#ifndef _VIDEO_PICTURE_H_ +#define _VIDEO_PICTURE_H_ + +#include +#include + +#include + +typedef struct _video_picture_context_t { + uint8_t* y_src; + uint8_t* cb_src; + uint8_t* cr_src; + + uint32_t y_woffset; // = picture->y_line_size (in bytes) + uint32_t c_woffset; // = picture->cb_line_size (in bytes) + uint32_t y_hoffset; // = picture->y_line_size * MCU_HEIGHT (in bytes) + +} video_picture_context_t; + +// Transform picture in macro blocks +C_RESULT video_blockline_to_macro_blocks(video_picture_context_t* ctx, int16_t* macro_blocks, int32_t num_macro_blocks); + +// Transform macro blocks in picture +C_RESULT video_blockline_from_macro_blocks(video_picture_context_t* ctx, int16_t* macro_blocks, int32_t num_macro_blocks, enum PixelFormat format); + +// Transform macro blocks in picture +C_RESULT video_blockline_from_blockline(video_picture_context_t* ctx, video_picture_context_t* src, int32_t num_macro_blocks, enum PixelFormat format); + + +#endif // _VIDEO_PICTURE_H_ diff --git a/ARDroneLib/VLIB/video_picture_defines.h b/ARDroneLib/VLIB/video_picture_defines.h new file mode 100644 index 0000000..224d445 --- /dev/null +++ b/ARDroneLib/VLIB/video_picture_defines.h @@ -0,0 +1,16 @@ +#ifndef _VIDEO_PICTURE_DEFINES_H_ +#define _VIDEO_PICTURE_DEFINES_H_ + +#define MCU_HEIGHT 8 +#define MCU_WIDTH 8 +#define MCU_BLOCK_SIZE (MCU_HEIGHT * MCU_WIDTH) + +// Offsets in video_picture_context structure +#define VIDEO_PICTURE_CONTEXT_Y_SRC 0 +#define VIDEO_PICTURE_CONTEXT_CB_SRC 4 +#define VIDEO_PICTURE_CONTEXT_CR_SRC 8 +#define VIDEO_PICTURE_CONTEXT_Y_WOFFSET 12 +#define VIDEO_PICTURE_CONTEXT_C_WOFFSET 16 +#define VIDEO_PICTURE_CONTEXT_Y_HOFFSET 20 + +#endif // _VIDEO_PICTURE_DEFINES_H_ diff --git a/ARDroneLib/VLIB/video_quantizer.c b/ARDroneLib/VLIB/video_quantizer.c new file mode 100644 index 0000000..67398d9 --- /dev/null +++ b/ARDroneLib/VLIB/video_quantizer.c @@ -0,0 +1,295 @@ +#include +#include + +C_RESULT video_quantizer_init( video_controller_t* controller ) +{ + // Init quantizer's value + // This value is between 1 and 31 + // TODO: this is not true in case of P264 but P264 don't use the video_quantizer functions. To be fixed + + int32_t quant = controller->quant; + + if( quant < 1 ) + quant = 1; + else if( quant >= 32 ) + quant = 31; + + if( controller->picture_type == VIDEO_PICTURE_INTRA ) + { + controller->Qp = 0; + controller->invQp = (1 << 16) / (2*quant); + } + else // VIDEO_PICTURE_INTER + { + controller->Qp = quant / 2; + controller->invQp = (1 << 16) / (2*quant); + } + + controller->dquant = 0; + + return C_OK; +} + +C_RESULT video_quantizer_update( video_controller_t* controller ) +{ + // Update quantizer's value + int32_t quant = controller->quant; + + if( quant < 1 ) + quant = 1; + else if( quant >= 32 ) + quant = 31; + + if( controller->picture_type == VIDEO_PICTURE_INTRA ) + { + controller->Qp = 0; + controller->invQp = (1 << 16) / (2*quant); + } + else // VIDEO_PICTURE_INTER + { + controller->Qp = quant / 2; + controller->invQp = (1 << 16) / (2*quant); + } + + controller->dquant = 0; + + return C_OK; +} + +C_RESULT video_quantize( video_controller_t* controller, video_macroblock_t* macroblock, int32_t num_macro_blocks ) +{ + int32_t sum_y, sum_c, dc0, dc1, dc2, dc3, dcb, dcr; + int16_t *y0; + + y0 = macroblock->data; + + while( num_macro_blocks > 0 ) + { + if( controller->do_azq == TRUE ) + { + int16_t *y1, *y2, *y3, *cb, *cr; + + y1 = y0 + MCU_BLOCK_SIZE; + y2 = y1 + MCU_BLOCK_SIZE; + y3 = y2 + MCU_BLOCK_SIZE; + cb = y3 + MCU_BLOCK_SIZE; + cr = cb + MCU_BLOCK_SIZE; + + // Test for azq (all zero quantized) in luma blocks + dc0 = *y0; + dc1 = *y1; + dc2 = *y2; + dc3 = *y3; + dcb = *cb; + dcr = *cr; + + sum_y = dc0 + dc1 + dc2 + dc3; + sum_c = dcb + dcr; + } + else + { + sum_y = 0x7F000000; + sum_c = 0x7F000000; + } + + macroblock->azq = (sum_y < controller->aq) & (sum_c < controller->bq); + macroblock->dquant = controller->dquant; + + // Perform quantification on coefficients if necessary + if( !macroblock->azq ) + { + RTMON_USTART(VIDEO_VLIB_DOQUANTIZE); + if( controller->picture_type == VIDEO_PICTURE_INTRA ) // intra + { + y0 = do_quantize_intra_mb(y0, controller->quant, ¯oblock->num_coeff_y0); + } + else + { + y0 = do_quantize_inter_mb(y0, controller->Qp, controller->invQp, ¯oblock->num_coeff_y0); + } + RTMON_USTOP(VIDEO_VLIB_DOQUANTIZE); + } + + macroblock++; + num_macro_blocks--; + + if( macroblock->azq ) + { + y0 = macroblock->data; + } + } + + return C_OK; +} + +C_RESULT video_unquantize( video_controller_t* controller, video_macroblock_t* macroblock, int32_t num_macro_blocks ) +{ + int16_t *dst; + + controller->quant += macroblock->dquant; + + dst = macroblock->data; + + while( num_macro_blocks > 0 ) + { + // TODO Check generated code + + if( !macroblock->azq ) + do_unquantize(dst, controller->picture_type, controller->quant, macroblock->num_coeff_y0); + + dst += MCU_BLOCK_SIZE; + + if( !macroblock->azq ) + do_unquantize(dst, controller->picture_type, controller->quant, macroblock->num_coeff_y1); + + dst += MCU_BLOCK_SIZE; + + if( !macroblock->azq ) + do_unquantize(dst, controller->picture_type, controller->quant, macroblock->num_coeff_y2); + + dst += MCU_BLOCK_SIZE; + + if( !macroblock->azq ) + do_unquantize(dst, controller->picture_type, controller->quant, macroblock->num_coeff_y3); + + dst += MCU_BLOCK_SIZE; + + if( !macroblock->azq ) + do_unquantize(dst, controller->picture_type, controller->quant, macroblock->num_coeff_cb); + + dst += MCU_BLOCK_SIZE; + + if( !macroblock->azq ) + do_unquantize(dst, controller->picture_type, controller->quant, macroblock->num_coeff_cr); + + dst += MCU_BLOCK_SIZE; + + macroblock ++; + num_macro_blocks--; + } + + return C_OK; +} + +#ifndef HAS_DO_QUANTIZE_INTRA_MB +int16_t* do_quantize_intra_mb(int16_t* ptr, int32_t quant, int32_t* last_ptr) +{ + int32_t i, num_coeff; + int32_t coeff, last; + int32_t j; + if (quant == TABLE_QUANTIZATION) + quant = TBL_QUANT_QUALITY; + + for( i = 6; i > 0; i-- ) + { + coeff = *ptr; + last = 1; + num_coeff = MCU_BLOCK_SIZE-1; + coeff = coeff / (QUANT_I(0,quant)); + if( coeff == 0 ) + coeff = 1; + *ptr = coeff; + ptr++; + j = 1; + + while( num_coeff > 0 ) + { + coeff = *ptr; + if( coeff != 0 ) + { + // TODO : division can be slow, a better implementation would consist in building an invQuant(j) table [2^16/QUANT_I(j,quant)] and computing (coeff*invQuant(j))>>16 instead of coeff / (QUANT_I(j,quant)) + coeff = coeff / (QUANT_I(j,quant)); + + if( coeff != 0 ) + { + last++; + } + + *ptr = coeff; + } + ptr++; + num_coeff--; + j++; + } + + *last_ptr++ = last; + } + + return ptr; +} +#endif // HAS_DO_QUANTIZE_INTRA_MB + +int16_t* do_quantize_inter_mb(int16_t* ptr, int32_t quant, int32_t invQuant, int32_t* last_ptr) +{ + int32_t i, num_coeff; + int32_t coeff, sign, last; + + // LEVEL = ( |COF| - QUANT/2 ) / (2*QUANT) see III.3.2.1 + + for( i = 6; i > 0; i-- ) + { + last = 0; + num_coeff = MCU_BLOCK_SIZE; + + while( num_coeff > 0 ) + { + coeff = *ptr; + + if( coeff != 0 ) + { + sign = coeff < 0; + + if( sign ) + coeff = -coeff; + + coeff -= quant; + coeff *= invQuant; + coeff >>= 16; + + if( sign ) + coeff = -coeff; + + if( coeff != 0 ) + { + last++; + } + + } + + ptr++; + num_coeff--; + } + + *last_ptr++ = last; + } + + return ptr; +} + +#ifndef HAS_DO_UNQUANTIZE +C_RESULT do_unquantize(int16_t* ptr, int32_t picture_type, int32_t quant, int32_t num_coeff) +{ + int32_t coeff; + uint32_t i=0; + + if (quant == TABLE_QUANTIZATION) + quant = TBL_QUANT_QUALITY; // TABLE_QUANTIZATION is an old mode and is equivalent to a QUANT_I(i,2) quantization table + + // table quantization mode + i=0; + do + { + coeff = *ptr; + if( coeff ) + { + coeff *= QUANT_I (i,quant); + *ptr = coeff; + num_coeff--; + } + i++; + ptr++; + } while( num_coeff > 0 ); + + return C_OK; +} +#endif diff --git a/ARDroneLib/VLIB/video_quantizer.h b/ARDroneLib/VLIB/video_quantizer.h new file mode 100644 index 0000000..f39bdbe --- /dev/null +++ b/ARDroneLib/VLIB/video_quantizer.h @@ -0,0 +1,26 @@ +#ifndef _VIDEO_QUANTIZER_H_ +#define _VIDEO_QUANTIZER_H_ + +#include + +// (quant > 0)&&(quant < 31) => use table quantization generated with QUANT_I(i,quant) macro +// quant == 31 => old quantization table mode, means QUANT_I(i,2) (backward compatibility) +#define TABLE_QUANTIZATION 31 // quant transmitted for old TABLE_QUANTIZATION mode +#define TBL_QUANT_QUALITY 2 // real quant used for old TABLE_QUANTIZATION mode + +// quantization macro +#define QUANT_IJ(i,j,quality) (1 + (1 +(i) + (j))*(quality)) +#define QUANT_I(i,quality) (1 + (1 +(i/8) + (i%8))*(quality)) + +// Utility functions +int16_t* do_quantize_intra_mb(int16_t* ptr, int32_t invQuant, int32_t* last_ptr); +int16_t* do_quantize_inter_mb(int16_t* ptr, int32_t quant, int32_t invQuant, int32_t* last_ptr); +C_RESULT do_unquantize(int16_t* ptr, int32_t picture_type, int32_t quant, int32_t num_coeff); + +// Default quantization scheme +C_RESULT video_quantizer_init( video_controller_t* controller ); +C_RESULT video_quantizer_update( video_controller_t* controller ); +C_RESULT video_quantize( video_controller_t* controller, video_macroblock_t* macroblock, int32_t num_macro_blocks ); +C_RESULT video_unquantize( video_controller_t* controller, video_macroblock_t* macroblock, int32_t num_macro_blocks ); + +#endif // _VIDEO_QUANTIZER_H_ diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec.c b/ARDroneLib/VP_SDK/ATcodec/ATcodec.c new file mode 100644 index 0000000..c3531df --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec.c @@ -0,0 +1,611 @@ +/** + * @file ATcodec_Buffer.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ +#include +#include +#include + +#include +#include + +/************************************************************************ + * For private use in 'vp_atcodec_sscanf' and 'vp_atcodec_sprintf' functions + ************************************************************************/ + +#ifdef AT_CODEC_DEBUG + +#define PRINTF_DEBUG printf +#define CURCHARS_DEBUG(str_val, fmt_val) ATCODEC_PRINT("Current characters : str_val='%c' ; fmt_val='%c'\n", str_val, fmt_val) +#define PRINT_DEBUG ATCODEC_PRINT("Sortie ligne %i\n", __LINE__) + +#else + +static inline void tmp_printf(char *str, ...){} + +#define PRINTF_DEBUG tmp_printf +#define CURCHARS_DEBUG(str_val, fmt_val) +#define PRINT_DEBUG + +#endif + +#define EXIT_LOOP_IF(cond) \ + if(cond) \ + { \ + bContinue = ATCODEC_FALSE; \ + PRINT_DEBUG; \ + break; \ + } + +typedef struct _ListParams +{ + char *listLengthPtr; + int list_length; + char *list_ptr_b; + char *list_ptr_e; + char list_char; +} +ListParams; + + +ATCODEC_RET +vp_atcodec_sscanf(ATcodec_Memory_t *str, ATcodec_Memory_t *fmt, ATcodec_Memory_t *mem, int *len_dec) +{ + int fmt_val, + str_val, + tmp_val, + tmp2_val = 0, + nbOpen; + char *stringLengthPtr; + + ATcodec_Buffer_t listsParams; + ListParams listParams, + *listParamsPtr; + + char *tmp_ptr, + *tmp2_ptr = NULL; + + ATCODEC_RET bContinue = ATCODEC_TRUE; + + int inList = -1, + escaped = -1, + inFacultative = -1; + + ATcodec_Buffer_init(&listsParams, sizeof(ListParams), 1); + + fmt_val = ATcodec_Memory_Get_Char(fmt); + str_val = ATcodec_Memory_Get_Char(str); + + while (bContinue == ATCODEC_TRUE && fmt_val != '\0') + { + if (fmt_val == '%' && escaped) + { + switch (( fmt_val = ATcodec_Memory_Get_Char(fmt))) + { + case 'l' : + fmt_val = ATcodec_Memory_Get_Char(fmt); + + EXIT_LOOP_IF(fmt_val != '{'); + + inList = 0; + listParams.list_ptr_b = fmt->current; + listParams.list_length = 0; + + listParams.listLengthPtr = mem->current; + ATcodec_Memory_Raw_Put_Int(mem, 0xFFFFFFFF); + + nbOpen = 0; + while(fmt_val != '\0' && ((fmt_val = ATcodec_Memory_Get_Char(fmt)) != '}' || !escaped || nbOpen--)) + { + if (fmt_val == '\\') + { + escaped = 0; + } + else if (fmt_val == '{' && escaped) + { + nbOpen++; + } + else + { + escaped = -1; + } + } + + EXIT_LOOP_IF(fmt_val == '\0'); // does a '}' lack ? + + listParams.list_ptr_e = fmt->current; + + listParams.list_char = ATcodec_Memory_Get_Char(fmt); + + fmt->current = listParams.list_ptr_b; + fmt_val = ATcodec_Memory_Get_Char(fmt); + + ATcodec_Buffer_pushElement(&listsParams, &listParams); + break; + + case 'd' : + EXIT_LOOP_IF((str_val < '0' || str_val > '9') && str_val != '-'); // not supported + + fmt_val = ATcodec_Memory_Get_Char(fmt); + EXIT_LOOP_IF(fmt_val >= '0' && fmt_val <= '9'); // not supported + + ATcodec_Memory_Unget_Char(str); + tmp_val = ATcodec_Memory_Str_Get_Int(str); + + str_val = ATcodec_Memory_Get_Char(str); // processes next characters + ATcodec_Memory_Raw_Put_Int(mem, tmp_val); + break; + + case 's' : + fmt_val = ATcodec_Memory_Get_Char(fmt); + + if (fmt_val == '\\') + { + escaped = 0; + fmt_val = ATcodec_Memory_Get_Char(fmt); + } + + if (fmt_val == ']' && escaped) // supported + { + fmt_val = ATcodec_Memory_Get_Char(fmt); // just skips this character + inFacultative = -1; + } + else + { + EXIT_LOOP_IF + ( + (fmt_val == '[' && escaped) || // not supported yet + (fmt_val == '%' && escaped) || // not supported + str_val == fmt_val // empty string case, prohibited + ); + } + + escaped = -1; + stringLengthPtr = mem->current; + ATcodec_Memory_Raw_Put_Int(mem, 0xFFFFFFFF); + + tmp_val = 0; + do + { + ATcodec_Memory_Put_Char(mem, str_val); + tmp_val++; + str_val = ATcodec_Memory_Get_Char(str); + } + while (str_val != fmt_val); + ATcodec_Memory_Put_Char(mem, '\0'); + tmp_ptr = mem->current; + mem->current = stringLengthPtr; + ATcodec_Memory_Raw_Put_Int(mem, tmp_val); + mem->current = tmp_ptr; + break; + + case 'c' : + fmt_val = ATcodec_Memory_Get_Char(fmt); + /** + * To match "%c", can be any character excepted , + * but as we are already in the loop, it is different from . + * So, we just "eat" one character. + **/ + str_val = ATcodec_Memory_Get_Char(str); + ATcodec_Memory_Put_Char(mem, str_val); + break; + + default : // prohibited pattern + bContinue = ATCODEC_FALSE; // exits with failure + PRINT_DEBUG; + break; + } + } + else if (!inList && fmt_val == '}' && escaped) + { + listParamsPtr = (ListParams *)ATcodec_Buffer_topElement(&listsParams); + VP_OS_ASSERT(listParamsPtr); + + if (str_val == ',') // one list element parsed + { + str_val = ATcodec_Memory_Get_Char(str); + fmt->current = listParamsPtr->list_ptr_b; + fmt_val = ATcodec_Memory_Get_Char(fmt); + listParamsPtr->list_length++; + } + else + { + EXIT_LOOP_IF + ( + (listParamsPtr->list_char != '\0') || + (str_val != listParamsPtr->list_char) + ); + + // entire list parsed + fmt->current = listParamsPtr->list_ptr_e; + fmt_val = ATcodec_Memory_Get_Char(fmt); + *listParamsPtr->listLengthPtr = ++listParamsPtr->list_length; + ATcodec_Buffer_justPopElement(&listsParams); + inList = ( ATcodec_Buffer_topElement(&listsParams) ? -1 : 0 ); + } + } + else if (fmt_val == '\\' && escaped) + { + fmt_val = ATcodec_Memory_Get_Char(fmt); + escaped = 0; + } + else if (fmt_val == '[' && escaped) + { + if ((fmt_val = ATcodec_Memory_Get_Char(fmt)) == '\\') + { + escaped = 0; + fmt_val = ATcodec_Memory_Get_Char(fmt); + } + + if (fmt_val != '%' || !escaped) + { + escaped = -1; + + if (str_val == fmt_val) + { + // it musts match the facultative pattern + ATcodec_Memory_Raw_Put_Int(mem, (int)0); + str_val = ATcodec_Memory_Get_Char(str); // processes next characters + fmt_val = ATcodec_Memory_Get_Char(fmt); + // nothing else to do, global loop does the job + inFacultative = 0; + } + else + { + // we skip the facultative pattern + ATcodec_Memory_Raw_Put_Int(mem, (int)-1); + + while(fmt_val != '\0' && ((fmt_val = ATcodec_Memory_Get_Char(fmt)) != ']' || !escaped)) + { + escaped = ( fmt_val == '\\' ? 0 : -1 ); + } + + EXIT_LOOP_IF(fmt_val == '\0'); // does a ']' lack ? + + fmt_val = ATcodec_Memory_Get_Char(fmt); + } + } + else + { + escaped = -1; + + // we have to manage a '%' as beginning of the facultative pattern which is too complicated + // so, we skip the facultative pattern to test the character that follows it + tmp_ptr = fmt->current; // points to the '%' character + tmp_val = fmt_val; // is equal to '%' + + while(fmt_val != '\0' && ((fmt_val = ATcodec_Memory_Get_Char(fmt)) != ']' || !escaped)) + { + escaped = ( fmt_val == '\\' ? 0 : -1 ); + } + + EXIT_LOOP_IF(fmt_val == '\0'); // does a ']' lack ? + + fmt_val = ATcodec_Memory_Get_Char(fmt); + if (fmt_val == '\\') + { + escaped = 0; + tmp2_val = fmt_val; + tmp2_ptr = fmt->current; + fmt_val = ATcodec_Memory_Get_Char(fmt); + } + + if (str_val != fmt_val && !(!inList && fmt_val == '}' && str_val == ',')) + { + escaped = -1; + // we do not really support this case but we try to be lucky ;-) + fmt->current = tmp_ptr; + fmt_val = tmp_val; + // we try to match the facultative pattern + ATcodec_Memory_Raw_Put_Int(mem, (int)0); + // nothing else to do, global loop does the job + inFacultative = 0; + } + else + { + if (!escaped) + { + fmt_val = tmp2_val; + fmt->current = tmp2_ptr; + escaped = -1; + } + // we skip the facultative pattern + ATcodec_Memory_Raw_Put_Int(mem, (int)-1); + } + } + } + else if (fmt_val == ']' && escaped) + { + fmt_val = ATcodec_Memory_Get_Char(fmt); + inFacultative = -1; + // nothing to do : global loop does the job + } + else if (str_val == fmt_val) // matches + { + // TODO : Verify as much as possible if rules are respected + + EXIT_LOOP_IF + ( + ((str_val == ',' || str_val == '}') && !inList && escaped) || + ((str_val == '[' || str_val == ']') && !inFacultative && escaped) + ); + + str_val = ATcodec_Memory_Get_Char(str); // processes next characters + fmt_val = ATcodec_Memory_Get_Char(fmt); + escaped = -1; + } + else if (fmt_val != '\0') // it does not match + { + bContinue = ATCODEC_FALSE; // exits with failure + PRINT_DEBUG; + CURCHARS_DEBUG(str_val, fmt_val); + break; + } + } + + while (bContinue == ATCODEC_TRUE && (fmt_val != '\0')) + { + if (fmt_val == ']') + { + fmt_val = ATcodec_Memory_Get_Char(fmt); + } + else if (fmt_val == '[') + { + ATcodec_Memory_Raw_Put_Int(mem, (int)-1); // we skip the facultative pattern + + while(fmt_val != '\0' && ((fmt_val = ATcodec_Memory_Get_Char(fmt)) != ']' || !escaped)) + { + escaped = ( fmt_val == '\\' ? 0 : -1 ); + } + + EXIT_LOOP_IF(fmt_val == '\0'); // does a ']' lack ? + + fmt_val = ATcodec_Memory_Get_Char(fmt); + } + else if (!inList && fmt_val == '}') + { + listParamsPtr = (ListParams *)ATcodec_Buffer_topElement(&listsParams); + VP_OS_ASSERT(listParamsPtr); + + fmt_val = ATcodec_Memory_Get_Char(fmt); + *listParamsPtr->listLengthPtr = ++listParamsPtr->list_length; + ATcodec_Buffer_justPopElement(&listsParams); + + inList = ( ATcodec_Buffer_topElement(&listsParams) ? -1 : 0 ); + } + else + { + bContinue = ATCODEC_FALSE; + PRINT_DEBUG; + CURCHARS_DEBUG(str_val, fmt_val); + } + } + + ATcodec_Buffer_destroy(&listsParams); + *len_dec = (unsigned)str->current-(unsigned)str->start; + return bContinue; +} + +/** + * Used to differentiate case where va_list is used from case where a memory area is used. + */ +static char ATCODEC_sprintf_memory_GetChar(ATcodec_Memory_t *mem, va_list *va) +{ + return ATcodec_Memory_Get_Char(mem); +} + +static void ATCODEC_sprintf_memory_GetString(ATcodec_Memory_t *mem, va_list *va, char *dst) +{ + ATcodec_Memory_Get_String(mem, dst); +} + +static int ATCODEC_sprintf_memory_Raw_GetInt(ATcodec_Memory_t *mem, va_list *va) +{ + return ATcodec_Memory_Raw_Get_Int(mem); +} + +static char ATCODEC_sprintf_valist_GetChar(ATcodec_Memory_t *mem, va_list *va) +{ + return (char)va_arg(*va, int); +} + +static void ATCODEC_sprintf_valist_GetString(ATcodec_Memory_t *mem, va_list *va, char *dst) +{ + strcpy(dst, va_arg(*va, char *)); +} + +static int ATCODEC_sprintf_valist_Raw_GetInt(ATcodec_Memory_t *mem, va_list *va) +{ + return va_arg(*va, int); +} + +typedef struct _sprintf_funcs +{ + char (* ATCODEC_sprintf_GetChar )(ATcodec_Memory_t *mem, va_list *va); + void (* ATCODEC_sprintf_GetString )(ATcodec_Memory_t *mem, va_list *va, char *dst); + int (* ATCODEC_sprintf_Raw_GetInt )(ATcodec_Memory_t *mem, va_list *va); +} +sprintf_funcs; + +static sprintf_funcs sprintf_funcs_memory = +{ + ATCODEC_sprintf_memory_GetChar, + ATCODEC_sprintf_memory_GetString, + ATCODEC_sprintf_memory_Raw_GetInt +}; + +static sprintf_funcs sprintf_funcs_valist = +{ + ATCODEC_sprintf_valist_GetChar, + ATCODEC_sprintf_valist_GetString, + ATCODEC_sprintf_valist_Raw_GetInt +}; + + +ATCODEC_RET +ATCodec_common_sprintf(ATcodec_Memory_t *dest, int32_t *len, ATcodec_Memory_t *fmt, int params_from_memory, ATcodec_Memory_t *mem, va_list *va) +{ + int fmt_val, + nbOpen, + value; + + char str[1024]; + char *str_ptr; + + ATcodec_Buffer_t listsParams; + ListParams listParams, + *listParamsPtr; + + ATCODEC_RET bContinue = ATCODEC_TRUE; + + int escaped = -1, + inList = -1; + + sprintf_funcs *funcs; + + if(params_from_memory) + { + funcs = &sprintf_funcs_memory; + } + else + { + funcs = &sprintf_funcs_valist; + } + + ATcodec_Buffer_init(&listsParams, sizeof(ListParams), 1); + + fmt_val = ATcodec_Memory_Get_Char(fmt); + + while (bContinue == ATCODEC_TRUE && fmt_val != '\0') + { + if (fmt_val == '%' && escaped) + { + switch ((fmt_val = ATcodec_Memory_Get_Char(fmt))) + { + case 'l' : + listParams.list_length = funcs->ATCODEC_sprintf_Raw_GetInt(mem, va); + + fmt_val = ATcodec_Memory_Get_Char(fmt); + + EXIT_LOOP_IF(fmt_val != '{'); + + inList = 0; + listParams.list_ptr_b = fmt->current; + + nbOpen = 0; + while(fmt_val != '\0' && ((fmt_val = ATcodec_Memory_Get_Char(fmt)) != '}' || !escaped || nbOpen--)) + { + if (fmt_val == '\\') + { + escaped = 0; + } + else if (fmt_val == '{' && escaped) + { + nbOpen++; + } + else + { + escaped = -1; + } + } + + EXIT_LOOP_IF(fmt_val == '\0'); // does a '}' lack ? + + fmt->current = listParams.list_ptr_b; + + ATcodec_Buffer_pushElement(&listsParams, &listParams); + break; + + case 'd' : + value = funcs->ATCODEC_sprintf_Raw_GetInt(mem, va); + ATcodec_Memory_Str_Put_Int (dest, value); + break; + + case 's' : + str_ptr = &str[0]; + funcs->ATCODEC_sprintf_GetString(mem, va, str_ptr); + while (*str_ptr) + { + ATcodec_Memory_Put_Char(dest, *str_ptr++); + } + break; + + case 'c' : + ATcodec_Memory_Put_Char(dest, funcs->ATCODEC_sprintf_GetChar(mem, va)); + break; + + default : // prohibited pattern + bContinue = ATCODEC_FALSE; // exits with failure + PRINT_DEBUG; + break; + } + } + else if (!inList && fmt_val == '}' && escaped) + { + listParamsPtr = (ListParams *)ATcodec_Buffer_topElement(&listsParams); + VP_OS_ASSERT(listParamsPtr); + + if (--listParamsPtr->list_length) + { + fmt->current = listParamsPtr->list_ptr_b; + ATcodec_Memory_Put_Char(dest, ','); + } + else + { + ATcodec_Buffer_justPopElement(&listsParams); + + inList = ( ATcodec_Buffer_topElement(&listsParams) ? -1 : 0 ); + } + } + else if (fmt_val == '\\' && escaped) + { + escaped = 0; + } + else if (fmt_val == '[' && escaped) + { + if(!(int)funcs->ATCODEC_sprintf_Raw_GetInt(mem, va)) // dump facultative pattern + { + // nothing to do + } + else // do not dump facultative pattern + { + // skip facultative pattern + while(fmt_val != '\0' && ((fmt_val = ATcodec_Memory_Get_Char(fmt)) != ']' || !escaped)) + { + escaped = ( fmt_val == '\\' ? 0 : -1 ); + } + + EXIT_LOOP_IF(fmt_val == '\0'); // does a ']' lack ? + } + } + else if (fmt_val != ']' || !escaped) + { + escaped = -1; + ATcodec_Memory_Put_Char(dest, fmt_val); + } + + fmt_val = ATcodec_Memory_Get_Char(fmt); + } + + ATcodec_Buffer_destroy(&listsParams); + ATcodec_Memory_Put_Char(dest, '\0'); + + *len = (unsigned)dest->current-(unsigned)dest->start-1; //+1; Do not count the termination zero character + return bContinue; +} + + +ATCODEC_RET +vp_atcodec_sprintf_valist(ATcodec_Memory_t *dest, int32_t *len, ATcodec_Memory_t *fmt, va_list *va) +{ + return ATCodec_common_sprintf(dest, len, fmt, 0, NULL, va); +} + + +ATCODEC_RET +vp_atcodec_sprintf_params(ATcodec_Memory_t *dest, int32_t *len, ATcodec_Memory_t *fmt, ATcodec_Memory_t *params) +{ + return ATCodec_common_sprintf(dest, len, fmt, 1, params, NULL); +} + diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec.h new file mode 100644 index 0000000..66f0718 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec.h @@ -0,0 +1,220 @@ +/** + * @file ATcodec_Buffer.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ + +#ifndef _AT_CODEC_INCLUDE_ +#define _AT_CODEC_INCLUDE_ + +#include + +#include +#include + + +#define INIT_CHAR_COUNT 128 +#define INIT_SON_COUNT 1 +#define INTERNAL_BUFFER_SIZE 1024 +#define ATCODEC_SERVER_YIELD_DELAY 5 + + +// For *_sprintf and *_sscanf debug +//#define AT_CODEC_DEBUG +// For common debug +//#define ATCODEC_DEBUG + + +// Return values +typedef enum _ATCODEC_Return_Values +{ + ATCODEC_TRUE, + ATCODEC_FALSE +} +ATCODEC_RET; + + +#ifdef AT_CODEC_DEBUG +# define ATCODEC_DEBUG +#endif // <- AT_CODEC_DEBUG + +#ifdef ATCODEC_DEBUG + +# define ATCODEC_PRINT(...) \ + PRINT(__VA_ARGS__) +# define ATCODEC_ZERO_MEMSET(DEST, VALUE, SIZE) \ + vp_os_memset((DEST),(VALUE),(SIZE)) + +#else // ! ATCODEC_DEBUG + +# define ATCODEC_PRINT(...) \ + do { } while(0) +# define ATCODEC_ZERO_MEMSET(DEST, VALUE, SIZE) \ + do { } while(0) + +#endif // <- ATCODEC_DEBUG + + +/** + * Inspired of the "Very complex scanf" from the CK5000 software, but again a little bit more complicated. + * + * This function allows the source string matching multiple model strings by using the '[' and ']' characters. + * For example, if the model string is "AT*PAVI=[%d],[%d],[%d],[%d]", successful matching source strings can be "AT*PAVI=76,,," or "AT*PAVI=76,,,87". + * + * It recognizes "%d", "%s", "%c", "%l". To match a '%' character, "\\%" can be used in . + * + * To formulate a list pattern, "%l" must be followed by a '{' character, then the part which can be repeated, and finally a closing '}'. + * + * Parameters are saved in a memory area given in parameter. + * + * CHANGES : + * + * - Shared memory saving of the parameters has been changed (no allocation for new parameters). + * + * - Facultative pattern management has been enhanced (not compatible with the old : closing character present, and opening character different). + * + * - List management has been added. + * + * - Spaces have to match exactly between and strings. + * + * - Access to characters has been optmized by using a pointer instead of accessing them with an index + * + * RULES : + * + * %s - The character which follows a "%s" in cannot be the '[' or '%' characters. + * + * - For "%s", the following character in determines the closing of the string. + * An empty string does not match the "%s" pattern. + * + * %d - For "%d", the following character in must be different from characters '0' to '9'. + * A matching "%d" pattern can begin with the '-' character. + * + * %c - "%c" can represent any character, excepted . + * + * [] - The character which follows a ']' closing character in must not be a '%' or '[' character. + * The character which follows an '[' opening character in must not be a '[' character but could be a '%' control character + * if the character which follows the respective ']' closing character make us able to determine if we try to match the facultative + * pattern or not. If this character does not correspond, we try to match the facultative pattern which begins with the '%' control character. + * + * - Characters that are between a '[' and a ']' character cannot contain other '[' or ']', excepted if they are escaped by a '\\' in . + * + * %l - Elements of the list are considered to be separated by the ',' character. So to use a ',' character in the format of a list + * element, you have to escape it by a '\\'. + * + * - The character in which follows the '}' character determines the closing of the list. Be careful not to have + * this character used in for the elements of the list. + * + * - Between the '{' and '}' characters, all special controls can be used. Imbricated "%l" are also supported. + * + * @param str The source string to recognize + * + * @param fmt The model string to match + * + * @param memory The memory where to save parameters + * + * @param len_dec Used to get length decoded in str + * + * @retVal ATCODEC_TRUE If the strings match + * @retVal ATCODEC_FALSE If the strings do not match + */ +ATCODEC_RET +vp_atcodec_sscanf + ( + ATcodec_Memory_t *str, + + ATcodec_Memory_t *fmt, + + ATcodec_Memory_t *memory, + + int *len_dec + ); + +/** + * Common private function, see below + * + * @param params_from_memory 1 : params are passed from a memory area / 0 : params are accessed using va_list + * @param ... Optional parameters used to fill patterns + */ +ATCODEC_RET +ATCodec_common_sprintf + ( + ATcodec_Memory_t *dest, + int32_t *len, + + ATcodec_Memory_t *fmt, + + int params_from_memory, + ATcodec_Memory_t *params, + va_list *va + ); + +/** + * Symmetrical function of the other one. + * + * The difficulty is to know to which pattern the arguments correspond. To resolve this, + * we provide additionnal informations between parameters when necessary : + * + * - for "%l" : before the parameters of the "%l" pattern must be expressed the size of the list + * + * - for facultative patterns : a boolean is used to know if we follow the facultative pattern or if we skip it + * + * Of course, rules that must be respected for the other symmetrical function must also be respected when formulating + * parameters. Otherwise, when decoded with the other, it will not work. + * + * @param dest The buffer to receive the result. It has to be allocated before ... + * @param len The length of the produced string + * + * @param fmt The model string to match + * + * @param ... Optional parameters used to fill patterns + * + * @retVal ATCODEC_TRUE If no error occured + * @retVal ATCODEC_FALSE If the model string is incorrect + */ +ATCODEC_RET +vp_atcodec_sprintf_valist + ( + ATcodec_Memory_t *dest, + int32_t *len, + + ATcodec_Memory_t *fmt, + + va_list *va + ); + +/** + * Same function as the previous, but with parameters passed through a memory area. + * + * The difficulty is to know to which pattern the arguments correspond. To resolve this, + * we provide additionnal informations between parameters when necessary : + * + * - for "%l" : before the parameters of the "%l" pattern must be expressed the size of the list + * + * - for facultative patterns : a boolean is used to know if we follow the facultative pattern or if we skip it + * + * Of course, rules that must be respected for the other symmetrical function must also be respected when formulating + * parameters. Otherwise, when decoded with the other, it will not work. + * + * @param dest The buffer to receive the result. It has to be allocated before ... + * @param len The length of the produced string + * + * @param fmt The model string to match + * + * @param params Optional parameters used to fill patterns + * + * @retVal ATCODEC_TRUE If no error occured + * @retVal ATCODEC_FALSE If the model string is incorrect + */ +ATCODEC_RET +vp_atcodec_sprintf_params + ( + ATcodec_Memory_t *dest, + int32_t *len, + + ATcodec_Memory_t *fmt, + + ATcodec_Memory_t *params + ); + + +#endif // ! _AT_CODEC_INCLUDE_ diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.c b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.c new file mode 100644 index 0000000..f21d6d0 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.c @@ -0,0 +1,145 @@ +/** + * @file ATcodec_Buffer.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ +#include "VP_Os/vp_os_assert.h" +#include "VP_Os/vp_os_malloc.h" + +#include "ATcodec_Buffer.h" + + + + +void +ATcodec_Buffer_init (ATcodec_Buffer_t *s, size_t elementSize, int nbElementsStart) +{ + s->totalSize = elementSize*nbElementsStart; + VP_OS_ASSERT(s->totalSize); + + s->data = vp_os_malloc(s->totalSize); + VP_OS_ASSERT(s->data); + + s->topElement = NULL; + s->nbElements = 0; /* Buffer is actually emply. nbElementsStart refers to allocated memory size.*/ + s->elementSize = elementSize; + +} + +void +ATcodec_Buffer_popElement (ATcodec_Buffer_t *s, void *dest) +{ + VP_OS_ASSERT(s->nbElements); + + vp_os_memcpy(dest, s->topElement, s->elementSize); + + if (!--s->nbElements) + { + s->topElement = NULL; + } + else + { + s->topElement = (void *)((char *)s->topElement-s->elementSize); + } +} + +void +ATcodec_Buffer_justPopElement (ATcodec_Buffer_t *s) +{ + VP_OS_ASSERT(s->nbElements); + + if (!--s->nbElements) + { + s->topElement = NULL; + } + else + { + s->topElement = (void *)((char *)s->topElement-s->elementSize); + } +} + +void +ATcodec_Buffer_pushElement (ATcodec_Buffer_t *s, const void *element) +{ + void *oldPtr; + + if (s->nbElements*s->elementSize >= s->totalSize) + { + oldPtr = s->data; + + s->totalSize <<= 1; + s->data = vp_os_realloc(s->data, s->totalSize); + + if (s->data != oldPtr) + s->topElement = (void *)(((char*)s->topElement-(char*)oldPtr)+(char*)s->data); + } + + if (!s->nbElements++) + { + s->topElement = s->data; + } + else + { + s->topElement = (void *)((char *)s->topElement+s->elementSize); + } + + vp_os_memcpy(s->topElement, element, s->elementSize); +} + +void +ATcodec_Buffer_pushElements (ATcodec_Buffer_t *s, const void *elements, int nb) +{ + void *oldPtr; + VP_OS_ASSERT(nb>=0); + + while ((s->nbElements+nb-1)*s->elementSize >= s->totalSize) + { + oldPtr = s->data; + + s->totalSize <<= 1; + s->data = vp_os_realloc(s->data, s->totalSize); + + if (s->data != oldPtr) + //s->topElement = (void *)(((int)s->topElement-(int)oldPtr)+(int)s->data); + s->topElement = (void *)((char*)s->topElement - (char*)oldPtr + (char*)s->data); + } + + if (!s->nbElements) + { + s->topElement = (char *)s->data+(nb-1)*s->elementSize; + vp_os_memcpy(s->data, elements, nb*s->elementSize); + } + else + { + vp_os_memcpy((char *)s->topElement+s->elementSize, elements, nb*s->elementSize); + s->topElement = (void *)((char *)s->topElement+nb*s->elementSize); + } + + s->nbElements += nb; +} + +void * +ATcodec_Buffer_getElement (ATcodec_Buffer_t *s, int index) +{ + VP_OS_ASSERT(index>=0 && index < s->nbElements); + + return (void *)((char*)s->data+index*s->elementSize); +} + +void * +ATcodec_Buffer_topElement (ATcodec_Buffer_t *s) +{ + return s->topElement; +} + +void +ATcodec_Buffer_destroy (ATcodec_Buffer_t *s) +{ + vp_os_free(s->data); + + s->data = NULL; + s->elementSize = 0; + s->nbElements = 0; + s->topElement = NULL; + s->totalSize = 0; +} diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.h new file mode 100644 index 0000000..6456d30 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Buffer.h @@ -0,0 +1,51 @@ +/** + * @file ATcodec_Buffer.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ + +#ifndef _AT_CODEC_BUFFER_INCLUDE_ +#define _AT_CODEC_BUFFER_INCLUDE_ + +typedef struct _ATcodec_Buffer_ +{ + void *data; + void *topElement; + + int nbElements; + + size_t elementSize; + size_t totalSize; +} +ATcodec_Buffer_t; + + +void +ATcodec_Buffer_init (ATcodec_Buffer_t *buffer, size_t elementSize, int nbElementsStart); + +void +ATcodec_Buffer_destroy (ATcodec_Buffer_t *buffer); + + +void +ATcodec_Buffer_popElement (ATcodec_Buffer_t *buffer, void *dest); + +void +ATcodec_Buffer_justPopElement (ATcodec_Buffer_t *buffer); + + +void +ATcodec_Buffer_pushElement (ATcodec_Buffer_t *buffer, const void *element); + +void +ATcodec_Buffer_pushElements (ATcodec_Buffer_t *buffer, const void *elements, int nb); + + +void * +ATcodec_Buffer_topElement (ATcodec_Buffer_t *buffer); + +void * +ATcodec_Buffer_getElement (ATcodec_Buffer_t *buffer, int index); + + +#endif // ! _AT_CODEC_BUFFER_INCLUDE_ diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Error.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Error.h new file mode 100644 index 0000000..c5bca80 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Error.h @@ -0,0 +1,52 @@ +/** + * @file ATcodec_Error.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ + +#ifndef _AT_CODEC_ERROR_INCLUDE_ +#define _AT_CODEC_ERROR_INCLUDE_ + + +// AT codec library error codes + +typedef enum _AT_CODEC_GENERAL_ERROR_CODE_ +{ + + // General AT Codec library error codes + AT_CODEC_GENERAL_ERROR, + AT_CODEC_GENERAL_OK, + + // "init" AT Codec library error codes + AT_CODEC_INIT_ERROR, + AT_CODEC_INIT_OK, + + // "shutdown" AT Codec library error codes + AT_CODEC_SHUTDOWN_ERROR, + AT_CODEC_SHUTDOWN_OK, + + // "enable" AT Codec library return values + AT_CODEC_ENABLE_ERROR, + AT_CODEC_ENABLE_OK, + + // "open" AT Codec library error codes + AT_CODEC_OPEN_ERROR, + AT_CODEC_OPEN_OK, + + // "close" AT Codec library error codes + AT_CODEC_CLOSE_ERROR, + AT_CODEC_CLOSE_OK, + + // "write" AT Codec library error codes + AT_CODEC_WRITE_ERROR, + AT_CODEC_WRITE_OK, + + // "read" AT Codec library error codes + AT_CODEC_READ_ERROR, + AT_CODEC_READ_OK, + +} +AT_CODEC_ERROR_CODE; + + +#endif // ! _AT_CODEC_ERROR_INCLUDE_ diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.c b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.c new file mode 100644 index 0000000..adc3aa6 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.c @@ -0,0 +1,234 @@ +/** + * @file ATcodec_Memory.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ + +#include + +#include + +// Macros +#define ATCODEC_MEMORY_SIZE_ASSERT(mem, size_inc) \ + do \ + { \ + VP_OS_ASSERT((unsigned)mem->current-(unsigned)mem->start + size_inc*mem->char_size < mem->size); \ + } \ + while(0) + +#define ATCODEC_MEMORY_GET_STRUCT_ASSERT(mem) \ + do \ + { \ + VP_OS_ASSERT(mem); \ + VP_OS_ASSERT(mem->start); \ + VP_OS_ASSERT(mem->char_size); \ + VP_OS_ASSERT(mem->get); \ + VP_OS_ASSERT(mem->put); \ + } \ + while(0) + +#define ATCODEC_MEMORY_PUT_STRUCT_ASSERT(mem) \ + do \ + { \ + ATCODEC_MEMORY_GET_STRUCT_ASSERT(mem); \ + VP_OS_ASSERT(mem->size); \ + } \ + while(0) + +// Static get/put + +static int +static_atcodec_getchar (char **str) +{ + VP_OS_ASSERT(str); + VP_OS_ASSERT(*str); + + return *((*str)++); +} + +static void +static_atcodec_putchar (char **str, int c) +{ + VP_OS_ASSERT(str); + VP_OS_ASSERT(*str); + + *((*str)++) = (char)c; +} + +// Init + +void +ATcodec_Memory_Init (ATcodec_Memory_t *mem, const char *start, int size, int char_size, ATcodec_Getchar get, ATcodec_Putchar put) +{ + VP_OS_ASSERT(mem); + VP_OS_ASSERT(start); + VP_OS_ASSERT(char_size); + + mem->start = start; + mem->size = size; + mem->char_size = char_size; + + mem->current = (char *)start; + + mem->get = (get && size ? get : static_atcodec_getchar); + mem->put = (put ? put : static_atcodec_putchar); +} + + +// Put + +void +ATcodec_Memory_Put_Char (ATcodec_Memory_t *mem, int character) +{ + ATCODEC_MEMORY_PUT_STRUCT_ASSERT(mem); + ATCODEC_MEMORY_SIZE_ASSERT(mem, 1); + + mem->put(&mem->current, character); +} + +// \todo Does source string need to be passed like an ATcodec_Memory_t ? +void +ATcodec_Memory_Put_String (ATcodec_Memory_t *mem, const char *str) +{ + char *s = (char *)str; + + VP_OS_ASSERT(s); + ATCODEC_MEMORY_PUT_STRUCT_ASSERT(mem); + + if(*s) + { + do + { + ATCODEC_MEMORY_SIZE_ASSERT(mem, 1); + mem->put(&mem->current, *s++); + } + while ( *s ); + } +} + +void +ATcodec_Memory_Raw_Put_Int (ATcodec_Memory_t *mem, int value) +{ + ATCODEC_MEMORY_PUT_STRUCT_ASSERT(mem); + + ATcodec_Memory_Put_Char(mem, (value>>24) & 0xFF); + + value &= 0x00FFFFFF; + ATcodec_Memory_Put_Char(mem, (value>>16) & 0xFF); + + value &= 0x0000FFFF; + ATcodec_Memory_Put_Char(mem, (value>>8) & 0xFF); + + value &= 0x000000FF; + ATcodec_Memory_Put_Char(mem, value & 0xFF); +} + +void +ATcodec_Memory_Str_Put_Int (ATcodec_Memory_t *mem, int value) +{ + int i; + + ATCODEC_MEMORY_PUT_STRUCT_ASSERT(mem); + + if (value < 0) + { + ATcodec_Memory_Put_Char(mem, '-'); + value = -value; + } + + for ( i=1 ; value >= 10*i ; i*=10 ); + + while (value) + { + VP_OS_ASSERT(i); + ATcodec_Memory_Put_Char(mem, '0'+(char)(value/i)); + value -= i*(value/i); + i /= 10; + } + + for ( ; i ; i/=10 ) + ATcodec_Memory_Put_Char(mem, '0'); +} + +// Get + +int +ATcodec_Memory_Get_Char (ATcodec_Memory_t *mem) +{ + ATCODEC_MEMORY_GET_STRUCT_ASSERT(mem); + + return mem->get(&mem->current); +} + +void +ATcodec_Memory_Unget_Char (ATcodec_Memory_t *mem) +{ + ATCODEC_MEMORY_GET_STRUCT_ASSERT(mem); + + mem->current -= mem->char_size; + VP_OS_ASSERT((unsigned)mem->current >= (unsigned)mem->start); +} + +// \todo Does destination string need to be passed like an ATcodec_Memory_t ? +void +ATcodec_Memory_Get_String (ATcodec_Memory_t *mem, char *dst) +{ + int c; + + VP_OS_ASSERT(dst); + ATCODEC_MEMORY_GET_STRUCT_ASSERT(mem); + + do + { + c = mem->get(&mem->current); + *dst++ = c; + } + while ( c ); +} + +int +ATcodec_Memory_Raw_Get_Int (ATcodec_Memory_t *mem) +{ + unsigned val; + + ATCODEC_MEMORY_GET_STRUCT_ASSERT(mem); + + val = (unsigned) ATcodec_Memory_Get_Char(mem); + val = ((unsigned)(ATcodec_Memory_Get_Char(mem) & 0xFF)) | (val << 8); + val = ((unsigned)(ATcodec_Memory_Get_Char(mem) & 0xFF)) | (val << 8); + val = ((unsigned)(ATcodec_Memory_Get_Char(mem) & 0xFF)) | (val << 8); + + return val; +} + +int +ATcodec_Memory_Str_Get_Int (ATcodec_Memory_t *mem) +{ + int neg, val; + char c; + + ATCODEC_MEMORY_GET_STRUCT_ASSERT(mem); + + c = (char) ATcodec_Memory_Get_Char(mem); + neg = (c == '-' ? 0 : -1); + + if (!neg) + c = (char) ATcodec_Memory_Get_Char(mem); // skips '-' character + + VP_OS_ASSERT(c >= '0' && c <= '9'); // not supported + + val = 0; + do + { + val = 10*val + c-'0'; + c = (char) ATcodec_Memory_Get_Char(mem); // processes next characters + } + while (c >= '0' && c <= '9'); + + ATcodec_Memory_Unget_Char(mem); // ungets last non-num character + + if(!neg) + val = -val; + + return val; +} diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.h new file mode 100644 index 0000000..c93e1e5 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Memory.h @@ -0,0 +1,68 @@ +/** + * @file ATcodec_Memory.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ + +#ifndef _AT_CODEC_MEMORY_INCLUDE_ +#define _AT_CODEC_MEMORY_INCLUDE_ + + +typedef int (*ATcodec_Getchar)(char **str); +typedef void (*ATcodec_Putchar)(char **str, int c); + + +typedef struct _ATcodec_Memory_s_ +{ + const char *start; + int size; + int char_size; + + char *current; + + ATcodec_Getchar get; + ATcodec_Putchar put; +} +ATcodec_Memory_t; + + +// Init + +void +ATcodec_Memory_Init (ATcodec_Memory_t *mem, const char *start, int size, int char_size, ATcodec_Getchar get, ATcodec_Putchar put); + + +// Put + +void +ATcodec_Memory_Put_Char (ATcodec_Memory_t *mem, int character); + +void +ATcodec_Memory_Put_String (ATcodec_Memory_t *mem, const char *str); + +void +ATcodec_Memory_Raw_Put_Int (ATcodec_Memory_t *mem, int value); + +void +ATcodec_Memory_Str_Put_Int (ATcodec_Memory_t *mem, int value); + + +// Get + +int +ATcodec_Memory_Get_Char (ATcodec_Memory_t *mem); + +void +ATcodec_Memory_Unget_Char (ATcodec_Memory_t *mem); + +void +ATcodec_Memory_Get_String (ATcodec_Memory_t *mem, char *dst); + +int +ATcodec_Memory_Raw_Get_Int (ATcodec_Memory_t *mem); + +int +ATcodec_Memory_Str_Get_Int (ATcodec_Memory_t *mem); + + +#endif // ! _AT_CODEC_MEMORY_INCLUDE_ diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Messages_ex.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Messages_ex.h new file mode 100644 index 0000000..e5a0d38 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Messages_ex.h @@ -0,0 +1,95 @@ +/** + * @file ATcodec_Messages_ex.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + */ + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// General commands +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_CGMI, "AT+CGMI\r", 0, at_cgmi, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_CGMM, "AT+CGMM\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_CGMR, "AT+CGMR\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PR, "AT*PR\r", 0, at_default_cb, 7) +// Motors commands +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PM, "AT*PM\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PM_QW, "AT*PM=!%d\r", 0, at_pm_qw, 0) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PM_QR, "AT*PM=?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PM_QV, "AT*PM?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PM_EXE, "AT*PM=%d,%d\r", 0, at_pm_exe, 0) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PM_CAL, "AT*PM!\r", 0, at_default_cb, 6) +// Lights commands +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PL, "AT*PL\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PL_QW, "AT*PL=!%d\r", 0, at_default_cb, 2) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PL_QR, "AT*PL=?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PL_QV, "AT*PL?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PL_EXE, "AT*PL=%d\r", 0, at_default_cb, 2) +// Audio/Video commands : streaming +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAVS_QR, "AT*PAVS=?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAVS_QV, "AT*PAVS?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAVS_EXE, "AT*PAVS=%d[,\"%s\"]\r", 0, at_default_cb, 7) +// Audio/Video commands : input settings +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAVI_QR, "AT*PAVI=?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAVI_QV, "AT*PAVI?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAVI_EXE, "AT*PAVI=%l{[%d]}\r", 0, at_default_cb, 7) +// Audio/Video commands : audio output +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAO_QR, "AT*PAO=?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAO_QV, "AT*PAO?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PAO_EXE, "AT*PAO=%d[,\"%s\"]\r", 0, at_default_cb, 1) +// Codecs commands : codecs choosing +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PCC_QR, "AT*PCC=?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PCC_QV, "AT*PCC?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PCC_EXE, "AT*PCC=[%d],[%d]\r", 0, at_default_cb, 8) +// Codecs commands : codecs settings +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PCS_QR, "AT*PCS=?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PCS_QV, "AT*PCS?\r", 0, at_default_cb, 9) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PCS_EXE, "AT*PCS=%l{[%d]}\r", 0, at_default_cb, 8) +// Test SDCard +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_SDT_EXE, "AT*SDT\r", 0, at_default_cb, 7) +// PID +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PIP_EXE, "AT*PIP=%d\r", 0, at_default_cb, 6) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PII_EXE, "AT*PII=%d\r", 0, at_default_cb, 6) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_PID_EXE, "AT*PID=%d\r", 0, at_default_cb, 6) +// change calibration +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_DEM_EXE, "AT*DEM\r", 0, at_default_cb, 6) +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_INM_EXE, "AT*INM\r", 0, at_default_cb, 6) +// get rssi +ATCODEC_DEFINE_AT_CMD(AT_MSG_ATCMD_RSS_EXE, "AT*RSS=%d:%d:%d:%d:%d:%d\r", 0, at_default_cb, 3) + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Result messages +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_OK, "OK\r", AT_MSG_ATCMD_DEFAULT, atresu_ok) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_ERROR, "ERROR\r", AT_MSG_ATCMD_DEFAULT, atresu_error) +// General commands results +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_CGMI, "+CGMI: \"%s\"\r", AT_MSG_ATCMD_CGMI, atresu_cgmi) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_CGMM, "+CGMM: (\"%s\",\"%s\")\r", AT_MSG_ATCMD_CGMM, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_CGMR, "+CGMR: (\"%s\",\"%s\")\r", AT_MSG_ATCMD_CGMR, at_default_cb) +// Motors commands results +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PM, "*PM: (%l{\"%s\"})\r", AT_MSG_ATCMD_PM, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PM_QR, "*PM: %d,(\"%s\",(%l{%d})),(\"%s\",)\r", AT_MSG_ATCMD_PM_QR, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PM_QV, "*PM: %d,%d\r", AT_MSG_ATCMD_PM_QV, at_default_cb) +// Lights commands results +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PL, "*PL: (%l{\"%s\"})\r", AT_MSG_ATCMD_PL, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PL_QR, "*PL: %d,(%l{%d})\r", AT_MSG_ATCMD_PL_QR, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PL_QV, "*PL: %d,%d\r", AT_MSG_ATCMD_PL_QV, at_default_cb) +// Audio/Video commands results : streaming +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PAVS_QR, "*PAVS: (\"%s\",(%l{\"%s\"}))\\[,(\"%s\",)\\]\r", AT_MSG_ATCMD_PAVS_QR, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PAVS_QV, "*PAVS: %d,\"[%s]\",%d,\"[%s]\"\r", AT_MSG_ATCMD_PAVS_QV, at_default_cb) +// Audio/Video commands results : input settings +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PAVI_QR, "*PAVI: %l{\\[(\"%s\"\\,(%d..%d))\\]}\r", AT_MSG_ATCMD_PAVI_QR, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PAVI_QV, "*PAVI: %l{%d}\r", AT_MSG_ATCMD_PAVI_QV, at_default_cb) +// Audio/Video commands results : audio output +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PAO_QR, "*PAO: (\"%s\",(%l{\"%s\"}))\\[,(\"%s\",)\\]\r", AT_MSG_ATCMD_PAO_QR, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PAO_QV, "*PAO: %d,\"[%s]\"\r", AT_MSG_ATCMD_PAO_QV, at_default_cb) +// Codecs commands results : codecs choosing +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PCC_QR, "*PCC: \\[(\"%s\",(%l{\"%s\"}))\\],\\[(\"%s\",(%l{\"%s\"}))\\]\r", AT_MSG_ATCMD_PCC_QR, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PCC_QV, "*PCC: %d,%d\r", AT_MSG_ATCMD_PCC_QV, at_default_cb) +// Codecs commands results : codecs settings +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PCS_QR, "*PCS: %l{\\[(\"%s\"\\,(%l{%d}))\\]}\r", AT_MSG_ATCMD_PCS_QR, at_default_cb) +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_PCS_QV, "*PCS: %l{%d}\r", AT_MSG_ATCMD_PCS_QV, at_default_cb) +// RSSI command result : value +ATCODEC_DEFINE_AT_RESU(AT_MSG_ATRESU_RSS, "*RSS: %d\r", AT_MSG_ATCMD_RSS_EXE, at_default_cb) + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.c b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.c new file mode 100644 index 0000000..14786d9 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.c @@ -0,0 +1,182 @@ +/** + * @file ATcodec_Sorted_List.c + * @author aurelien.morelle@parrot.fr + * @date 2007/01/30 + */ +#include "VP_Os/vp_os_assert.h" +#include "VP_Os/vp_os_malloc.h" +#include "VP_Os/vp_os_types.h" + +#include "ATcodec_Sorted_List.h" + + +#define ATCODEC_MAGIC_NUMBER 0xA7C00DEC + + +typedef struct _ATcodec_Sorted_List_header_ +{ + uint32_t magic; + + struct _ATcodec_Sorted_List_header_ *next; + struct _ATcodec_Sorted_List_header_ *previous; + uint32_t sortValue; + + void *element; +} +ATcodec_Sorted_List_header_t; + + +#define ATCODEC_SYSTEM_PTR(ELEMENT) \ + ((ATcodec_Sorted_List_header_t *)(((int)(ELEMENT))-(int)&((ATcodec_Sorted_List_header_t *)NULL)->element)) + +void +ATcodec_Sorted_List_init (ATcodec_Sorted_List_t *list, size_t size) +{ + list->head = NULL; + list->nb = 0; + list->size = size; +} + +void +ATcodec_Sorted_List_batchProcess (ATcodec_Sorted_List_t *list, ATcodec_element_processing process_func) +{ + ATcodec_Sorted_List_header_t *current = (ATcodec_Sorted_List_header_t *)list->head; + ATcodec_Sorted_List_header_t *next; + + while(current) + { + next = current->next; + process_func(¤t->element); + current = next; + } +} + +static void +ATcodec_Sorted_List_freeElement(void *element) +{ + vp_os_free(ATCODEC_SYSTEM_PTR(element)); +} + +void +ATcodec_Sorted_List_destroy (ATcodec_Sorted_List_t *list) +{ + ATcodec_Sorted_List_batchProcess(list, ATcodec_Sorted_List_freeElement); +} + +void * +ATcodec_Sorted_List_headElement (ATcodec_Sorted_List_t *list) +{ + return &((ATcodec_Sorted_List_header_t *)list->head)->element; +} + +void * +ATcodec_Sorted_List_nextElement (ATcodec_Sorted_List_t *list, void *element) +{ + ATcodec_Sorted_List_header_t *system_ptr = ATCODEC_SYSTEM_PTR(element); + return &system_ptr->next->element; +} + +void * +ATcodec_Sorted_List_previousElement (ATcodec_Sorted_List_t *list, void *element) +{ + ATcodec_Sorted_List_header_t *system_ptr = ATCODEC_SYSTEM_PTR(element); + return &system_ptr->previous->element; +} + +void * +ATcodec_Sorted_List_getElement (ATcodec_Sorted_List_t *list, unsigned int index) +{ + ATcodec_Sorted_List_header_t *current = (ATcodec_Sorted_List_header_t *)list->head; + + while(current && index--) + { + current = current->next; + } + + return (current ? ¤t->element : NULL); +} + +void +ATcodec_Sorted_List_removeElement (ATcodec_Sorted_List_t *list, void *element) +{ + ATcodec_Sorted_List_header_t *system_ptr; + ATcodec_Sorted_List_header_t *next; + ATcodec_Sorted_List_header_t *previous; + + VP_OS_ASSERT(element); + + system_ptr = ATCODEC_SYSTEM_PTR(element); + + VP_OS_ASSERT(system_ptr); + VP_OS_ASSERT(system_ptr->magic == ATCODEC_MAGIC_NUMBER); + + next = system_ptr->next; + previous = system_ptr->previous; + + if(previous) + { + previous->next = next; + } + else + { + list->head = next; + } + + if(next) + next->previous = previous; + + vp_os_free(system_ptr); + + list->nb--; +} + +void +ATcodec_Sorted_List_insertElement (ATcodec_Sorted_List_t *list, const void *element, int sortValue) +{ + ATcodec_Sorted_List_header_t *current = (ATcodec_Sorted_List_header_t *)list->head; + ATcodec_Sorted_List_header_t *previous = NULL; + ATcodec_Sorted_List_header_t *ptr = (ATcodec_Sorted_List_header_t *)vp_os_malloc(list->size+sizeof(ATcodec_Sorted_List_header_t)-sizeof(void *)); + + ptr->magic = ATCODEC_MAGIC_NUMBER; + ptr->sortValue = sortValue; + memcpy(&ptr->element, element, list->size); + + while(current && sortValue >= (int32_t)current->sortValue) + { + previous = current; + current = current->next; + } + + if(current && sortValue < (int32_t)current->sortValue) + { + if(current->previous) + { + current->previous->next = ptr; + } + else + { + list->head = ptr; + } + + ptr->previous = current->previous; + ptr->next = current; + current->previous = ptr; + } + else + { + if(previous) + { + previous->next = ptr; + ptr->previous = previous; + ptr->next = NULL; + } + else + { + list->head = ptr; + ptr->previous = NULL; + ptr->next = NULL; + } + } + + list->nb++; +} diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.h new file mode 100644 index 0000000..dcd6bba --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Sorted_List.h @@ -0,0 +1,52 @@ +/** + * @file ATcodec_Sorted_List.h + * @author aurelien.morelle@parrot.fr + * @date 2007/01/30 + */ + +#ifndef _AT_CODEC_SORTED_LIST_INCLUDE_ +#define _AT_CODEC_SORTED_LIST_INCLUDE_ + +typedef struct _ATcodec_Sorted_List_ +{ + void *head; + + int nb; + + size_t size; +} +ATcodec_Sorted_List_t; + + +typedef void (*ATcodec_element_processing)(void *element); + + +void +ATcodec_Sorted_List_init (ATcodec_Sorted_List_t *list, size_t size); + +void +ATcodec_Sorted_List_destroy (ATcodec_Sorted_List_t *list); + + +void * +ATcodec_Sorted_List_headElement (ATcodec_Sorted_List_t *list); + +void * +ATcodec_Sorted_List_tailElement (ATcodec_Sorted_List_t *list); + +void * +ATcodec_Sorted_List_getElement (ATcodec_Sorted_List_t *list, unsigned int index); + + +void +ATcodec_Sorted_List_insertElement (ATcodec_Sorted_List_t *list, const void *element, int sortValue); + +void +ATcodec_Sorted_List_removeElement (ATcodec_Sorted_List_t *list, void *element); + + +void +ATcodec_Sorted_List_batchProcess (ATcodec_Sorted_List_t *list, ATcodec_element_processing process_func); + + +#endif // ! _AT_CODEC_SORTED_LIST_INCLUDE_ diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.c b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.c new file mode 100644 index 0000000..52a2c9d --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.c @@ -0,0 +1,419 @@ +/** + * @file ATcodec_tree.c + * @author aurelien.morelle@parrot.com + * @date 2007/08/20 + * modified on 2010/07/19 by stephane.piskorski.ext@parrot.fr (bug fix+comments) + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +/* \todo Remove nodes fields initializations that are not necessary in each function */ + + + + +static void +ATcodec_Tree_Node_init(ATcodec_Tree_Node_t *node) +{ + VP_OS_ASSERT(node); + + node->data = -1; + node->depth = 0; + node->nb_sons = 0; + vp_os_memset(node->sons,0,sizeof(node->sons)); + node->strkey = 0; + node->type = ATCODEC_TREE_NODE_TYPE_EMPTY; + +} + + + +/******************************************************************** + * @brief Initialises the AT command search tree. + * @param[in] tree The tree to initialise. +*/ +void +ATcodec_Tree_init(ATcodec_Tree_t *tree, size_t leaf_size, int nb_start) +{ + ATcodec_Tree_Node_t s_node; + + VP_OS_ASSERT(tree); + + ATcodec_Buffer_init(&tree->leaves, leaf_size, nb_start); + ATcodec_Buffer_init(&tree->strs, sizeof(char), nb_start); + ATcodec_Buffer_init(&tree->sons, sizeof(ATcodec_Tree_Node_t), nb_start); + + ATcodec_Tree_Node_init(&s_node); + tree->root = tree->sons.nbElements; + ATcodec_Buffer_pushElement(&tree->sons, &s_node); +} + + + + +/******************************************************************** + * @param[in] tree Tree in which the node is inserted. + * @brief Creates a new node in the tree. +*/ +static int +ATcodec_Tree_Node_insert(ATcodec_Tree_t *tree, ATCODEC_TREE_NODE_TYPE type, int depth, int str_index, int data, ATcodec_Tree_Node_t *father, int son_index) +{ + /* The new node's value */ + ATcodec_Tree_Node_t s_node; + /* Index of the new node inside the tree's nodes list */ + int node_index; + + /* Clears the new node */ + vp_os_memset(&s_node,0,sizeof(s_node)); + + node_index = tree->sons.nbElements; + if(father) + father->sons[son_index] = node_index; + + s_node.type = type; + s_node.depth = depth; + s_node.strkey = str_index; + s_node.data = data; + + ATcodec_Buffer_pushElement(&tree->sons, &s_node); + + return node_index; +} + + + +/******************************************************************** + * @param[in] tree Tree in which the command is inserted. + * @brief Inserts an AT command string in the tree. +*/ +static int +ATcodec_Tree_Node_search(ATcodec_Tree_t *tree, char *str) +{ + ATcodec_Tree_Node_t *node; + int searching = 1; + int depth = 0; + int str_index; + int node_index = -1; + int temp_data; + int father_index; + + VP_OS_ASSERT(str); + VP_OS_ASSERT(*str); + VP_OS_ASSERT(tree); + + str_index = tree->strs.nbElements; + + /* Adds the new string to the list of commands */ + ATcodec_Buffer_pushElements(&tree->strs, str, strlen(str)+1); + + /* !! WARNING !! this pointer might be invalid after inserting an element in the tree */ + node = ATcodec_Tree_Node_get(tree, tree->root); + + while(searching) + { + switch(node->type) + { + + /* Tree is empty -> we insert the string as the only element */ + case ATCODEC_TREE_NODE_TYPE_EMPTY: + { + /* Initialise the root element */ + node->type = ATCODEC_TREE_NODE_TYPE_LEAF; + node->depth = depth; + node->strkey = str_index; /* str_index = place of the newly inserted string */ + node_index = 0; + /* Stop the search */ + searching = 0; + } + break; + + /* + Parse an intermediate node, which means that previously inserted + command strings began with the same characters. + */ + case ATCODEC_TREE_NODE_TYPE_NODE: + { + /* Gets the node representing the next character of the command string */ + node_index = node->sons[(int)*str]; + + /* If there is no such node, the remaining part of the string is stored in the + tree as a terminal node (a leaf of the tree).*/ + if(node_index == -1) + { + node_index = ATcodec_Tree_Node_insert(tree, + ATCODEC_TREE_NODE_TYPE_LEAF, + depth+1, + str_index, /* str_index = place of the newly inserted string */ + /*data*/-1, + /*father*/node, + /*index*/(int)*(str)); + searching = 0; + } + /* Otherwise, we get the node representing this character and continue scanning the tree.*/ + node = ATcodec_Tree_Node_get(tree, node_index); + depth++; + str++; + } + break; + + /* + Scanning arrives on a leaf -> this leaf must be split to store the two + possible command-string endings. + */ + case ATCODEC_TREE_NODE_TYPE_LEAF: + { + /* + Retrieves the already-stored string. + We have to insert as many additional intermediate nodes as there are common + characters in the two string remainders. + Two terminal leaves will then be added to store the parts of those strings which differ. + */ + char *leaf_str = (char *)ATcodec_Buffer_getElement(&tree->strs, node->strkey); + int i; + + /* As far as strings endings are the same, insert the intermediate nodes ...*/ + while(*str && *str == leaf_str[depth]) + { + /* Change the current leaf node to an intermediate node and initialises the list of sons. */ + node->type = ATCODEC_TREE_NODE_TYPE_NODE; + for(i = 0 ; i < AT_CODEC_TREE_MAX_SONS ; i++) { node->sons[i] = -1; } + + /* Create a new leaf */ + node_index = ATcodec_Tree_Node_insert(tree, + /*node type*/ATCODEC_TREE_NODE_TYPE_LEAF, + /*node depth*/depth+1, + /*str_index*/node->strkey, /* Points to the old command-string by default */ + /*data*/node->data, + /*father*/node, + /*son_index*/(int)leaf_str[depth]); + depth++; + + node = ATcodec_Tree_Node_get(tree, node_index); + str++; + } + + /* If the new string was in fact a subpart of the old one ...*/ + if(*str == leaf_str[depth]) + { + /* Change the leaf to a multileaves */ + node->type = ATCODEC_TREE_NODE_TYPE_MULTILEAVES; + node->nb_sons = 2; + temp_data = node->data; + node->data = -1; + father_index = node_index; + + /* Insert a leaf for the old longer string */ + node_index = ATcodec_Tree_Node_insert(tree, + ATCODEC_TREE_NODE_TYPE_LEAF, + ++depth, + node->strkey, + temp_data, + /*father*/node, + /*son_index*/0); + + /* Pointer 'node' is invalid from here because it points + to a buffer which might have been resized by 'ATcodec_Tree_Node_insert'. + We fetch a valid address computed from the index.*/ + node = ATcodec_Tree_Node_get(tree,father_index); + + /* Insert a leaf for the new, shorter string */ + node_index = ATcodec_Tree_Node_insert(tree, + ATCODEC_TREE_NODE_TYPE_LEAF, + depth, + str_index, + /*data*/-1, + /*father*/node, + /*son_index*/1); + } + + /* If the two strings have different endings ...*/ + else + { + /* The old leaf becomes an intermediate node with two daughter leaves */ + node->type = ATCODEC_TREE_NODE_TYPE_NODE; + for(i = 0 ; i < AT_CODEC_TREE_MAX_SONS ; i++) { node->sons[i] = -1; } + father_index = node_index; + + /* Recreate a leaf for the old command string */ + node_index = ATcodec_Tree_Node_insert(tree, + ATCODEC_TREE_NODE_TYPE_LEAF, + node->depth+1, + node->strkey, /* strkey was propagated from the original leaf */ + node->data, /* keeps the data of the old command string */ + /*father*/node, + /*son_index*/(int)leaf_str[depth] + ); + + /* Pointer 'node' is invalid from here because it points + to a buffer which might have been resized by 'ATcodec_Tree_Node_insert'. + We fetch a valid address computed from the index.*/ + node = ATcodec_Tree_Node_get(tree,father_index); + + + //node->sons[(int)leaf_str[depth]] = node_index; + + /* Create a new leaf for the new command string */ + node_index = ATcodec_Tree_Node_insert(tree, + ATCODEC_TREE_NODE_TYPE_LEAF, + node->depth+1, + str_index, /* str_index = place of the newly inserted string */ + -1, /* data is initialised later in the ATcodec_Tree_insert function */ + /*father*/node, + /*son_index*/(int)*str); + } + + searching = 0; + } + break; + + /* + If there are already at leat two several end-of-command-strings starting with the current character, + these are represented by a 'multileaves' node and we just add a new son to this node. + */ + case ATCODEC_TREE_NODE_TYPE_MULTILEAVES: + { + node_index = ATcodec_Tree_Node_insert(tree, + ATCODEC_TREE_NODE_TYPE_LEAF, + ++depth, + str_index, /* str_index = place of the newly inserted string */ + /*data*/-1, /* data is initialised later in the ATcodec_Tree_insert function */ + /*father*/node, + /*son_index*/node->nb_sons++ + ); + searching = 0; + } + break; + } + } + + return node_index; +} + + +/******************************************************************** + * @param[in] tree Tree in which the command is inserted. + * @brief Inserts an AT command string in the AT tree with its associated parameters. +*/ +int +ATcodec_Tree_insert(ATcodec_Tree_t *tree, char *str, void *data) +{ + ATcodec_Tree_Node_t *node; + int node_i; + + VP_OS_ASSERT(tree); + + /* + Insert the 'command part' (until the '=' symbol, without parameter) + in the search tree. + */ + node_i = ATcodec_Tree_Node_search(tree, str); + node = ATcodec_Tree_Node_get(tree, node_i); + node->data = tree->leaves.nbElements; + /* Stores the string containing the parameters */ + ATcodec_Buffer_pushElement(&tree->leaves, data); + + return node_i; +} + + + +/******************************************************************** + * @param[in] tree Tree from which the node is retrieved. + * @param[in] node Index of the node whose pointer is to be returned. + * @brief Gets a pointer the node-th node of the tree. + * @return Pointer to the asked node. + * Be extremely careful not to use this pointer anymore after a tree->sons buffer resize. +*/ +ATcodec_Tree_Node_t * +ATcodec_Tree_Node_get(ATcodec_Tree_t *tree, int node) +{ + ATcodec_Tree_Node_t * res = (ATcodec_Tree_Node_t *)ATcodec_Buffer_getElement(&tree->sons, node); + return res; +} + + +#define AT_CODEC_PRINT_NODE_CHAR_CASE(CARAC_SRC,STR_DST) \ + case CARAC_SRC: \ + PRINT(STR_DST); \ + break + +#define AT_CODEC_PRINT_NODE_CHAR(CARAC) \ + switch(CARAC) \ + { \ + AT_CODEC_PRINT_NODE_CHAR_CASE('\r',""); \ + AT_CODEC_PRINT_NODE_CHAR_CASE('\n',""); \ + AT_CODEC_PRINT_NODE_CHAR_CASE('\0',"<\\0>"); \ + AT_CODEC_PRINT_NODE_CHAR_CASE(' ',"< >"); \ + default: \ + PRINT("%c", CARAC); \ + break; \ + } + +void +ATcodec_Tree_Node_print(ATcodec_Tree_t *tree, ATcodec_Tree_Node_t *node) +{ +#ifdef ATCODEC_DEBUG + static int tab = 0; + int i, j; + char *sta; + + if(node->type == ATCODEC_TREE_NODE_TYPE_LEAF) + { + /* Get the end-of-command-string stored on the leaf */ + sta = ATcodec_Buffer_getElement(&tree->strs, node->strkey); + for(j = 0 ; j < tab ; j++) + ATCODEC_PRINT(" . "); + do + { + /* Print the end-of-command-string */ + AT_CODEC_PRINT_NODE_CHAR(*sta); + } + while(*sta++); + ATCODEC_PRINT("\"\n"); + } + else if(node->type == ATCODEC_TREE_NODE_TYPE_NODE) + { + /* For each possible character of the ascii map, check if a command-string is stored. */ + for(i = 0 ; i < AT_CODEC_TREE_MAX_SONS ; i++) + { + if(node->sons[i] != -1) + { + for(j = 0 ; j < tab ; j++) + ATCODEC_PRINT(" . "); + AT_CODEC_PRINT_NODE_CHAR((char)i); + ATCODEC_PRINT("\n"); + tab++; + ATcodec_Tree_Node_print(tree, ATcodec_Tree_Node_get(tree, node->sons[i])); + tab--; + } + } + } + else if(node->type == ATCODEC_TREE_NODE_TYPE_MULTILEAVES) + { + for(i = 0 ; i < node->nb_sons ; i++) + { + tab++; + ATcodec_Tree_Node_print(tree, ATcodec_Tree_Node_get(tree, node->sons[i])); + tab--; + } + } +#endif // > ATCODEC_DEBUG +} + + +void +ATcodec_Tree_print(ATcodec_Tree_t *tree) +{ +#ifdef ATCODEC_DEBUG + ATcodec_Tree_Node_print(tree, ATcodec_Tree_Node_get(tree, tree->root)); +#endif // > ATCODEC_DEBUG +} + diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.h new file mode 100644 index 0000000..afde5f8 --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_Tree.h @@ -0,0 +1,139 @@ +/** + * @file ATcodec_tree.c + * @author aurelien.morelle@parrot.com + * @date 2007/08/20 + */ + + +/* +------- Builds a tree which factorises the beginning of AT command strings ------ +---- and allows quick search of the callback corresponding to an AT command ---- + +Example: + +A + . T + . . * + . . . A + . . . . AT*ANIM=<\0>" + . . . C + . . . . A + . . . . . D + . . . . . . AT*CAD=<\0>" + . . . . . P + . . . . . . AT*CAP=<\0>" + . . . . O + . . . . . M + . . . . . . AT*COMWDG=<\0>" + . . . . . N + . . . . . . AT*CONFIG=<\0>" + . . . . T + . . . . . AT*CTRL=<\0>" + . . . F + . . . . AT*FTRIM=<\0>" + . . . G + . . . . AT*GAIN=<\0>" + . . . L + . . . . AT*LED=<\0>" + . . . M + . . . . I + . . . . . AT*MISC=<\0>" + . . . . T + . . . . . AT*MTRIM=<\0>" + . . . P + . . . . C + . . . . . AT*PCMD=<\0>" + . . . . O + . . . . . AT*POL=<\0>" + . . . . W + . . . . . AT*PWM=<\0>" + . . . R + . . . . AT*REF=<\0>" + . . . V + . . . . I + . . . . . S + . . . . . . O + . . . . . . . AT*VISO=<\0>" + . . . . . . P + . . . . . . . AT*VISP=<\0>" + . . . Z + . . . . AT*ZAP=<\0>" +E + . ERROR<\0>" +O + . OK<\0>" + + ----------------------------------------------------------*/ + +#ifndef _AT_CODEC_TREE_INCLUDE_ +#define _AT_CODEC_TREE_INCLUDE_ + + +//#include +#include +#include + +#define AT_CODEC_TREE_MAX_SONS 256 + +typedef enum _ATCODEC_TREE_NODE_TYPE_ +{ + ATCODEC_TREE_NODE_TYPE_EMPTY, // just for tree root, when nothing has been added yet + ATCODEC_TREE_NODE_TYPE_NODE, + ATCODEC_TREE_NODE_TYPE_LEAF, + ATCODEC_TREE_NODE_TYPE_MULTILEAVES, +} +ATCODEC_TREE_NODE_TYPE; + + +typedef struct _ATcodec_Tree_Node_ +{ + ATCODEC_TREE_NODE_TYPE type; + int depth; + int strkey; + + int sons[AT_CODEC_TREE_MAX_SONS]; + + int nb_sons; // only when type is MULTILEAVES + + int data; // only when type is LEAF; index of the parameter string in the 'data' buffer. +} +ATcodec_Tree_Node_t; + + +typedef struct _ATcodec_Tree_ +{ + int root; + + ATcodec_Buffer_t leaves; + ATcodec_Buffer_t strs; + ATcodec_Buffer_t sons; +} +ATcodec_Tree_t; + + +void +ATcodec_Tree_init(ATcodec_Tree_t *tree, size_t leaf_size, int nb_start); + + +int +ATcodec_Tree_insert(ATcodec_Tree_t *tree, char *str, void *data); + + +ATcodec_Tree_Node_t * +ATcodec_Tree_Node_get(ATcodec_Tree_t *tree, int node); + + +void +ATcodec_Tree_print(ATcodec_Tree_t *tree); + + +/* void */ +/* ATcodec_Tree_remove(ATcodec_Tree_t *tree, char *str, void *data); */ + + +/* void */ +/* ATcodec_Tree_destroy(ATcodec_Tree_t *tree); */ + + +#endif // -> _AT_CODEC_TREE_INCLUDE_ + diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_api.c b/ARDroneLib/VP_SDK/ATcodec/ATcodec_api.c new file mode 100644 index 0000000..a80a6eb --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_api.c @@ -0,0 +1,780 @@ +/** + * @file ATcodec_api.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + + * modified on 2010/07/19 by stephane.piskorski.ext@parrot.fr (bug fix+comments) + */ + +#include +#include +#include +#include +#include +#include + +#if !defined(TARGET_OS_IPHONE) && !defined(TARGET_IPHONE_SIMULATOR) +# include +#endif // ! TARGET_OS_IPHONE && ! TARGET_IPHONE_SIMULATOR + +#include +#include +#include +#include + + +static AT_CODEC_READING_MODE at_codec_reading_mode = ATCODEC_READ_FROM_STREAM; + +static AT_CODEC_FUNCTIONS_PTRS func_ptrs; +static ATcodec_Tree_t default_tree; +static int atcodec_lib_init_ok = 0; + +// only for client +static vp_os_mutex_t ATcodec_cond_mutex; +static vp_os_cond_t ATcodec_wait_cond; +static int8_t ATcodec_Message_Buffer[INTERNAL_BUFFER_SIZE]; +static int32_t ATcodec_Message_len = 0; + +static int32_t v_continue = 0; + + +static ATCODEC_RET +test_dyn_strs_one_node(ATcodec_Tree_t *tree, ATcodec_Tree_Node_t *node, int depth, const char *dynamic_str, ATcodec_Memory_t *memory, AT_CODEC_Message_Received *ptr, int *len_dec) +{ + char *static_str, *dyn_str, *mem_index; + int len; + ATcodec_Memory_t str, fmt; + + static_str = (char *)ATcodec_Buffer_getElement(&tree->strs, ((ATcodec_Message_Data_t *)ATcodec_Buffer_getElement(&tree->leaves, node->data))->static_str); + if((len = strlen(static_str)) > depth) + { + if(strncmp(static_str+depth, dynamic_str, (len-depth)*sizeof(char))) + return ATCODEC_FALSE; + } + + dyn_str = (char *)ATcodec_Buffer_getElement(&tree->strs, ((ATcodec_Message_Data_t *)ATcodec_Buffer_getElement(&tree->leaves, node->data))->dynamic_str); + ATcodec_Memory_Init(&str, dynamic_str+(len-depth), 0, 1, NULL, NULL); + ATcodec_Memory_Init(&fmt, dyn_str, 0, 1, NULL, NULL); + + mem_index = memory->current; + if(vp_atcodec_sscanf(&str, &fmt, memory, len_dec) == ATCODEC_TRUE) + { + memory->current = mem_index; + *ptr = ((ATcodec_Message_Data_t *)ATcodec_Buffer_getElement(&tree->leaves, node->data))->func_ptr; + *len_dec += len; + return ATCODEC_TRUE; + } + + return ATCODEC_FALSE; +} + + +// We assume we know that current->isleaf != -1 here +static ATCODEC_RET +test_dyn_strs(ATcodec_Tree_t *tree, ATcodec_Tree_Node_t *current, int depth, const char *dynamic_str, ATcodec_Memory_t *memory, AT_CODEC_Message_Received *ptr, int *len_dec) +{ + ATcodec_Tree_Node_t *son; + int i; + + if(current->type == ATCODEC_TREE_NODE_TYPE_LEAF) + { + // just current to be tested + return test_dyn_strs_one_node(tree, current, depth, dynamic_str, memory, ptr, len_dec); + } + else + { + VP_OS_ASSERT(current->type == ATCODEC_TREE_NODE_TYPE_MULTILEAVES); + // all sons have to be tested + for(i = 0 ; i < current->nb_sons ; i++) + { + son = (ATcodec_Tree_Node_t *)ATcodec_Buffer_getElement(&tree->sons, current->sons[i]); + if(test_dyn_strs_one_node(tree, son, depth, dynamic_str, memory, ptr, len_dec) == ATCODEC_TRUE) + return ATCODEC_TRUE; + } + } + + return ATCODEC_FALSE; +} + + +static ATCODEC_RET +test_process_node(ATcodec_Tree_t *tree, ATcodec_Tree_Node_t *node, const char *cpy, ATcodec_Memory_t *memory, int *len_dec, int depth) +{ + ATcodec_Tree_Node_t *son; + AT_CODEC_Message_Received ptr; + AT_CODEC_MSG_ID id = (AT_CODEC_MSG_ID)-1; + char *fmt_str; + int32_t output_len; + char output_params[INTERNAL_BUFFER_SIZE]; + int8_t output_str[INTERNAL_BUFFER_SIZE]; + ATcodec_Memory_t output, dest, fmt; + + if(test_dyn_strs(tree, node, depth, cpy, memory, &ptr, len_dec) == ATCODEC_TRUE) + { + ATcodec_Memory_Init(&output, &output_params[0], INTERNAL_BUFFER_SIZE, 1, NULL, NULL); + VP_OS_ASSERT(ptr); + ptr(memory, &output, &id); + if((int)id != -1) + { + son = ATcodec_Tree_Node_get(tree, id); + fmt_str = (char *)ATcodec_Buffer_getElement(&tree->strs, ((ATcodec_Message_Data_t *)ATcodec_Buffer_getElement(&tree->leaves, son->data))->total_str); + + ATcodec_Memory_Init(&dest, (char*)&output_str[0], INTERNAL_BUFFER_SIZE, 1, NULL, NULL); + ATcodec_Memory_Init(&fmt, fmt_str, 0, 1, NULL, NULL); + + output.current = (char *)output.start; + if(vp_atcodec_sprintf_params(&dest, &output_len, &fmt, &output) != ATCODEC_TRUE) + return ATCODEC_FALSE; + + if(func_ptrs.write(&output_str[0], &output_len) != AT_CODEC_WRITE_OK) + return ATCODEC_FALSE; + } + return ATCODEC_TRUE; + } + + return ATCODEC_FALSE; +} + + +static ATCODEC_RET +find_process_node(ATcodec_Tree_t *tree, const char *message, ATcodec_Memory_t *memory, int *len_dec) +{ + ATcodec_Tree_Node_t *current = ATcodec_Tree_Node_get(tree, tree->root); + char *cpy = (char *)message; + int depth = 0; + + while(current->type == ATCODEC_TREE_NODE_TYPE_NODE) + { + if(current->sons[0] != -1) + { + if(test_process_node(tree, ATcodec_Tree_Node_get(tree, current->sons[0]), cpy, memory, len_dec, depth) == ATCODEC_TRUE) + return ATCODEC_TRUE; + } + if(!*cpy || current->sons[(int)(*cpy)] == -1) + { + return ATCODEC_FALSE; + } + else + { + current = ATcodec_Tree_Node_get(tree, current->sons[(int)(*cpy++)]); + depth++; + } + } + + return test_process_node(tree, current, cpy, memory, len_dec, depth); +} + +/******************************************************************** + * @param[in] str String to a raw AT command (with % standing for parameters). + * @brief Computes the length of the non-changing part (before the parameters) of an AT command string. +*/ +static int +static_len(const char *str) +{ + int len = 0; + int percent = 0; + int escaped = 1; + + do + { + switch(*str) + { + case '%': + if(escaped) + percent = 1-percent; + escaped = 1; + break; + case 's': + case 'd': + case 'c': + case 'l': + if(percent) + { + return (len-1); + } + escaped = 1; + percent = 0; + break; + case '[': + if(escaped) + { + return len; + } + break; + case '\\': + escaped = 1-escaped; + percent = 0; + break; + case '\0': + return len; + break; + default: + escaped = 1; + percent = 0; + break; + } + + len++; + } + while(*str++); + + return len; +} + + +AT_CODEC_ERROR_CODE at_default_cb(ATcodec_Memory_t *input, ATcodec_Memory_t *output, int *id) +{ + ATCODEC_PRINT("< AT message received >\n"); + + return AT_CODEC_GENERAL_OK; +} + + +AT_CODEC_MSG_ID +ATcodec_Add_Hashed_Message (const char *str, AT_CODEC_MSG_ID from_cmd, AT_CODEC_Message_Received func_ptr, int priority) +{ + return ATcodec_Add_Hashed_Message_Tree (&default_tree, str, from_cmd, func_ptr, priority); +} + + +AT_CODEC_MSG_ID +ATcodec_Add_Hashed_Message_Tree (ATcodec_Tree_t *tree, const char *str, AT_CODEC_MSG_ID from_cmd, AT_CODEC_Message_Received func_ptr, int priority) +{ + ATcodec_Message_Data_t data, *p_data; + ATcodec_Tree_Node_t *node; + int len_s, len_d, node_i; + char buffer[1024]; + + data.static_str = -1; + data.dynamic_str = -1; + data.total_str = -1; + + data.from_cmd = from_cmd; + data.func_ptr = func_ptr; + data.priority = priority; + + /* Retrieves the length of the never-changing part of the AT command */ + len_s = static_len(str); + VP_OS_ASSERT(len_s < 1024); + vp_os_memcpy(&buffer[0], str, len_s); + buffer[len_s] = 0; + node_i = ATcodec_Tree_insert(tree, &buffer[0], &data); + node = ATcodec_Tree_Node_get(tree, node_i); + + p_data = ATcodec_Buffer_getElement(&tree->leaves, node->data); + p_data->static_str = node->strkey; + + // backup dynamic_str + p_data->dynamic_str = tree->strs.nbElements; + len_d = strlen(str+len_s)+1; + ATcodec_Buffer_pushElements (&tree->strs, str+len_s, len_d); + + // backup concatenation of static_str and dynamic_str + p_data->total_str = tree->strs.nbElements; + ATcodec_Buffer_pushElements (&tree->strs, str, len_s+len_d); + + return (AT_CODEC_MSG_ID)node_i; +} + + +AT_CODEC_MSG_ID +ATcodec_Add_Defined_Message (const char *str) +{ + return ATcodec_Add_Defined_Message_Tree (&default_tree, str); +} + + +AT_CODEC_MSG_ID +ATcodec_Add_Defined_Message_Tree (ATcodec_Tree_t *tree, const char *str) +{ + return ATcodec_Add_Hashed_Message_Tree (tree, str, 0, NULL, 0); +} + + +void +ATcodec_Init_Library (AT_CODEC_FUNCTIONS_PTRS *funcs) +{ + ATcodec_Init_Library_Tree (&default_tree, funcs); +} + +void +ATcodec_Set_Reading_Mode(AT_CODEC_READING_MODE _mode) +{ + if (_mode==ATCODEC_READ_FROM_STREAM || _mode==ATCODEC_READ_FROM_PACKETS) + { + at_codec_reading_mode = _mode; + } +} + +void +ATcodec_Init_Library_Tree (ATcodec_Tree_t *tree, AT_CODEC_FUNCTIONS_PTRS *funcs) +{ + VP_OS_ASSERT(funcs); + VP_OS_ASSERT(funcs->open); + VP_OS_ASSERT(funcs->read); + VP_OS_ASSERT(funcs->enable); + VP_OS_ASSERT(funcs->write); + VP_OS_ASSERT(funcs->close); + VP_OS_ASSERT(funcs->init); + VP_OS_ASSERT(funcs->shutdown); + + ATcodec_Tree_init(tree, sizeof(ATcodec_Message_Data_t), 1); + + memcpy(&func_ptrs, funcs, sizeof(*funcs)); + + vp_os_mutex_init(&ATcodec_cond_mutex); + vp_os_cond_init(&ATcodec_wait_cond, &ATcodec_cond_mutex); + + if(func_ptrs.init() != AT_CODEC_INIT_OK) + { + ATCODEC_PRINT("ATcodec Init error\n"); + } + else + { + ATcodec_Tree_print(tree); + atcodec_lib_init_ok = 1; + ATcodec_Message_len = 0; + } +} + + +void +ATcodec_Shutdown_Library (void) +{ + ATcodec_Shutdown_Library_Tree(&default_tree); +} + + +void +ATcodec_Shutdown_Library_Tree (ATcodec_Tree_t *tree) +{ + /* ATcodec_Buffer_destroy(tree->strs); */ + /* ATcodec_Buffer_destroy(tree->sons); */ + /* ATcodec_Buffer_destroy(tree->leaves); */ + atcodec_lib_init_ok = 0; +} + + +// \todo CHANGE THE '\r' +static int append_reception(char *buffer, int len, char *global_buffer, int *global_len, int global_buffer_limit) +{ + int res = 0, i; + + for(i = 0 ; i < len ; i++) + { + global_buffer[(*global_len)++] = buffer[i]; + if(*global_len >= /*INTERNAL_BUFFER_SIZE*/global_buffer_limit) + { + // buffer overflow => purge + *global_len = 0; + return -1; + } + if(buffer[i] == '\r') + { + res++; + } + } + + global_buffer[*global_len] = '\0'; + + return res; +} + + +static ATCODEC_RET process_received_data(ATcodec_Tree_t *tree, int nb, char *global_buffer, int *global_len) +{ + ATCODEC_RET res = ATCODEC_TRUE; + int len_dec; + char memory[INTERNAL_BUFFER_SIZE]; + ATcodec_Memory_t mem; + + while(nb--) /* nb is the number of \r in the buffer, ie. the number of potential AT commands */ + { + ATcodec_Memory_Init(&mem, &memory[0], sizeof(memory), 1, NULL, NULL); + if(find_process_node(tree, global_buffer, &mem, &len_dec) != ATCODEC_TRUE) + { + /* Go to the next potential command */ + for(len_dec = 0 ; len_dec < *global_len && global_buffer[len_dec] != '\r' ; len_dec++) + { + // nothing + } + ATCODEC_PRINT("PURGE\n"); + if(global_buffer[len_dec++] == '\r') + { + if(global_buffer[len_dec++] == '\0') + len_dec++; + } + } + + if(--len_dec >= *global_len) + len_dec = *global_len; + + if(*global_len == len_dec) + { + ATCODEC_ZERO_MEMSET(global_buffer, 0, *global_len*sizeof(char)); + *global_len = 0; + } + else + { + memmove(/*dest*/global_buffer, /*src*/global_buffer+len_dec, /*nb bytes*/*global_len-len_dec); + ATCODEC_ZERO_MEMSET(global_buffer+*global_len-len_dec, 0, (len_dec)*sizeof(char)); + *global_len -= len_dec; + } + } + + return res; +} + + + + +/** +* AT Command receiving thread. ( ** AT Command Server ** ) +* This thread keeps calling a callback function stored +* in 'func_ptrs.read' to fetch data, accumulates these data until +* a full AT command has been received, and then call the AT decoder. +* */ +#if !defined(TARGET_OS_IPHONE) && !defined(TARGET_IPHONE_SIMULATOR) +DEFINE_THREAD_ROUTINE_STACK(ATcodec_Commands_Server,data,ATCODEC_STACK_SIZE) +{ + ATcodec_Tree_t *tree = &default_tree; + AT_CODEC_ERROR_CODE res; + int32_t v_loop, v_read, len, nb_cmd = 0; + char buffer[INTERNAL_BUFFER_SIZE]; // user-defined + char global_buffer[INTERNAL_BUFFER_SIZE]; + char safety[16]; // Absorbs data overflowing from global_buffer. + int global_len=0; + + v_continue = 1; + PRINT("Thread AT Commands Server Start\n"); + + + + while(!atcodec_lib_init_ok) + { + vp_os_thread_yield(); + } + + while(v_continue) + { + vp_os_memset(buffer,0,sizeof(buffer)); + vp_os_memset(global_buffer,0,sizeof(global_buffer));global_len=0; + vp_os_memset(safety,0,sizeof(safety)); + + // open and init + if((res = func_ptrs.open()) != AT_CODEC_OPEN_OK){ + v_continue = 0; + } + + for ( v_loop = 1 ; v_loop && func_ptrs.enable() == AT_CODEC_ENABLE_OK; ) + { + v_read = 1; + do + { + // wait so that thread can give the hand : delay user-defined / OS-dependent + // ... + vp_os_delay(ATCODEC_SERVER_YIELD_DELAY); + //vp_os_thread_yield(); + + + + /* In case of reading from packets, we clear the incoming buffer. + * Splitting AT commands into several packets would be a bad idea since packet order in not guaranteed in UDP. + */ + if (at_codec_reading_mode==ATCODEC_READ_FROM_PACKETS){ + vp_os_memset(global_buffer,0,sizeof(global_buffer)); + global_len=0; + } + + /* + * Read some bytes; this function blocks until some data are made + * available by the VP_COM thread. + */ + len = sizeof(buffer); //INTERNAL_BUFFER_SIZE/*/2*/; // user-defined + res = func_ptrs.read((int8_t*)&buffer[0], (int32_t*)&len); + + if(res == AT_CODEC_READ_OK) + { + if(len > 0) + { + // process characters and update v_read + // \todo Do not use nb_cmd ? + + /* Data are accumulated in the global buffer until at least one '\r' is found. */ + if((nb_cmd = append_reception(&buffer[0], len, &global_buffer[0], &global_len,sizeof(global_buffer))) > 0) + { + v_read = 0; + } + else if(nb_cmd == -1) /* no \r found in the global_buffer*/ + { + // a buffer overflow occurs + switch(at_codec_reading_mode) + { + case ATCODEC_READ_FROM_STREAM: + PRINT("AT Codec buffer was filled before a full AT commands was received."); + break; + case ATCODEC_READ_FROM_PACKETS: + PRINT("AT Codec received a packet with no complete AT command or buffer was too small to store the whole packet."); + break; + } + //ATCODEC_PRINT("Overflow\n"); + + /* In case of overflow, a TCP connection should be reinitialized in order to resynchronize + * the client and the server. Otherwise there is no way to find the beginning of the next AT Command. + * For a UDP connection, we assume all packets begin with an AT Command, and we just wait + * for the next packet to arrive. + */ + if (at_codec_reading_mode==ATCODEC_READ_FROM_STREAM) { v_loop = 0; } + } + else + { + v_read = 1; + } + } + else + { + if(len < 0) + { + ATCODEC_PRINT("read returns a neg length\n"); + v_loop = 0; + } + } + } + else /* if (res == AT_CODEC_READ_OK) */ + { + // an error occurred + ATCODEC_PRINT("an error occurs\n"); + v_loop = 0; + } + } + while (v_read && v_loop); + + // process what has been received if no error occurs + if(v_loop) + { + // ... + if(process_received_data(tree, nb_cmd, &global_buffer[0], &global_len) != ATCODEC_TRUE) + { + ATCODEC_PRINT("process_received returns false\n"); + v_loop = 0; + } + } + }/*for*/ + + // close and un-init : user-defined + if((res = func_ptrs.close()) != AT_CODEC_CLOSE_OK) + v_continue = 0; + + }/* while */ + + if((res = func_ptrs.shutdown()) != AT_CODEC_SHUTDOWN_OK) + { + ATCODEC_PRINT("ATcodec Shutdown error\n"); + } + + return((THREAD_RET)0); +} +#endif // ! TARGET_OS_IPHONE && ! TARGET_IPHONE_SIMULATOR + + +static ATCODEC_RET +valist_ATcodec_Queue_Message_valist_Tree(ATcodec_Tree_t *tree, AT_CODEC_MSG_ID id, va_list *va) +{ + int32_t len; + ATCODEC_RET res; + ATcodec_Tree_Node_t *node = ATcodec_Tree_Node_get(tree, (int)id); + ATcodec_Message_Data_t *data = (ATcodec_Message_Data_t *)ATcodec_Buffer_getElement(&tree->leaves, node->data); + char *total_str = (char *)ATcodec_Buffer_getElement(&tree->strs, data->total_str); + ATcodec_Memory_t msg, fmt; + char buffer[INTERNAL_BUFFER_SIZE]; + + if(!atcodec_lib_init_ok) + return ATCODEC_FALSE; + + + vp_os_mutex_lock(&ATcodec_cond_mutex); + + ATcodec_Memory_Init(&msg, (char*)&buffer[0], INTERNAL_BUFFER_SIZE, 1, NULL, NULL); + ATcodec_Memory_Init(&fmt, total_str, 0, 1, NULL, NULL); + + if((res = vp_atcodec_sprintf_valist(&msg, &len, &fmt, va)) != ATCODEC_TRUE) + { + vp_os_mutex_unlock(&ATcodec_cond_mutex); + va_end(*va); + return res; + } + + if(ATcodec_Message_len + len < INTERNAL_BUFFER_SIZE) + { + memcpy(&ATcodec_Message_Buffer[ATcodec_Message_len], &buffer[0], len); + ATcodec_Message_len += len; + } + + //vp_os_cond_signal(&ATcodec_wait_cond); + vp_os_mutex_unlock(&ATcodec_cond_mutex); + va_end(*va); + + return ATCODEC_TRUE; +} + + + +/** +* Push an AT Command in the AT command output queue. +* This is the function called by the ardrone_at.c API functions. +* */ +ATCODEC_RET +ATcodec_Queue_Message_valist(AT_CODEC_MSG_ID id, ...) +{ + ATCODEC_RET res; + va_list va; + + va_start(va, id); + + res = valist_ATcodec_Queue_Message_valist_Tree(&default_tree, id, &va); + + va_end(va); + + return res; +} + + +ATCODEC_RET +ATcodec_Queue_Message_valist_Tree(ATcodec_Tree_t *tree, AT_CODEC_MSG_ID id, ...) +{ + ATCODEC_RET res; + va_list va; + + va_start(va, id); + + res = valist_ATcodec_Queue_Message_valist_Tree(tree, id, &va); + + va_end(va); + + return res; +} + + +ATCODEC_RET +ATcodec_Queue_Message_params(AT_CODEC_MSG_ID id, ATcodec_Memory_t *params) +{ + return ATcodec_Queue_Message_params_Tree(&default_tree, id, params); +} + + +ATCODEC_RET +ATcodec_Queue_Message_params_Tree(ATcodec_Tree_t *tree, AT_CODEC_MSG_ID id, ATcodec_Memory_t *params) +{ + int32_t len; + ATCODEC_RET res; + ATcodec_Tree_Node_t *node = ATcodec_Tree_Node_get(tree, (int)id); + ATcodec_Message_Data_t *data = (ATcodec_Message_Data_t *)ATcodec_Buffer_getElement(&tree->leaves, node->data); + char *total_str = (char *)ATcodec_Buffer_getElement(&tree->strs, data->total_str); + ATcodec_Memory_t msg, fmt; + char buffer[INTERNAL_BUFFER_SIZE]; + if(!atcodec_lib_init_ok) + return ATCODEC_FALSE; + + ATcodec_Memory_Init(&msg, (char*)&buffer[0], INTERNAL_BUFFER_SIZE, 1, NULL, NULL); + ATcodec_Memory_Init(&fmt, total_str, 0, 1, NULL, NULL); + + params->current = (char *)params->start; + if((res = vp_atcodec_sprintf_params(&msg, &len, &fmt, params)) != ATCODEC_TRUE) + { + vp_os_mutex_unlock(&ATcodec_cond_mutex); + return res; + } + + + if(ATcodec_Message_len + len < INTERNAL_BUFFER_SIZE) + { + memcpy(&ATcodec_Message_Buffer[ATcodec_Message_len], &buffer[0], len); + ATcodec_Message_len += len; + } + + //vp_os_cond_signal(&ATcodec_wait_cond); + vp_os_mutex_unlock(&ATcodec_cond_mutex); + + return ATCODEC_TRUE; +} + + +ATCODEC_RET +ATcodec_Send_Messages() +{ + ATCODEC_RET res = ATCODEC_TRUE; + + if(!atcodec_lib_init_ok) + return ATCODEC_FALSE; + + vp_os_mutex_lock(&ATcodec_cond_mutex); + + if(ATcodec_Message_len > INTERNAL_BUFFER_SIZE) + printf("ATcodec_Send_Messages : buf=%s, len=%d\n", &ATcodec_Message_Buffer[0], ATcodec_Message_len); + + if(ATcodec_Message_len && func_ptrs.write((int8_t*)&ATcodec_Message_Buffer[0], (int32_t*)&ATcodec_Message_len) != AT_CODEC_WRITE_OK) + res = ATCODEC_FALSE; + + ATcodec_Message_len = 0; + + vp_os_mutex_unlock(&ATcodec_cond_mutex); + + return res; +} + +#if !defined(TARGET_OS_IPHONE) && !defined(TARGET_IPHONE_SIMULATOR) +DEFINE_THREAD_ROUTINE_STACK(ATcodec_Commands_Client,data,ATCODEC_STACK_SIZE) +{ + AT_CODEC_ERROR_CODE res; + int32_t v_loop; + + v_continue = 1; + PRINT("Thread AT Commands Client Start\n"); + + while(!atcodec_lib_init_ok) + { + vp_os_thread_yield(); + } + + while(v_continue) + { + // open and init + if((res = func_ptrs.open()) != AT_CODEC_OPEN_OK) + v_continue = 0; + + for ( v_loop = 1 ; v_loop ; ) + { + // vp_os_delay(ATCODEC_SERVER_YIELD_DELAY); + vp_os_thread_yield(); + + // wait a successful ATcodec_Queue_... has been called + vp_os_mutex_lock(&ATcodec_cond_mutex); + //vp_os_cond_wait(&ATcodec_wait_cond); + + //ATCODEC_PRINT("Must send \"%s\"\n", &ATcodec_Message_Buffer[0]); + if(ATcodec_Message_len && func_ptrs.write((int8_t*)&ATcodec_Message_Buffer[0], (int32_t*)&ATcodec_Message_len) != AT_CODEC_WRITE_OK) + v_loop = 0; + + ATcodec_Message_len = 0; + vp_os_mutex_unlock(&ATcodec_cond_mutex); + } + + // close and un-init : user-defined + if((res = func_ptrs.close()) != AT_CODEC_CLOSE_OK) + v_continue = 0; + } + + if((res = func_ptrs.shutdown()) != AT_CODEC_SHUTDOWN_OK) + { + ATCODEC_PRINT("ATcodec Shutdown error\n"); + } + + return((THREAD_RET)0); +} +#endif // ! TARGET_OS_IPHONE && ! TARGET_IPHONE_SIMULATOR + + +void ATcodec_exit_thread(void) +{ + v_continue = 0; +} diff --git a/ARDroneLib/VP_SDK/ATcodec/ATcodec_api.h b/ARDroneLib/VP_SDK/ATcodec/ATcodec_api.h new file mode 100644 index 0000000..1bf983c --- /dev/null +++ b/ARDroneLib/VP_SDK/ATcodec/ATcodec_api.h @@ -0,0 +1,272 @@ +/** + * @file ATcodec_api.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/06 + * modified on 2010/07/19 by stephane.piskorski.ext@parrot.fr (bug fix+comments) + */ + +#ifndef _AT_CODEC_LIBRARY_INCLUDE_ +#define _AT_CODEC_LIBRARY_INCLUDE_ + + +#include +#include + +#include +#include +#include +#include + + +#ifndef ATCODEC_STACK_SIZE +# define ATCODEC_STACK_SIZE 40000 +#endif // ! ATCODEC_STACK_SIZE + + + /** + * AT Codec reading mode. + * AT Codec can read incoming commands from a stream or from packets. + */ +typedef enum { + ATCODEC_READ_FROM_STREAM=1, /**< AT Commands are read from a stream; incoming data is fused until a full command is received. */ + ATCODEC_READ_FROM_PACKETS /**< AT Commands are read from packets which are processed independently, one at a time. */ +} AT_CODEC_READING_MODE; + + +// Functions pointers typedefs + +typedef struct _AT_CODEC_FUNCTIONS_PTRS_ +{ + AT_CODEC_ERROR_CODE (*init) (void); + AT_CODEC_ERROR_CODE (*shutdown) (void); + AT_CODEC_ERROR_CODE (*enable) (void); + AT_CODEC_ERROR_CODE (*open) (void); + AT_CODEC_ERROR_CODE (*close) (void); + AT_CODEC_ERROR_CODE (*write) (int8_t *buffer, int32_t *len); + AT_CODEC_ERROR_CODE (*read) (int8_t *buffer, int32_t *len); +} +AT_CODEC_FUNCTIONS_PTRS; + + +// Others typedefs + +typedef int AT_CODEC_MSG_ID; +typedef AT_CODEC_ERROR_CODE (*AT_CODEC_Message_Received)(ATcodec_Memory_t *input, ATcodec_Memory_t *output, AT_CODEC_MSG_ID *id); + + +typedef struct _ATcodec_Message_Data_ +{ + int static_str; + int dynamic_str; + int total_str; + + AT_CODEC_MSG_ID from_cmd; + AT_CODEC_Message_Received func_ptr; + + int priority; // \todo To be used +} +ATcodec_Message_Data_t; + + +// API + +/** + * Initialization of the ATcodec library. + * + * @param funcs Functions pointers + */ +void +ATcodec_Init_Library (AT_CODEC_FUNCTIONS_PTRS *funcs); + + +/** + * Initialization of the ATcodec library reading mode (default is STREAMING). + * + * @param _mode Tells AT Codec to read data in a streaming manner or packet by packet. + */ +void +ATcodec_Set_Reading_Mode(AT_CODEC_READING_MODE _mode); + + +/** + * Initialization of the ATcodec library. + * + * @param tree Messages tree + * @param funcs Functions pointers + */ +void +ATcodec_Init_Library_Tree (ATcodec_Tree_t *tree, AT_CODEC_FUNCTIONS_PTRS *funcs); + +/** + * Cleans all allocated data. + */ +void +ATcodec_Shutdown_Library (void); + +/** + * Cleans all allocated data. + * + * @param tree Messages tree + */ +void +ATcodec_Shutdown_Library_Tree (ATcodec_Tree_t *tree); + +/** + * AT message received default callback that does nothing. + * + * @param input Input parameters of the message received + * @param output Output parameters of the message answer to send + * @param size_max Maximum size of the ouput memory + * @param id ID of the message answer to send + * + * @retVal AT_CODEC_GENERAL_OK If OK + */ +AT_CODEC_ERROR_CODE +at_default_cb(ATcodec_Memory_t *input, ATcodec_Memory_t *output, int *id); + +/** + * Add a message that will be automatically processed by the ATcodec library when it is received. + * + * @param str String of the message + * @param from_cmd For a result, the command ID it is from + * @param func_ptr Pointer to the callback when message is received + * + * @retVal -1 If an error occurs + * @retVal A new ID If initialization OK + */ +AT_CODEC_MSG_ID +ATcodec_Add_Hashed_Message (const char *str, AT_CODEC_MSG_ID from_cmd, AT_CODEC_Message_Received func_ptr, int priority); + +/** + * Add a message that will be automatically processed by the ATcodec library when it is received. + * + * @param tree Messages tree + * @param str String of the message + * @param from_cmd For a result, the command ID it is from + * @param func_ptr Pointer to the callback when message is received + * + * @retVal -1 If an error occurs + * @retVal A new ID If initialization OK + */ +AT_CODEC_MSG_ID +ATcodec_Add_Hashed_Message_Tree (ATcodec_Tree_t *tree, const char *str, AT_CODEC_MSG_ID from_cmd, AT_CODEC_Message_Received func_ptr, int priority); + +/** + * Add a message just for the user to have the ID to be able to send it via the ATcodec library. + * + * @param str String of the message + * + * @retVal -1 If an error occurs + * @retVal A new ID If initialization OK + */ +AT_CODEC_MSG_ID +ATcodec_Add_Defined_Message (const char *str); + +/** + * Add a message just for the user to have the ID to be able to send it via the ATcodec library. + * + * @param tree Messages tree + * @param str String of the message + * + * @retVal -1 If an error occurs + * @retVal A new ID If initialization OK + */ +AT_CODEC_MSG_ID +ATcodec_Add_Defined_Message_Tree (ATcodec_Tree_t *tree, const char *str); + +/** + * Requires ATcodec AT client to be started. + * Add an AT message to the sending queue. + * Sending is done automatically. + * + * @param id ID of the AT command to generate + * @param params Params used for the generation of the command + * + * @retVal ATCODEC_TRUE If it is OK + * @retVal ATCODEC_FALSE If it fails + */ +ATCODEC_RET +ATcodec_Queue_Message_params (AT_CODEC_MSG_ID id, ATcodec_Memory_t *params); + +/** + * Requires ATcodec AT client to be started. + * Add an AT message to the sending queue. + * Sending is done automatically. + * + * @param tree Messages tree + * @param id ID of the AT command to generate + * @param params Params used for the generation of the command + * + * @retVal ATCODEC_TRUE If it is OK + * @retVal ATCODEC_FALSE If it fails + */ +ATCODEC_RET +ATcodec_Queue_Message_params_Tree(ATcodec_Tree_t *tree, AT_CODEC_MSG_ID id, ATcodec_Memory_t *params); + +/** + * Requires ATcodec AT client to be started. + * Same function as ATcodec_Queue_Message_params with parameters passed through a valist. + * + * @param id ID of the AT command to generate + * @param params Params used for the generation of the command + * + * @retVal ATCODEC_TRUE If it is OK + * @retVal ATCODEC_FALSE If it fails + */ +ATCODEC_RET +ATcodec_Queue_Message_valist (AT_CODEC_MSG_ID id, ...); + +/** + * Requires ATcodec AT client to be started. + * Same function as ATcodec_Queue_Message_params with parameters passed through a valist. + * + * @param tree Messages tree + * @param id ID of the AT command to generate + * @param params Params used for the generation of the command + * + * @retVal ATCODEC_TRUE If it is OK + * @retVal ATCODEC_FALSE If it fails + */ +ATCODEC_RET +ATcodec_Queue_Message_valist_Tree(ATcodec_Tree_t *tree, AT_CODEC_MSG_ID id, ...); + +/** + * Send pushed messages. + * + * @retVal ATCODEC_TRUE If it is OK + * @retVal ATCODEC_FALSE If it fails + */ +ATCODEC_RET +ATcodec_Send_Messages(void); + +/** + * ATcodec AT server that processes AT commands. + * + * @param data Data passed to thread routine + */ +DEFINE_THREAD_ROUTINE(ATcodec_Commands_Server, data); + +/** + * ATcodec AT client that sends AT commands. + * + * @param data Data passed to thread routine + */ +DEFINE_THREAD_ROUTINE(ATcodec_Commands_Client, data); + +/** + * Exits from current thread execution (either client and server) + * + * @param void + */ +void +ATcodec_exit_thread(void); + +/** + * Print the tree created by the adding of the messages. + */ +void +ATcodec_Print_Tree(void); + + +#endif // -> _AT_CODEC_LIBRARY_INCLUDE_ + diff --git a/ARDroneLib/VP_SDK/Build/Makefile b/ARDroneLib/VP_SDK/Build/Makefile new file mode 100644 index 0000000..b6c38b4 --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/Makefile @@ -0,0 +1,242 @@ + +########################################################################################### +# +# Makefile called externally to build the SDK, alone or to be used in an application. +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +# Builds libraries and examples. +# +# Needs some variables to be passed for it to know what to do. +# Variables definitions tests are done in varcontrol.makefile +# +########################################################################################### + + + ############################## +########################################################################################### +# Variables definitions management +########################################################################################### +include varcontrol.makefile +########################################################################################### + ############################## + + +# +# At that point, following global variables are defined : +# a : always / c : conditional + +# (a) NO_COM +# (a) USE_BLUEZ +# (a) USE_SDK +# (a) RELEASE_BUILD + +# (c) SDK_VERSION +# (c) PROJECT +# (c) FF_ARCH + + + ############################## +########################################################################################### +# System variable definitions +########################################################################################### +include sysvar.makefile +########################################################################################### + ############################## + + +# +# At that point, following global variables are defined : +# a : always / c : conditional + +# (a) OS_TARGET_DIR +# (a) VLIB_TARGET_DIR +# (c) COM_TARGET_DIR +# (c) CODEC_TARGET_DIR +# (c) JPEG_TARGET_DIR +# (c) SDK_TARGET_DIR + + + ############################## +########################################################################################### +# Main rules +########################################################################################### + +TARGETS=vlib parrotOS_core parrotOS_utils parrotOS_drivers parrotOS_devs parrotOS_codec libplf sdk lib app + +define ADD_RULE_TEMPLATE + ifeq ($$(USE_$(shell echo $(1) | tr "a-z" "A-Z")),yes) + TO_BUILD+=build_$(1) + endif +endef + +# Add rule for each target +$(foreach target,$(TARGETS),$(eval $(call ADD_RULE_TEMPLATE,$(target)))) + +.PHONY: $(foreach target,$(TARGETS),build_$(target) clean_$(target)) + +all $(MAKECMDGOALS): $(TO_BUILD) + @if [ $(MAKECMDGOALS) ] && [ $(MAKECMDGOALS) = check ] ; then $(SDK_SOURCE_DIR)/Build/cvsstatus.sh $(SDK_SOURCE_DIR)/Build END ; fi + +before_check: + @if [ $(MAKECMDGOALS) ] && [ $(MAKECMDGOALS) = check ] ; then rm -rf *.log ; fi + +define GENERIC_RULES_TEMPLATE + ifneq ($(1),dll) + build_$(1): before_check + @$(MAKE) -f $(1).makefile $(MAKECMDGOALS) + endif +endef + +build_dll: before_check + @$(MAKE) -f app.makefile $(MAKECMDGOALS) + + +# Build rules for each target +$(foreach target,$(TARGETS),$(eval $(call GENERIC_RULES_TEMPLATE,$(target)))) +########################################################################################### + ############################## + + + ############################## +########################################################################################### +# Update generic flags +########################################################################################### +FLAGS_FILTER_OUT=-O0 -O1 -O2 -O3 -Os -fno-rtti -frtti -fvtable-gc -Winline -Woverloaded-virtual -lstdc++ +ifneq ($(USE_RTMON),yes) + FLAGS_FILTER_OUT+=-g +endif + +DEFINE_FLAGS=USE_WIFI USE_CAMIF USE_BASEBAND NO_COM USE_SERIAL USE_VLIB USE_MINGW32 USE_DLL USE_LINUX USE_ELINUX USE_PARROTOS_CORE USE_PARROTOS_UTILS USE_PARROTOS_DRIVERS USE_PARROTOS_DEVS USE_PARROTOS_CODEC USE_LIBPLF USE_BROADCOM USE_IWLIB USE_ANDROID + + +ifeq ($(USE_ELINUX),yes) + include elinux.makefile +else + GENERIC_CFLAGS+= -Wall +endif + +ifeq ($(USE_LIBPLF),yes) + GENERIC_CFLAGS+= -DOS_LINUX +endif + +GENERIC_CFLAGS+=-Wall +#-Werror -Wfatal-errors -Wno-unused-variable + +GENERIC_LDFLAGS+=-Wl,--warn-common + +ifeq ("$(BUILD_MODE)","PROD_MODE") + GENERIC_CFLAGS+=-O3 -DCOMPIL_MODE_PROD + GENERIC_CFLAGS:=$(filter-out -DNDEBUG,$(GENERIC_CFLAGS)) -DNDEBUG + GENERIC_LDFLAGS+=-O3 + ifeq ($(USE_RTMON),yes) + GENERIC_CFLAGS+=-g + GENERIC_LDFLAGS+=-g + endif +endif +ifeq ("$(BUILD_MODE)","DEBUG_MODE") + GENERIC_CFLAGS+=-g -O0 -DDEBUG_MODE -DDEBUG -D_DEBUG + GENERIC_LDFLAGS+=-g -O0 +endif + +ifeq ($(USE_NDS),yes) + GENERIC_CFLAGS+=-D__NDS__ -DUSE_NDS + ifeq ($(NDS_CPU),ARM7) + GENERIC_CFLAGS+=-DARM7 -DSDK_ARM7 -mcpu=arm7tdmi -mtune=arm7tdmi + GENERIC_LDFLAGS+=-specs=ds_arm7.specs + endif + ifeq ($(NDS_CPU),ARM9) + GENERIC_CFLAGS+=-DARM9 -DSDK_ARM9 -mtune=arm9tdmi -march=armv5te + GENERIC_LDFLAGS+=-specs=ds_arm9.specs + endif + GENERIC_CFLAGS+=-fomit-frame-pointer -ffast-math + GENERIC_LDFLAGS+=-mno-fpu -Wl,-Map,.map +else + ifeq ($(USE_ELINUX),yes) + GENERIC_CFLAGS+=-D_ELINUX=$(USE_ELINUX) -D__elinux__ -D__ELINUX__ -DPARROT5 + ifeq ($(PROCESSOR),ARM_CORTEX_A8) + ## Check http://processors.wiki.ti.com/index.php/Cortex-A8 + GENERIC_CFLAGS+=-march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp + endif + ifeq ($(PROCESSOR),ARM_926EJS) + ## Check http://www.codesourcery.com/sgpp/lite/arm/portal/kbentry26 + GENERIC_CFLAGS+=-mcpu=arm926ej-s + endif + else + ifneq ($(USE_MINGW32),yes) + GENERIC_CFLAGS+=-D__linux__ + + ifeq ($(USE_IPHONE),yes) + GENERIC_CFLAGS+=-D__MACOSX__ -std=gnu99 + ifeq ($(IPHONE_PLATFORM),iphoneos) + GENERIC_CFLAGS+=-arch $(ARDRONE_TARGET_ARCH) + else + GENERIC_CFLAGS+=-arch i386 + endif + else + ifeq ($(USE_LINUX), yes) + GENERIC_CFLAGS+=-D__LINUX__ + else + ifeq ($(USE_ANDROID),yes) + TARGET_arm_release_CFLAGS := -O2 \ + -fomit-frame-pointer \ + -fstrict-aliasing \ + -funswitch-loops \ + -finline-limit=300 + + TARGET_arm_debug_CFLAGS := $(TARGET_arm_release_CFLAGS) \ + -fno-omit-frame-pointer \ + -fno-strict-aliasing + + GENERIC_CFLAGS+= $(TARGET_arm_debug_CFLAGS) \ + -fstack-protector \ + -fno-short-enums \ + -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ \ + -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ + endif + endif + endif + endif + endif +endif + +GENERIC_CFLAGS+=-DTARGET_CPU_ARM=$(TARGET_CPU_ARM) -DTARGET_CPU_X86=$(TARGET_CPU_X86) + +ifeq ("$(USE_MEMPROT)","yes") + GENERIC_CFLAGS+=-fno-common -mlong-calls +endif + +ifeq ("$(USE_PVSP)","yes") + GENERIC_CFLAGS+=-DBLUES_SUPPORT_PVSP_BLOCK +endif + +ifeq ("$(USE_BONJOUR)","yes") + GENERIC_CFLAGS+= \ + -DMDNS_DEBUGMSGS=0 \ + -DMDNS_LOG_ANSWER_SUPPRESSION_TIMES=0 \ + -DCOMPILER_LIKES_PRAGMA_MARK=0 \ + -DHAVE_IPV6=0 \ + -DUSES_NETLINK=0 \ + -DTARGET_OS_LINUX=1 \ + -DNOT_HAVE_DAEMON=1 \ + -Dsigset_t=cyg_uint32 +endif + +define ADD_DEFINE_FLAG_TEMPLATE + ifeq ($$($(1)),yes) + GENERIC_CFLAGS+=-D$(1) + endif +endef + +# Add define flags +$(foreach flag,$(DEFINE_FLAGS),$(eval $(call ADD_DEFINE_FLAG_TEMPLATE,$(flag)))) + +# All that needs to be exported +######################## +export GENERIC_CFLAGS +export GENERIC_LDFLAGS +export GENERIC_ARFLAGS=rcs +########################################################################################### + ############################## + diff --git a/ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/api_ethernet_raw_sdl b/ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/api_ethernet_raw_sdl new file mode 100755 index 0000000000000000000000000000000000000000..d67a12890cce1673780d85660409169805b73947 GIT binary patch literal 64944 zcmb@v4}6rxwKu+-Y+!}eU3JlDqXrvoQlln{ZK7DS3A;ok8i7Pq!XF_qx%@5J1+0R^ z&B{JLuBNT_(tB+$6xvH~X`wAeRH_@2vY@m#{Ars4)~K}Znp_*jLR4P!`+mXSG@_=3j;-(?Y0!oy|T0;mVIy&IC)Y#cs*B ze8F<5WfYQ_H(?EM@CX5jvX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CR4xxVX^qKkpD;$I6?}mBIeMp}?f2H4}WM_(VAOCan$}GPdX7XoV`{RC>FynJc zD72z--qf*!!DWMZ2+pO%eGUdYSXc)Baf8MGZ}8s^qT5Sza`V58oZ^ak-!n5OcQH@T zbS)K(s$3Fo4uyS}6BV0R8{cJx*6%q1bAmr7WaC7;Ktr6+2}PIw|I~*?!KJKx zvcBahVzJcU+Ttl<`rltPW$Mg}L$%j?imq=C7cFIN)>Bl!qB*!?nSF*@Z44_uLDsJZ zcxs4alY`*xOG{Ho*jYp_3i)s5KP$P7LEafSxV__vo2KI479f&|u zyR5N}3<4zNUy;FPQ!WVtt%YV5rUvU32M?1iul`r|_hs1rx(QwOx%+ebW`&)E6Wk2o zW)R`y-Ti6opr3YtYuq3>jU|=>cP}1==_fe3kvMh%8oOU(4Fwhxc0Al@!bGF+X$(>f zTs{L5jY&XlaLG^Al!D-A=!C*yW7567t{U+hu@rK44r}9zX&4ju6D!rU+J&jNF zt})7X;5vC%z6x_uU(Nf;PMF3xiy=nzxcCGo!*?;xh0~a*1)v@f2~OiM7p{?a(W-nj zHX94$$MWv}+D4?Ets+v7P$73BPU&NISO_ykv6k3F?FjYA-!O}{u!a2i8uSJU2i zEWhxYp9^;nJ{N93aQpuW+`nhQ9R%(ma4rrZbl)G~T|8F48ao~a?ywWa!@#NDeu{JR zJ-`_Ez`JQ2E}U@wA_Goi;e)_6DWUTdjGV4pbMY;{1N-u?j8()W=jU^tPw-U!qHl3~ sPHx3PkH@zxjnGH9ew%UWP-GvtM1~x=ac-U_5&y<>RPK4#lY!&E0RRVA8~^|S literal 0 HcmV?d00001 diff --git a/ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/sym_api_ethernet_raw_sdl b/ARDroneLib/VP_SDK/Build/PROD_MODE_gcc_4.3.3_Examples/linux/sym_api_ethernet_raw_sdl new file mode 100755 index 0000000000000000000000000000000000000000..697fc98124af1c658ec977844d4daf58f4c926b0 GIT binary patch literal 84977 zcmb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c%@c2_9XnFo&iVcZ^(3Bj$6fX`V5uYGMUR6F8QK5 zt#6=Ptr?AK3sn$W1#2mt2$+asX`n4S56G|~dEWZu z()1dpsMDP_ZJK>3m}9FcZ&DhkO@-00&DV(8Yg@>Nn-7+)cCXQ*+N5SARnV3Kp%C%R zDl=zQ>W|vawjf>SADc-OR>+uWW40nBGFdZ1=_p)MEmFh+v7vTUvMg%BVZZE~lq$x} zXAGGIa8k39Epn|)k3GcYvE7~N4gG={%(-62c%Tu6qK;8$&8?kezMgf$H)lS?x3$5v z^%~~b-5jz81>tN&NTuLxQsT%gScu@qOg1(uA>6ydM3R{X4HFGF4)jTlK=Nitih5bg zYxJ!k6_4p^X{cp02)@=!eIM_%S)bT7RgK&t9h9S7T((evehyGQXR)FcdxFuXqhk3% zhn-wg&P#t0O#_Ey^Z-!|1^QPW=z zuLYr;N*aaLR3{)~jKcx7%5H{4h^ocSZ45UE5S|l%z{sRT3RD@R-J%XAmOzYaiP635}RptDP=x$~r&GwQR3U9kg}z0|gH!>URgNndV%? zcb*({wjdNZv6Eb(WQ)5#*Gikv1~bOt@$jvEq)27qra722ZsALN91r=~zihk9S zg<*K-*DK9-C%?cvv?_{f+;W#pu3?9i?J3xdWe5GyjBVSvVuNQs(&3_kzE|?2Mrv!g zNpm;$gjQibW_3Z-&Y76+z5Y;~p#d$l1y!NO2d?yyg*6>vR_rDZS%+0mX9nGCGaG91 zo$S6UFj3s|7JTR8uDsN-4Ec*RBG^}pQS&p4XiiDol(SjEa?*;5xkYv`444wEZf!4Z Mz9Q>%$7sp_0exqvz5oCK literal 0 HcmV?d00001 diff --git a/ARDroneLib/VP_SDK/Build/app.makefile b/ARDroneLib/VP_SDK/Build/app.makefile new file mode 100644 index 0000000..432be5b --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/app.makefile @@ -0,0 +1,34 @@ + +########################################################################################### +# +# Designed to build an application using generic.makefile, linked with Sdk +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +########################################################################################### + +include common.makefile + +ifeq ($(USE_APP),yes) + GENERIC_BINARIES_TARGET_DIR=$(APP_TARGET_DIR) +else + GENERIC_BINARIES_TARGET_DIR=$(DLL_TARGET_DIR) +endif + +# All that needs to be exported +######################## +export GENERIC_ADD_OFILES +export GENERIC_INCLUDES +export GENERIC_LIB_PATHS +export GENERIC_LIBS +export GENERIC_BINARIES_LIBS_DEPS +export GENERIC_BINARIES_TARGET_DIR + +# Bug fix ... +export GENERIC_LIBRARY_TARGET_DIR=$(GENERIC_BINARIES_TARGET_DIR) + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/common.makefile b/ARDroneLib/VP_SDK/Build/common.makefile new file mode 100644 index 0000000..d358479 --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/common.makefile @@ -0,0 +1,318 @@ + +########################################################################################### +# +# Common to sdk.makefile and app.makefile +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +########################################################################################### + +# To be reordered (CommonSoft) +######################## +XCC=$(GENERIC_COMMAND_PREFIX)gcc +XAR=$(GENERIC_COMMAND_PREFIX)ar + +ifdef MYKONOS +GENERIC_INCLUDES+= \ + -I$(ALL_TARGETS)/CommonSoft/include \ + -I$(ALL_TARGETS)/CommonSoft/include/xmlparser \ + -I$(ALL_TARGETS)/CommonSoft/include/crypto +endif + +# Used for include paths +######################## +ifdef MYKONOS +SDK_PATH:=$(ALL_SOURCES)/ardrone_api/$(SDK_VERSION)/ARDrone_API/ARDroneLib +SDK_SOURCE_DIR=$(SDK_PATH)/VP_SDK +VLIB_SOURCE_DIR=$(SDK_PATH)/VLIB + +COMMONSOFT=$(ALL_SOURCES)/commonsoft/$(COMMONSOFT_VERSION)/CommonSoft +PARROTOS_CORE_SOURCE_DIR=$(COMMONSOFT)/ParrotOS/core/src +PARROTOS_CORE_INCLUDE_DIR=$(COMMONSOFT)/ParrotOS/core/include +PARROTOS_UTILS_SOURCE_DIR=$(COMMONSOFT)/ParrotOS/utils/src +PARROTOS_UTILS_INCLUDE_DIR=$(COMMONSOFT)/ParrotOS/utils/include +PARROTOS_DRIVERS_SOURCE_DIR=$(COMMONSOFT)/ParrotOS/drivers/src +PARROTOS_DRIVERS_INCLUDE_DIR=$(COMMONSOFT)/ParrotOS/drivers/include +PARROTOS_DEVS_SOURCE_DIR=$(COMMONSOFT)/ParrotOS/devs/ +PARROTOS_DEVS_INCLUDE_DIR=$(COMMONSOFT)/ParrotOS/devs/ +PARROTOS_CODEC_SOURCE_DIR=$(COMMONSOFT)/ParrotOS/codec +PARROTOS_CODEC_INCLUDE_DIR=$(COMMONSOFT)/ParrotOS/codec +LIBPLF_SOURCE_DIR=$(COMMONSOFT)/libplf/src +LIBPLF_INCLUDE_DIR=$(COMMONSOFT)/libplf/include +else +SDK_SOURCE_DIR=../ +VLIB_SOURCE_DIR=../../VLIB +endif + +# Sdk relative paths +######################## +API_PATH = VP_Api +ATCODEC_PATH = ATcodec +COM_PATH = VP_Com +OS_PATH = VP_Os +EXAMPLES_PATH = Examples +STAGES_PATH = VP_Stages + +ifeq ($(USE_NDS),yes) + OS=nds +else + ifeq ($(USE_MINGW32),yes) + OS=win32 + else + ifeq ($(USE_ELINUX),yes) + OS=elinux + else + OS=linux + endif + endif +endif + +# Include paths +######################## +ifeq ($(USE_ANDROID),yes) +GENERIC_INCLUDES+= \ + -I$(NDK_PATH)/build/platforms/$(NDK_PLATFORM_VERSION)/arch-arm/usr/include +endif + +ifeq ($(USE_IPHONE),yes) + GENERIC_INCLUDES+= \ + -isysroot $(IPHONE_SDK_PATH) \ + -I$(IPHONE_SDK_PATH)/usr/include/gcc/darwin/4.2 +endif + +ifeq ($(USE_ELINUX),yes) + GENERIC_INCLUDES+= \ + -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/staging-dir_$(BOARD_CPU)_$(BOARD_NAME)/usr/include \ + -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/staging-dir_$(BOARD_CPU)_$(BOARD_NAME)/usr/include/linux \ + -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/kernel/linux/include \ + -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/kernel/linux/drivers \ + -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/packages/drivers + + ifeq ($(USE_WIFI),yes) + GENERIC_INCLUDES+= \ + -Dlinux -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/packages/drivers/bcm4318/src_4_170_55/include \ + -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/staging-dir_$(BOARD_CPU)_$(BOARD_NAME)/include + endif +endif +ifeq ($(USE_NDS),yes) + GENERIC_INCLUDES+= \ + -I$(DEVKITARM)/include \ + -I$(DEVKITPRO)/libnds/include +endif + +ifeq ($(USE_VLIB),yes) + GENERIC_INCLUDES+= \ + -I$(VLIB_SOURCE_DIR)/.. \ + -I$(VLIB_SOURCE_DIR)/P263 +ifeq ($(TARGET_CPU_ARM),1) + GENERIC_INCLUDES+= \ + -I$(VLIB_SOURCE_DIR)/Platform/arm9 \ + -I$(VLIB_SOURCE_DIR)/Platform/arm11 +else +ifeq ($(TARGET_CPU_X86),1) + GENERIC_INCLUDES+= \ + -I$(VLIB_SOURCE_DIR)/Platform/x86 +endif +endif +endif +ifeq ($(NO_COM),no) + GENERIC_INCLUDES+= \ + -I$(COM_TARGET_DIR)/include +endif +ifeq ($(USE_SDK),yes) + GENERIC_INCLUDES+= \ + -I$(SDK_SOURCE_DIR) \ + -I$(SDK_SOURCE_DIR)/$(COM_PATH) + +ifeq ($(USE_LIBPLF),yes) + GENERIC_INCLUDES+= \ + -I$(LIBPLF_INCLUDE_DIR) +endif + +ifeq ($(USE_PARROTOS_CORE),yes) + GENERIC_INCLUDES+= \ + -I$(PARROTOS_CORE_INCLUDE_DIR) \ + -I$(PARROTOS_CORE_INCLUDE_DIR)/generic \ + -I$(PARROTOS_CORE_INCLUDE_DIR)/linux \ + -I$(PARROTOS_CORE_INCLUDE_DIR)/posix \ + -I$(PARROTOS_UTILS_INCLUDE_DIR) \ + -I$(PARROTOS_DRIVERS_INCLUDE_DIR) \ + -I$(PARROTOS_DRIVERS_INCLUDE_DIR)/linux \ + -I$(PARROTOS_DEVS_INCLUDE_DIR) \ + -I$(PARROTOS_CODEC_INCLUDE_DIR) \ + -I$(SDK_SOURCE_DIR)/$(OS_PATH)/parrotos +else + GENERIC_INCLUDES+= \ + -I$(SDK_SOURCE_DIR)/$(OS_PATH)/$(OS) +endif +ifeq ($(NO_COM),no) + GENERIC_INCLUDES+= \ + -I$(SDK_SOURCE_DIR)/$(COM_PATH)/$(OS) +endif +endif + + GENERIC_INCLUDES+= \ + -I$(PFFMPEG_SOURCE_DIR)/specific + +ifeq ($(USE_JPEG_P6),yes) + GENERIC_INCLUDES+= \ + -I$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/build_$(BOARD_CPU)_$(BOARD_NAME)/jpeg-6b +endif +ifeq ($(USE_BONJOUR),yes) + GENERIC_INCLUDES+=-I$(BONJOUR_SOURCE_DIR) +endif + +# Libraries +######################## + +GENERIC_LIB_PATHS+= \ + -L$(OS_TARGET_DIR)/install/lib \ + -L$(SDK_TARGET_DIR) + +INITIAL_GENERIC_LIBS:=$(GENERIC_LIBS) + +GENERIC_LIBS+= \ + -lsdk + +GENERIC_BINARIES_LIBS_DEPS=$(SDK_TARGET_DIR)/libsdk.a + +ifeq ($(USE_LIBPLF),yes) + GENERIC_LIB_PATHS+= \ + -L$(LIBPLF_TARGET_DIR) + + GENERIC_LIBS+= \ + -lplf \ + -lz + +endif + +ifeq ($(USE_PARROTOS_CORE),yes) + GENERIC_LIB_PATHS+= \ + -L$(PARROTOS_CORE_TARGET_DIR) \ + -L$(PARROTOS_UTILS_TARGET_DIR) \ + -L$(PARROTOS_DRIVERS_TARGET_DIR) \ + -L$(PARROTOS_CODEC_TARGET_DIR) \ + -L$(PARROTOS_DEVS_TARGET_DIR) + + GENERIC_LIBS+= \ + -lparrotOS_core \ + -lparrotOS_utils \ + -lparrotOS_devs \ + -lparrotOS_codec \ + -lparrotOS_drivers \ + -lrt + GENERIC_BINARIES_LIBS_DEPS+= \ + $(PARROTOS_CORE_TARGET_DIR)/libparrotOS_core.a \ + $(PARROTOS_UTILS_TARGET_DIR)/libparrotOS_utils.a \ + $(PARROTOS_DRIVERS_TARGET_DIR)/libparrotOS_drivers.a \ + $(PARROTOS_CODEC_TARGET_DIR)/libparrotOS_codec.a \ + $(PARROTOS_DEVS_TARGET_DIR)/libparrotOS_devs.a +endif + +ifeq ($(USE_VLIB),yes) + ifeq ($(USE_ELINUX),yes) + + GENERIC_LIB_PATHS+= \ + -L$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/staging-dir_$(BOARD_CPU)_$(BOARD_NAME)/lib \ + -L$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/staging-dir_$(BOARD_CPU)_$(BOARD_NAME)/usr/lib + + GENERIC_LIBS+= \ + -luiomap -ldma_alloc + endif + GENERIC_LIB_PATHS+= \ + -L$(CODEC_TARGET_DIR) + GENERIC_LIBS+= \ + -lvlib + GENERIC_BINARIES_LIBS_DEPS+= \ + $(CODEC_TARGET_DIR)/libvlib.a +endif + +ifeq ($(USE_NDS),yes) + GENERIC_LIB_PATHS+= \ + -L$(DEVKITPRO)/libnds/lib + ifeq ($(NDS_CPU),ARM9) + GENERIC_LIBS+= \ + -ldswifi9 \ + -lnds9 + endif + ifeq ($(NDS_CPU),ARM7) + GENERIC_LIBS+= \ + -ldswifi7 \ + -lnds7 + endif +else + ifeq ($(USE_MINGW32),yes) + GENERIC_LIBS+= \ + -lws2_32 + else + GENERIC_LIBS+= \ + -lpthread + ifneq ($(USE_ELINUX),yes) + ifeq ($(USE_IWLIB),yes) + GENERIC_LIBS+= \ + -liw + endif + GENERIC_LIBS+= \ + -lSDL \ + -lGL \ + -lGLU + endif + endif +endif + +ifeq ($(USE_ELINUX),yes) + ifeq ($(USE_WIFI),yes) + GENERIC_LIB_PATHS+= \ + -L$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/staging-dir_$(BOARD_CPU)_$(BOARD_NAME)/lib + + ifeq ($(USE_IWLIB), yes) + GENERIC_LIBS+=-liw + endif + endif + ifeq ($(USE_JPEG_P6),yes) + + GENERIC_LIB_PATHS+= \ + -L$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/build_$(BOARD_CPU)_$(BOARD_NAME)/jpeg-6b \ + -L$(ALL_SOURCES)/linux/$(ELINUX_VERSION)/Linux/lucie/build/staging-dir_$(BOARD_CPU)_$(BOARD_NAME)/usr/lib + + GENERIC_LIBS+= \ + -ljpeg \ + -ldma_alloc \ + -luiomap + endif +endif + +ifeq ($(USE_ARDRONELIB),yes) +GENERIC_LIB_PATHS+= \ + -L$(ARDRONELIB_TARGET_DIR) +endif + +ifeq ($(USE_ARDRONE_VISION),yes) +GENERIC_LIB_PATHS+= \ + -L$(ARDRONE_VISION_TARGET_DIR) +endif + +ifeq ($(USE_ARDRONE_POLARIS),yes) +GENERIC_LIB_PATHS+= \ + -L$(ARDRONE_POLARIS_TARGET_DIR) +endif + +ifeq ($(USE_ARDRONE_VICON),yes) +GENERIC_LIB_PATHS+= \ + -L$(ARDRONE_VICON_TARGET_DIR) +endif + +ifeq ($(USE_ARDRONE_TEST_BENCHS),yes) +GENERIC_LIB_PATHS+= \ + -L$(ARDRONE_TEST_BENCHS_TARGET_DIR) +endif + +ifeq ($(USE_ARDRONE_CALIBRATION),yes) +GENERIC_LIB_PATHS+= \ + -L$(ARDRONE_CALIBRATION_TARGET_DIR) +endif + +GENERIC_LIBS+=$(INITIAL_GENERIC_LIBS) + + diff --git a/ARDroneLib/VP_SDK/Build/do.sh b/ARDroneLib/VP_SDK/Build/do.sh new file mode 100755 index 0000000..c0b3a1e --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/do.sh @@ -0,0 +1,256 @@ +#! /bin/sh + +##################### +# Parameters +##################### + +QUIET_BUILD=no + +USE_SDK=yes +USE_APP=no +NO_EXAMPLES=yes + +RELEASE_BUILD=yes +SDK_VERSION=dev +IPHONE_SDK_VERSION=3.0 +USE_FFMPEG=no +USE_MJPEG=no +USE_JPEG=no +USE_JPEG_P6=no +USE_SWING=no +USE_VLIB=yes +SWING_VERSION=head + +# Check validity of script usage. +if [ $1 ] && [ $1 = ecos ] ; then + if [ ! $QUIET_BUILD = yes ] ; then + echo ; echo "BUILD FOR ECOS" ; echo + fi + USE_ECOS=yes + USE_LINUX=no + USE_ELINUX=no + USE_NDS=no + USE_IPHONE=no + # head ecos-stable-2006-11-21 ecos-stable-2007-07-23 CK5300_Version_20070928_Beta5 + ECOS_VERSION=Mykonos_Version_20090212 + PROJECT=mykonos_p5p + MODE_TARGET=rls_ram_wifi_ap + CUSTOM_PRIORITIES=$ALL_SOURCES/video/$SDK_VERSION/Video/VP_SDK/VP_Os/ecos/task_priorities.h + # gnutools_2008_03_28 gnutools_2007_02_07 gnutools_2005_05_20 + GNUTOOLS_VERSION=gnutools_2008_03_28 + USE_ECOS_RELEASE=no + NO_COM=no + USE_BONJOUR=no + USE_BLUES32=no + # Stable_20070307 Stable_20060922 Stable_20061129_Blues_3_6_4 Version_KEA_1_00_RC5_200701131 + BLUES32_VERSION=Stable_20060922 + COMMONSOFT_VERSION=head + USE_PVSP=yes + USE_SOUL=no + SOUL_VERSION=Stable_20070307 + USE_TANGO=no + # Stable_20061222 Stable_20070509 + TANGO_VERSION=Stable_20070509 + DONT_USE_TTS=yes + USE_CK5050=no + CK5050_VERSION=head + USE_BLUEZ=no + # P5 Intel smdk2412 + FF_ARCH=P5 + USE_PARROTOS_CORE=no +elif [ $1 ] && [ $1 = elinux ] ; then + if [ ! $QUIET_BUILD = yes ] ; then + echo ; echo "BUILD FOR EMBEDDED LINUX" ; echo + fi + USE_ECOS=no + USE_LINUX=no + USE_ELINUX=yes + USE_NDS=no + USE_IPHONE=no + ELINUX_VERSION=head + TOOLCHAIN_VERSION=arm-eglibc + NO_COM=no + USE_BLUES32=no + USE_BLUEZ=no + USE_BONJOUR=no + FF_ARCH=Intel + USE_BROADCOM=no + USE_IWLIB=yes + USE_PARROTOS_CORE=no + COMMONSOFT_VERSION=head + CONFIG_PARROTOS=$ALL_SOURCES/video/$SDK_VERSION/Video/VP_SDK/VP_Os/parrotos/default_config.h +elif [ $1 ] && [ $1 = linux ] ; then + if [ ! $QUIET_BUILD = yes ] ; then + echo ; echo "BUILD FOR LINUX" ; echo + fi + USE_ECOS=no + USE_LINUX=yes + USE_ELINUX=no + USE_NDS=no + USE_IPHONE=no + NO_COM=no + USE_BLUES32=no + USE_BLUEZ=no + USE_WIFI=no + USE_BONJOUR=no + FF_ARCH=Intel + USE_PARROTOS_CORE=no +elif [ $1 ] && [ $1 = nds ] ; then + if [ ! $QUIET_BUILD = yes ] ; then + echo ; echo "BUILD FOR NINTENDO DS" ; echo + fi + USE_ECOS=no + USE_LINUX=no + USE_ELINUX=no + USE_NDS=yes + NDS_CPU=ARM9 + USE_IPHONE=no + NO_COM=no + USE_BLUES32=no + USE_BLUEZ=no + USE_BONJOUR=no + FF_ARCH=Intel + USE_PARROTOS_CORE=no +elif [ $1 ] && [ ${1:0:6} = iphone ] ; then + if [ ! $QUIET_BUILD = yes ] ; then + echo ; echo "BUILD FOR IPHONE with platform $1 $IPHONE_SDK_VERSION" ; echo + fi + USE_ECOS=no + USE_LINUX=no + USE_ELINUX=no + USE_NDS=no + USE_IPHONE=yes + IPHONE_PLATFORM=$1 + NO_COM=no + USE_BLUES32=no + USE_BLUEZ=no + USE_WIFI=no + USE_BONJOUR=no + FF_ARCH=Intel + USE_PARROTOS_CORE=no +else + echo ; echo "UNDEFINED BUILD" ; echo ; +fi + +##################### +# Update flags +##################### +FLAGS="USE_APP=$USE_APP" +FLAGS="IPHONE_SDK_VERSION=$IPHONE_SDK_VERSION $FLAGS" +FLAGS="NO_EXAMPLES=$NO_EXAMPLES $FLAGS" +FLAGS="GNUTOOLS_VERSION=$GNUTOOLS_VERSION $FLAGS" +FLAGS="USE_ECOS=$USE_ECOS $FLAGS" +FLAGS="USE_LINUX=$USE_LINUX $FLAGS" +FLAGS="USE_ELINUX=$USE_ELINUX $FLAGS" +FLAGS="USE_NDS=$USE_NDS $FLAGS" +FLAGS="NDS_CPU=$NDS_CPU $FLAGS" +FLAGS="USE_IPHONE=$USE_IPHONE $FLAGS" +FLAGS="IPHONE_PLATFORM=$IPHONE_PLATFORM $FLAGS" +FLAGS="USE_SDK=$USE_SDK $FLAGS" +FLAGS="NO_COM=$NO_COM $FLAGS" +FLAGS="USE_BLUES32=$USE_BLUES32 $FLAGS" +FLAGS="USE_SOUL=$USE_SOUL $FLAGS" +FLAGS="USE_TANGO=$USE_TANGO $FLAGS" +FLAGS="USE_CK5050=$USE_CK5050 $FLAGS" +FLAGS="USE_BLUEZ=$USE_BLUEZ $FLAGS" +FLAGS="USE_FFMPEG=$USE_FFMPEG $FLAGS" +FLAGS="USE_MJPEG=$USE_MJPEG $FLAGS" +FLAGS="USE_JPEG=$USE_JPEG $FLAGS" +FLAGS="USE_JPEG_P6=$USE_JPEG_P6 $FLAGS" +FLAGS="USE_SWING=$USE_SWING $FLAGS" +FLAGS="USE_VLIB=$USE_VLIB $FLAGS" +FLAGS="SWING_VERSION=$SWING_VERSION $FLAGS" +FLAGS="USE_BONJOUR=$USE_BONJOUR $FLAGS" +FLAGS="USE_WIFI=$USE_WIFI $FLAGS" + +FLAGS="QUIET_BUILD=$QUIET_BUILD $FLAGS" +FLAGS="RELEASE_BUILD=$RELEASE_BUILD $FLAGS" +FLAGS="SDK_VERSION=$SDK_VERSION $FLAGS" + +FLAGS="USE_ECOS_RELEASE=$USE_ECOS_RELEASE $FLAGS" +FLAGS="ECOS_VERSION=$ECOS_VERSION $FLAGS" +FLAGS="ELINUX_VERSION=$ELINUX_VERSION $FLAGS" +FLAGS="PROJECT=$PROJECT $FLAGS" +FLAGS="MODE_TARGET=$MODE_TARGET $FLAGS" + +FLAGS="TOOLCHAIN_VERSION=$TOOLCHAIN_VERSION $FLAGS" + +FLAGS="BLUES32_VERSION=$BLUES32_VERSION $FLAGS" +FLAGS="SOUL_VERSION=$SOUL_VERSION $FLAGS" +FLAGS="TANGO_VERSION=$TANGO_VERSION $FLAGS" +FLAGS="CK5050_VERSION=$CK5050_VERSION $FLAGS" +FLAGS="DONT_USE_TTS=$DONT_USE_TTS $FLAGS" + +FLAGS="FF_ARCH=$FF_ARCH $FLAGS" + +FLAGS="USE_BROADCOM=$USE_BROADCOM $FLAGS" +FLAGS="USE_IWLIB=$USE_IWLIB $FLAGS" +FLAGS="USE_PARROTOS_CORE=$USE_PARROTOS_CORE $FLAGS" +FLAGS="COMMONSOFT_VERSION=$COMMONSOFT_VERSION $FLAGS" + +if [ $USE_ECOS = yes ] ; then + FLAGS="CUSTOM_PRIORITIES=$CUSTOM_PRIORITIES $FLAGS" +fi + +if [ $USE_ELINUX = yes ] ; then + FLAGS="CONFIG_PARROTOS=$CONFIG_PARROTOS $FLAGS" +fi + +if [ $USE_ECOS = yes ] && [ $2 ] && ! [ $2 = check ] && ! [ $2 = clean ] || [ $USE_ECOS = yes ] && ! [ $2 ] ; then + CHOOSE=yes +fi +if [ $2 ] && [ $2 = check ] ; then + CHECK=yes +fi +shift + +##################### +# Build +##################### + +size=`stty size` +if [ $QUIET_BUILD = yes ] ; then + make_theme=darkq +else + make_theme=dark +fi +if [ $CHECK ] && [ $CHECK = yes ] ; then + make -f Makefile $FLAGS $* 2>&1 | grep -v "^$" +else + make -f Makefile $FLAGS $* 2>&1 +fi + +##################### +# Choose example ? +##################### + +if [ $CHOOSE ] && [ $CHOOSE = yes ] ; then + j=1 ; for i in $( find . -type d -name "*Examples" | grep arm ) ; do j=$( expr $j + 1 ) ; done + + if [ $j = 1 ] ; then + echo No example directory found + exit + fi + + if ! [ $j = 2 ] ; then + j=1 ; for i in $( find . -type d -name "*Examples" | grep arm ) ; do echo -e "\t$j\t$i" ; j=$( expr $j + 1 ) ; done + echo -n -e "\nChoose directory : " + read var + j=1 ; for i in $( find . -type d -name "*Examples" | grep arm ) ; do if [ $j = $var ] ; then ex_dir=$i ; fi ; j=$( expr $j + 1 ) ; done + else + ex_dir=$( find . -type d -name "*Examples" | grep arm ) + fi + + echo -e "\nDirectory $ex_dir :" + + j=1 ; for i in $( find $ex_dir -type f -exec basename \{\} \; ) ; do echo -e "\t$j\t$i" ; j=$( expr $j + 1 ) ; done + echo -n -e "\nChoose example : " + read var + j=1 ; for i in $( find $ex_dir -type f ) ; do if [ $j = $var ] ; then ex_file=$i ; fi ; j=$( expr $j + 1 ) ; done + + if [ ! -z $ex_file ] && [ -f $ex_file ] ; then + cp $ex_file /srv/tftp/program.elf && echo -e "\n$ex_file copied to /srv/tftp/program.elf" + else + echo -e "\nBad choice !" + fi +fi diff --git a/ARDroneLib/VP_SDK/Build/elinux.makefile b/ARDroneLib/VP_SDK/Build/elinux.makefile new file mode 100644 index 0000000..597e61c --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/elinux.makefile @@ -0,0 +1,35 @@ +########################################################################################### +# +# Designed to help building vp_sdk's application with eLinux +# ---------------------------------------------------------------------------------- +# Author : pierre.eline@parrot.com +# Date : 2009/07/01 +# +########################################################################################### + + +ifeq ($(USE_ELINUX),yes) + ifeq ($(USE_BROADCOM),yes) + ELINUX_BCM4318_AP=$(shell cat $(LINUX_CONFIG_PATH) | grep BR2_PACKAGE_BCM4318_AP | grep y > /dev/null && echo yes || echo no) + ifeq ($(ELINUX_BCM4318_AP),yes) + GENERIC_CFLAGS+=-DBR2_PACKAGE_BCM4318_AP + endif + USE_WIFI=$(shell cat $(LINUX_CONFIG_PATH) | grep BR2_PACKAGE_BCM4318* | grep y > /dev/null && echo yes || echo no) + endif +endif + +USE_WIFI=yes + +USE_CAMIF = yes + +# All that needs to be exported +######################## +export USE_MEMPROT +export USE_SDCARD +export USE_CAMIF +export USE_LCD +export USE_WIFI +export USE_BASEBAND +export GENERIC_CFLAGS + + diff --git a/ARDroneLib/VP_SDK/Build/generic.makefile b/ARDroneLib/VP_SDK/Build/generic.makefile new file mode 100644 index 0000000..942017d --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/generic.makefile @@ -0,0 +1,220 @@ + +########################################################################################### +# +# Generic makefile, used everywhere +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +########################################################################################### + +INTERNAL_LOG_FILE=build.log + +ifdef PARROTOS_MAKEFILE + TWEAKED_PARROTOS_MAKEFILE=$(GENERIC_LIBRARY_TARGET_DIR)/tweaked_parrotos.mak + include $(TWEAKED_PARROTOS_MAKEFILE) + GENERIC_LIBRARY_SOURCE_FILES=$(filter-out mDNSPosix/Responder.c,$(CFILES:P5_FFT.c=P5_FFT.s) $(SFILES) $(PSFILES)) + GENERIC_INCLUDES+=$(patsubst %,-I$(GENERIC_LIBRARY_SOURCE_DIR)/%,$(MODULES)) +endif + +ifeq ($(QUIET_BUILD),yes) + Q=@ + SILENT=2>&1 > /dev/null +endif + +ifeq ($(USE_NDS),yes) + NDS_CPU_TYPE=$(shell echo $(NDS_CPU) | tr "A-Z" "a-z" | sed -e "s@[0-9][0-9]*@@") + NDS_CPU_NUM=$(shell echo $(NDS_CPU) | sed -e "s@[a-zA-Z][a-zA-Z]*@@") + INTERNAL_NDSTOOL:=$(Q)ndstool + INTERNAL_DSBUILD:=$(Q)dsbuild +endif + +INTERNAL_SOURCE_EXTENSIONS= .c .S .s .cpp + +INTERNAL_MKDIR=mkdir -p +INTERNAL_ECHO=echo + +# (in) GENERIC_COMMAND_PREFIX +INTERNAL_CC:=$(GENERIC_COMMAND_PREFIX)gcc +INTERNAL_AR:=$(GENERIC_COMMAND_PREFIX)ar +INTERNAL_OBJCOPY:=$(GENERIC_COMMAND_PREFIX)objcopy +INTERNAL_STRIP:=$(GENERIC_COMMAND_PREFIX)strip + +# (in) GENERIC_CFLAGS +# (in) GENERIC_LDFLAGS +# (in) GENERIC_ARFLAGS + +# (in) GENERIC_INCLUDES + +# (in) GENERIC_ADD_OFILES : for linking with + +# (in) GENERIC_LIBRARY_SOURCE_DIR +# (in) GENERIC_LIBRARY_SOURCE_FILES +# (in) GENERIC_LIBRARY_TARGET_DIR : for .o files +INTERNAL_LIBRARY_SOURCE_FILES:=$(patsubst %,$(GENERIC_LIBRARY_SOURCE_DIR)/%,$(GENERIC_LIBRARY_SOURCE_FILES)) +INTERNAL_LIBRARY_TARGET_OFILES:=$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),\ + $(patsubst $(GENERIC_LIBRARY_SOURCE_DIR)/%$(ext),$(GENERIC_LIBRARY_TARGET_DIR)/%.o,$(filter %$(ext),$(INTERNAL_LIBRARY_SOURCE_FILES)))) + +# (in) GENERIC_BINARIES_SOURCE_DIR +# (in) GENERIC_BINARIES_COMMON_SOURCE_FILES +# (in) GENERIC_BINARIES_SOURCE_ENTRYPOINTS +# (in) GENERIC_BINARIES_TARGET_DIR : for .o files +INTERNAL_BINARIES_COMMON_SOURCE_FILES:=$(patsubst %,$(GENERIC_BINARIES_SOURCE_DIR)/%,$(GENERIC_BINARIES_COMMON_SOURCE_FILES)) +INTERNAL_BINARIES_COMMON_TARGET_OFILES:=$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),\ + $(patsubst $(GENERIC_BINARIES_SOURCE_DIR)/%$(ext),$(GENERIC_BINARIES_TARGET_DIR)/%.o,$(filter %$(ext),$(INTERNAL_BINARIES_COMMON_SOURCE_FILES)))) +INTERNAL_BINARIES_TARGET_OENTRYPOINTS:=$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),\ + $(patsubst %$(ext),$(GENERIC_BINARIES_TARGET_DIR)/%.o,$(filter %$(ext),$(GENERIC_BINARIES_SOURCE_ENTRYPOINTS)))) + +# (in) GENERIC_TARGET_LIBRARY + +# (in) GENERIC_TARGET_BINARIES_PREFIX : for binaries naming +# (in) GENERIC_TARGET_BINARIES_DIR : for binaries places +INTERNAL_TARGET_BINARIES:=$(foreach entrypoint,$(GENERIC_BINARIES_SOURCE_ENTRYPOINTS),$(shell basename $(entrypoint) .c)) +INTERNAL_TARGET_BINARIES:=$(patsubst %.c,%,$(GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) +INTERNAL_TARGET_BINARIES:=$(patsubst %,$(GENERIC_TARGET_BINARIES_DIR)/$(GENERIC_TARGET_BINARIES_PREFIX)%,$(INTERNAL_TARGET_BINARIES)) + +_INTERNAL_LIBRARY_DEPFILES:=$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),\ + $(patsubst $(GENERIC_LIBRARY_SOURCE_DIR)/%$(ext),$(GENERIC_LIBRARY_TARGET_DIR)/%$(ext).d,$(filter %$(ext),$(INTERNAL_LIBRARY_SOURCE_FILES)))) +_INTERNAL_BINARIES_DEPFILES:=$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),\ + $(patsubst $(GENERIC_BINARIES_SOURCE_DIR)/%$(ext),$(GENERIC_BINARIES_TARGET_DIR)/%$(ext).d,$(filter %$(ext),$(INTERNAL_BINARIES_COMMON_SOURCE_FILES)))) +_INTERNAL_BINARIES_DEPFILES+=$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),\ + $(patsubst %$(ext),$(GENERIC_BINARIES_TARGET_DIR)/%$(ext).d,$(filter %$(ext),$(GENERIC_BINARIES_SOURCE_ENTRYPOINTS)))) + +ifneq ($(MAKECMDGOALS),clean) + INTERNAL_LIBRARY_DEPFILES:=$(_INTERNAL_LIBRARY_DEPFILES) + INTERNAL_BINARIES_DEPFILES:=$(_INTERNAL_BINARIES_DEPFILES) +endif + +ALL_TO_BE_DONE= \ + $(INTERNAL_LIBRARY_DEPFILES) \ + $(INTERNAL_BINARIES_DEPFILES) \ + $(INTERNAL_LIBRARY_TARGET_OFILES) \ + $(GENERIC_TARGET_LIBRARY) \ + $(INTERNAL_BINARIES_COMMON_TARGET_OFILES) \ + $(INTERNAL_BINARIES_TARGET_OENTRYPOINTS) \ + $(INTERNAL_TARGET_BINARIES) + +ifeq ($(GENERIC_TARGET_LIBRARY),) +ifeq ($(USE_DLL),yes) + ALL_TO_BE_DONE+=$(GENERIC_TARGET_BINARIES_DIR)/$(GENERIC_TARGET_BINARIES_PREFIX)$(DLL_ID).dll +endif +endif + +CREATE_TARGET_DIRECTORY=$(INTERNAL_MKDIR) $(@D) + +all: clean_log $(ALL_TO_BE_DONE) + +clean_log: + @rm -f $(GENERIC_BINARIES_TARGET_DIR)/$(INTERNAL_LOG_FILE) $(GENERIC_LIBRARY_TARGET_DIR)/$(INTERNAL_LOG_FILE) + +check: + @(cd $(GENERIC_LIBRARY_SOURCE_DIR) ; $(SDK_SOURCE_DIR)/Build/cvsstatus.sh $(SDK_SOURCE_DIR)/Build ADD) + +clean: + $(RM) $(ALL_TO_BE_DONE) $(_INTERNAL_LIBRARY_DEPFILES) $(_INTERNAL_BINARIES_DEPFILES) + +update: + +$(TWEAKED_PARROTOS_MAKEFILE): $(PARROTOS_MAKEFILE) + @$(CREATE_TARGET_DIRECTORY) + @echo "all:" >> $(TWEAKED_PARROTOS_MAKEFILE) + @cat $(PARROTOS_MAKEFILE) | grep -v "^[-]*include" | grep -v "^all:" | sed -e "s@^\([A-Z]*[=]*\)\([ \t]*\)\(/\)@\1\2@" | sed -e "s@^clean:@NOCLEAN:@" >> $(TWEAKED_PARROTOS_MAKEFILE) + +ifneq ("$(INTERNAL_LIBRARY_TARGET_OFILES)","") +$(GENERIC_TARGET_LIBRARY): $(INTERNAL_LIBRARY_TARGET_OFILES) + @$(CREATE_TARGET_DIRECTORY) + @$(INTERNAL_ECHO) "ar $(GENERIC_ARFLAGS)" $(subst $(GENERIC_LIBRARY_TARGET_DIR)/,,$@ $^) + @rm -f $@ + @$(INTERNAL_AR) $(GENERIC_ARFLAGS) $@ $^ +endif + +ifeq ($(USE_DLL),yes) +$(GENERIC_TARGET_BINARIES_DIR)/$(GENERIC_TARGET_BINARIES_PREFIX)$(DLL_ID).dll: $(INTERNAL_BINARIES_COMMON_TARGET_OFILES) $(GENERIC_ADD_OFILES) $(GENERIC_BINARIES_LIBS_DEPS) +else +$(GENERIC_TARGET_BINARIES_DIR)/$(GENERIC_TARGET_BINARIES_PREFIX)%: $(GENERIC_BINARIES_TARGET_DIR)/%.o $(INTERNAL_BINARIES_COMMON_TARGET_OFILES) $(GENERIC_ADD_OFILES) $(GENERIC_BINARIES_LIBS_DEPS) +endif + @$(CREATE_TARGET_DIRECTORY) + ifeq ($(QUIET_BUILD),yes) + ifeq ($(USE_NDS),yes) + @$(INTERNAL_ECHO) "dsbuild $(GENERIC_TARGET_BINARIES_PREFIX)$*.nds" + else + ifeq ($(USE_DLL),yes) + @$(INTERNAL_ECHO) "ld $(GENERIC_TARGET_BINARIES_PREFIX)$(DLL_ID).dll" + else + @$(INTERNAL_ECHO) "ld $(GENERIC_TARGET_BINARIES_PREFIX)$*" + endif + endif + endif + ifeq ($(USE_DLL),yes) + $(GENERIC_COMMAND_PREFIX)dlltool -e $(GENERIC_TARGET_BINARIES_DIR)/$(DLL_ID)_exports.o --export-all-symbols -l $(@:.dll=.lib) $(INTERNAL_BINARIES_COMMON_TARGET_OFILES) + $(INTERNAL_CC) --shared -o $@ $(INTERNAL_BINARIES_COMMON_TARGET_OFILES) $(GENERIC_TARGET_BINARIES_DIR)/$(DLL_ID)_exports.o $(GENERIC_ADD_OFILES) $(GENERIC_LIB_PATHS) $(GENERIC_LIBS) $(GENERIC_LDFLAGS) $(LDFLAGS_$(subst /,_,$*)) + $(RM) $(GENERIC_TARGET_BINARIES_DIR)/$(DLL_ID)_exports.o + else + $(INTERNAL_CC) -o $@ $(GENERIC_BINARIES_TARGET_DIR)/$*.o $(INTERNAL_BINARIES_COMMON_TARGET_OFILES) $(GENERIC_ADD_OFILES) $(GENERIC_LIB_PATHS) $(GENERIC_LIBS) $(GENERIC_LDFLAGS) $(LDFLAGS_$(subst /,_,$*)) + endif + ifeq ($(RELEASE_BUILD),yes) + cp $@ $(shell dirname $@)/sym_$(shell basename $@) + $(INTERNAL_STRIP) $@ + endif + ifeq ($(USE_NDS),yes) + $(INTERNAL_OBJCOPY) -O binary $@ $@.$(NDS_CPU_TYPE)$(NDS_CPU_NUM) + $(INTERNAL_NDSTOOL) -c $@.nds -$(NDS_CPU_NUM) $@.$(NDS_CPU_TYPE)$(NDS_CPU_NUM) $(SILENT) + $(INTERNAL_DSBUILD) $@.nds $(SILENT) + endif + +# Template build rules +# first param $(1) : rule type (LIBRARY or BINARIES) +# second param $(2) : source extension (.c for example) +define BUILD_OFILE_TEMPLATE + $$(GENERIC_$(1)_TARGET_DIR)/%$(2).d: $$(GENERIC_$(1)_SOURCE_DIR)/%$(2) + @$$(CREATE_TARGET_DIRECTORY) + ifeq ($$(QUIET_BUILD),yes) + @$$(INTERNAL_ECHO) "dep $$*$(2)" + endif + $$(INTERNAL_CC) -M $$(filter-out -Wall,$$(GENERIC_CFLAGS)) -w $$(CFLAGS_$$(subst /,_,$$*)) $$(GENERIC_INCLUDES) $$(GENERIC_$(1)_SOURCE_DIR)/$$*$(2) > $$@ +ifeq ($(USE_IPHONE),yes) + @sed -ie 's,\(.*\.o\)\([ :]*\),\1 $$@\2,g' $$@ +else + @sed -i 's,\(.*\.o\)\([ :]*\),\1 $$@\2,g' $$@ +endif + $$(GENERIC_$(1)_TARGET_DIR)/%.o: $$(GENERIC_$(1)_TARGET_DIR)/%$(2).d + @$$(CREATE_TARGET_DIRECTORY) + ifeq ($$(QUIET_BUILD),yes) + @$$(INTERNAL_ECHO) "cc $$*$(2)" + endif + @echo -E $$(INTERNAL_CC) $$(GENERIC_CFLAGS) $$(CFLAGS_$$(subst /,_,$$*)) $$(GENERIC_INCLUDES) -c -o $$@ $$(GENERIC_$(1)_SOURCE_DIR)/$$*$(2) >> $$(GENERIC_$(1)_TARGET_DIR)/$(INTERNAL_LOG_FILE) + $$(INTERNAL_CC) $$(GENERIC_CFLAGS) $$(CFLAGS_$$(subst /,_,$$*)) $$(GENERIC_INCLUDES) -c -o $$@ $$(GENERIC_$(1)_SOURCE_DIR)/$$*$(2) 2>&1 >> $$(GENERIC_$(1)_TARGET_DIR)/$(INTERNAL_LOG_FILE) + ifeq ("$$(USE_MEMPROT)","yes") + ifdef GENERIC_DOMAIN + ifeq ($$(QUIET_BUILD),yes) + @$$(INTERNAL_ECHO) "put_in_domain $$(GENERIC_DOMAIN) $$*.o" + @$$(PUT_IN_DOMAIN) $$(GENERIC_DOMAIN) $$@ + else + $$(PUT_IN_DOMAIN) $$(GENERIC_DOMAIN) $$@ + endif + else + ifeq ($$(QUIET_BUILD),yes) + @if [ ! -z $$(DOMAIN_$$(subst /,_,$$*)) ]; then \ + $$(INTERNAL_ECHO) "put_in_domain $$(DOMAIN_$$(subst /,_,$$*)) $$*.o"; \ + $$(PUT_IN_DOMAIN) $$(DOMAIN_$$(subst /,_,$$*)) $$@; \ + fi + else + @if [ ! -z $$(DOMAIN_$$(subst /,_,$$*)) ]; then \ + $$(INTERNAL_ECHO) $$(PUT_IN_DOMAIN) $$(DOMAIN_$$(subst /,_,$$*)) $$@; \ + $$(PUT_IN_DOMAIN) $$(DOMAIN_$$(subst /,_,$$*)) $$@; \ + fi + endif + endif + endif +endef + +# Build rules for each extension +$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),$(eval $(call BUILD_OFILE_TEMPLATE,LIBRARY,$(ext)))) +$(foreach ext,$(INTERNAL_SOURCE_EXTENSIONS),$(eval $(call BUILD_OFILE_TEMPLATE,BINARIES,$(ext)))) + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(MAKECMDGOALS),check) + -include $(INTERNAL_LIBRARY_DEPFILES) $(INTERNAL_BINARIES_DEPFILES) +endif +endif + diff --git a/ARDroneLib/VP_SDK/Build/lib.makefile b/ARDroneLib/VP_SDK/Build/lib.makefile new file mode 100644 index 0000000..a2cc52b --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/lib.makefile @@ -0,0 +1,25 @@ + +########################################################################################### +# +# Designed to build a library using generic.makefile, linked with Sdk +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +########################################################################################### + +include common.makefile + +GENERIC_LIBRARY_TARGET_DIR=$(LIB_TARGET_DIR) +GENERIC_TARGET_LIBRARY:=$(GENERIC_LIBRARY_TARGET_DIR)/$(GENERIC_TARGET_LIBRARY) + +export GENERIC_TARGET_LIBRARY +export GENERIC_LIBRARY_TARGET_DIR=$(LIB_TARGET_DIR) + +# Bug fix ... +export GENERIC_BINARIES_TARGET_DIR=$(GENERIC_LIBRARY_TARGET_DIR) + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/libplf.makefile b/ARDroneLib/VP_SDK/Build/libplf.makefile new file mode 100644 index 0000000..ecd69b4 --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/libplf.makefile @@ -0,0 +1,38 @@ + +########################################################################################### +# +# Designed to build plf library using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : sylvain.gaeremynck@parrot.com +# Date : 2009/06/09 +# +########################################################################################### + +include common.makefile + + +GENERIC_LIBRARY_TARGET_DIR=$(LIBPLF_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(GENERIC_LIBRARY_TARGET_DIR)/libplf.a + +GENERIC_LIBRARY_SOURCE_FILES= \ + lib_plf.c + +GENERIC_LIBRARY_SOURCE_DIR=$(LIBPLF_SOURCE_DIR) + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_LIBRARY_SOURCE_FILES + +# All that shall not be defined +######################## +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +export GENERIC_BINARIES_COMMON_SOURCE_FILES= + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/parrotOS_codec.makefile b/ARDroneLib/VP_SDK/Build/parrotOS_codec.makefile new file mode 100644 index 0000000..2d2c39b --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/parrotOS_codec.makefile @@ -0,0 +1,44 @@ + +########################################################################################### +# +# Designed to build ParrotOS Codec library using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : sylvain.gaeremynck@parrot.com +# Date : 2009/06/09 +# +########################################################################################### + +include common.makefile + + +GENERIC_LIBRARY_TARGET_DIR=$(PARROTOS_CODEC_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(GENERIC_LIBRARY_TARGET_DIR)/libparrotOS_codec.a + +# Check these defines against ParrotOs/codec/Makefile.global +GENERIC_CFLAGS+=-DPOS_LINUX +GENERIC_CFLAGS+=-D_XOPEN_SOURCE=600 +GENERIC_CFLAGS+=-DSUP_U32_IS_ATOMIC + +GENERIC_LIBRARY_SOURCE_FILES= \ + pal_codec.c + +GENERIC_LIBRARY_SOURCE_DIR=$(PARROTOS_CODEC_SOURCE_DIR) + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_LIBRARY_SOURCE_FILES + +# All that shall not be defined +######################## +export PARROTOS_MAKEFILE= +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +export GENERIC_BINARIES_COMMON_SOURCE_FILES= + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/parrotOS_core.makefile b/ARDroneLib/VP_SDK/Build/parrotOS_core.makefile new file mode 100644 index 0000000..e637011 --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/parrotOS_core.makefile @@ -0,0 +1,56 @@ + +########################################################################################### +# +# Designed to build ParrotOS Core library using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : sylvain.gaeremynck@parrot.com +# Date : 2009/06/09 +# +########################################################################################### + +include common.makefile + + +GENERIC_LIBRARY_TARGET_DIR=$(PARROTOS_CORE_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(GENERIC_LIBRARY_TARGET_DIR)/libparrotOS_core.a + +# Check these defines against ParrotOs/core/Makefile.linux.global +GENERIC_CFLAGS+=-DPOS_LINUX +GENERIC_CFLAGS+=-D_XOPEN_SOURCE=600 +GENERIC_CFLAGS+=-DSUP_U32_IS_ATOMIC + +GENERIC_LIBRARY_SOURCE_FILES= \ + posix/posix_alarm.c \ + posix/posix_cond.c \ + posix/posix_mutex.c \ + posix/posix_sem.c \ + posix/posix_thread.c \ + posix/posix_main.c \ + posix/posix_time.c \ + posix/posix_sys.c \ + generic/generic_flag.c \ + generic/generic_mbox2.c \ + generic/generic_diag.c \ + generic/generic_mbox.c + + +GENERIC_LIBRARY_SOURCE_DIR=$(PARROTOS_CORE_SOURCE_DIR) + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_LIBRARY_SOURCE_FILES + +# All that shall not be defined +######################## +export PARROTOS_MAKEFILE= +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +export GENERIC_BINARIES_COMMON_SOURCE_FILES= + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/parrotOS_devs.makefile b/ARDroneLib/VP_SDK/Build/parrotOS_devs.makefile new file mode 100644 index 0000000..bccdeef --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/parrotOS_devs.makefile @@ -0,0 +1,45 @@ + +########################################################################################### +# +# Designed to build ParrotOS Device library using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : sylvain.gaeremynck@parrot.com +# Date : 2009/06/09 +# +########################################################################################### + +include common.makefile + + +GENERIC_LIBRARY_TARGET_DIR=$(PARROTOS_DEVS_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(GENERIC_LIBRARY_TARGET_DIR)/libparrotOS_devs.a + +# Check these defines against ParrotOs/devs/Makefile.global +GENERIC_CFLAGS+=-DPOS_LINUX +GENERIC_CFLAGS+=-D_XOPEN_SOURCE=600 +GENERIC_CFLAGS+=-DSUP_U32_IS_ATOMIC + +GENERIC_LIBRARY_SOURCE_FILES= \ + i2c/p6mu_adc.c \ + i2c/p6mu_codec.c + +GENERIC_LIBRARY_SOURCE_DIR=$(PARROTOS_DEVS_SOURCE_DIR) + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_LIBRARY_SOURCE_FILES + +# All that shall not be defined +######################## +export PARROTOS_MAKEFILE= +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +export GENERIC_BINARIES_COMMON_SOURCE_FILES= + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/parrotOS_drivers.makefile b/ARDroneLib/VP_SDK/Build/parrotOS_drivers.makefile new file mode 100644 index 0000000..fbd2960 --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/parrotOS_drivers.makefile @@ -0,0 +1,47 @@ + +########################################################################################### +# +# Designed to build ParrotOS Core library using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : sylvain.gaeremynck@parrot.com +# Date : 2009/06/09 +# +########################################################################################### + +include common.makefile + + +GENERIC_LIBRARY_TARGET_DIR=$(PARROTOS_DRIVERS_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(GENERIC_LIBRARY_TARGET_DIR)/libparrotOS_drivers.a + +# Check these defines against ParrotOs/core/Makefile.linux.global +GENERIC_CFLAGS+=-DPOS_LINUX +GENERIC_CFLAGS+=-D_XOPEN_SOURCE=600 +GENERIC_CFLAGS+=-DSUP_U32_IS_ATOMIC + +GENERIC_LIBRARY_SOURCE_FILES= \ + linux/gpio.c \ + linux/pwm.c \ + linux/button.c \ + linux/i2c.c + +GENERIC_LIBRARY_SOURCE_DIR=$(PARROTOS_DRIVERS_SOURCE_DIR) + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_LIBRARY_SOURCE_FILES + +# All that shall not be defined +######################## +export PARROTOS_MAKEFILE= +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +export GENERIC_BINARIES_COMMON_SOURCE_FILES= + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/parrotOS_utils.makefile b/ARDroneLib/VP_SDK/Build/parrotOS_utils.makefile new file mode 100644 index 0000000..62b4e11 --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/parrotOS_utils.makefile @@ -0,0 +1,55 @@ + +########################################################################################### +# +# Designed to build ParrotOS Utils library using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : sylvain.gaeremynck@parrot.com +# Date : 2009/06/09 +# +########################################################################################### + +include common.makefile + + +GENERIC_LIBRARY_TARGET_DIR=$(PARROTOS_UTILS_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(GENERIC_LIBRARY_TARGET_DIR)/libparrotOS_utils.a + +# Check these defines against ParrotOs/utils/Makefile.global +GENERIC_CFLAGS+=-DPOS_LINUX +GENERIC_CFLAGS+=-D_XOPEN_SOURCE=600 +GENERIC_CFLAGS+=-DSUP_U32_IS_ATOMIC + +GENERIC_LIBRARY_SOURCE_FILES= \ +packstr2.c \ +supervis.c \ +timers.c \ +uart.c \ +uart_rt.c \ +strlcat.c \ +strlcpy.c \ +strnlen.c \ +uart_rt_usb_rec.c \ +crc.c \ +RemoteUI.c + + +GENERIC_LIBRARY_SOURCE_DIR=$(PARROTOS_UTILS_SOURCE_DIR) + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_LIBRARY_SOURCE_FILES + +# All that shall not be defined +######################## +export PARROTOS_MAKEFILE= +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +export GENERIC_BINARIES_COMMON_SOURCE_FILES= + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/sdk.makefile b/ARDroneLib/VP_SDK/Build/sdk.makefile new file mode 100644 index 0000000..526a7d6 --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/sdk.makefile @@ -0,0 +1,267 @@ + +########################################################################################### +# +# Designed to build Sdk using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +########################################################################################### + +include common.makefile + +GENERIC_LIBRARY_TARGET_DIR=$(SDK_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(SDK_TARGET_DIR)/libsdk.a + +GENERIC_LIBRARY_SOURCE_FILES= \ + $(OS_PATH)/vp_os_malloc.c \ + $(OS_PATH)/vp_os_error_handling.c \ + $(API_PATH)/vp_api.c \ + $(API_PATH)/vp_api_error.c \ + $(API_PATH)/vp_api_io_multi_stage.c \ + $(API_PATH)/vp_api_stage.c \ + $(API_PATH)/vp_api_supervisor.c \ + $(API_PATH)/vp_api_thread_helper.c \ + $(STAGES_PATH)/vp_stages_frame_pipe.c \ + $(STAGES_PATH)/vp_stages_configs.c \ + $(STAGES_PATH)/vp_stages_io_buffer.c \ + $(STAGES_PATH)/vp_stages_io_console.c \ + $(STAGES_PATH)/vp_stages_io_file.c \ + $(STAGES_PATH)/vp_stages_yuv2rgb.c \ + $(STAGES_PATH)/vp_stages_io_com.c \ + $(STAGES_PATH)/vp_stages_buffer_to_picture.c \ + $(ATCODEC_PATH)/ATcodec_Memory.c \ + $(ATCODEC_PATH)/ATcodec_Buffer.c \ + $(ATCODEC_PATH)/ATcodec_Sorted_List.c \ + $(ATCODEC_PATH)/ATcodec.c \ + $(ATCODEC_PATH)/ATcodec_Tree.c \ + $(ATCODEC_PATH)/ATcodec_api.c \ + $(COM_PATH)/$(OS)/vp_com.c \ + $(COM_PATH)/vp_com_error.c + +ifeq ($(USE_PARROTOS_CORE),yes) +GENERIC_LIBRARY_SOURCE_FILES+= \ + $(OS_PATH)/parrotos/vp_os_signal.c \ + $(OS_PATH)/parrotos/vp_os_delay.c \ + $(OS_PATH)/parrotos/vp_os_thread.c +else +GENERIC_LIBRARY_SOURCE_FILES+= \ + $(OS_PATH)/$(OS)/vp_os_signal.c \ + $(OS_PATH)/$(OS)/vp_os_delay.c \ + $(OS_PATH)/$(OS)/vp_os_thread.c +endif + +ifneq ($(USE_ANDROID),yes) +ifneq ($(USE_ELINUX),yes) +ifneq ($(USE_MINGW32),yes) +ifneq ($(USE_IPHONE),yes) + GENERIC_LIBRARY_SOURCE_FILES+= \ + $(STAGES_PATH)/vp_stages_o_sdl.c +endif +endif +endif +endif + +#ifneq ($(USE_MINGW32),yes) +ifneq ($(USE_ANDROID),yes) +ifneq ($(USE_NDS),yes) +ifneq ($(USE_IPHONE),yes) + GENERIC_LIBRARY_SOURCE_FILES+= \ + $(COM_PATH)/$(OS)/vp_com_serial.c +endif +endif +endif +#endif + +ifeq ($(USE_ELINUX),yes) + GENERIC_LIBRARY_SOURCE_FILES += \ + $(OS_PATH)/$(OS)/vp_os_ltt.c +endif + +ifneq ($(NO_COM),yes) + +# Com Linux source files +######################## + +ifneq ($(USE_MINGW32),yes) + +ifeq ($(USE_ELINUX),yes) + BUILD_COM_BASE:=yes + ifeq ($(USE_WIFI),yes) + GENERIC_LIBRARY_SOURCE_FILES += \ + $(COM_PATH)/elinux/vp_com_wifi.c \ + $(COM_PATH)/elinux/vp_com_wlc.c \ + $(COM_PATH)/elinux/vp_com_interface.c + endif +endif + +ifeq ($(USE_LINUX),yes) + BUILD_COM_BASE:=yes +ifeq ($(USE_WIFI),yes) + GENERIC_LIBRARY_SOURCE_FILES += \ + $(COM_PATH)/linux/vp_com_wifi.c +endif +endif + +ifeq ($(USE_ANDROID),yes) + BUILD_COM_BASE:=yes +ifeq ($(USE_WIFI),yes) + GENERIC_LIBRARY_SOURCE_FILES += \ + $(COM_PATH)/linux/vp_com_wifi.c +endif +endif + +ifeq ($(USE_IPHONE),yes) + BUILD_COM_BASE:=yes +ifeq ($(USE_WIFI),yes) + GENERIC_LIBRARY_SOURCE_FILES += \ + $(COM_PATH)/linux/vp_com_wifi.c +endif +endif + +ifeq ($(BUILD_COM_BASE),yes) + GENERIC_LIBRARY_SOURCE_FILES += \ + $(COM_PATH)/linux/vp_com_wired.c \ + $(COM_PATH)/vp_com_socket.c \ + $(COM_PATH)/vp_com_socket_utils.c \ + $(COM_PATH)/linux/vp_com_config_itf.c +endif +ifeq ($(USE_BLUEZ),yes) + GENERIC_LIBRARY_SOURCE_FILES += \ + $(COM_PATH)/linux/bluez.c \ + $(COM_PATH)/linux/vp_com_bluetooth.c +endif +else + GENERIC_LIBRARY_SOURCE_FILES += \ + $(COM_PATH)/vp_com_socket.c \ + $(COM_PATH)/vp_com_socket_utils.c +endif + +endif + + + +GENERIC_BINARIES_COMMON_SOURCE_FILES= \ + $(EXAMPLES_PATH)/common/common.c + +ifneq ($(USE_NDS),yes) + GENERIC_BINARIES_COMMON_SOURCE_FILES+= \ + $(EXAMPLES_PATH)/common/atcodec_server.c +endif +GENERIC_BINARIES_COMMON_SOURCE_FILES+= \ + $(EXAMPLES_PATH)/common/atcodec_client.c + +GENERIC_BINARIES_TARGET_DIR=$(GENERIC_LIBRARY_TARGET_DIR) + +GENERIC_BINARIES_SOURCE_DIR=$(SDK_SOURCE_DIR) +GENERIC_LIBRARY_SOURCE_DIR=$(SDK_SOURCE_DIR) + +GENERIC_TARGET_BINARIES_PREFIX:=Build/$(BUILD_MODE)_$(GENERIC_TARGET_BINARIES_PREFIX)$(GCC_ID)_ +GENERIC_TARGET_BINARIES_DIR=$(SDK_SOURCE_DIR) + +define FILTER_OUT_PATTERN + $(2):=$$(shell for i in $$($(2)) ; do echo $$$$i ; done | grep -v $(1)) +endef + +ifeq ($(USE_ELINUX),yes) + GENERIC_BINARIES_SOURCE_ENTRYPOINTS= \ + $(EXAMPLES_PATH)/$(OS)/api_ifile_upper_ofile.c \ + $(EXAMPLES_PATH)/$(OS)/api_serial_ofile.c \ + $(EXAMPLES_PATH)/$(OS)/atcodec_sorted_list.c \ + $(EXAMPLES_PATH)/$(OS)/api_threads.c \ + $(EXAMPLES_PATH)/$(OS)/atcodec_server.c \ + $(EXAMPLES_PATH)/$(OS)/atcodec_client.c \ + $(EXAMPLES_PATH)/$(OS)/api_v4l_raw_ethernet.c \ + $(EXAMPLES_PATH)/$(OS)/api_v4l_vlib_ethernet.c + ifeq ($(USE_CAMIF),yes) + endif + ifeq ($(USE_WIFI),yes) + GENERIC_BINARIES_SOURCE_ENTRYPOINTS+= \ + $(EXAMPLES_PATH)/$(OS)/api_wifiClientTCP_console.c + endif + +else + ifeq ($(USE_NDS),yes) + GENERIC_BINARIES_SOURCE_ENTRYPOINTS= \ + $(EXAMPLES_PATH)/$(OS)/hello_world.c \ + $(EXAMPLES_PATH)/$(OS)/atcodec_client.c + + else + ifeq ($(USE_MJPEG),yes) + GENERIC_BINARIES_SOURCE_ENTRYPOINTS+= \ + $(EXAMPLES_PATH)/$(OS)/api_encode_decode.c + endif + GENERIC_BINARIES_SOURCE_ENTRYPOINTS+= \ + $(EXAMPLES_PATH)/$(OS)/api_ethernet_raw_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_ethernet_vlib_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_ifile_raw_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_ifile_MJPEG_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_serial_MJPEG_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_serial_raw_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_serial_decoder_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_wifiClientTCP_raw_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_bluetoothClientTCP_decoder_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_wifiClientTCP_decoder_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_wifiClientTCP_MJPEG_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_bluetoothClientTCP_raw_sdl.c \ + $(EXAMPLES_PATH)/$(OS)/api_BTclientTCP_MJPEG_sdl.c + endif +endif + +ifeq ($(NO_COM),yes) + $(eval $(call FILTER_OUT_PATTERN,bluetooth,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) + $(eval $(call FILTER_OUT_PATTERN,wifi,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) + $(eval $(call FILTER_OUT_PATTERN,videoEncoder,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) +endif +ifneq ($(USE_MJPEG),yes) +ifneq ($(USE_FFMPEG),yes) + $(eval $(call FILTER_OUT_PATTERN,videoEncoder,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) + $(eval $(call FILTER_OUT_PATTERN,encoder,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) + $(eval $(call FILTER_OUT_PATTERN,decoder,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) + $(eval $(call FILTER_OUT_PATTERN,video_tracker,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) +endif +endif +ifneq ($(USE_VLIB),yes) + $(eval $(call FILTER_OUT_PATTERN,vlib,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) +endif +ifneq ($(USE_MJPEG),yes) + $(eval $(call FILTER_OUT_PATTERN,MJPEG,GENERIC_BINARIES_SOURCE_ENTRYPOINTS)) +endif + + +ifeq ($(USE_APP),yes) + GENERIC_BINARIES_COMMON_SOURCE_FILES= + GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +endif +ifeq ($(USE_DLL),yes) + GENERIC_BINARIES_COMMON_SOURCE_FILES= + GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +endif +ifeq ($(NO_EXAMPLES),yes) + GENERIC_BINARIES_COMMON_SOURCE_FILES= + GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +endif + + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_ADD_OFILES +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_FILES +export GENERIC_BINARIES_SOURCE_DIR +export GENERIC_BINARIES_COMMON_SOURCE_FILES +export GENERIC_BINARIES_TARGET_DIR +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_TARGET_BINARIES_PREFIX +export GENERIC_TARGET_BINARIES_DIR +export GENERIC_LIB_PATHS +export GENERIC_LIBS +export GENERIC_BINARIES_LIBS_DEPS +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS + + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile PARROTOS_MAKEFILE= $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Build/sysvar.makefile b/ARDroneLib/VP_SDK/Build/sysvar.makefile new file mode 100644 index 0000000..6471cee --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/sysvar.makefile @@ -0,0 +1,378 @@ + +########################################################################################### +# +# Creates needed build system variables +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +# Included from global Makefile +# +########################################################################################### + +ifndef ALL_TARGETS +export ALL_TARGETS=../../Soft/Build/targets_versions +endif + +ifeq ($(MAKECMDGOALS),check) + export QUIET_BUILD=no + export MAKEFLAGS=--no-print-directory +endif + +ifeq ($(QUIET_BUILD),yes) + export MAKEFLAGS=-s --no-print-directory + GENERIC_COMMAND_PREFIX:=@$(GENERIC_COMMAND_PREFIX) + RM=@rm -rfv +else + RM=rm -rf +endif + + +ifeq "$(RELEASE_BUILD)" "yes" + BUILD_MODE=PROD_MODE +endif +ifeq "$(RELEASE_BUILD)" "no" + BUILD_MODE=DEBUG_MODE +endif + + +ifeq ($(USE_NDS),yes) + export DEVKITARM=/usr/local/devkitARM-eabi_release_21/devkitARM + export DEVKITPRO=$(DEVKITARM) + OS_TARGET_ID=nds_$(NDS_CPU) + GNUTOOLS_PATH=$(DEVKITARM)/bin + GENERIC_COMMAND_PREFIX=$(GNUTOOLS_PATH)/arm-eabi- + ifeq ($(wildcard $(GNUTOOLS_PATH)),) + $(error ERROR Bad GNUTOOLS_PATH [ $(GNUTOOLS_PATH) does not exist ]) + endif + ifeq ($(wildcard $(GENERIC_COMMAND_PREFIX)gcc),) + $(error ERROR Bad GENERIC_COMMAND_PREFIX [ $(GENERIC_COMMAND_PREFIX)gcc does not exist ]) + endif +else + ifeq ($(USE_MINGW32),yes) + OS_TARGET_ID=mingw32_gtk+-2.14.7 + GENERIC_COMMAND_PREFIX=i586-mingw32msvc- + ifeq ($(shell which $(GENERIC_COMMAND_PREFIX)gcc 2> /dev/null),) + $(error ERROR You need Minimalist GNU Win32 cross compiler. (under Debian: apt-get install mingw32)) + endif + else + ifeq ($(USE_ELINUX),yes) + OS_TARGET_ID=eLinux + TOOLCHAIN_PATH=/opt/$(TOOLCHAIN_VERSION)/bin + ifeq ($(TOOLCHAIN_VERSION),arm-eglibc) + GENERIC_COMMAND_PREFIX=$(TOOLCHAIN_PATH)/arm-none-linux-gnueabi- + else + ifeq ($(TOOLCHAIN_VERSION),arm-2010.09) + GENERIC_COMMAND_PREFIX=$(TOOLCHAIN_PATH)/arm-none-linux-gnueabi- + else + ifeq ($(TOOLCHAIN_VERSION),arm-uclibc) + GENERIC_COMMAND_PREFIX=$(TOOLCHAIN_PATH)/arm-linux-uclibcgnueabi- + else + $(error ERROR Unsupported toolchain.) + endif + endif + endif + else + ifeq ($(USE_IPHONE),yes) + OS_TARGET_ID=$(IPHONE_PLATFORM) + OS_TARGET_NAME:=$(OS_TARGET_ID) + OS_TARGET_NAME:=$(shell echo "$(OS_TARGET_NAME)" | sed -e "s/iphone/iPhone/g") + OS_TARGET_NAME:=$(shell echo "$(OS_TARGET_NAME)" | sed -e "s/os/OS/g") + OS_TARGET_NAME:=$(shell echo "$(OS_TARGET_NAME)" | sed -e "s/simulator/Simulator/g") + TOOLCHAIN_PATH=/Developer/Platforms/$(OS_TARGET_NAME).platform/Developer/usr/bin + GENERIC_COMMAND_PREFIX=$(TOOLCHAIN_PATH)/ + else + OS_TARGET_ID=$(shell uname -sor | sed -e "s/[ \/]/_/g") + ifeq ($(USE_ANDROID),yes) + TOOLCHAIN_PATH=$(NDK_PATH)/build/prebuilt/linux-x86/$(TOOLCHAIN_VERSION)/bin + GENERIC_COMMAND_PREFIX=$(TOOLCHAIN_PATH)/arm-eabi- + else + GENERIC_COMMAND_PREFIX= + endif + endif + endif + endif +endif + +GCC_VERSION=$(shell $(GENERIC_COMMAND_PREFIX)gcc -v 2>&1 | grep --color=never version | grep -v [cC]onfigur | sed -e "s/\(^version gcc \)\([^ ]*\)\(.*\)/\2/" | sed -e "s/\(^gcc version \)\([^ ]*\)\(.*\)/\2/") + +ifeq ($(USE_NDS),no) +ifeq ($(USE_MINGW32),no) +ifeq ($(USE_ELINUX), no) + ifneq ($(GCC_VERSION),4.3.3) +# $(error GCC version not supported) + endif +endif +endif +endif + +GCC_ID:=$(subst $(GNUTOOLS_PATH)/,,$(GENERIC_COMMAND_PREFIX))gcc_$(GCC_VERSION) + +ifneq ($(NO_COM),yes) + ifeq ($(USE_BLUEZ),yes) + COM_TARGET_ID=libbluetooth3 + COM_TARGET_ID:=$(COM_TARGET_ID)_$(shell apt-cache show libbluetooth-dev | grep "^Version" | cut -d" " -f2 | head -n 1) + COM_TARGET_ID:=$(COM_TARGET_ID)_libiw + COM_TARGET_ID:=$(COM_TARGET_ID)_$(shell apt-cache show libiw-dev | grep "^Version" | cut -d" " -f2 | head -n 1) + endif +endif + +ifeq ($(USE_BONJOUR),yes) + BONJOUR_TARGET_ID:=bonjour_$(BONJOUR_VERSION) + COM_TARGET_ID:=$(COM_TARGET_ID)_$(BONJOUR_TARGET_ID) +endif + +ARCH_TARGET_ID=$(ARDRONE_TARGET_ARCH) +PARROTOS_CORE_TARGET_ID:=parrotOS_core_$(COMMONSOFT_VERSION) +PARROTOS_UTILS_TARGET_ID:=parrotOS_utils_$(COMMONSOFT_VERSION) +PARROTOS_DRIVERS_TARGET_ID:=parrotOS_drivers_$(COMMONSOFT_VERSION) +PARROTOS_DEVS_TARGET_ID:=parrotOS_devs_$(COMMONSOFT_VERSION) +PARROTOS_CODEC_TARGET_ID:=parrotOS_codec_$(COMMONSOFT_VERSION) +LIBPLF_TARGET_ID:=libplf_$(COMMONSOFT_VERSION) + +ifeq ($(USE_ARDRONELIB),yes) + ARDRONELIB_TARGET_ID=ardrone_lib_$(BUILD_MODE) +endif + +ifeq ($(USE_ARDRONE_VISION),yes) + ARDRONE_VISION_TARGET_ID=vision_lib_$(BUILD_MODE) +endif + +ifeq ($(USE_ARDRONE_POLARIS),yes) + ARDRONE_POLARIS_TARGET_ID=polaris_lib_$(BUILD_MODE) +endif + +ifeq ($(USE_ARDRONE_VICON),yes) + ARDRONE_VICON_TARGET_ID=vicon_lib_$(BUILD_MODE) +endif + +ifeq ($(USE_ARDRONE_TEST_BENCHS),yes) + ARDRONE_TEST_BENCHS_TARGET_ID=test_benchs_lib_$(BUILD_MODE) +endif + +ifeq ($(USE_ARDRONE_CALIBRATION),yes) + ARDRONE_CALIBRATION_TARGET_ID=calibration_lib_$(BUILD_MODE) +endif + +ifeq ($(USE_SDK),yes) + SDK_TARGET_ID=sdk_$(BUILD_MODE) +endif +ifeq ($(USE_APP),yes) + APP_TARGET_ID:=$(APP_ID)_$(BUILD_MODE) +endif +ifeq ($(USE_DLL),yes) + DLL_TARGET_ID:=$(DLL_ID)_$(BUILD_MODE) +endif +ifeq ($(USE_LIB),yes) + LIB_TARGET_ID:=$(LIB_ID)_$(BUILD_MODE) +endif + +ifeq ($(USE_FFMPEG),yes) + CODEC_TARGET_ID=ffmpeg_$(FF_ARCH) +else +ifeq ($(USE_MJPEG),yes) + CODEC_TARGET_ID=mjpeg +endif +ifeq ($(USE_VLIB),yes) + CODEC_TARGET_ID=vlib +endif +endif + +ifeq ($(USE_ARDRONELIB),yes) +ifneq ($(COM_TARGET_ID),) + ARDRONELIB_TARGET_ID:=$(ARDRONELIB_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + ARDRONELIB_TARGET_ID:=$(ARDRONELIB_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + ARDRONELIB_TARGET_ID:=$(ARDRONELIB_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_ARDRONE_VISION),yes) +ifneq ($(COM_TARGET_ID),) + ARDRONE_VISION_TARGET_ID:=$(ARDRONE_VISION_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + ARDRONE_VISION_TARGET_ID:=$(ARDRONE_VISION_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + ARDRONE_VISION_TARGET_ID:=$(ARDRONE_VISION_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_ARDRONE_POLARIS),yes) +ifneq ($(COM_TARGET_ID),) + ARDRONE_POLARIS_TARGET_ID:=$(ARDRONE_POLARIS_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + ARDRONE_POLARIS_TARGET_ID:=$(ARDRONE_POLARIS_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + ARDRONE_POLARIS_TARGET_ID:=$(ARDRONE_POLARIS_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_ARDRONE_VICON),yes) +ifneq ($(COM_TARGET_ID),) + ARDRONE_VICON_TARGET_ID:=$(ARDRONE_VICON_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + ARDRONE_VICON_TARGET_ID:=$(ARDRONE_VICON_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + ARDRONE_VICON_TARGET_ID:=$(ARDRONE_VICON_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_ARDRONE_TEST_BENCHS),yes) +ifneq ($(COM_TARGET_ID),) + ARDRONE_TEST_BENCHS_TARGET_ID:=$(ARDRONE_TEST_BENCHS_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + ARDRONE_TEST_BENCHS_TARGET_ID:=$(ARDRONE_TEST_BENCHS_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + ARDRONE_TEST_BENCHS_TARGET_ID:=$(ARDRONE_TEST_BENCHS_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_ARDRONE_CALIBRATION),yes) +ifneq ($(COM_TARGET_ID),) + ARDRONE_CALIBRATION_TARGET_ID:=$(ARDRONE_CALIBRATION_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + ARDRONE_CALIBRATION_TARGET_ID:=$(ARDRONE_CALIBRATION_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + ARDRONE_CALIBRATION_TARGET_ID:=$(ARDRONE_CALIBRATION_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_JPEG),yes) + JPEG_TARGET_ID=jpeg-6b_$(BUILD_MODE) +endif + +ifeq ($(USE_SDK),yes) +ifneq ($(COM_TARGET_ID),) + SDK_TARGET_ID:=$(SDK_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + SDK_TARGET_ID:=$(SDK_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + SDK_TARGET_ID:=$(SDK_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_APP),yes) +ifneq ($(COM_TARGET_ID),) + APP_TARGET_ID:=$(APP_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + APP_TARGET_ID:=$(APP_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + APP_TARGET_ID:=$(APP_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifeq ($(USE_LIB),yes) +ifneq ($(COM_TARGET_ID),) + LIB_TARGET_ID:=$(LIB_TARGET_ID)_$(COM_TARGET_ID) +endif +ifneq ($(CODEC_TARGET_ID),) + LIB_TARGET_ID:=$(LIB_TARGET_ID)_$(CODEC_TARGET_ID) +endif +ifneq ($(ARCH_TARGET_ID),) + LIB_TARGET_ID:=$(LIB_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifneq ($(CODEC_TARGET_ID),) + CODEC_TARGET_ID:=$(CODEC_TARGET_ID)_$(BUILD_MODE) +ifneq ($(ARCH_TARGET_ID),) + CODEC_TARGET_ID:=$(CODEC_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif +ifneq ($(COM_TARGET_ID),) + COM_TARGET_ID:=$(COM_TARGET_ID)_$(BUILD_MODE) +ifneq ($(ARCH_TARGET_ID),) + COM_TARGET_ID:=$(COM_TARGET_ID)_$(ARCH_TARGET_ID) +endif +endif + +ifneq ($(BONJOUR_TARGET_ID),) + BONJOUR_TARGET_ID:=$(BONJOUR_TARGET_ID)_$(BUILD_MODE)_$(_COM_TARGET_ID_) +endif + +define ADD_OS_TARGET_ID + ifneq ($(1),OS) + $(1)_TARGET_ID:=$$($(1)_TARGET_ID)_$$(OS_TARGET_ID) + endif +endef + +define FINALIZE_TARGET_ID + ifneq ($$($(1)_TARGET_ID),) + $(1)_TARGET_ID:=$$($(1)_TARGET_ID)_$$(GCC_ID) + $(1)_TARGET_DIR:=$$(ALL_TARGETS)/$$($(1)_TARGET_ID) + endif + export $(1)_TARGET_DIR +endef + +TARGET_IDS:=OS APP DLL LIB SDK COM CODEC JPEG BONJOUR PARROTOS_CORE PARROTOS_UTILS PARROTOS_DRIVERS PARROTOS_DEVS PARROTOS_CODEC LIBPLF ARDRONE_VISION ARDRONE_POLARIS ARDRONE_TEST_BENCHS ARDRONE_CALIBRATION ARDRONELIB ARDRONE_VICON + +$(foreach id,$(filter-out OS,$(TARGET_IDS)),$(eval $(call ADD_OS_TARGET_ID,$(id)))) +$(foreach id,$(TARGET_IDS),$(eval $(call FINALIZE_TARGET_ID,$(id)))) + + +ifeq ($(USE_NDS),yes) + ifeq ($(NDS_CPU),ARM7) + TARGET_CPU_ARM=1 + TARGET_CPU_X86=0 + endif + ifeq ($(NDS_CPU),ARM9) + TARGET_CPU_ARM=1 + TARGET_CPU_X86=0 + endif +else + ifeq ($(USE_ANDROID),yes) + TARGET_CPU_ARM=1 + TARGET_CPU_X86=0 + else + ifeq ($(USE_ELINUX),yes) + TARGET_CPU_ARM=1 + TARGET_CPU_X86=0 + else + ifeq ($(USE_IPHONE),yes) + ifeq ($(IPHONE_PLATFORM),iphoneos) + TARGET_CPU_ARM=1 + TARGET_CPU_X86=0 + else + TARGET_CPU_ARM=0 + TARGET_CPU_X86=1 + endif + else + TARGET_CPU_ARM=0 + TARGET_CPU_X86=1 + endif + endif + endif +endif + +# All that needs to be exported +######################## + +export MAKE +export RM + +export GENERIC_COMMAND_PREFIX +export GNUTOOLS_PATH +export GCC_ID + +export BUILD_MODE + +export TARGET_CPU_ARM +export TARGET_CPU_X86 + diff --git a/ARDroneLib/VP_SDK/Build/varcontrol.makefile b/ARDroneLib/VP_SDK/Build/varcontrol.makefile new file mode 100644 index 0000000..8bae78b --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/varcontrol.makefile @@ -0,0 +1,236 @@ + +########################################################################################### +# +# Controls validity of variables values +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2007/05/16 +# +# Included from global Makefile +# +########################################################################################### + +# +# Control macros +################################################### + +define EXIT_IF_ERROR + ifeq "$$(ERROR)" "1" + $$(error There has been some errors) + endif +endef + +define CHECK_DEFINITION + ifndef $(1) + $$(warning ERROR : $(1) undefined $(2)) + ERROR=1 + endif +endef + +define CHECK_YES_NO + ifneq "$$($(1))" "yes" + ifneq "$$($(1))" "no" + $$(warning ERROR : $(1) must be set to "yes" or "no") + ERROR=1 + endif + endif +endef + +define CHECK_VALUE + ifneq "$$($(1))" "$(2)" + $$(warning ERROR : $(1) must be set to "$(2)" when $(3)) + ERROR=1 + endif +endef + +define CHECK_TWO_VALUES + ifneq "$$($(1))" "$(2)" + ifneq "$$($(1))" "$(3)" + $$(warning ERROR : $(1) must be set to "$(2)" or "$(3)" when $(4)) + ERROR=1 + endif + endif +endef + +define CHECK_DIR + ifeq ($$(wildcard $(1)),) + $$(warning ERROR Bad $(2) : "$$($(2))" [ $(1) does not exist ]) + ERROR=1 + endif +endef + +# +# All that need to be defined +################################################### + +ifeq "$(USE_ELINUX)" "yes" +$(eval $(call CHECK_DEFINITION,ALL_SOURCES,: should be defined as an environment variable.)) +$(eval $(call CHECK_DEFINITION,ALL_TARGETS,: should be defined as an environment variable.)) +$(eval $(call CHECK_DEFINITION,LINUX_CONFIG_PATH,: should be defined as an environment variable.)) +endif +$(eval $(call CHECK_DEFINITION,USE_ANDROID,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_LINUX,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_ELINUX,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_NDS,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_IPHONE,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,NO_COM,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_BLUEZ,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_VLIB,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,RELEASE_BUILD,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_SDK,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,USE_APP,: should be "yes" or "no")) +$(eval $(call CHECK_DEFINITION,NO_EXAMPLES,: should be "yes" or "no")) +# +#ifeq "$(USE_SDK)" "yes" +# $(eval $(call CHECK_DEFINITION,SDK_VERSION,( example : "head" ))) +#endif + +ifeq "$(USE_ELINUX)" "yes" + $(eval $(call CHECK_DEFINITION,TOOLCHAIN_VERSION,( example : "arm-uclibc" ))) + $(eval $(call CHECK_DEFINITION,USE_PARROTOS_CORE,: should be "yes" or "no")) +endif + +ifeq "$(USE_NDS)" "yes" + $(eval $(call CHECK_DEFINITION,NDS_CPU,: should be "ARM7" or "ARM9")) +endif + +ifeq "$(USE_BONJOUR)" "yes" + $(eval $(call CHECK_DEFINITION,BONJOUR_VERSION,( example : "head" ))) +endif + +$(eval $(call EXIT_IF_ERROR)) + +ifeq "$(USE_APP)" "yes" +ifndef PARROTOS_MAKEFILE + $(eval $(call CHECK_DEFINITION,GENERIC_BINARIES_SOURCE_DIR,)) + $(eval $(call CHECK_DEFINITION,GENERIC_BINARIES_SOURCE_DIR,)) + $(eval $(call CHECK_DEFINITION,GENERIC_TARGET_BINARIES_DIR,)) + $(eval $(call CHECK_DEFINITION,GENERIC_BINARIES_SOURCE_ENTRYPOINTS,)) +endif +endif + +# +# Validity test +################################################### +$(eval $(call CHECK_YES_NO,USE_ANDROID)) +$(eval $(call CHECK_YES_NO,USE_LINUX)) +$(eval $(call CHECK_YES_NO,USE_ELINUX)) +$(eval $(call CHECK_YES_NO,USE_NDS)) +$(eval $(call CHECK_YES_NO,USE_IPHONE)) + +$(eval $(call CHECK_YES_NO,NO_COM)) +$(eval $(call CHECK_YES_NO,USE_BLUEZ)) +$(eval $(call CHECK_YES_NO,USE_SDK)) +$(eval $(call CHECK_YES_NO,USE_APP)) +$(eval $(call CHECK_YES_NO,USE_VLIB)) +$(eval $(call CHECK_YES_NO,NO_EXAMPLES)) +$(eval $(call CHECK_YES_NO,RELEASE_BUILD)) +$(eval $(call CHECK_YES_NO,USE_ARDRONELIB)) +$(eval $(call CHECK_YES_NO,USE_ARDRONE_VISION)) +$(eval $(call CHECK_YES_NO,USE_ARDRONE_POLARIS)) +$(eval $(call CHECK_YES_NO,USE_ARDRONE_VICON)) +$(eval $(call CHECK_YES_NO,USE_ARDRONE_TEST_BENCHS)) +$(eval $(call CHECK_YES_NO,USE_ARDRONE_CALIBRATION)) + +ifeq "$(USE_ELINUX)" "yes" + $(eval $(call CHECK_YES_NO,USE_PARROTOS_CORE)) + ifneq "$(TOOLCHAIN_VERSION)" "arm-uclibc" + ifneq "$(TOOLCHAIN_VERSION)" "arm-eglibc" + ifneq "$(TOOLCHAIN_VERSION)" "arm-2010.09" + $(warning ERROR Bad TOOLCHAIN_VERSION : must be "arm-uclibc", "arm-eglibc", or "arm-2010.09") + ERROR=1 + endif + endif + endif +endif + +ifeq "$(USE_NDS)" "yes" + ifneq "$(NDS_CPU)" "ARM7" + ifneq "$(NDS_CPU)" "ARM9" + $(warning ERROR Bad NDS_CPU : must be "ARM7" or "ARM9") + ERROR=1 + endif + endif +endif + +$(eval $(call EXIT_IF_ERROR)) + +# +# Compatibility test +################################################### +ifeq "$(USE_ANDROID)" "yes" + $(eval $(call CHECK_DEFINITION,NDK_PATH,: should be defined as an environment variable.)) + $(eval $(call CHECK_VALUE,USE_LINUX,no,android is used)) + $(eval $(call CHECK_VALUE,USE_NDS,no,android is used)) + $(eval $(call CHECK_VALUE,USE_ELINUX,no,android is used)) + $(eval $(call CHECK_VALUE,USE_PARROTOS_CORE,no,android is used (parrotos is available only on elinux))) + $(eval $(call CHECK_VALUE,USE_IPHONE,no,android is used)) +endif + +ifeq "$(USE_APP)" "yes" + $(eval $(call CHECK_DEFINITION,APP_ID,(example : "ardrone"))) +endif +ifeq "$(USE_SDK)" "yes" + $(eval $(call CHECK_DIR,$(ALL_SOURCES)/$(SDK_SOURCE_DIR),SDK_VERSION)) + $(eval $(call EXIT_IF_ERROR)) + #Disabled by Stephane - this is probably deprecated + #ifeq "$(USE_FFMPEG)" "yes" + # $(eval $(call CHECK_DIR,$(ALL_SOURCES)/$(SDK_SOURCE_DIR)/PFFMPEG/$(FF_ARCH),FF_ARCH)) + #endif +endif +ifeq "$(USE_BONJOUR)" "yes" + $(eval $(call CHECK_DIR,$(ALL_SOURCES)/bonjour/$(BONJOUR_VERSION)/Bonjour,BONJOUR_VERSION)) +endif + +ifeq "$(USE_LINUX)" "yes" + $(eval $(call CHECK_VALUE,USE_ANDROID,no,linux is used)) + $(eval $(call CHECK_VALUE,USE_ELINUX,no,linux is used)) + $(eval $(call CHECK_VALUE,USE_NDS,no,linux is used)) + $(eval $(call CHECK_VALUE,USE_PARROTOS_CORE,no,linux is used (parrotos is available only on elinux))) + $(eval $(call CHECK_VALUE,USE_IPHONE,no,linux is used)) +endif + +ifeq "$(USE_ELINUX)" "yes" + $(eval $(call CHECK_VALUE,USE_ANDROID,no,linux is used)) + $(eval $(call CHECK_DIR,$(ALL_SOURCES)/commonsoft/$(COMMONSOFT_VERSION)/CommonSoft,COMMONSOFT_VERSION)) + $(eval $(call CHECK_VALUE,USE_LINUX,no,embedded linux is used)) + $(eval $(call CHECK_VALUE,USE_NDS,no,embedded linux is used)) + $(eval $(call CHECK_VALUE,USE_IPHONE,no,embedded linux is used)) +endif + +ifeq "$(USE_NDS)" "yes" + $(eval $(call CHECK_VALUE,USE_ANDROID,no,linux is used)) + $(eval $(call CHECK_VALUE,USE_LINUX,no,nintendo ds is used)) + $(eval $(call CHECK_VALUE,USE_ELINUX,no,nintendo ds is used)) + $(eval $(call CHECK_VALUE,USE_PARROTOS_CORE,no,nintendo ds is used (parrotos is available only on elinux))) + $(eval $(call CHECK_VALUE,USE_IPHONE,no,nintendo ds is used)) +endif + + +ifeq "$(USE_IPHONE)" "yes" + $(eval $(call CHECK_VALUE,USE_ANDROID,no,linux is used)) + $(eval $(call CHECK_DEFINITION,IPHONE_SDK_PATH,(example : "path to sdk"))) + $(eval $(call CHECK_DEFINITION,IPHONE_PLATFORM,(example : "iphoneos or iphonesimulator"))) + $(eval $(call CHECK_VALUE,USE_NDS,no,iphone is used)) + $(eval $(call CHECK_VALUE,USE_LINUX,no,iphone is used)) + $(eval $(call CHECK_VALUE,USE_ELINUX,no,iphone is used)) + $(eval $(call CHECK_VALUE,USE_PARROTOS_CORE,no,iphone is used (parrotos is available only on elinux))) + $(eval $(call CHECK_TWO_VALUES,IPHONE_PLATFORM,iphoneos,iphonesimulator, IPHONE_PLATFORM must be set to iphoneos or iphonesimulator)) +endif + +$(eval $(call CHECK_VALUE,USE_BONJOUR,no,ecos is not used)) + +ifeq "$(NO_COM)" "yes" + $(eval $(call CHECK_VALUE,USE_BLUEZ,no,NO_COM is used)) +endif + +ifeq "$(USE_BROADCOM)" "yes" + $(eval $(call CHECK_VALUE,USE_IWLIB,no,BROADCOM is used)) +endif + +ifeq "$(USE_IWLIB)" "yes" + $(eval $(call CHECK_VALUE,USE_BROADCOM,no,iwlib is used)) +endif + +$(eval $(call EXIT_IF_ERROR)) + diff --git a/ARDroneLib/VP_SDK/Build/vlib.makefile b/ARDroneLib/VP_SDK/Build/vlib.makefile new file mode 100644 index 0000000..c64d5cc --- /dev/null +++ b/ARDroneLib/VP_SDK/Build/vlib.makefile @@ -0,0 +1,105 @@ + +########################################################################################### +# +# Designed to build VLIB using generic.makefile +# ---------------------------------------------------------------------------------- +# Author : aurelien.morelle@parrot.com +# Date : 2008/10/30 +# +########################################################################################### + +include common.makefile + +GENERIC_LIBRARY_TARGET_DIR=$(CODEC_TARGET_DIR) +GENERIC_TARGET_LIBRARY=$(GENERIC_LIBRARY_TARGET_DIR)/libvlib.a + +GENERIC_LIBRARY_SOURCE_FILES= \ + video_codec.c \ + video_controller.c \ + video_mem32.c \ + video_dct.c \ + video_huffman.c \ + video_macroblock.c \ + video_packetizer.c \ + video_picture.c \ + video_quantizer.c \ + P263/p263_codec.c \ + P263/p263_huffman.c \ + P263/p263_mb_layer.c \ + P263/p263_gob_layer.c \ + P263/p263_picture_layer.c \ + P264/p264_zigzag.c \ + P264/p264_transform.c \ + P264/p264_Qp.c \ + P264/p264_intra_pred.c \ + P264/p264_inter_mc.c \ + P264/p264_merge.c \ + P264/p264_codec.c \ + P264/p264.c \ + P264/p264_gob_layer.c \ + P264/p264_mb_layer.c \ + P264/p264_picture_layer.c \ + P264/video_p264.c \ + Stages/vlib_stage_decode.c \ + Stages/vlib_stage_encode.c \ + UVLC/uvlc_codec.c \ + UVLC/uvlc.c \ + UVLC/uvlc_gob_layer.c \ + UVLC/uvlc_mb_layer.c \ + UVLC/uvlc_picture_layer.c + +ifeq ($(USE_ELINUX),yes) +GENERIC_LIBRARY_SOURCE_FILES+= \ + Platform/arm9_P6/video_utils.c \ + Platform/arm9_P6/video_dct_p6.c \ + Platform/arm9_P6/video_p264_p6.c \ + Platform/arm9_P6/video_quantizer_p6.c \ + Platform/arm9_P6/video_packetizer_p6.S \ + Platform/arm9_P6/UVLC/uvlc_p6.S \ + Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.S +endif + +ifeq ($(USE_IPHONE),yes) + ifeq ($(IPHONE_PLATFORM),iphoneos) + GENERIC_LIBRARY_SOURCE_FILES+= \ + Platform/arm11/video_utils.c \ + Platform/arm11/UVLC/uvlc_codec.c + else + GENERIC_LIBRARY_SOURCE_FILES+= \ + Platform/x86/video_utils.c \ + Platform/x86/UVLC/uvlc_codec.c + endif +else + ifeq ($(USE_ANDROID),yes) + GENERIC_LIBRARY_SOURCE_FILES+= \ + Platform/arm11/video_utils.c \ + Platform/arm11/UVLC/uvlc_codec.c + else + ifeq ($(FF_ARCH),Intel) + GENERIC_LIBRARY_SOURCE_FILES+= \ + Platform/x86/video_utils.c \ + Platform/x86/UVLC/uvlc_codec.c + endif + endif +endif + +GENERIC_LIBRARY_SOURCE_DIR=$(VLIB_SOURCE_DIR) + + +# All that needs to be exported +######################## +export GENERIC_LIBRARY_TARGET_DIR +export GENERIC_TARGET_LIBRARY +export GENERIC_INCLUDES +export GENERIC_LIBRARY_SOURCE_DIR +export GENERIC_LIBRARY_SOURCE_FILES + +# All that shall not be defined +######################## +export PARROTOS_MAKEFILE= +export GENERIC_BINARIES_SOURCE_ENTRYPOINTS= +export GENERIC_BINARIES_COMMON_SOURCE_FILES= + +all $(MAKECMDGOALS): + @$(MAKE) -f generic.makefile $(MAKECMDGOALS) + diff --git a/ARDroneLib/VP_SDK/Examples/common/atcodec_client.c b/ARDroneLib/VP_SDK/Examples/common/atcodec_client.c new file mode 100644 index 0000000..c0d2153 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/atcodec_client.c @@ -0,0 +1,258 @@ + +#include +#include +#include + + +#ifndef AT_MESSAGES_HEADER +# define AT_MESSAGES_HEADER +#endif // > AT_MESSAGES_HEADER + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifndef AT_MESSAGES_HEADER +#error You need to define AT_MESSAGES_HEADER +#endif + + +AT_CODEC_MSG_IDS ids; + +static vp_stages_input_com_config_t icc; +static Write atcodec_write; +static Read atcodec_read; + +static vp_com_t com; + +#ifdef NO_COM + static vp_com_serial_config_t config; +#else // ! NO_COM +#ifdef USE_WIFI + static vp_com_wifi_connection_t connection; + static vp_com_wifi_config_t config; +#endif // ! USE_WIFI +#endif // > NO_COM + +AT_CODEC_ERROR_CODE atresu_fake(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + PRINT("FAKE received !\n"); + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE atresu_ok(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + PRINT("OK received !\n"); + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE atresu_error(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + PRINT("ERROR received !\n"); + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE atresu_cgmi(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + char str[1024]; + + //int len = + ATcodec_Memory_Raw_Get_Int(mem); + + ATcodec_Memory_Get_String(mem, &str[0]); + + PRINT("CGMI received : \"%s\" !\n", &str[0]); + + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_Client_init(void) +{ + static int foo = 1; + + vp_os_memset(&com, 0, sizeof(vp_com_t)); + icc.com = &com; + + if(foo) + { + +# undef ATCODEC_DEFINE_AT_CMD +# define ATCODEC_DEFINE_AT_CMD(ID,Str,From,Cb,Prio) \ + if((ids.ID = ATcodec_Add_Defined_Message(Str)) == -1) \ + { \ + fprintf(stderr, "Error Add_Hashed \"%s\" library\n", Str); \ + return AT_CODEC_INIT_ERROR; \ + } + +# undef ATCODEC_DEFINE_AT_RESU +# define ATCODEC_DEFINE_AT_RESU(ID,Str,From,Cb) \ + if((ids.ID = ATcodec_Add_Hashed_Message(Str,ids.From,Cb,0)) == -1) \ + { \ + fprintf(stderr, "Error Add_Defined \"%s\" library\n", Str); \ + return AT_CODEC_INIT_ERROR; \ + } + +# include AT_MESSAGES_HEADER + + //ATcodec_Print_Tree(); + + //vp_delay(100); + +#ifdef NO_COM +#ifdef __linux__ + strcpy(config.itfName, "/dev/ttyUSB0"); +#else + strcpy(config.itfName, "/dev/ser0"); +#endif + config.initial_baudrate = VP_COM_BAUDRATE_115200; + config.baudrate = VP_COM_BAUDRATE_115200; + config.sync = 0; //1; + + com.type = VP_COM_SERIAL; + icc.socket.type = VP_COM_CLIENT; + icc.config = (vp_com_config_t *)&config; + icc.buffer_size = 16; +#else // ! NO_COM +#ifdef USE_WIFI + strcpy(connection.networkName,"linksys"); + + strcpy(config.itfName, "rausb0"); + strcpy(config.localHost, "192.168.1.57"); + strcpy(config.netmask, "255.255.255.0"); + strcpy(config.broadcast, "192.168.1.255"); + strcpy(config.gateway, "192.168.1.1"); + strcpy(config.server, "192.168.1.1"); + strcpy(config.passkey, "9F1C3EE11CBA230B27BF1C1B6F"); + config.infrastructure = 1; + config.secure = 1; + + com.type = VP_COM_WIFI; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket_client.serverHost,"192.168.1.23"); +#endif // ! USE_WIFI +#endif // > NO_COM + + if(FAILED(vp_com_init(icc.com))) + { + PRINT("VP_Com : Failed to init\n"); + vp_com_shutdown(icc.com); + return AT_CODEC_OPEN_ERROR; + } + + if(FAILED(vp_com_local_config(icc.com, icc.config))) + { + PRINT("VP_Com : Failed to configure\n"); + vp_com_shutdown(icc.com); + return AT_CODEC_OPEN_ERROR; + } + + PRINT("com_init OK\n"); + + foo = 0; + + } + + return AT_CODEC_INIT_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_Client_shutdown(void) +{ + ATcodec_Shutdown_Library(); + + return AT_CODEC_SHUTDOWN_OK; +} + +int rfcomm_socket; + +AT_CODEC_ERROR_CODE AT_CODEC_Client_open(void) +{ + static int foo = 1; + + printf("ATcodec_open\n"); + + if(foo) + { +/* if(FAILED(vp_com_connect(icc.connection, 1))) */ +/* return AT_CODEC_OPEN_ERROR; */ + + if(FAILED(vp_com_open(icc.com, &icc.socket_client, &atcodec_read,&atcodec_write))) + return AT_CODEC_OPEN_ERROR; + + foo = 0; + + } + + return AT_CODEC_OPEN_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_Client_close(void) +{ + printf("ATcodec_close\n"); + + vp_com_close(icc.com, &icc.socket_client); + + return AT_CODEC_CLOSE_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_Client_write(int8_t *buffer, int32_t *len) +{ + //printf("ATcodec_write\n"); + + if(FAILED(atcodec_write(&icc.socket_client, buffer, len))) + return AT_CODEC_WRITE_ERROR; + + return AT_CODEC_WRITE_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_Client_read(int8_t *buffer, int32_t *len) +{ +/* printf("< ATcodec_read >\n"); */ + + if(FAILED(atcodec_read(&icc.socket_client, buffer, len))) + return AT_CODEC_READ_ERROR; + + if(*len) + { + buffer[*len] = '\0'; +/* PRINT("len=%d AT_CODEC_Client_read : \"", *len); */ +/* for( ; *buffer ; buffer++) */ +/* { */ +/* if(*buffer == '\r') */ +/* { */ +/* PRINT(""); */ +/* } */ +/* else if(*buffer == '\n') */ +/* { */ +/* PRINT(""); */ +/* } */ +/* else if(*buffer == '\0') */ +/* { */ +/* PRINT("<\\0>"); */ +/* } */ +/* else */ +/* { */ +/* PRINT("%c", *buffer); */ +/* } */ +/* } */ +/* PRINT("\"\n"); */ + } + + return AT_CODEC_READ_OK; +} diff --git a/ARDroneLib/VP_SDK/Examples/common/atcodec_client.h b/ARDroneLib/VP_SDK/Examples/common/atcodec_client.h new file mode 100644 index 0000000..e04bb61 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/atcodec_client.h @@ -0,0 +1,33 @@ +#ifndef _ATCODEC_SERVER_H_ +#define _ATCODEC_SERVER_H_ + + +#include + + +typedef struct _AT_CODEC_MSG_IDS_ +{ +# define ATCODEC_DEFINE_AT_CMD(ID,Str,From,Cb,Prio) AT_CODEC_MSG_ID ID; +# define ATCODEC_DEFINE_AT_RESU(ID,Str,From,Cb) AT_CODEC_MSG_ID ID; + + AT_CODEC_MSG_ID AT_MSG_ATCMD_DEFAULT; + +# include AT_MESSAGES_HEADER +} +AT_CODEC_MSG_IDS; + + +AT_CODEC_ERROR_CODE atresu_ok(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *len); +AT_CODEC_ERROR_CODE atresu_error(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *len); +AT_CODEC_ERROR_CODE atresu_cgmi(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *len); + + +AT_CODEC_ERROR_CODE AT_CODEC_Client_init(void); +AT_CODEC_ERROR_CODE AT_CODEC_Client_shutdown(void); +AT_CODEC_ERROR_CODE AT_CODEC_Client_open(void); +AT_CODEC_ERROR_CODE AT_CODEC_Client_close(void); +AT_CODEC_ERROR_CODE AT_CODEC_Client_write(int8_t *buffer, int32_t *len); +AT_CODEC_ERROR_CODE AT_CODEC_Client_read(int8_t *buffer, int32_t *len); + + +#endif // ! _ATCODEC_SERVER_H_ diff --git a/ARDroneLib/VP_SDK/Examples/common/atcodec_server.c b/ARDroneLib/VP_SDK/Examples/common/atcodec_server.c new file mode 100644 index 0000000..1fdbd5b --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/atcodec_server.c @@ -0,0 +1,277 @@ + +#include +#include +#include + +#ifndef AT_MESSAGES_HEADER +# define AT_MESSAGES_HEADER +#endif // > AT_MESSAGES_HEADER + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifndef AT_MESSAGES_HEADER +#error You need to define AT_MESSAGES_HEADER +#endif + + +typedef struct _AT_CODEC_MSG_IDS_ +{ +# define ATCODEC_DEFINE_AT_CMD(ID,Str,From,Cb,Prio) AT_CODEC_MSG_ID ID; +# define ATCODEC_DEFINE_AT_RESU(ID,Str,From,Cb) AT_CODEC_MSG_ID ID; +# include AT_MESSAGES_HEADER +} +AT_CODEC_MSG_IDS; + + +static AT_CODEC_MSG_IDS ids; + + +static vp_stages_output_com_config_t occ; + +static Write atcodec_write; +static Read atcodec_read; + +static vp_com_t com; + +#ifdef NO_COM + static vp_com_serial_config_t config; +#else // ! NO_COM +#ifdef USE_WIFI + vp_com_wifi_connection_t connection; + vp_com_wifi_config_t config; +#endif // ! USE_WIFI +#endif // > NO_COM + + + +AT_CODEC_ERROR_CODE at_pm_qw(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + static int foo = 0; + int motor = ATcodec_Memory_Raw_Get_Int(mem); + + PRINT("Motor selected : %d\n", motor); + + if(foo) + *id = ids.AT_MSG_ATRESU_OK; + else + *id = ids.AT_MSG_ATRESU_ERROR; + + foo = 1-foo; + + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE at_pm_exe(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + static int foo = 1; + int speed = ATcodec_Memory_Raw_Get_Int(mem); + int timestamp = ATcodec_Memory_Raw_Get_Int(mem); + PRINT("Motor command : speed=%d , timestamp=%d\n", speed, timestamp); + + if(foo) + *id = ids.AT_MSG_ATRESU_OK; + else + *id = ids.AT_MSG_ATRESU_ERROR; + + foo = 1-foo; + + return AT_CODEC_GENERAL_OK; +} + +AT_CODEC_ERROR_CODE at_cgmi(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *id) +{ + PRINT("CGMI command\n"); + + ATcodec_Memory_Put_String(output, "By Aurelien Morelle"); + + *id = ids.AT_MSG_ATRESU_CGMI; + + return AT_CODEC_GENERAL_OK; +} + + +AT_CODEC_ERROR_CODE AT_CODEC_init(void) +{ + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + occ.com = &com; + +# undef ATCODEC_DEFINE_AT_CMD +# define ATCODEC_DEFINE_AT_CMD(ID,Str,From,Cb,Prio) \ + if((ids.ID = ATcodec_Add_Hashed_Message(Str,From,Cb,Prio)) == -1) \ + { \ + PRINT("Error Add_Hashed \"%s\" library\n", Str); \ + return AT_CODEC_INIT_ERROR; \ + } + +# undef ATCODEC_DEFINE_AT_RESU +# define ATCODEC_DEFINE_AT_RESU(ID,Str,From,Cb) \ + if((ids.ID = ATcodec_Add_Defined_Message(Str)) == -1) \ + { \ + PRINT("Error Add_Defined \"%s\" library\n", Str); \ + return AT_CODEC_INIT_ERROR; \ + } + +# include AT_MESSAGES_HEADER + + //ATcodec_Print_Tree(); + +#ifdef NO_COM +#ifdef __linux__ + strcpy(config.itfName, "/dev/ttyS0"); +#else + strcpy(config.itfName, "/dev/ser1"); +#endif + config.initial_baudrate = VP_COM_BAUDRATE_115200; + config.baudrate = VP_COM_BAUDRATE_115200; + config.sync = 0; //1; + + com.type = VP_COM_SERIAL; + + occ.socket.type = VP_COM_SERVER; + occ.config = (vp_com_config_t *)&config; + occ.buffer_size = 16; +#else // ! NO_COM +#ifdef USE_WIFI + vp_os_memset(&connection,0,sizeof(vp_com_connection_t)); + strcpy(connection.networkName,"linksys"); + + strcpy(config.itfName, "wl0"); + strcpy(config.localHost, "192.168.1.23"); + strcpy(config.netmask, "255.255.255.0"); + strcpy(config.broadcast, "192.168.1.255"); + strcpy(config.gateway, "192.168.1.1"); + strcpy(config.server, "192.168.1.1"); + strcpy(config.passkey, "9F1C3EE11CBA230B27BF1C1B6F"); + config.infrastructure = 1; + config.secure = 1; + + com.type = VP_COM_WIFI; + + occ.config = (vp_com_config_t*)&config; + occ.connection = (vp_com_connection_t*)&connection; + occ.socket.type = VP_COM_SERVER; + occ.socket.protocol = VP_COM_TCP; + occ.socket.port = 5555; + occ.buffer_size = 128; +#endif // ! USE_WIFI +#endif // > NO_COM + + + if(FAILED(vp_com_init(occ.com))) + { + PRINT("VP_Com : Failed to init\n"); + vp_com_shutdown(occ.com); + return AT_CODEC_OPEN_ERROR; + } + + if(FAILED(vp_com_local_config(occ.com, occ.config))) + { + PRINT("VP_Com : Failed to configure\n"); + vp_com_shutdown(occ.com); + return AT_CODEC_OPEN_ERROR; + } + + PRINT("com_init OK\n"); + + return AT_CODEC_INIT_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_shutdown(void) +{ + ATcodec_Shutdown_Library(); + + return AT_CODEC_SHUTDOWN_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_open(void) +{ + PRINT("ATcodec_open\n"); + + if(FAILED(vp_com_open(occ.com, &occ.socket, &atcodec_read,&atcodec_write))) + return AT_CODEC_OPEN_ERROR; + + if(FAILED(vp_com_wait_connections(occ.com, &occ.socket, &occ.socket_client, 1))) + return AT_CODEC_OPEN_ERROR; + + PRINT("Connection RFCOMM incoming\n"); + + return AT_CODEC_OPEN_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_close(void) +{ + PRINT("ATcodec_close\n"); + + vp_com_close(occ.com, &occ.socket); + vp_com_close(occ.com, &occ.socket_client); + + PRINT("socket closed\n"); + + return AT_CODEC_CLOSE_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_write(int8_t *buffer, int32_t *len) +{ +/* int i; */ + + if(FAILED(atcodec_write(&occ.socket_client, buffer, len))) + return AT_CODEC_WRITE_ERROR; + +/* if(*len) */ +/* { */ +/* PRINT("ATcodec_write < "); */ +/* for(i = 0 ; i < *len ; i++) */ +/* { */ +/* if(buffer[i] == '\r') */ +/* PRINT("_CR_"); */ +/* else if(buffer[i] == '\n') */ +/* PRINT("_LF_"); */ +/* else */ +/* PRINT("%c", buffer[i]); */ +/* } */ +/* PRINT(" > (%d)\n", *len); */ +/* } */ + + return AT_CODEC_WRITE_OK; +} + +AT_CODEC_ERROR_CODE AT_CODEC_read(int8_t *buffer, int32_t *len) +{ +/* int i; */ + + if(FAILED(atcodec_read(&occ.socket_client, buffer, len))) + return AT_CODEC_READ_ERROR; + + if(*len) + { + buffer[*len] = '\0'; +/* PRINT("ATcodec_read < "); */ +/* for(i = 0 ; i < *len ; i++) */ +/* { */ +/* if(buffer[i] == '\r') */ +/* PRINT("_CR_"); */ +/* else if(buffer[i] == '\n') */ +/* PRINT("_LF_"); */ +/* else if(buffer[i] == '\0') */ +/* PRINT("_\\0_"); */ +/* else */ +/* PRINT("%c", buffer[i]); */ +/* } */ +/* PRINT(" > (%d)\n", *len); */ + } + + return AT_CODEC_READ_OK; +} diff --git a/ARDroneLib/VP_SDK/Examples/common/atcodec_server.h b/ARDroneLib/VP_SDK/Examples/common/atcodec_server.h new file mode 100644 index 0000000..30a4999 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/atcodec_server.h @@ -0,0 +1,21 @@ +#ifndef _ATCODEC_SERVER_H_ +#define _ATCODEC_SERVER_H_ + + +#include + + +AT_CODEC_ERROR_CODE at_cgmi(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *len); +AT_CODEC_ERROR_CODE at_pm_qw(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *len); +AT_CODEC_ERROR_CODE at_pm_exe(ATcodec_Memory_t *mem, ATcodec_Memory_t *output, int *len); + + +AT_CODEC_ERROR_CODE AT_CODEC_init(void); +AT_CODEC_ERROR_CODE AT_CODEC_shutdown(void); +AT_CODEC_ERROR_CODE AT_CODEC_open(void); +AT_CODEC_ERROR_CODE AT_CODEC_close(void); +AT_CODEC_ERROR_CODE AT_CODEC_write(int8_t *buffer, int32_t *len); +AT_CODEC_ERROR_CODE AT_CODEC_read(int8_t *buffer, int32_t *len); + + +#endif // ! _ATCODEC_SERVER_H_ diff --git a/ARDroneLib/VP_SDK/Examples/common/com_client.c b/ARDroneLib/VP_SDK/Examples/common/com_client.c new file mode 100644 index 0000000..0f4bd7e --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/com_client.c @@ -0,0 +1,74 @@ +#include "common.h" + +#include +#include + +#include "com_client.h" + +static com_config_t config; +static com_socket_t clt; +static com_connection_t connection; +static Read read; +static Write write; + +C_RESULT init_com_client(void) +{ + config.connection = COM_BLUETOOTH; + config.localAdapterName = DEVICENAME; + config.localIpAddress = CLIENTHOST; + config.localIpSubmask = SUBMASK; + + if(FAILED(com_init(&config))) + return C_FAIL; + + return C_OK; +} + +C_RESULT run_com_client(COM_PROTOCOL protocol) +{ + com_strToAddress(BTADDR_SERVER,&connection.address); + + com_passKey(PIN_CODE); + if(FAILED(com_connect(&connection,1))) + return C_FAIL; + + clt.socket = COM_CLIENT; + clt.protocol = protocol; + + if(protocol == COM_RFCOMM) + { + clt.scn = BTADDR_SCN; + } + else if(protocol == COM_BNEP) + { + clt.port = BTADDR_PORT; + clt.serverHost = SERVERHOST; + } + else + return C_FAIL; + + if(FAILED(com_open(&clt,&read,&write))) + return C_FAIL; + + return C_OK; +} + +C_RESULT shutdown_com_client(void) +{ + com_close(&clt); + + com_disconnect(); + com_shutdown(); + + return C_OK; +} + +C_RESULT read_client(int8_t* buffer, int32_t* size) +{ + return read(&clt,buffer,size); +} + +C_RESULT write_client(const int8_t* buffer, int32_t* size) +{ + return write(&clt,buffer,size); +} diff --git a/ARDroneLib/VP_SDK/Examples/common/com_client.h b/ARDroneLib/VP_SDK/Examples/common/com_client.h new file mode 100644 index 0000000..f6f3cef --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/com_client.h @@ -0,0 +1,23 @@ +// ---------------------------------------------- +// +// Author : +// Date : 15/01/2007 +// +// Parrot Video SDK : Examples/common +// +// ---------------------------------------------- + +#ifndef _COM_CLIENT_H_ +#define _COM_CLIENT_H_ + +#include +#include + +C_RESULT init_com_client(void); +C_RESULT run_com_client(COM_PROTOCOL protocol); +C_RESULT shutdown_com_client(void); + +C_RESULT read_client(int8_t* buffer, int32_t* size); +C_RESULT write_client(const int8_t* buffer, int32_t* size); + +#endif // _COM_CLIENT_H_ diff --git a/ARDroneLib/VP_SDK/Examples/common/com_server.c b/ARDroneLib/VP_SDK/Examples/common/com_server.c new file mode 100644 index 0000000..aaf6c56 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/com_server.c @@ -0,0 +1,82 @@ +// ---------------------------------------------- +// +// Author : +// Date : 15/01/2007 +// +// Parrot Video SDK : Examples/common +// +// ---------------------------------------------- + +#include "common.h" + +#include +#include +#include + +#include "com_server.h" + +static com_config_t config; +static com_socket_t srv; +static com_socket_t clt; +static Read read; +static Write write; + +C_RESULT init_com_server(void) +{ + config.connection = COM_BLUETOOTH; + config.localAdapterName = DEVICENAME; + config.localIpAddress = SERVERHOST; + config.localIpSubmask = SUBMASK; + + if(FAILED(com_init(&config))) + return C_FAIL; + + return C_OK; +} + +C_RESULT run_com_server(COM_PROTOCOL protocol) +{ + srv.socket = COM_SERVER; + srv.protocol = protocol; + + if(protocol == COM_RFCOMM) + { + srv.scn = BTADDR_SCN; + } + else if(protocol == COM_BNEP) + { + srv.port = BTADDR_PORT; + srv.serverHost = SERVERHOST; + } + else + return C_FAIL; + + if(FAILED(com_open(&srv,&read,&write))) + return C_FAIL; + + com_passKey(PIN_CODE); + if(FAILED(com_accept(&srv,&clt))) + return C_FAIL; + + return C_OK; +} + +C_RESULT shutdown_com_server(void) +{ + com_close(&clt); + com_close(&srv); + + com_shutdown(); + + return C_OK; +} + +C_RESULT read_server(int8_t* buffer, int32_t* size) +{ + return read(&clt,buffer,size); +} + +C_RESULT write_server(const int8_t* buffer, int32_t* size) +{ + return write(&clt,buffer,size); +} diff --git a/ARDroneLib/VP_SDK/Examples/common/com_server.h b/ARDroneLib/VP_SDK/Examples/common/com_server.h new file mode 100644 index 0000000..601aff8 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/com_server.h @@ -0,0 +1,23 @@ +// ---------------------------------------------- +// +// Author : +// Date : 15/01/2007 +// +// Parrot Video SDK : Examples/common +// +// ---------------------------------------------- + +#ifndef _COM_SERVER_H_ +#define _COM_SERVER_H_ + +#include +#include + +C_RESULT init_com_server(void); +C_RESULT run_com_server(COM_PROTOCOL protocol); +C_RESULT shutdown_com_server(void); + +C_RESULT read_server(int8_t* buffer, int32_t* size); +C_RESULT write_server(const int8_t* buffer, int32_t* size); + +#endif // _COM_SERVER_H_ diff --git a/ARDroneLib/VP_SDK/Examples/common/common.c b/ARDroneLib/VP_SDK/Examples/common/common.c new file mode 100644 index 0000000..09280af --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/common.c @@ -0,0 +1,13 @@ +#include +#include + +void deviceinquiry_df(bdaddr_t* address,const char* name) +{ + PRINT("%s - %x:%x:%x:%x:%x:%x\n", + name, address->b[0], address->b[1], address->b[2], address->b[3], address->b[4], address->b[5]); +} + +void adapterinquiry_df(const char* name) +{ + PRINT("%s\n",name); +} diff --git a/ARDroneLib/VP_SDK/Examples/common/common.h b/ARDroneLib/VP_SDK/Examples/common/common.h new file mode 100644 index 0000000..8ff3c30 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/common/common.h @@ -0,0 +1,37 @@ +// ---------------------------------------------- +// +// Author : +// Date : 03/01/2007 +// +// Parrot Video SDK : Examples/common +// +// ---------------------------------------------- + +#ifndef _COMMON_H_ +#define _COMMON_H_ + +#define BTADDR_SERVER /* "AE:11:A5:22:DE:DE" */ "00:0A:3A:6B:DB:B9" +#define BTADDR_SCN 9 +#define BTADDR_PORT 5555 + +#define SERVERHOST "192.168.2.2" +#define CLIENTHOST "192.168.2.1" +#define LOCALHOST "192.168.2.2" +#define SUBMASK "255.255.255.0" + +#define PIN_CODE "1234" + +#ifdef _WIN32 +#define DEVICENAME "Bluetooth Network" +#endif + +#ifdef __linux__ +#define DEVICENAME "hci0" +#endif + +#include + +void deviceinquiry_df(bdaddr_t* address,const char* name); +void adapterinquiry_df(const char* name); + +#endif // _COMMON_H_ diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_console.c b/ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_console.c new file mode 100644 index 0000000..4f11a0a --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_console.c @@ -0,0 +1,66 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +static PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + + vp_com_t com; + vp_com_bluetooth_config_t config; + vp_com_bluetooth_connection_t connection; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) ); + vp_com_str_to_address("00:01:48:03:70:54",&connection.address); + vp_stages_fill_default_config(BLUETOOTH_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_BLUETOOTH; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 64; + + strcpy(icc.socket.serverHost,"192.168.2.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_CONSOLE; + stages[1].cfg = NULL; + stages[1].funcs = vp_stages_output_console_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_ofile.c b/ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_ofile.c new file mode 100644 index 0000000..7cbc505 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_bluetoothClientTCP_ofile.c @@ -0,0 +1,71 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +static PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + vp_stages_output_file_config_t ofc; + + vp_com_t com; + vp_com_bluetooth_connection_t connection; + vp_com_bluetooth_config_t config; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &ofc, 0, sizeof(vp_stages_output_file_config_t) ); + vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) ); + vp_com_str_to_address("00:01:48:03:70:54",&connection.address); + vp_stages_fill_default_config(BLUETOOTH_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_BLUETOOTH; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket.serverHost,"192.168.2.23"); + + ofc.name = "out.mpg"; + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_FILE; + stages[1].cfg = (void *)&ofc; + stages[1].funcs = vp_stages_output_file_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_ifile_upper_ofile.c b/ARDroneLib/VP_SDK/Examples/elinux/api_ifile_upper_ofile.c new file mode 100644 index 0000000..5425e3d --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_ifile_upper_ofile.c @@ -0,0 +1,115 @@ +#include +#include + +#include +#include +#include +#include + + +#define NB_STAGES 3 + + +static PIPELINE_HANDLE pipeline_handle; + + +C_RESULT +my_transform_open(void *cfg) +{ + return (SUCCESS); +} + +C_RESULT +my_transform_transform(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + int i; + + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = in->size; // to be cleaned ... + out->buffers = (int8_t **)malloc(sizeof(int8_t *)+out->size*sizeof(int8_t)); + out->buffers[0] = (int8_t *)(out->buffers+1); + out->indexBuffer = 0; + // out->lineSize not used + out->status = VP_API_STATUS_PROCESSING; + } + + if(in->status == VP_API_STATUS_ENDED) + { + free(out->buffers); + } + else if(in->status == VP_API_STATUS_PROCESSING) + { + // uppercase + for(i = 0 ; i < in->size ; i++) + { + out->buffers[0][i] = toupper(in->buffers[in->indexBuffer][i]); + } + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +my_transform_close(void *cfg) +{ + return (SUCCESS); +} + + +const vp_api_stage_funcs_t my_transform_funcs = +{ + NULL, + (vp_api_stage_open_t)my_transform_open, + (vp_api_stage_transform_t)my_transform_transform, + (vp_api_stage_close_t)my_transform_close +}; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_file_config_t ofc; + + ifc.name = "toto.in"; + ifc.buffer_size = 512; + + ofc.name = "toto.out"; + + stages[0].type = VP_API_INPUT_FILE; + stages[0].cfg = (void *)&ifc; + stages[0].funcs = vp_stages_input_file_funcs; + + stages[1].type = VP_API_FILTER_ENCODER; + stages[1].cfg = NULL; + stages[1].funcs = my_transform_funcs; + + stages[2].type = VP_API_OUTPUT_FILE; + stages[2].cfg = (void *)&ofc; + stages[2].funcs = vp_stages_output_file_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + + // \todo tests + + vp_api_close(&pipeline, &pipeline_handle); + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_serial_ofile.c b/ARDroneLib/VP_SDK/Examples/elinux/api_serial_ofile.c new file mode 100644 index 0000000..81c389d --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_serial_ofile.c @@ -0,0 +1,76 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_com_t com; + vp_stages_input_com_config_t icc; + vp_com_serial_config_t config; + vp_stages_output_file_config_t ofc; + + + vp_os_memset(&icc,0,sizeof(vp_stages_input_com_config_t)); + vp_os_memset(&ofc,0,sizeof(vp_stages_output_file_config_t)); + vp_stages_fill_default_config(UART1_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_SERIAL; + icc.com = &com; + icc.socket.type = VP_COM_CLIENT; + icc.config = (vp_com_config_t *)&config; + icc.buffer_size = 1024; + + + ofc.name = "toto.out"; + + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_FILE; + stages[1].cfg = (void *)&ofc; + stages[1].funcs = vp_stages_output_file_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + //vp_os_delay( 200 ); + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_threads.c b/ARDroneLib/VP_SDK/Examples/elinux/api_threads.c new file mode 100644 index 0000000..e9b1698 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_threads.c @@ -0,0 +1,82 @@ +/** + * \brief VP Api. Filter encoder/decoder stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 21/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include + + +#define STACK_SIZE 40000 + + +PROTO_THREAD_ROUTINE(thread1,nomParams); +PROTO_THREAD_ROUTINE(thread2,nomParams); +PROTO_THREAD_ROUTINE(thread3,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(thread1,20) + THREAD_TABLE_ENTRY(thread2,20) + THREAD_TABLE_ENTRY(thread3,20) +END_THREAD_TABLE + +PROTO_THREAD_ROUTINE(thread1,nomParams) +{ + PRINT("Thread 1 Start\n"); + + while(1) + { + vp_os_delay(100); + PRINT("Thread 1 Loop\n"); + } +} + +PROTO_THREAD_ROUTINE(thread2,nomParams) +{ + PRINT("Thread 2 Start\n"); + + while(1) + { + vp_os_delay(200); + PRINT("Thread 2 Loop\n"); + } +} + +PROTO_THREAD_ROUTINE(thread3,nomParams) +{ + PRINT("Thread 3 Start\n"); + + while(1) + { + vp_os_delay(300); + PRINT("Thread 3 Loop\n"); + } +} + +void runApplication(void) +{ + START_THREAD(thread1, NO_PARAM); + START_THREAD(thread2, NO_PARAM); + START_THREAD(thread3, NO_PARAM); + + JOIN_THREAD(thread1); + JOIN_THREAD(thread2); + JOIN_THREAD(thread3); +} + +int main(int argc, char **argv) +{ + runApplication(); + + return 0; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_v4l_raw_ethernet.c b/ARDroneLib/VP_SDK/Examples/elinux/api_v4l_raw_ethernet.c new file mode 100644 index 0000000..a132605 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_v4l_raw_ethernet.c @@ -0,0 +1,243 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#undef BLOCK_MODE +#undef ACQ_WIDTH +#undef ACQ_HEIGHT + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + +#define COM_VIDEO() wired_com() +#define COM_CONFIG_VIDEO() wired_config() +#define COM_CONNECTION_VIDEO() wired_connection() + + +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +#define NB_STAGES_MAX 10 + + +static vp_stages_input_v4l_config_t ivc; +static vp_stages_output_com_config_t occ; + +static PIPELINE_HANDLE pipeline_handle; + +static vp_api_picture_t picture; + + +C_RESULT +buffer_to_picture_open(int *cfg) +{ + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH/2; + picture.cr_line_size = ACQ_WIDTH/2; + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(int *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + static int32_t blockline; + + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + blockline = 0; + out->numBuffers = 1; + out->size = ACQ_WIDTH*ACQ_HEIGHT*3/2; + out->buffers = (int8_t **)(int8_t *)&picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + out->status = in->status; + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + picture.y_buf = (uint8_t*)in->buffers[0]; + picture.cb_buf = (uint8_t*)in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT; + picture.cr_buf = (uint8_t*)in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT*5/4; + picture.complete = 1; + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(int *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +vp_com_t* wired_com(void) +{ + static vp_com_t com = { + VP_COM_WIRED, + FALSE, + 0, + { { 0 } }, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* wired_config(void) +{ + static vp_com_wired_config_t config = { + "eth0", + "172.20.22.253", + "255.255.255.0", + "172.20.22.255" + }; + + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* wired_connection(void) +{ + static vp_com_wired_connection_t connection = { + 0 + }; + + return (vp_com_connection_t*) (void*) &connection; +} + + +int main(int argc, char **argv) +{ + START_THREAD(app, argv); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES_MAX]; + + uint16_t time1,time2; + uint16_t i; + + time1 = clock(); + + vp_os_memset(&ivc,0,sizeof(ivc)); + //vp_os_memset(&vec,0,sizeof(vec)); + vp_os_memset(&occ,0,sizeof(occ)); + + ivc.device = "/tmp/video0"; + ivc.width = ACQ_WIDTH; + ivc.height = ACQ_HEIGHT; + ivc.vp_api_picture = &picture; + +/* vec.width = ACQ_WIDTH; */ +/* vec.height = ACQ_HEIGHT; */ +/* vec.block_mode_enable = FALSE; */ +/* vec.picture = &picture; */ + + occ.com = COM_VIDEO(); + occ.config = COM_CONFIG_VIDEO(); + occ.connection = COM_CONNECTION_VIDEO(); + occ.socket.type = VP_COM_SERVER; + occ.socket.protocol = VP_COM_TCP; + occ.socket.port = 5555; + occ.buffer_size = 320*240*3/2; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_FILE; + stages[pipeline.nb_stages].cfg = (void *)&ivc; + stages[pipeline.nb_stages++].funcs = vp_stages_input_v4l_funcs; + +/* stages[pipeline.nb_stages].type = VP_API_FILTER_ENCODER; */ +/* stages[pipeline.nb_stages].cfg = (void *)NULL; */ +/* stages[pipeline.nb_stages++].funcs = buffer_to_picture_funcs; */ + +/* stages[pipeline.nb_stages].type = VP_API_FILTER_ENCODER; */ +/* stages[pipeline.nb_stages].cfg = (void*)&vec; */ +/* stages[pipeline.nb_stages++].funcs = vlib_encoding_funcs; */ + + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&occ; + stages[pipeline.nb_stages++].funcs = vp_stages_output_com_funcs; + + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + + out.status = VP_API_STATUS_PROCESSING; + + ///////////////////////////////////////////////////////////////////////////////////////// + i = 0; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING)) + { + i++; + PRINT("image %d \n",i); + //vp_os_delay(50); + } + ///////////////////////////////////////////////////////////////////////////////////////// + + time2 = clock(); + printf("temps ecoule : %d \n",time2-time1); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_v4l_vlib_ethernet.c b/ARDroneLib/VP_SDK/Examples/elinux/api_v4l_vlib_ethernet.c new file mode 100644 index 0000000..7cd6151 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_v4l_vlib_ethernet.c @@ -0,0 +1,244 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#undef BLOCK_MODE +#undef ACQ_WIDTH +#undef ACQ_HEIGHT + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + +#define COM_VIDEO() wired_com() +#define COM_CONFIG_VIDEO() wired_config() +#define COM_CONNECTION_VIDEO() wired_connection() + + +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +#define NB_STAGES_MAX 10 + + +static vp_stages_input_v4l_config_t ivc; +static vlib_stage_encoding_config_t vec; +static vp_stages_output_com_config_t occ; + +static PIPELINE_HANDLE pipeline_handle; + +static vp_api_picture_t picture; + + +C_RESULT +buffer_to_picture_open(int *cfg) +{ + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH/2; + picture.cr_line_size = ACQ_WIDTH/2; + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(int *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + static int32_t blockline; + + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + blockline = 0; + out->numBuffers = 1; + out->size = ACQ_WIDTH*ACQ_HEIGHT*3/2; + out->buffers = (int8_t **)(int8_t *)&picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + out->status = in->status; + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + picture.y_buf = (uint8_t*)in->buffers[0]; + picture.cb_buf = (uint8_t*)in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT; + picture.cr_buf = (uint8_t*)in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT*5/4; + picture.complete = 1; + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(int *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +vp_com_t* wired_com(void) +{ + static vp_com_t com = { + VP_COM_WIRED, + FALSE, + 0, + { { 0 } }, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* wired_config(void) +{ + static vp_com_wired_config_t config = { + "eth0", + "172.20.22.253", + "255.255.255.0", + "172.20.22.255" + }; + + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* wired_connection(void) +{ + static vp_com_wired_connection_t connection = { + 0 + }; + + return (vp_com_connection_t*) (void*) &connection; +} + + +int main(int argc, char **argv) +{ + START_THREAD(app, argv); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES_MAX]; + + uint16_t time1,time2; + uint16_t i; + + time1 = clock(); + + vp_os_memset(&ivc,0,sizeof(ivc)); + vp_os_memset(&vec,0,sizeof(vec)); + vp_os_memset(&occ,0,sizeof(occ)); + + ivc.device = "/tmp/video0"; + ivc.width = ACQ_WIDTH; + ivc.height = ACQ_HEIGHT; + ivc.vp_api_picture = &picture; + + vec.width = ACQ_WIDTH; + vec.height = ACQ_HEIGHT; + vec.block_mode_enable = FALSE; + vec.picture = &picture; + + occ.com = COM_VIDEO(); + occ.config = COM_CONFIG_VIDEO(); + occ.connection = COM_CONNECTION_VIDEO(); + occ.socket.type = VP_COM_SERVER; + occ.socket.protocol = VP_COM_TCP; + occ.socket.port = 5555; + occ.buffer_size = 1500; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_FILE; + stages[pipeline.nb_stages].cfg = (void *)&ivc; + stages[pipeline.nb_stages++].funcs = vp_stages_input_v4l_funcs; + + stages[pipeline.nb_stages].type = VP_API_FILTER_ENCODER; + stages[pipeline.nb_stages].cfg = (void *)NULL; + stages[pipeline.nb_stages++].funcs = buffer_to_picture_funcs; + + stages[pipeline.nb_stages].type = VP_API_FILTER_ENCODER; + stages[pipeline.nb_stages].cfg = (void*)&vec; + stages[pipeline.nb_stages++].funcs = vlib_encoding_funcs; + + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&occ; + stages[pipeline.nb_stages++].funcs = vp_stages_output_com_funcs; + + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + + out.status = VP_API_STATUS_PROCESSING; + + ///////////////////////////////////////////////////////////////////////////////////////// + i = 0; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING)) + { + i++; + PRINT("image %d \n",i); + //vp_os_delay(50); + } + ///////////////////////////////////////////////////////////////////////////////////////// + + time2 = clock(); + printf("temps ecoule : %d \n",time2-time1); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/elinux/api_wifiClientTCP_console.c b/ARDroneLib/VP_SDK/Examples/elinux/api_wifiClientTCP_console.c new file mode 100644 index 0000000..eeaa150 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/api_wifiClientTCP_console.c @@ -0,0 +1,66 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +static PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + + vp_com_t com; + vp_com_wifi_config_t config; + vp_com_wifi_connection_t connection; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t)); + vp_os_memset( &connection, 0, sizeof(vp_com_wifi_connection_t) ); + strcpy(connection.networkName,"linksys"); + vp_stages_fill_default_config(WIFI_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_WIFI; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket.serverHost,"192.168.1.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_CONSOLE; + stages[1].cfg = NULL; + stages[1].funcs = vp_stages_output_console_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/atcodec_client.c b/ARDroneLib/VP_SDK/Examples/elinux/atcodec_client.c new file mode 100644 index 0000000..d7b8e2a --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/atcodec_client.c @@ -0,0 +1,78 @@ + +#include +#include + +#include +#include + +#define AT_MESSAGES_HEADER "ATcodec/ATcodec_Messages_ex.h" + +#include "ATcodec/ATcodec_api.h" +#include "VP_Os/vp_os_types.h" +#include "VP_Os/vp_os_thread.h" +#include "VP_Os/vp_os_delay.h" +#include "VP_Os/vp_os_print.h" +#include + +#ifndef AT_MESSAGES_HEADER +#error You need to define AT_MESSAGES_HEADER +#endif + +extern AT_CODEC_MSG_IDS ids; + +#define INTRA_CMD_DELAY 10 + +THREAD_RET +thread_send_commands (THREAD_PARAMS data) +{ + while(1) + { + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + } +} + +int main(int argc, char **argv) +{ + THREAD_HANDLE atcodec_test_handle; + THREAD_HANDLE atcodec_test_handle2; + THREAD_HANDLE cmds_handle; + + AT_CODEC_FUNCTIONS_PTRS ptrs = + { + .init = AT_CODEC_Client_init, + .shutdown = AT_CODEC_Client_shutdown, + .open = AT_CODEC_Client_open, + .close = AT_CODEC_Client_close, + .read = AT_CODEC_Client_read, + .write = AT_CODEC_Client_write, + }; + + ATcodec_Init_Library(&ptrs); + + vp_os_thread_create(thread_ATcodec_Commands_Client, 0, &atcodec_test_handle); + vp_os_thread_create(thread_send_commands, 0, &cmds_handle); + vp_os_thread_create(thread_ATcodec_Commands_Server, 0, &atcodec_test_handle2); + + vp_os_thread_join(cmds_handle); + vp_os_thread_join(atcodec_test_handle2); + vp_os_thread_join(atcodec_test_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/elinux/atcodec_server.c b/ARDroneLib/VP_SDK/Examples/elinux/atcodec_server.c new file mode 100644 index 0000000..2d0ec7d --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/atcodec_server.c @@ -0,0 +1,41 @@ +#include + +#define AT_MESSAGES_HEADER "ATcodec/ATcodec_Messages_ex.h" + +#include "ATcodec/ATcodec_api.h" +#include "VP_Os/vp_os_types.h" +#include "VP_Os/vp_os_thread.h" +#include + +#ifndef AT_MESSAGES_HEADER +#error You need to define AT_MESSAGES_HEADER +#endif + +int main(int argc, char **argv) +{ + THREAD_HANDLE atcodec_test_handle; + + AT_CODEC_FUNCTIONS_PTRS ptrs = + { + .init = AT_CODEC_init, + .shutdown = AT_CODEC_shutdown, + .open = AT_CODEC_open, + .close = AT_CODEC_close, + .read = AT_CODEC_read, + .write = AT_CODEC_write, + }; + + ptrs.init = AT_CODEC_init; + ptrs.shutdown = AT_CODEC_shutdown; + ptrs.open = AT_CODEC_open; + ptrs.close = AT_CODEC_close; + ptrs.read = AT_CODEC_read; + ptrs.write = AT_CODEC_write; + + ATcodec_Init_Library(&ptrs); + + vp_os_thread_create(thread_ATcodec_Commands_Server, 0, &atcodec_test_handle); + vp_os_thread_join(atcodec_test_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/atcodec_sorted_list.c b/ARDroneLib/VP_SDK/Examples/elinux/atcodec_sorted_list.c new file mode 100644 index 0000000..ee30a22 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/atcodec_sorted_list.c @@ -0,0 +1,71 @@ + +#include + +#include "VP_Os/vp_os_types.h" +#include "ATcodec/ATcodec_Sorted_List.h" + +void print_element(void *element) +{ + printf("%d, ", *(uint32_t *)element); +} + +void print_list(ATcodec_Sorted_List_t *list) +{ + printf("{ "); + ATcodec_Sorted_List_batchProcess(list, print_element); + printf("}\n"); +} + +#define INSERT(VALUE) \ + element = VALUE; \ + ATcodec_Sorted_List_insertElement(&list, &element, element); \ + print_list(&list) + +#define REMOVE(INDEX) \ + ATcodec_Sorted_List_removeElement(&list, ATcodec_Sorted_List_getElement(&list, INDEX)); \ + print_list(&list) + +int main(int argc, char **argv) +{ + ATcodec_Sorted_List_t list; + int element; + + ATcodec_Sorted_List_init(&list, sizeof(int)); + print_list(&list); + + INSERT(10); + INSERT(5); + INSERT(7); + INSERT(12); + INSERT(1); + + REMOVE(3); + + INSERT(12); + + REMOVE(0); + REMOVE(0); + + INSERT(3); + INSERT(4); + INSERT(6); + + REMOVE(0); + REMOVE(0); + REMOVE(0); + REMOVE(0); + REMOVE(0); + REMOVE(0); + + INSERT(7); + INSERT(12); + INSERT(1); + + REMOVE(1); + REMOVE(1); + REMOVE(0); + + ATcodec_Sorted_List_destroy(&list); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/elinux/v4l_stage.c b/ARDroneLib/VP_SDK/Examples/elinux/v4l_stage.c new file mode 100644 index 0000000..18381fc --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/elinux/v4l_stage.c @@ -0,0 +1,256 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "Video/ov7720.h" +#include "Video/cresyn.h" + +#include +#include + + +//#define ACQ_WIDTH 176 +//#define ACQ_HEIGHT 144 + +#define ACQ_WIDTH 640 +#define ACQ_HEIGHT 480 + +#define CRESYN_CAM +//#define OV_CAM +//#define BLOCK_MODE +//#define BUFFER +//#define ENCODE +//#define FILE_OUTPUT +//#define ETHERNET_OUTPUT + + + +#define NB_STAGES_MAX 10 + + +static vp_stages_input_camif_config_t ivc; +static vlib_stage_encoding_config_t vec; +static vp_stages_output_file_config_t ofc; +static vp_stages_output_com_config_t occ; +static blockline_to_buffer_config_t bbc; + +static PIPELINE_HANDLE pipeline_handle; + + +C_RESULT +buffer_to_picture_close(int *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t V4L2_funcs = +{ + (vp_api_stage_handle_msg_t)vp_stages_input_camif_stage_handle_msg, + (vp_api_stage_open_t)vp_stages_input_camif_stage_open, + (vp_api_stage_transform_t)vp_stages_input_camif_stage_transform, + (vp_api_stage_close_t)vp_stages_input_camif_stage_close +}; + +//// COM +vp_com_t* wired_com(void) +{ + static vp_com_t com = { + VP_COM_WIRED, + FALSE, + 0, + { { 0 } }, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* wired_config(void) +{ + static vp_com_wired_config_t config = { + "eth0", + "172.20.2.190", + "255.255.255.0", + "172.20.2.255" + }; + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* wired_connection(void) +{ + static vp_com_wired_connection_t connection = { + 0 + }; + + return (vp_com_connection_t*) (void*) &connection; +} + + + + +int main(int argc, char **argv) +{ + vp_api_picture_t video_picture; + vp_api_picture_t buffer_blockline; +#ifdef BLOCK_MODE + vp_api_picture_t video_blockline; +#endif + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES_MAX]; + + vp_os_memset(&ivc,0,sizeof(ivc)); + vp_os_memset(&ofc,0,sizeof(ofc)); + vp_os_memset(&occ,0,sizeof(occ)); + + + // CAMIF config + ivc.camera = "/dev/video1"; + ivc.i2c = "/dev/i2c-0"; +#ifdef OV_CAM + ivc.camera_configure = &camera_configure_ov77xx; +#else +#ifdef CRESYN_CAM + ivc.camera_configure = &camera_configure_cresyn; +#else +#error no cam selected +#endif +#endif + + ivc.resolution = VGA; + ivc.nb_buffers = 8; + ivc.format = V4L2_PIX_FMT_YUV420; + ivc.y_pad = 0; + ivc.c_pad = 0; + ivc.offset_delta = 0; +#ifdef BLOCK_MODE + ivc.vp_api_blockline = &video_blockline; +#endif + ivc.vp_api_picture = &video_picture; + ivc.use_chrominances = 1; + ivc.framerate = 15; + + // BUFFER +#ifdef BLOCK_MODE + bbc.picture = &video_blockline; +#endif + + // ENCODER + vec.width = 320; + vec.height = 240; +#ifdef BLOCK_MODE + vec.block_mode_enable = TRUE; +#else + vec.block_mode_enable = FALSE; +#endif + vec.picture = &video_picture; + + // OUTPUT FILE config + ofc.name = "/tmp/out.yuv"; + + // COM CONFIG + occ.com = wired_com(); + occ.config = wired_config(); + occ.connection = wired_connection(); + occ.socket.type = VP_COM_SERVER; + occ.socket.protocol = VP_COM_TCP; + occ.socket.port = 5555; + occ.buffer_size = 640*480*3/2; + + // build pipeline + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_CAMIF; + stages[pipeline.nb_stages].cfg = (void *)&ivc; + stages[pipeline.nb_stages++].funcs = V4L2_funcs; + +#ifdef BLOCK_MODE +#ifdef BUFFER + stages[pipeline.nb_stages].type = VP_API_INPUT_CAMIF; + stages[pipeline.nb_stages].cfg = (void *)&bbc; + stages[pipeline.nb_stages++].funcs = blockline_to_buffer_funcs; +#endif +#endif + +#ifdef ENCODE + stages[pipeline.nb_stages].type = VP_API_FILTER_ENCODER; + stages[pipeline.nb_stages].cfg = (void*)&vec; + stages[pipeline.nb_stages++].funcs = vlib_encoding_funcs; +#endif + +#ifdef FILE_OUTPUT + stages[pipeline.nb_stages].type = VP_API_OUTPUT_FILE; + stages[pipeline.nb_stages].cfg = (void *)&ofc; + stages[pipeline.nb_stages++].funcs = vp_stages_output_file_funcs; +#endif + +#ifdef ETHERNET_OUTPUT + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&occ; + stages[pipeline.nb_stages++].funcs = vp_stages_output_com_funcs; +#endif + + pipeline.stages = &stages[0]; + + // launch pipelines + vp_api_open(&pipeline, &pipeline_handle); + + out.status = VP_API_STATUS_PROCESSING; + + ///////////////////////////////////////////////////////////////////////////////////////// + + uint16_t i = 0; + + struct timeval time1,time2; + + printf("Pipeline launched....\n"); + gettimeofday(&time1,NULL); + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING)) + { + i++; + //printf("image %d \n",i); + if (i>50) + break; + //vp_os_delay(20); + } + ///////////////////////////////////////////////////////////////////////////////////////// + + gettimeofday(&time2,NULL); + int seconde = time2.tv_sec-time1.tv_sec; + int ms = time2.tv_usec-time1.tv_usec; + if (ms<0) + { + seconde--; + ms += 1000000; + } + ms = ms/1000; + float fps = ((float)i*1000)/(float)(seconde*1000+ms); + printf("temps ecoule : %d.%d / nombre image : %d average fps : %f\n",seconde,ms,i,fps); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_BTclientTCP_MJPEG_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_BTclientTCP_MJPEG_sdl.c new file mode 100644 index 0000000..1cd2af6 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_BTclientTCP_MJPEG_sdl.c @@ -0,0 +1,707 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define NB_STAGES 3 + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + + +static PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + stream_new( &cfg->stream, OUTPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + C_RESULT res; + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { +#ifdef RECORD_MJPEG_VIDEO + fp = fopen("video", "wb"); +#endif // ! RECORD_MJPEG_VIDEO + + out->numBuffers = 1; + out->buffers = (int8_t**)cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) + { +#ifdef RECORD_MJPEG_VIDEO + fclose( fp ); +#endif // ! RECORD_MJPEG_VIDEO + out->status = in->status; + } + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( in->size > 0 ) + { + if( out->status == VP_API_STATUS_PROCESSING ) + { + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); +#ifdef RECORD_MJPEG_VIDEO + if( fp != NULL ) + fwrite(in->buffers[in->indexBuffer], in->size, 1, fp); +#endif // ! RECORD_MJPEG_VIDEO + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + res = mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + + PRINT( "%d picture decoded\n", cfg->mjpeg.num_frames ); + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} + + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + mjpeg_stage_decoding_config_t dec; + vp_stages_output_sdl_config_t osc; + + vp_com_t com; + vp_com_bluetooth_connection_t connection; + vp_com_bluetooth_config_t config; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + + picture.y_pad = 0; + picture.c_pad = 0; + + dec.picture = &picture; + dec.out_buffer_size = 4096; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &osc, 0, sizeof(vp_stages_output_sdl_config_t) ); + vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) ); + vp_os_memset( &config, 0, sizeof(vp_com_bluetooth_config_t) ); + vp_os_memset( &com, 0, sizeof(vp_com_t) ); + + vp_com_str_to_address("08:75:48:03:60:34",&connection.address); + // vp_com_str_to_address("00:12:1C:FF:A4:EE",&connection.address); + + strcpy(config.itfName, "bnep0"); + strcpy(config.localHost, "192.168.2.58"); + strcpy(config.netmask, "255.255.255.0"); + strcpy(config.broadcast, "192.168.2.255"); + strcpy(config.gateway, "192.168.2.0"); + strcpy(config.server, "192.168.2.0"); + strcpy(config.passkey, "1234" ); + config.secure = 1; + + com.type = VP_COM_BLUETOOTH; + + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 1600; + // icc.sockopt = VP_COM_NON_BLOCKING; + + strcpy(icc.socket.serverHost,"192.168.2.23"); + + osc.width = 320; + osc.height = 240; + osc.bpp = 16; + osc.window_width = 320; + osc.window_height = 240; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void*)&dec; + stages[1].funcs = mjpeg_decoding_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + +///*******************************************************************************************************************/// + + +// static THREAD_HANDLE dct_thread_handle; + +static dct_io_buffer_t* current_io_buffer; +static dct_io_buffer_t* result_io_buffer; + +static void fdct(const unsigned short* in, short* out); +static void idct(const short* in, unsigned short* out); + + +//----------------------------------------------------------------------------- +// DCT API +//----------------------------------------------------------------------------- + + +bool_t dct_init(void) +{ + current_io_buffer = NULL; + result_io_buffer = NULL; + + return TRUE; +} + +bool_t dct_compute( dct_io_buffer_t* io_buffer ) +{ + bool_t res = FALSE; + + assert(io_buffer != NULL); + + if( current_io_buffer == NULL && result_io_buffer == NULL ) + { + current_io_buffer = io_buffer; + res = TRUE; + + } + + return res; +} + +dct_io_buffer_t* dct_result( void ) +{ + uint32_t i; + dct_io_buffer_t* io_buffer; + + io_buffer = NULL; + + if( current_io_buffer != NULL) + { + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + io_buffer = current_io_buffer; + current_io_buffer = NULL; + } + + return io_buffer; +} + + +//----------------------------------------------------------------------------- +// DCT Computation +//----------------------------------------------------------------------------- + + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +static void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} + +static void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_console.c b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_console.c new file mode 100644 index 0000000..4f11a0a --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_console.c @@ -0,0 +1,66 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +static PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + + vp_com_t com; + vp_com_bluetooth_config_t config; + vp_com_bluetooth_connection_t connection; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) ); + vp_com_str_to_address("00:01:48:03:70:54",&connection.address); + vp_stages_fill_default_config(BLUETOOTH_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_BLUETOOTH; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 64; + + strcpy(icc.socket.serverHost,"192.168.2.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_CONSOLE; + stages[1].cfg = NULL; + stages[1].funcs = vp_stages_output_console_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_decoder_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_decoder_sdl.c new file mode 100644 index 0000000..a09036e --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_decoder_sdl.c @@ -0,0 +1,105 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifdef USE_FFMPEG +#define NB_STAGES 3 +#else +#define NB_STAGES 1 +#endif + + +static PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, NO_PARAM); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,nomParams) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + vp_stages_decoder_filter_config_t dfc; + vp_stages_output_sdl_config_t osc; + + vp_com_t com; + vp_com_bluetooth_connection_t connection; + vp_com_bluetooth_config_t config; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) ); + vp_com_str_to_address("00:01:48:03:70:54",&connection.address); + vp_stages_fill_default_config(BLUETOOTH_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + vp_stages_fill_default_config(DECODER_MPEG4_CONFIG, &dfc, sizeof(dfc)); + vp_stages_fill_default_config(SDL_DECODING_CONFIG, &osc, sizeof(osc)); + + com.type = VP_COM_BLUETOOTH; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket.serverHost,"192.168.2.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; +#ifdef USE_FFMPEG + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void *)&dfc; + stages[1].funcs = vp_stages_decoder_filter_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; +#endif + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_ofile.c b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_ofile.c new file mode 100644 index 0000000..7cbc505 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_ofile.c @@ -0,0 +1,71 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +static PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + vp_stages_output_file_config_t ofc; + + vp_com_t com; + vp_com_bluetooth_connection_t connection; + vp_com_bluetooth_config_t config; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &ofc, 0, sizeof(vp_stages_output_file_config_t) ); + vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) ); + vp_com_str_to_address("00:01:48:03:70:54",&connection.address); + vp_stages_fill_default_config(BLUETOOTH_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_BLUETOOTH; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket.serverHost,"192.168.2.23"); + + ofc.name = "out.mpg"; + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_FILE; + stages[1].cfg = (void *)&ofc; + stages[1].funcs = vp_stages_output_file_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_raw_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_raw_sdl.c new file mode 100644 index 0000000..0caa254 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_bluetoothClientTCP_raw_sdl.c @@ -0,0 +1,93 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +static PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + vp_stages_output_sdl_config_t osc; + + vp_com_t com; + vp_com_bluetooth_connection_t connection; + vp_com_bluetooth_config_t config; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &connection, 0, sizeof(vp_com_bluetooth_connection_t) ); + vp_com_str_to_address("00:01:48:03:70:54",&connection.address); + vp_stages_fill_default_config(BLUETOOTH_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + vp_stages_fill_default_config(SDL_DECODING_QCIF_CONFIG, &osc, sizeof(osc)); + + com.type = VP_COM_BLUETOOTH; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket.serverHost,"192.168.2.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_SDL; + stages[1].cfg = (void *)&osc; + stages[1].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_config.c b/ARDroneLib/VP_SDK/Examples/linux/api_config.c new file mode 100644 index 0000000..890ed09 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_config.c @@ -0,0 +1,12 @@ +#include +#include + +#include + +int main(void) +{ + printf ("navdata_port:%d\n", get_navdata_port()); + + return 0; +} + diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_encode_decode.c b/ARDroneLib/VP_SDK/Examples/linux/api_encode_decode.c new file mode 100644 index 0000000..1b872fe --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_encode_decode.c @@ -0,0 +1,1019 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// #define USE_EULER_ANGLES + +// #define ACQ_WIDTH (176+0*16) +// #define ACQ_HEIGHT (144+0*16) + +// #define QVGA_WIDTH 352 +// #define QVGA_HEIGHT 288 + +#define ACQ_WIDTH (320) +#define ACQ_HEIGHT (240) + +#define NB_STAGES 4 + + +PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(app, nomParams); +PROTO_THREAD_ROUTINE(dct, nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(app, 20) + THREAD_TABLE_ENTRY(dct, 20) +END_THREAD_TABLE + + +///*******************************************************************************************************************/// + + +typedef struct _buffer_to_picture_config_t +{ + vp_api_picture_t* picture; + +} buffer_to_picture_config_t; + +C_RESULT +buffer_to_picture_open(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) cfg->picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + vp_os_memcpy( cfg->picture->y_buf, in->buffers[0], ACQ_WIDTH*ACQ_HEIGHT ); + vp_os_memcpy( cfg->picture->cb_buf, in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT, ACQ_WIDTH*ACQ_HEIGHT/4 ); + vp_os_memcpy( cfg->picture->cr_buf, in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4, ACQ_WIDTH*ACQ_HEIGHT/4 ); + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +///*******************************************************************************************************************/// + + +typedef struct _picture_to_buffer_config_t +{ + vp_api_picture_t* picture; + +} picture_to_buffer_config_t; + +C_RESULT +picture_to_buffer_open(buffer_to_picture_config_t *cfg) +{ + return C_OK; +} + +C_RESULT +picture_to_buffer_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) vp_os_malloc(out->size*sizeof(int8_t) + sizeof(int8_t*)); + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + + out->buffers[0] = (int8_t *)(out->buffers+1); + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + if( in->size == 1 ) + { + // got a picture + vp_os_memcpy( out->buffers[0], cfg->picture->y_buf, ACQ_WIDTH*ACQ_HEIGHT ); + vp_os_memcpy( out->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT, cfg->picture->cb_buf, ACQ_WIDTH*ACQ_HEIGHT/4); + vp_os_memcpy( out->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4, cfg->picture->cr_buf, ACQ_WIDTH*ACQ_HEIGHT/4); + } + } + + // out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +picture_to_buffer_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t picture_to_buffer_funcs = +{ + NULL, + (vp_api_stage_open_t) picture_to_buffer_open, + (vp_api_stage_transform_t) picture_to_buffer_transform, + (vp_api_stage_close_t) picture_to_buffer_close +}; + + +///*******************************************************************************************************************/// + + +enum { + MJPEG_ENCODER, + MJPEG_DECODER +}; + +typedef struct _mjpeg_stage_encoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_encoding_config_t; + +C_RESULT mjpeg_stage_encoding_open(mjpeg_stage_encoding_config_t *cfg) +{ + stream_new( &cfg->stream, INPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_ENCODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_encoding_transform(mjpeg_stage_encoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + C_RESULT res; + uint32_t num_frames; + bool_t got_image; + + res = C_OK; + + vp_os_mutex_lock(&out->lock); + + if( out->status == VP_API_STATUS_INIT ) + { + out->numBuffers = 1; + out->buffers = (int8_t**) vp_os_malloc( sizeof(int8_t*) + cfg->out_buffer_size*sizeof(int8_t) ); + out->buffers[0] = (int8_t*) ( out->buffers + 1 ); + out->indexBuffer = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( out->status == VP_API_STATUS_PROCESSING ) + { + stream_config( &cfg->stream, cfg->out_buffer_size, out->buffers[0] ); + + num_frames = cfg->mjpeg.num_frames; + res = mjpeg_encode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + if( got_image ) + { + PRINT("Frame complete. Size = %d bytes\n", cfg->stream.index); + } + out->size = cfg->stream.index; + } + + if( out->status == VP_API_STATUS_ENDED ) + { + PRINT("End of data\n"); + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_encoding_close(mjpeg_stage_encoding_config_t *cfg) +{ + return mjpeg_release( &cfg->mjpeg ); +} + + +///*******************************************************************************************************************/// + + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + stream_new( &cfg->stream, OUTPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)&cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) + out->status = in->status; + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( out->status == VP_API_STATUS_PROCESSING ) + { + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + + PRINT( "%d picture decoded\n", cfg->mjpeg.num_frames ); + + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} + + +///*******************************************************************************************************************/// + + +const vp_api_stage_funcs_t mjpeg_encoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_encoding_open, + (vp_api_stage_transform_t) mjpeg_stage_encoding_transform, + (vp_api_stage_close_t) mjpeg_stage_encoding_close +}; + + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + + +///*******************************************************************************************************************/// + +int32_t codec; + +int +main(int argc, char **argv) +{ + codec = -1; + + if(argc == 4) + { + if( strcmp(argv[1], "encode") == 0 ) + { + codec = MJPEG_ENCODER; + } + else if( strcmp(argv[1], "decode") == 0 ) + { + codec = MJPEG_DECODER; + } + } + + if( codec < 0 ) + { + PRINT("Usage : %s [encode|decode] .\n", argv[0]); + return EXIT_FAILURE; + } + + // START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + // JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + uint32_t num_stages = 0; + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_file_config_t ofc; + // vp_stages_output_sdl_config_t osc; + + buffer_to_picture_config_t bpc; + mjpeg_stage_encoding_config_t mec; + + picture_to_buffer_config_t pbc; + mjpeg_stage_decoding_config_t dec; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + + picture.y_pad = 0; + picture.c_pad = 0; + + vp_os_memset(&ifc,0,sizeof(vp_stages_input_file_config_t)); + + ifc.name = ((char**)argv)[2]; + ifc.buffer_size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + + ofc.name = ((char**)argv)[3]; + + stages[num_stages].type = VP_API_INPUT_FILE; + stages[num_stages].cfg = (void *)&ifc; + stages[num_stages].funcs = vp_stages_input_file_funcs; + + num_stages++; + + if( codec == MJPEG_ENCODER ) + { + bpc.picture = &picture; + + mec.picture = &picture; + mec.out_buffer_size = 4096 * 4; + + stages[num_stages].type = VP_API_FILTER_DECODER; + stages[num_stages].cfg = (void *)&bpc; + stages[num_stages].funcs = buffer_to_picture_funcs; + + num_stages++; + + stages[num_stages].type = MJPEG_ENCODER; + stages[num_stages].cfg = (void*)&mec; + stages[num_stages].funcs = mjpeg_encoding_funcs; + } + else if( codec == MJPEG_DECODER ) + { + dec.picture = &picture; + dec.out_buffer_size = 4096 * 4; + + pbc.picture = &picture; + + stages[num_stages].type = MJPEG_DECODER; + stages[num_stages].cfg = (void*)&dec; + stages[num_stages].funcs = mjpeg_decoding_funcs; + + num_stages++; + + stages[num_stages].type = VP_API_FILTER_ENCODER; + stages[num_stages].cfg = (void *)&pbc; + stages[num_stages].funcs = picture_to_buffer_funcs; + } + + num_stages++; + + stages[num_stages].type = VP_API_OUTPUT_FILE; + stages[num_stages].cfg = (void*)&ofc; + stages[num_stages].funcs = vp_stages_output_file_funcs; + + num_stages++; + + pipeline.nb_stages = num_stages; + pipeline.stages = &stages[0]; + + PRINT("Pipeline configured with %d stages\n", num_stages); + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + + +///*******************************************************************************************************************/// + + +// static THREAD_HANDLE dct_thread_handle; +static vp_os_mutex_t dct_start_mutex; +static vp_os_cond_t dct_start_cond; +static vp_os_mutex_t critical_section; + +static dct_io_buffer_t* current_io_buffer; +static dct_io_buffer_t* result_io_buffer; + +static void fdct(const unsigned short* in, short* out); +static void idct(const short* in, unsigned short* out); + + +//----------------------------------------------------------------------------- +// DCT Thread +//----------------------------------------------------------------------------- + +PROTO_THREAD_ROUTINE(dct, params) +{ + uint32_t i; + + PRINT("DCT thread start\n"); + + while(1) + { + if( current_io_buffer == NULL ) + { + vp_os_mutex_lock(&dct_start_mutex); + vp_os_cond_wait(&dct_start_cond); + vp_os_mutex_unlock(&dct_start_mutex); + } + + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + vp_os_mutex_lock(&critical_section); + result_io_buffer = current_io_buffer; + current_io_buffer = NULL; + vp_os_mutex_unlock(&critical_section); + } + + return 0; +} + + +//----------------------------------------------------------------------------- +// DCT API +//----------------------------------------------------------------------------- + + +bool_t dct_init(void) +{ + vp_os_mutex_init(&dct_start_mutex); + vp_os_cond_init(&dct_start_cond, &dct_start_mutex); + + vp_os_mutex_init(&critical_section); + + current_io_buffer = NULL; + result_io_buffer = NULL; + + // START_THREAD(dct, NO_PARAM); + + return TRUE; +} + +bool_t dct_compute( dct_io_buffer_t* io_buffer ) +{ + bool_t res = FALSE; + + assert(io_buffer != NULL); + + if( current_io_buffer == NULL && result_io_buffer == NULL ) + { +// if( vp_os_mutex_trylock(&critical_section) ) + { + current_io_buffer = io_buffer; +/* + vp_os_mutex_lock(&dct_start_mutex); + vp_os_cond_signal(&dct_start_cond); + vp_os_mutex_unlock(&dct_start_mutex); +*/ + res = TRUE; + +// vp_os_mutex_unlock(&critical_section); + } + } + + return res; +} + +dct_io_buffer_t* dct_result( void ) +{ + uint32_t i; + dct_io_buffer_t* io_buffer; + + io_buffer = NULL; + + if( current_io_buffer != NULL) + { + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + io_buffer = current_io_buffer; + current_io_buffer = NULL; + } +/* + if( result_io_buffer != NULL ) + { + if( vp_os_mutex_trylock(&critical_section) ) + { + io_buffer = result_io_buffer; + result_io_buffer = NULL; + + vp_os_mutex_unlock(&critical_section); + } + } +*/ + return io_buffer; +} + +//----------------------------------------------------------------------------- +// DCT Computation +//----------------------------------------------------------------------------- + + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +static void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} + +static void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_ethernet_raw_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_ethernet_raw_sdl.c new file mode 100644 index 0000000..a03eca4 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_ethernet_raw_sdl.c @@ -0,0 +1,204 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define SERVER_HOST "172.20.22.245" + +#undef BLOCK_MODE +#undef ACQ_WIDTH +#undef ACQ_HEIGHT + +#define NB_STAGES_MAX 10 + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + + +#define COM_VIDEO() wired_com() +#define COM_CONFIG_VIDEO() wired_config() +#define COM_CONNECTION_VIDEO() wired_connection() +#define COM_CONFIG_SOCKET_VIDEO(socket, type, opt, serverhost) wired_config_socket(socket, type, opt, serverhost) + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,10) +END_THREAD_TABLE + + +static vp_stages_input_com_config_t icc; +static vp_stages_buffer_to_picture_config_t bpc; +static vp_stages_output_sdl_config_t osc; + +static PIPELINE_HANDLE pipeline_handle; + +static vp_api_picture_t picture; + + +vp_com_t* wired_com(void) +{ + static vp_com_t com = { + VP_COM_WIRED, + FALSE, + 0, + { { 0 } }, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* wired_config(void) +{ + static vp_com_wired_config_t config = { + "eth1", + "172.20.22.245", + "255.255.255.0", + "172.20.22.255" + }; + + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* wired_connection(void) +{ + static vp_com_wired_connection_t connection = { + 0 + }; + + return (vp_com_connection_t*) (void*) &connection; +} + +void wired_config_socket(vp_com_socket_t* socket, VP_COM_SOCKET_TYPE type, int32_t port, const char* serverhost) +{ + vp_os_memset(socket, 0, sizeof(vp_com_socket_t)); + + socket->type = type; + socket->protocol = VP_COM_TCP; + socket->port = port; + + if(serverhost && socket->type == VP_COM_CLIENT) + strcpy(socket->serverHost, serverhost); +} + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES_MAX]; + + vp_os_memset( &icc, 0, sizeof(icc) ); + vp_os_memset( &bpc, 0, sizeof(bpc) ); + vp_os_memset( &osc, 0, sizeof(osc) ); + + icc.com = COM_VIDEO(); + icc.buffer_size = ACQ_WIDTH*ACQ_HEIGHT*3/2; + icc.socket.protocol = VP_COM_TCP; + COM_CONFIG_SOCKET_VIDEO(&icc.socket, VP_COM_CLIENT, 5555, SERVER_HOST); + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 30; + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + picture.y_pad = 0; + picture.c_pad = 0; + + bpc.picture = &picture; + bpc.block_mode_enable = FALSE; + bpc.y_buffer_size = ACQ_WIDTH * ACQ_HEIGHT; + bpc.y_blockline_size = ACQ_WIDTH * 16; // each blockline have 16 lines + bpc.y_current_size = 0; + bpc.num_frames = 0; + bpc.y_buf_ptr = NULL; + bpc.luma_only = FALSE; + bpc.cr_buf_ptr = NULL; + bpc.cb_buf_ptr = NULL; + + osc.width = ACQ_WIDTH; + osc.height = ACQ_HEIGHT; + osc.bpp = 16; + osc.window_width = ACQ_WIDTH; + osc.window_height = ACQ_HEIGHT; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&icc; + stages[pipeline.nb_stages++].funcs = vp_stages_input_com_funcs; + + stages[pipeline.nb_stages].type = VP_API_FILTER_DECODER; + stages[pipeline.nb_stages].cfg = (void*)&bpc; + stages[pipeline.nb_stages++].funcs = vp_stages_buffer_to_picture_funcs; + + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SDL; + stages[pipeline.nb_stages].cfg = (void *)&osc; + stages[pipeline.nb_stages++].funcs = vp_stages_output_sdl_funcs; + + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_ethernet_vlib_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_ethernet_vlib_sdl.c new file mode 100644 index 0000000..c56e5fe --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_ethernet_vlib_sdl.c @@ -0,0 +1,199 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define SERVER_HOST "172.20.22.245" + +#undef BLOCK_MODE +#undef ACQ_WIDTH +#undef ACQ_HEIGHT + +#define NB_STAGES_MAX 10 + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + + +#define COM_VIDEO() wired_com() +#define COM_CONFIG_VIDEO() wired_config() +#define COM_CONNECTION_VIDEO() wired_connection() +#define COM_CONFIG_SOCKET_VIDEO(socket, type, opt, serverhost) wired_config_socket(socket, type, opt, serverhost) + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,10) +END_THREAD_TABLE + + +static vp_stages_input_com_config_t icc; +static vlib_stage_decoding_config_t vdc; +static vp_stages_output_sdl_config_t osc; + +static PIPELINE_HANDLE pipeline_handle; + +static vp_api_picture_t picture; + + +vp_com_t* wired_com(void) +{ + static vp_com_t com = { + VP_COM_WIRED, + FALSE, + 0, + { { 0 } }, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* wired_config(void) +{ + static vp_com_wired_config_t config = { + "eth1", + "172.20.22.245", + "255.255.255.0", + "172.20.22.255" + }; + + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* wired_connection(void) +{ + static vp_com_wired_connection_t connection = { + 0 + }; + + return (vp_com_connection_t*) (void*) &connection; +} + +void wired_config_socket(vp_com_socket_t* socket, VP_COM_SOCKET_TYPE type, int32_t port, const char* serverhost) +{ + vp_os_memset(socket, 0, sizeof(vp_com_socket_t)); + + socket->type = type; + socket->protocol = VP_COM_TCP; + socket->port = port; + + if(serverhost && socket->type == VP_COM_CLIENT) + strcpy(socket->serverHost, serverhost); +} + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES_MAX]; + + vp_os_memset( &icc, 0, sizeof(icc) ); + vp_os_memset( &vdc, 0, sizeof(vdc) ); + vp_os_memset( &osc, 0, sizeof(osc) ); + + icc.com = COM_VIDEO(); + icc.buffer_size = 1024; + icc.socket.protocol = VP_COM_TCP; + COM_CONFIG_SOCKET_VIDEO(&icc.socket, VP_COM_CLIENT, 5555, SERVER_HOST); + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 30; + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + picture.y_pad = 0; + picture.c_pad = 0; + + vdc.width = ACQ_WIDTH; + vdc.height = ACQ_HEIGHT; + vdc.picture = &picture; + vdc.luma_only = FALSE; + vdc.block_mode_enable = FALSE; + + osc.width = ACQ_WIDTH; + osc.height = ACQ_HEIGHT; + osc.bpp = 16; + osc.window_width = ACQ_WIDTH; + osc.window_height = ACQ_HEIGHT; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&icc; + stages[pipeline.nb_stages++].funcs = vp_stages_input_com_funcs; + + stages[pipeline.nb_stages].type = VP_API_FILTER_DECODER; + stages[pipeline.nb_stages].cfg = (void*)&vdc; + stages[pipeline.nb_stages++].funcs = vlib_decoding_funcs; + + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SDL; + stages[pipeline.nb_stages].cfg = (void *)&osc; + stages[pipeline.nb_stages++].funcs = vp_stages_output_sdl_funcs; + + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_ifile_MJPEG_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_ifile_MJPEG_sdl.c new file mode 100644 index 0000000..3c7db1a --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_ifile_MJPEG_sdl.c @@ -0,0 +1,690 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define NB_STAGES 3 + +#define CAMIF_BLOCKLINES_LOG2 4 +#define CAMIF_BLOCKLINES (1 << CAMIF_BLOCKLINES_LOG2) + +#define ACQ_WIDTH (176) +#define ACQ_HEIGHT (144) + +#define WINDOW_WIDTH 320 +#define WINDOW_HEIGHT 240 + + +PIPELINE_HANDLE pipeline_handle; + +PROTO_THREAD_ROUTINE(escaper, nomParams); +PROTO_THREAD_ROUTINE(app, nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper, 20) + THREAD_TABLE_ENTRY(app, 20) +END_THREAD_TABLE + + +///*******************************************************************************************************************/// + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + uint32_t width = cfg->picture->width; + uint32_t height = cfg->picture->height; + enum PixelFormat format = cfg->picture->format; + + stream_new( &cfg->stream, OUTPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, width, height, format ); +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + C_RESULT res; + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) + { + out->status = in->status; + } + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( in->size > 0 ) + { + if( out->status == VP_API_STATUS_PROCESSING ) + { + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + res = mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + + PRINT( "%d picture decoded\n", cfg->mjpeg.num_frames ); + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + + +int +main(int argc, char **argv) +{ + if(argc != 2) + { + PRINT("You must specify a filename.\n"); + return EXIT_FAILURE; + } + + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_sdl_config_t osc; + mjpeg_stage_decoding_config_t dec; + + vp_os_memset(&ifc,0,sizeof(vp_stages_input_file_config_t)); + + ifc.name = ((char**)argv)[1]; + ifc.buffer_size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + + osc.width = WINDOW_WIDTH; + osc.height = WINDOW_HEIGHT; + osc.bpp = 16; + osc.window_width = WINDOW_WIDTH; + osc.window_height = WINDOW_HEIGHT; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + + picture.y_pad = 0; + picture.c_pad = 0; + + dec.picture = &picture; + dec.out_buffer_size = 4096; + + stages[0].type = VP_API_INPUT_FILE; + stages[0].cfg = (void *)&ifc; + stages[0].funcs = vp_stages_input_file_funcs; + + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void *)&dec; + stages[1].funcs = mjpeg_decoding_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + vp_os_delay( 30 ); + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + + +///*******************************************************************************************************************/// + + +// static THREAD_HANDLE dct_thread_handle; + +static dct_io_buffer_t* current_io_buffer; +static dct_io_buffer_t* result_io_buffer; + +static void fdct(const unsigned short* in, short* out); +static void idct(const short* in, unsigned short* out); + + +//----------------------------------------------------------------------------- +// DCT API +//----------------------------------------------------------------------------- + + +bool_t dct_init(void) +{ + current_io_buffer = NULL; + result_io_buffer = NULL; + + return TRUE; +} + +bool_t dct_compute( dct_io_buffer_t* io_buffer ) +{ + bool_t res = FALSE; + + assert(io_buffer != NULL); + + if( current_io_buffer == NULL && result_io_buffer == NULL ) + { + current_io_buffer = io_buffer; + res = TRUE; + + } + + return res; +} + +dct_io_buffer_t* dct_result( void ) +{ + uint32_t i; + dct_io_buffer_t* io_buffer; + + io_buffer = NULL; + + if( current_io_buffer != NULL) + { + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + io_buffer = current_io_buffer; + current_io_buffer = NULL; + } + + return io_buffer; +} + + +//----------------------------------------------------------------------------- +// DCT Computation +//----------------------------------------------------------------------------- + + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +static void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} + +static void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_ifile_raw_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_ifile_raw_sdl.c new file mode 100644 index 0000000..b436254 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_ifile_raw_sdl.c @@ -0,0 +1,185 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define ACQ_WIDTH (320) +#define ACQ_HEIGHT (240) + +#define NB_STAGES 3 + + +PIPELINE_HANDLE pipeline_handle; + +PROTO_THREAD_ROUTINE(escaper, nomParams); +PROTO_THREAD_ROUTINE(app, nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper, 20) + THREAD_TABLE_ENTRY(app, 20) +END_THREAD_TABLE + + +///*******************************************************************************************************************/// + +typedef struct _buffer_to_picture_config_t +{ + vp_api_picture_t* picture; + +} buffer_to_picture_config_t; + +C_RESULT +buffer_to_picture_open(buffer_to_picture_config_t *cfg) +{ + cfg->picture->format = PIX_FMT_YUV420P; + + cfg->picture->width = ACQ_WIDTH; + cfg->picture->height = ACQ_HEIGHT; + cfg->picture->framerate = 15; + + cfg->picture->y_line_size = ACQ_WIDTH; + cfg->picture->cb_line_size = ACQ_WIDTH / 2; + cfg->picture->cr_line_size = ACQ_WIDTH / 2; + + cfg->picture->y_pad = 0; + cfg->picture->c_pad = 0; + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) cfg->picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + cfg->picture->y_buf = in->buffers[0]; + cfg->picture->cb_buf = in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT; + cfg->picture->cr_buf = in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4; + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +int +main(int argc, char **argv) +{ + if(argc != 2) + { + PRINT("You must specify a filename.\n"); + return EXIT_FAILURE; + } + + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_sdl_config_t osc; + buffer_to_picture_config_t bpc; + + vp_os_memset(&ifc,0,sizeof(vp_stages_input_file_config_t)); + + ifc.name = ((char**)argv)[1]; + ifc.buffer_size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + + osc.width = ACQ_WIDTH; + osc.height = ACQ_HEIGHT; + osc.bpp = 16; + osc.window_width = ACQ_WIDTH; + osc.window_height = ACQ_HEIGHT; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + bpc.picture = &picture; + + stages[0].type = VP_API_INPUT_FILE; + stages[0].cfg = (void *)&ifc; + stages[0].funcs = vp_stages_input_file_funcs; + + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void *)&bpc; + stages[1].funcs = buffer_to_picture_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + vp_os_delay( 500 ); + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_ifile_upper_ofile.c b/ARDroneLib/VP_SDK/Examples/linux/api_ifile_upper_ofile.c new file mode 100644 index 0000000..5425e3d --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_ifile_upper_ofile.c @@ -0,0 +1,115 @@ +#include +#include + +#include +#include +#include +#include + + +#define NB_STAGES 3 + + +static PIPELINE_HANDLE pipeline_handle; + + +C_RESULT +my_transform_open(void *cfg) +{ + return (SUCCESS); +} + +C_RESULT +my_transform_transform(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + int i; + + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = in->size; // to be cleaned ... + out->buffers = (int8_t **)malloc(sizeof(int8_t *)+out->size*sizeof(int8_t)); + out->buffers[0] = (int8_t *)(out->buffers+1); + out->indexBuffer = 0; + // out->lineSize not used + out->status = VP_API_STATUS_PROCESSING; + } + + if(in->status == VP_API_STATUS_ENDED) + { + free(out->buffers); + } + else if(in->status == VP_API_STATUS_PROCESSING) + { + // uppercase + for(i = 0 ; i < in->size ; i++) + { + out->buffers[0][i] = toupper(in->buffers[in->indexBuffer][i]); + } + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +my_transform_close(void *cfg) +{ + return (SUCCESS); +} + + +const vp_api_stage_funcs_t my_transform_funcs = +{ + NULL, + (vp_api_stage_open_t)my_transform_open, + (vp_api_stage_transform_t)my_transform_transform, + (vp_api_stage_close_t)my_transform_close +}; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_file_config_t ofc; + + ifc.name = "toto.in"; + ifc.buffer_size = 512; + + ofc.name = "toto.out"; + + stages[0].type = VP_API_INPUT_FILE; + stages[0].cfg = (void *)&ifc; + stages[0].funcs = vp_stages_input_file_funcs; + + stages[1].type = VP_API_FILTER_ENCODER; + stages[1].cfg = NULL; + stages[1].funcs = my_transform_funcs; + + stages[2].type = VP_API_OUTPUT_FILE; + stages[2].cfg = (void *)&ofc; + stages[2].funcs = vp_stages_output_file_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + + // \todo tests + + vp_api_close(&pipeline, &pipeline_handle); + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_serial_MJPEG_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_serial_MJPEG_sdl.c new file mode 100644 index 0000000..52d068d --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_serial_MJPEG_sdl.c @@ -0,0 +1,746 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define NB_STAGES 3 + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + + +static PIPELINE_HANDLE pipeline_handle; + +//////////////////////////////////////////////////////////////////////////////// +// cpu load information part +// +#define NOMFICH_CPUINFO "/proc/cpuinfo" +double RDTSC(void) +{ + unsigned long long x; + __asm__ volatile (".byte 0x0f, 0x31" : "=A"(x)); + return (double)x; +} + +int read_cpu_freq (double* freq) +{ + const char* prefix_cpu_mhz = "cpu MHz"; + FILE* F; + char line[300+1]; + char *pos; + int ok=0; + + F = fopen(NOMFICH_CPUINFO, "r"); + if (!F) return 0; + + while (!feof(F)) + { + fgets (line, sizeof(line), F); + + if (!strncmp(line, prefix_cpu_mhz, strlen(prefix_cpu_mhz))) + { + pos = strrchr (line, ':') +2; + if (!pos) break; + if (pos[strlen(pos)-1] == '\n') pos[strlen(pos)-1] = '\0'; + strcpy (line, pos); + strcat (line,"e6"); + *freq = atof (line); + ok = 1; + break; + } + } + fclose (F); + return ok; +} +//////////////////////////////////////////////////////////////////////////////// + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,10) +END_THREAD_TABLE + + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +double cpufreq; +double t1,t2, t; +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + stream_new( &cfg->stream, OUTPUT_STREAM ); + + read_cpu_freq(&cpufreq); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + uint32_t success; + bool_t got_image; + static FILE* fp=NULL; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + + fp = fopen("tmp.mjpg", "wb"); + //mjpeg_init_block_mode( &cfg->mjpeg, 15 ); + } + + if( in->status == VP_API_STATUS_ENDED ) + out->status = in->status; + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( in->size > 0 ) + { + if( out->status == VP_API_STATUS_PROCESSING ) + { + if( NULL != fp ) + fwrite( in->buffers[in->indexBuffer] , 1, in->size, fp ); + + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + success = SUCCEED(mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream , &got_image )); + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + } + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} + + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + +PROTO_THREAD_ROUTINE(app,argv) +{ + int32_t success, curstage=0; + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + mjpeg_stage_decoding_config_t dec; + vp_stages_output_sdl_config_t osc; + vp_com_serial_config_t config; + + vp_com_t com; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 30; + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + picture.y_pad = 0; + picture.c_pad = 0; + + dec.picture = &picture; + dec.out_buffer_size = 4096; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t) ); + vp_os_memset( &osc, 0, sizeof(vp_stages_output_sdl_config_t) ); + vp_os_memset( &com, 0, sizeof(vp_com_t) ); + + strcpy(config.itfName, "/dev/ttyUSB1"); + + // + config.initial_baudrate = VP_COM_BAUDRATE_921600; + config.baudrate = VP_COM_BAUDRATE_921600; + // + //config.initial_baudrate = VP_COM_BAUDRATE_460800; + //config.baudrate = VP_COM_BAUDRATE_460800; + // + + config.sync = 0; + config.blocking = 1; + com.type = VP_COM_SERIAL; + + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.socket.type = VP_COM_CLIENT; + icc.buffer_size = 320*240; + + //osc.width = 640; + //osc.height = 480; + osc.width = 320; + osc.height = 240; + osc.bpp = 16; + //osc.window_width = 640; + //osc.window_height = 480; + osc.window_width = 320; + osc.window_height = 240; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void*)&dec; + stages[1].funcs = mjpeg_decoding_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + /* + do { + t1 = RDTSC(); + success = SUCCEED(vp_api_run(&pipeline, &out)); + t2 = RDTSC(); + + t = (t2-t1)*1000 / cpufreq ; + if( t>4 )printf("%d\t%f\n", curstage, t ); + if( ++curstage == 3 ) curstage = 0; + } while( success && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING) ); + */ + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + +///*******************************************************************************************************************/// + + +// static THREAD_HANDLE dct_thread_handle; + +static dct_io_buffer_t* current_io_buffer; +static dct_io_buffer_t* result_io_buffer; + +static void fdct(const unsigned short* in, short* out); +static void idct(const short* in, unsigned short* out); + + +//----------------------------------------------------------------------------- +// DCT API +//----------------------------------------------------------------------------- + + +bool_t dct_init(void) +{ + current_io_buffer = NULL; + result_io_buffer = NULL; + + return TRUE; +} + +bool_t dct_compute( dct_io_buffer_t* io_buffer ) +{ + bool_t res = FALSE; + + assert(io_buffer != NULL); + + if( current_io_buffer == NULL && result_io_buffer == NULL ) + { + current_io_buffer = io_buffer; + res = TRUE; + + } + + return res; +} + +dct_io_buffer_t* dct_result( void ) +{ + uint32_t i; + dct_io_buffer_t* io_buffer; + + io_buffer = NULL; + + if( current_io_buffer != NULL) + { + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + io_buffer = current_io_buffer; + current_io_buffer = NULL; + } + + return io_buffer; +} + + +//----------------------------------------------------------------------------- +// DCT Computation +//----------------------------------------------------------------------------- + + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +static void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} + +static void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_serial_decoder_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_serial_decoder_sdl.c new file mode 100644 index 0000000..8b183b5 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_serial_decoder_sdl.c @@ -0,0 +1,105 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 3 + + +PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_com_t com; + vp_stages_input_com_config_t icc; + vp_com_serial_config_t config; + vp_stages_decoder_ffmpeg_config_t dfc; + vp_stages_output_sdl_config_t osc; + + + vp_os_memset(&icc,0,sizeof(vp_stages_input_com_config_t)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + vp_stages_fill_default_config(UART1_COM_CONFIG, &config, sizeof(config)); + vp_stages_fill_default_config(DECODER_MPEG4_CONFIG, &dfc, sizeof(dfc)); + vp_stages_fill_default_config(SDL_DECODING_CONFIG, &osc, sizeof(osc)); + + + com.type = VP_COM_SERIAL; + icc.com = &com; + icc.socket.type = VP_COM_CLIENT; + icc.config = (vp_com_config_t *)&config; + icc.buffer_size = 1024; + + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void *)&dfc; + stages[1].funcs = vp_stages_decoder_ffmpeg_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + //vp_os_delay( 200 ); + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_serial_ofile.c b/ARDroneLib/VP_SDK/Examples/linux/api_serial_ofile.c new file mode 100644 index 0000000..81c389d --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_serial_ofile.c @@ -0,0 +1,76 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_com_t com; + vp_stages_input_com_config_t icc; + vp_com_serial_config_t config; + vp_stages_output_file_config_t ofc; + + + vp_os_memset(&icc,0,sizeof(vp_stages_input_com_config_t)); + vp_os_memset(&ofc,0,sizeof(vp_stages_output_file_config_t)); + vp_stages_fill_default_config(UART1_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_SERIAL; + icc.com = &com; + icc.socket.type = VP_COM_CLIENT; + icc.config = (vp_com_config_t *)&config; + icc.buffer_size = 1024; + + + ofc.name = "toto.out"; + + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_FILE; + stages[1].cfg = (void *)&ofc; + stages[1].funcs = vp_stages_output_file_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + //vp_os_delay( 200 ); + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_serial_raw_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_serial_raw_sdl.c new file mode 100644 index 0000000..121f5cf --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_serial_raw_sdl.c @@ -0,0 +1,175 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +vp_stages_output_sdl_config_t osc; + +#define ACQ_WIDTH (osc.width) +#define ACQ_HEIGHT (osc.height) + +#define NB_STAGES 3 + + +PIPELINE_HANDLE pipeline_handle; + + +// used by buffer_to_picture +static vp_api_picture_t picture; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +C_RESULT +buffer_to_picture_open(int *cfg) +{ + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = 0; //ACQ_WIDTH/2; + picture.cr_line_size = 0; //ACQ_WIDTH/2; + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(int *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = ACQ_WIDTH*ACQ_HEIGHT; //(ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **)(int8_t *)&picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + picture.y_buf = in->buffers[in->indexBuffer]; + picture.cb_buf = in->buffers[in->indexBuffer]+ACQ_WIDTH*ACQ_HEIGHT; + picture.cr_buf = in->buffers[in->indexBuffer]+(ACQ_WIDTH*ACQ_HEIGHT*5)/4; + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(int *cfg) +{ + return (SUCCESS); +} + + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_com_t com; + vp_stages_input_com_config_t icc; + vp_com_serial_config_t config; + + + vp_os_memset(&icc,0,sizeof(vp_stages_input_com_config_t)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + vp_stages_fill_default_config(UART1_COM_CONFIG, &config, sizeof(config)); + vp_stages_fill_default_config(SDL_RAW_QCIF_CONFIG, &osc, sizeof(osc)); + + com.type = VP_COM_SERIAL; + icc.com = &com; + icc.socket.type = VP_COM_CLIENT; + icc.config = (vp_com_config_t *)&config; + icc.buffer_size = 176*144; //ACQ_WIDTH*ACQ_HEIGHT; + + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void *)NULL; + stages[1].funcs = buffer_to_picture_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + // no delay here + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_threads.c b/ARDroneLib/VP_SDK/Examples/linux/api_threads.c new file mode 100644 index 0000000..e9b1698 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_threads.c @@ -0,0 +1,82 @@ +/** + * \brief VP Api. Filter encoder/decoder stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 21/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include + + +#define STACK_SIZE 40000 + + +PROTO_THREAD_ROUTINE(thread1,nomParams); +PROTO_THREAD_ROUTINE(thread2,nomParams); +PROTO_THREAD_ROUTINE(thread3,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(thread1,20) + THREAD_TABLE_ENTRY(thread2,20) + THREAD_TABLE_ENTRY(thread3,20) +END_THREAD_TABLE + +PROTO_THREAD_ROUTINE(thread1,nomParams) +{ + PRINT("Thread 1 Start\n"); + + while(1) + { + vp_os_delay(100); + PRINT("Thread 1 Loop\n"); + } +} + +PROTO_THREAD_ROUTINE(thread2,nomParams) +{ + PRINT("Thread 2 Start\n"); + + while(1) + { + vp_os_delay(200); + PRINT("Thread 2 Loop\n"); + } +} + +PROTO_THREAD_ROUTINE(thread3,nomParams) +{ + PRINT("Thread 3 Start\n"); + + while(1) + { + vp_os_delay(300); + PRINT("Thread 3 Loop\n"); + } +} + +void runApplication(void) +{ + START_THREAD(thread1, NO_PARAM); + START_THREAD(thread2, NO_PARAM); + START_THREAD(thread3, NO_PARAM); + + JOIN_THREAD(thread1); + JOIN_THREAD(thread2); + JOIN_THREAD(thread3); +} + +int main(int argc, char **argv) +{ + runApplication(); + + return 0; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_v4l_raw_ethernet.c b/ARDroneLib/VP_SDK/Examples/linux/api_v4l_raw_ethernet.c new file mode 100644 index 0000000..5d3af63 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_v4l_raw_ethernet.c @@ -0,0 +1,167 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#undef BLOCK_MODE +#undef ACQ_WIDTH +#undef ACQ_HEIGHT + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + +#define COM_VIDEO() wired_com() +#define COM_CONFIG_VIDEO() wired_config() +#define COM_CONNECTION_VIDEO() wired_connection() + + +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +#define NB_STAGES_MAX 10 + + +static vp_stages_input_v4l_config_t ivc; +static vp_stages_output_com_config_t occ; + +static PIPELINE_HANDLE pipeline_handle; + +static vp_api_picture_t picture; + + +vp_com_t* wired_com(void) +{ + static vp_com_t com = { + VP_COM_WIRED, + FALSE, + 0, + { { 0 } }, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* wired_config(void) +{ + static vp_com_wired_config_t config = { + "eth0", + "172.20.22.245", + "255.255.255.0", + "172.20.22.255" + }; + + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* wired_connection(void) +{ + static vp_com_wired_connection_t connection = { + 0 + }; + + return (vp_com_connection_t*) (void*) &connection; +} + + +int main(int argc, char **argv) +{ + if(argc < 2) + { + PRINT("You need to specify video device path\n"); + PRINT("Ex : %s /dev/video0\n", argv[0]); + return EXIT_FAILURE; + } + + START_THREAD(app, argv); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES_MAX]; + + uint16_t time1,time2; + uint16_t i; + + time1 = clock(); + + vp_os_memset(&ivc,0,sizeof(ivc)); + vp_os_memset(&occ,0,sizeof(occ)); + + ivc.device = ((char**)argv)[1]; + ivc.width = ACQ_WIDTH; + ivc.height = ACQ_HEIGHT; + ivc.vp_api_picture = &picture; + + occ.com = COM_VIDEO(); + occ.config = COM_CONFIG_VIDEO(); + occ.connection = COM_CONNECTION_VIDEO(); + occ.socket.type = VP_COM_SERVER; + occ.socket.protocol = VP_COM_TCP; + occ.socket.port = 5555; + occ.buffer_size = 320*240*3/2; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_FILE; + stages[pipeline.nb_stages].cfg = (void *)&ivc; + stages[pipeline.nb_stages++].funcs = vp_stages_input_v4l_funcs; + + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&occ; + stages[pipeline.nb_stages++].funcs = vp_stages_output_com_funcs; + + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + + out.status = VP_API_STATUS_PROCESSING; + + ///////////////////////////////////////////////////////////////////////////////////////// + i = 0; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING)) + { + i++; + PRINT("image %d \n",i); + //vp_os_delay(500); + } + ///////////////////////////////////////////////////////////////////////////////////////// + + time2 = clock(); + printf("temps ecoule : %d \n",time2-time1); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_v4l_vlib_ethernet.c b/ARDroneLib/VP_SDK/Examples/linux/api_v4l_vlib_ethernet.c new file mode 100644 index 0000000..7509dde --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_v4l_vlib_ethernet.c @@ -0,0 +1,183 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define VIDEO_DEVICE_PATH "/dev/video0" + +#undef BLOCK_MODE +#undef ACQ_WIDTH +#undef ACQ_HEIGHT + +#define ACQ_WIDTH 320 +#define ACQ_HEIGHT 240 + +#define COM_VIDEO() wired_com() +#define COM_CONFIG_VIDEO() wired_config() +#define COM_CONNECTION_VIDEO() wired_connection() + + +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +#define NB_STAGES_MAX 10 + + +static vp_stages_input_v4l_config_t ivc; +static vp_stages_buffer_to_picture_config_t bpc; +static vlib_stage_encoding_config_t vec; +static vp_stages_output_com_config_t occ; + +static PIPELINE_HANDLE pipeline_handle; + +static vp_api_picture_t picture; + + +vp_com_t* wired_com(void) +{ + static vp_com_t com = { + VP_COM_WIRED, + FALSE, + 0, + { { 0 } }, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; + + return &com; +} + +vp_com_config_t* wired_config(void) +{ + static vp_com_wired_config_t config = { + "eth0", + "172.20.22.245", + "255.255.255.0", + "172.20.22.255" + }; + + return (vp_com_config_t*) &config; +} + +vp_com_connection_t* wired_connection(void) +{ + static vp_com_wired_connection_t connection = { + 0 + }; + + return (vp_com_connection_t*) (void*) &connection; +} + + +int main(int argc, char **argv) +{ + if(argc < 2) + { + PRINT("You need to specify video device path\n"); + PRINT("Ex : %s /dev/video0\n", argv[0]); + return EXIT_FAILURE; + } + + START_THREAD(app, argv); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES_MAX]; + + uint16_t time1,time2; + uint16_t i; + + time1 = clock(); + + vp_os_memset(&ivc,0,sizeof(ivc)); + vp_os_memset(&bpc,0,sizeof(bpc)); + vp_os_memset(&vec,0,sizeof(vec)); + vp_os_memset(&occ,0,sizeof(occ)); + + ivc.device = ((char**)argv)[1]; + ivc.width = ACQ_WIDTH; + ivc.height = ACQ_HEIGHT; + ivc.vp_api_picture = &picture; + + vec.width = ACQ_WIDTH; + vec.height = ACQ_HEIGHT; + vec.block_mode_enable = FALSE; + vec.picture = &picture; + + occ.com = COM_VIDEO(); + occ.config = COM_CONFIG_VIDEO(); + occ.connection = COM_CONNECTION_VIDEO(); + occ.socket.type = VP_COM_SERVER; + occ.socket.protocol = VP_COM_TCP; + occ.socket.port = 5555; + occ.buffer_size = 1500; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_FILE; + stages[pipeline.nb_stages].cfg = (void *)&ivc; + stages[pipeline.nb_stages++].funcs = vp_stages_input_v4l_funcs; + + stages[pipeline.nb_stages].type = VP_API_FILTER_ENCODER; + stages[pipeline.nb_stages].cfg = (void*)&vec; + stages[pipeline.nb_stages++].funcs = vlib_encoding_funcs; + + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&occ; + stages[pipeline.nb_stages++].funcs = vp_stages_output_com_funcs; + + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + + out.status = VP_API_STATUS_PROCESSING; + + ///////////////////////////////////////////////////////////////////////////////////////// + i = 0; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING)) + { + i++; + PRINT("image %d \n",i); + //vp_os_delay(50); + } + ///////////////////////////////////////////////////////////////////////////////////////// + + time2 = clock(); + printf("temps ecoule : %d \n",time2-time1); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_MJPEG_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_MJPEG_sdl.c new file mode 100644 index 0000000..9efe537 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_MJPEG_sdl.c @@ -0,0 +1,751 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define NB_STAGES 3 + +#define RECORD_MJPEG_VIDEO + +#define CAMIF_BLOCKLINES_LOG2 4 +#define CAMIF_BLOCKLINES (1 << CAMIF_BLOCKLINES_LOG2) + +#define ACQ_WIDTH (176) +#define ACQ_HEIGHT (144) + +#define WINDOW_WIDTH (320) +#define WINDOW_HEIGHT (240) + +#ifdef RECORD_MJPEG_VIDEO +static FILE* fp; +#endif // ! RECORD_MJPEG_VIDEO + +static PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + uint32_t width = cfg->picture->width; + uint32_t height = cfg->picture->height; + enum PixelFormat format = cfg->picture->format; + + stream_new( &cfg->stream, OUTPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, width, height, format ); +} + +static uint32_t get_current_time() +{ + static bool_t init = TRUE; + static struct timeval tv_init; + + uint32_t t; + float32_t s, us; + + struct timeval tv; + + if( init ) + { + gettimeofday(&tv_init, NULL); + init = FALSE; + } + + gettimeofday(&tv, NULL); + tv.tv_sec -= tv_init.tv_sec; + tv.tv_usec -= tv_init.tv_usec; + + s = tv.tv_sec; + us = tv.tv_usec; + + t = (s * 1000.0f) + ( us / 1000.0f); + + return t; +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + C_RESULT res; + bool_t got_image; + static int32_t start_time, dt; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { +#ifdef RECORD_MJPEG_VIDEO + fp = fopen("video", "wb"); +#endif // ! RECORD_MJPEG_VIDEO + + out->numBuffers = 1; + out->buffers = (int8_t**)cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + + dt = 0; + } + + if( in->status == VP_API_STATUS_ENDED ) + { +#ifdef RECORD_MJPEG_VIDEO + fclose( fp ); +#endif // ! RECORD_MJPEG_VIDEO + out->status = in->status; + } + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( in->size > 0 ) + { + if( out->status == VP_API_STATUS_PROCESSING ) + { + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); +#ifdef RECORD_MJPEG_VIDEO + if( fp != NULL ) + fwrite(in->buffers[in->indexBuffer], in->size, 1, fp); +#endif // ! RECORD_MJPEG_VIDEO + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + start_time = get_current_time(); + res = mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + dt += (get_current_time() - start_time); + + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + PRINT( "%d picture decoded in %d ms\n", cfg->mjpeg.num_frames, dt ); + dt = 0; + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} + + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + +PROTO_THREAD_ROUTINE(app,argv) +{ + + uint32_t nb_stages = 0; + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + mjpeg_stage_decoding_config_t dec; + vp_stages_output_sdl_config_t osc; + + vp_com_t com; + vp_com_wifi_connection_t connection; + vp_com_wifi_config_t config; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + + picture.y_pad = 0; + picture.c_pad = 0; + + dec.picture = &picture; + dec.out_buffer_size = 4096; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t)); + vp_os_memset( &connection, 0, sizeof(vp_com_wifi_connection_t) ); + strcpy(connection.networkName, "linksys"); + vp_stages_fill_default_config(WIFI_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_WIFI; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 1024; + icc.sockopt = VP_COM_NON_BLOCKING; + + strcpy(icc.socket.serverHost, "30.30.30.1"); + + osc.width = WINDOW_WIDTH; + osc.height = WINDOW_HEIGHT; + osc.bpp = 16; + osc.window_width = WINDOW_WIDTH; + osc.window_height = WINDOW_HEIGHT; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + stages[nb_stages].type = VP_API_INPUT_SOCKET; + stages[nb_stages].cfg = (void *)&icc; + stages[nb_stages].funcs = vp_stages_input_com_funcs; + + nb_stages++; + + stages[nb_stages].type = VP_API_FILTER_DECODER; + stages[nb_stages].cfg = (void*)&dec; + stages[nb_stages].funcs = mjpeg_decoding_funcs; + + nb_stages++; + + stages[nb_stages].type = VP_API_OUTPUT_SDL; + stages[nb_stages].cfg = (void *)&osc; + stages[nb_stages].funcs = vp_stages_output_sdl_funcs; + + nb_stages++; + + pipeline.nb_stages = nb_stages; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + +///*******************************************************************************************************************/// + + +// static THREAD_HANDLE dct_thread_handle; + +static dct_io_buffer_t* current_io_buffer; +static dct_io_buffer_t* result_io_buffer; + +static void fdct(const unsigned short* in, short* out); +static void idct(const short* in, unsigned short* out); + + +//----------------------------------------------------------------------------- +// DCT API +//----------------------------------------------------------------------------- + + +bool_t dct_init(void) +{ + current_io_buffer = NULL; + result_io_buffer = NULL; + + return TRUE; +} + +bool_t dct_compute( dct_io_buffer_t* io_buffer ) +{ + bool_t res = FALSE; + + assert(io_buffer != NULL); + + if( current_io_buffer == NULL && result_io_buffer == NULL ) + { + current_io_buffer = io_buffer; + res = TRUE; + + } + + return res; +} + +dct_io_buffer_t* dct_result( void ) +{ + uint32_t i; + dct_io_buffer_t* io_buffer; + + io_buffer = NULL; + + if( current_io_buffer != NULL) + { + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + io_buffer = current_io_buffer; + current_io_buffer = NULL; + } + + return io_buffer; +} + + +//----------------------------------------------------------------------------- +// DCT Computation +//----------------------------------------------------------------------------- + + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +static void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} + +static void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_console.c b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_console.c new file mode 100644 index 0000000..eeaa150 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_console.c @@ -0,0 +1,66 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + + +static PIPELINE_HANDLE pipeline_handle; + + +int +main(int argc, char **argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + + vp_com_t com; + vp_com_wifi_config_t config; + vp_com_wifi_connection_t connection; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t)); + vp_os_memset( &connection, 0, sizeof(vp_com_wifi_connection_t) ); + strcpy(connection.networkName,"linksys"); + vp_stages_fill_default_config(WIFI_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + + com.type = VP_COM_WIFI; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket.serverHost,"192.168.1.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_CONSOLE; + stages[1].cfg = NULL; + stages[1].funcs = vp_stages_output_console_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_decoder_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_decoder_sdl.c new file mode 100644 index 0000000..aff32ef --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_decoder_sdl.c @@ -0,0 +1,106 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifdef USE_FFMPEG +#define NB_STAGES 3 +#else +#define NB_STAGES 1 +#endif + + +static PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + vp_stages_decoder_ffmpeg_config_t dfc; + vp_stages_output_sdl_config_t osc; + + vp_com_t com; + vp_com_wifi_connection_t connection; + vp_com_wifi_config_t config; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t)); + vp_os_memset( &connection, 0, sizeof(vp_com_wifi_connection_t) ); + strcpy(connection.networkName, "linksys"); + vp_stages_fill_default_config(WIFI_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + vp_stages_fill_default_config(DECODER_MPEG4_CONFIG, &dfc, sizeof(dfc)); + vp_stages_fill_default_config(SDL_DECODING_QCIF_CONFIG, &osc, sizeof(osc)); + + com.type = VP_COM_WIFI; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket.serverHost, "192.168.1.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + +#ifdef USE_FFMPEG + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void *)&dfc; + stages[1].funcs = vp_stages_decoder_ffmpeg_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; +#endif + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_raw_sdl.c b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_raw_sdl.c new file mode 100644 index 0000000..b1933d0 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/api_wifiClientTCP_raw_sdl.c @@ -0,0 +1,92 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define NB_STAGES 2 + +static PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(escaper,nomParams); +PROTO_THREAD_ROUTINE(app,nomParams); + + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper,20) + THREAD_TABLE_ENTRY(app,20) +END_THREAD_TABLE + + +int +main(int argc, char **argv) +{ + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_com_config_t icc; + vp_stages_output_sdl_config_t osc; + + vp_com_t com; + vp_com_wifi_config_t config; + vp_com_wifi_connection_t connection; + + vp_os_memset( &icc, 0, sizeof(vp_stages_input_com_config_t)); + vp_os_memset( &connection, 0, sizeof(vp_com_wifi_connection_t) ); + strcpy(connection.networkName,"linksys"); + vp_stages_fill_default_config(WIFI_COM_CONFIG, &config, sizeof(config)); + vp_os_memset(&com, 0, sizeof(vp_com_t)); + vp_stages_fill_default_config(SDL_DECODING_QCIF_CONFIG, &osc, sizeof(osc)); + + com.type = VP_COM_WIFI; + icc.com = &com; + icc.config = (vp_com_config_t*)&config; + icc.connection = (vp_com_connection_t*)&connection; + icc.socket.type = VP_COM_CLIENT; + icc.socket.protocol = VP_COM_TCP; + icc.socket.port = 5555; + icc.buffer_size = 6400; + + strcpy(icc.socket_client.serverHost,"192.168.1.23"); + + stages[0].type = VP_API_INPUT_SOCKET; + stages[0].cfg = (void *)&icc; + stages[0].funcs = vp_stages_input_com_funcs; + + stages[1].type = VP_API_OUTPUT_SDL; + stages[1].cfg = (void *)&osc; + stages[1].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/atcodec_client.c b/ARDroneLib/VP_SDK/Examples/linux/atcodec_client.c new file mode 100644 index 0000000..d7b8e2a --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/atcodec_client.c @@ -0,0 +1,78 @@ + +#include +#include + +#include +#include + +#define AT_MESSAGES_HEADER "ATcodec/ATcodec_Messages_ex.h" + +#include "ATcodec/ATcodec_api.h" +#include "VP_Os/vp_os_types.h" +#include "VP_Os/vp_os_thread.h" +#include "VP_Os/vp_os_delay.h" +#include "VP_Os/vp_os_print.h" +#include + +#ifndef AT_MESSAGES_HEADER +#error You need to define AT_MESSAGES_HEADER +#endif + +extern AT_CODEC_MSG_IDS ids; + +#define INTRA_CMD_DELAY 10 + +THREAD_RET +thread_send_commands (THREAD_PARAMS data) +{ + while(1) + { + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + } +} + +int main(int argc, char **argv) +{ + THREAD_HANDLE atcodec_test_handle; + THREAD_HANDLE atcodec_test_handle2; + THREAD_HANDLE cmds_handle; + + AT_CODEC_FUNCTIONS_PTRS ptrs = + { + .init = AT_CODEC_Client_init, + .shutdown = AT_CODEC_Client_shutdown, + .open = AT_CODEC_Client_open, + .close = AT_CODEC_Client_close, + .read = AT_CODEC_Client_read, + .write = AT_CODEC_Client_write, + }; + + ATcodec_Init_Library(&ptrs); + + vp_os_thread_create(thread_ATcodec_Commands_Client, 0, &atcodec_test_handle); + vp_os_thread_create(thread_send_commands, 0, &cmds_handle); + vp_os_thread_create(thread_ATcodec_Commands_Server, 0, &atcodec_test_handle2); + + vp_os_thread_join(cmds_handle); + vp_os_thread_join(atcodec_test_handle2); + vp_os_thread_join(atcodec_test_handle); + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/linux/atcodec_server.c b/ARDroneLib/VP_SDK/Examples/linux/atcodec_server.c new file mode 100644 index 0000000..2d0ec7d --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/atcodec_server.c @@ -0,0 +1,41 @@ +#include + +#define AT_MESSAGES_HEADER "ATcodec/ATcodec_Messages_ex.h" + +#include "ATcodec/ATcodec_api.h" +#include "VP_Os/vp_os_types.h" +#include "VP_Os/vp_os_thread.h" +#include + +#ifndef AT_MESSAGES_HEADER +#error You need to define AT_MESSAGES_HEADER +#endif + +int main(int argc, char **argv) +{ + THREAD_HANDLE atcodec_test_handle; + + AT_CODEC_FUNCTIONS_PTRS ptrs = + { + .init = AT_CODEC_init, + .shutdown = AT_CODEC_shutdown, + .open = AT_CODEC_open, + .close = AT_CODEC_close, + .read = AT_CODEC_read, + .write = AT_CODEC_write, + }; + + ptrs.init = AT_CODEC_init; + ptrs.shutdown = AT_CODEC_shutdown; + ptrs.open = AT_CODEC_open; + ptrs.close = AT_CODEC_close; + ptrs.read = AT_CODEC_read; + ptrs.write = AT_CODEC_write; + + ATcodec_Init_Library(&ptrs); + + vp_os_thread_create(thread_ATcodec_Commands_Server, 0, &atcodec_test_handle); + vp_os_thread_join(atcodec_test_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/atcodec_sorted_list.c b/ARDroneLib/VP_SDK/Examples/linux/atcodec_sorted_list.c new file mode 100644 index 0000000..ee30a22 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/atcodec_sorted_list.c @@ -0,0 +1,71 @@ + +#include + +#include "VP_Os/vp_os_types.h" +#include "ATcodec/ATcodec_Sorted_List.h" + +void print_element(void *element) +{ + printf("%d, ", *(uint32_t *)element); +} + +void print_list(ATcodec_Sorted_List_t *list) +{ + printf("{ "); + ATcodec_Sorted_List_batchProcess(list, print_element); + printf("}\n"); +} + +#define INSERT(VALUE) \ + element = VALUE; \ + ATcodec_Sorted_List_insertElement(&list, &element, element); \ + print_list(&list) + +#define REMOVE(INDEX) \ + ATcodec_Sorted_List_removeElement(&list, ATcodec_Sorted_List_getElement(&list, INDEX)); \ + print_list(&list) + +int main(int argc, char **argv) +{ + ATcodec_Sorted_List_t list; + int element; + + ATcodec_Sorted_List_init(&list, sizeof(int)); + print_list(&list); + + INSERT(10); + INSERT(5); + INSERT(7); + INSERT(12); + INSERT(1); + + REMOVE(3); + + INSERT(12); + + REMOVE(0); + REMOVE(0); + + INSERT(3); + INSERT(4); + INSERT(6); + + REMOVE(0); + REMOVE(0); + REMOVE(0); + REMOVE(0); + REMOVE(0); + REMOVE(0); + + INSERT(7); + INSERT(12); + INSERT(1); + + REMOVE(1); + REMOVE(1); + REMOVE(0); + + ATcodec_Sorted_List_destroy(&list); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/client.c b/ARDroneLib/VP_SDK/Examples/linux/client.c new file mode 100644 index 0000000..dfe9cf3 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/client.c @@ -0,0 +1,47 @@ +// ---------------------------------------------- +// +// Author : +// Date : 03/01/2007 +// +// Parrot Video SDK : Examples/linux +// +// ---------------------------------------------- + +#include +#include +#include + +int main(void) +{ + if(FAILED(init_com_client())) + { + PRINT("Failed to init\n"); + return -1; + } + + if(FAILED(run_com_client(COM_BNEP))) + { + PRINT("Failed to run\n"); + } + else + { + int size = 17; + char msg[16]; + + PRINT("Connected to server\n"); + + memset(msg,0,size); + while(FAILED(read_client(msg,&size))) + size = 16; + + PRINT("received: %s\n",msg); + } + + if(FAILED(shutdown_com_client())) + { + PRINT("Failed to shutdown\n"); + return -1; + } + + return 0; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/com.c b/ARDroneLib/VP_SDK/Examples/linux/com.c new file mode 100644 index 0000000..32d60b2 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/com.c @@ -0,0 +1,103 @@ +#include +#include +#include + +#include +#include + +int main(int argc,char* argv[]) +{ + com_config_t cfg; + vp_com_connection_t conn; + + printf("---------- Network Adapter Inquiry ----------\n"); + com_networkAdapterLookUp(COM_BLUETOOTH,adapterinquiry_df); + printf("---------------------------------------------\n"); + + cfg.connection = COM_BLUETOOTH; + cfg.localAdapterName = DEVICENAME; + cfg.localIpAddress = LOCALHOST; + cfg.localIpSubmask = "255.255.255.0"; + + printf("--------------- INITIALISATION --------------\n"); + if(FAILED(com_init(&cfg))) + { + printf("Failed to init\n"); + com_shutdown(); + return -1; + } +/* + printf("----------- Remote Device Inquiry -----------\n"); + com_inquire(deviceinquiry,60000); + printf("---------------------------------------------\n"); +*/ + + printf("---------- Tentative de connection ----------\n"); + com_strToAddress(BTADDR_SERVER,&conn.address); + com_passKey("1234"); + if(FAILED(com_connect(&conn,1))) + { + printf("Failed to connect\n"); + com_shutdown(); + return -1; + } + + printf("Connected to BTT\n"); + + printf("---------- BNEP Connection ----------\n"); + {// Test d'execution bnep + com_socket_t socket; + Read read; + + socket.socket = VP_COM_CLIENT; + socket.protocol = COM_BNEP; + socket.serverHost = SERVERHOST; + socket.port = BTADDR_PORT; + + if(SUCCEED(com_open(&socket,&read,0))) + { + char buffer[10]; + int r = 10; + printf("Connection BNEP succeeded\n"); + if(SUCCEED(read((void*)&socket,buffer,&r))) + printf("Read succeed\n"); + + printf("socket closed\n"); + com_close(&socket); + } + } + + sleep(1); + + printf("---------- RFCOMM Connection ----------\n"); + {// Test d'execution rfcomm + com_socket_t socket; + Write write; + + socket.socket = VP_COM_CLIENT; + socket.protocol = COM_RFCOMM; + socket.scn = BTADDR_SCN; + + if(SUCCEED(com_open(&socket,0,&write))) + { + char buffer[10]; + int r = 10; + printf("Connection RFCOMM succeeded\n"); + if(SUCCEED(write((void*)&socket,buffer,&r))) + printf("Write succeed\n"); + + printf("socket closed\n"); + com_close(&socket); + } + } + + sleep(1); + + printf("Deconnection\n"); + com_disconnect(); + + printf("End of program\n"); + com_shutdown(); + + return 0; +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/server.c b/ARDroneLib/VP_SDK/Examples/linux/server.c new file mode 100644 index 0000000..23533ef --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/server.c @@ -0,0 +1,47 @@ +// ---------------------------------------------- +// +// Author : +// Date : 03/01/2007 +// +// Parrot Video SDK : Examples/ +// +// ---------------------------------------------- + +#include +#include +#include + +int main() +{ + PRINT("Thread Server Start\n"); + + if(FAILED(init_com_server())) + { + PRINT("Failed to init\n"); + return; + } + + if(FAILED(run_com_server(COM_RFCOMM))) + { + PRINT("Failed to run\n"); + } + else + { + uint32_t size = 10; + char msg[10]; + + memset(msg,0,10); + + PRINT("Connection accepted\n"); + + if(SUCCEED(read_server(msg,&size))) + PRINT("msg: %s\n",msg); + } + + if(FAILED(shutdown_com_server())) + { + PRINT("Failed to shutdown\n"); + } + + PRINT("Thread Server End\n"); +} diff --git a/ARDroneLib/VP_SDK/Examples/linux/wifi.c b/ARDroneLib/VP_SDK/Examples/linux/wifi.c new file mode 100644 index 0000000..4791e1b --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/linux/wifi.c @@ -0,0 +1,116 @@ +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#define DRONE_HOST "192.168.1.2" +#define DRONE_PORT 5555 + +#define TIME_TO_SEND 1024*10 +#define SIZE_TO_SEND 1024 + +static com_socket_t clt; +static Read my_read; +static Write my_write; + +static int8_t buffer[SIZE_TO_SEND]; +static int32_t size; + +static uint32_t timeGetTime() +{ + struct timeval tv; struct timezone tz; + + gettimeofday(&tv,&tz); + + return (uint32_t)( tv.tv_sec*1000 + tv.tv_usec/10000 ); +} + +int main(void) +{ + com_config_t config; + vp_com_connection_t connection; + + config.connection = VP_COM_WIFI; + config.localAdapterName = "rausb0"; + + connection.essid = "Drone"; + connection.channel = 10; + + if(FAILED(com_init(&config))) + PRINT("com_init failed\n"); + + if(FAILED(com_passKey("9F1C3EE11CBA230B27BF1C1B6F"))) + PRINT("com_passKey failed\n"); + + if(FAILED(com_connect(&connection,1))) + PRINT("com_connect failed\n"); + + clt.socket = VP_COM_CLIENT; + clt.port = DRONE_PORT; + clt.serverHost = DRONE_HOST; + + if(SUCCEED(com_open(&clt,&my_read,&my_write))) + { + int32_t i = 0; + float st = timeGetTime(); + float et = timeGetTime(); + float db = 0.0f; + float d = 0.0f; + + for(i=0; i < TIME_TO_SEND;i++) + { + int32_t received; + + PRINT("\r reception n° %d... ",i); + + received = 0; + size = SIZE_TO_SEND; + + while(received != SIZE_TO_SEND) + { + my_read(&clt,buffer,&size); + received += size; + size = SIZE_TO_SEND - received; + } + + PRINT("%d bytes ",received); + } + + et = timeGetTime(); + d = (et - st) / 1000.0f; + if(d > 0) + { + float tx = SIZE_TO_SEND * TIME_TO_SEND / 1024.0f; + db = tx / d; + } + PRINT("\n---------------\n"); + PRINT("Start Time : %f\n",st); + PRINT("End Time : %f\n",et); + PRINT("%d Kbytes sent in %f time\n",SIZE_TO_SEND * TIME_TO_SEND / 1024,d); + PRINT("Debit: %f\n",db); + PRINT("\n---------------\n"); + } + else + { + PRINT("snif... pas connecte a la socket\n"); + } + + PRINT("Waiting for disconnection\n"); + vp_delay(5000); + + com_disconnect(); + PRINT("Disconnected\n"); + + com_shutdown(); + + return 0; +} diff --git a/ARDroneLib/VP_SDK/Examples/nds/atcodec_client.c b/ARDroneLib/VP_SDK/Examples/nds/atcodec_client.c new file mode 100644 index 0000000..deea953 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/nds/atcodec_client.c @@ -0,0 +1,136 @@ + +#include +#include + +#include +#include + +#define AT_MESSAGES_HEADER "ATcodec/ATcodec_Messages_ex.h" + +#include "ATcodec/ATcodec_api.h" +#include "VP_Os/vp_os_types.h" +#include "VP_Os/vp_os_thread.h" +#include "VP_Os/vp_os_delay.h" +#include "VP_Os/vp_os_print.h" +#include + +#include + +#ifndef AT_MESSAGES_HEADER +#error You need to define AT_MESSAGES_HEADER +#endif + +extern AT_CODEC_MSG_IDS ids; + +#define INTRA_CMD_DELAY 10 + + +volatile int frame = 0; + + +//--------------------------------------------------------------------------------- +void Vblank() +{ + //--------------------------------------------------------------------------------- + frame++; +} + + +//--------------------------------------------------------------------------------- +void initNDS() +{ + //--------------------------------------------------------------------------------- + irqInit(); + irqSet(IRQ_VBLANK, Vblank); + irqEnable(IRQ_VBLANK); + videoSetMode(0); //not using the main screen + videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text + vramSetBankC(VRAM_C_SUB_BG); + + SUB_BG0_CR = BG_MAP_BASE(31); + + BG_PALETTE_SUB[255] = RGB15(31,31,31); //by default font will be rendered with color 255 + + //consoleInit() is a lot more flexible but this gets you up and running quick + consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); +} + + +//--------------------------------------------------------------------------------- +THREAD_RET +thread_send_commands (THREAD_PARAMS data) +{ + //--------------------------------------------------------------------------------- + while(1) + { + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_CGMI); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_QW,1); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50); + vp_os_delay(INTRA_CMD_DELAY); + ATcodec_Queue_Message_valist(ids.AT_MSG_ATCMD_PM_EXE,1,50); + vp_os_delay(INTRA_CMD_DELAY); + //vp_os_thread_yield(); + } +} + + +//--------------------------------------------------------------------------------- +int main(int argc, char **argv) +{ + //--------------------------------------------------------------------------------- + touchPosition touchXY; + THREAD_HANDLE atcodec_test_handle; + THREAD_HANDLE atcodec_test_handle2; + THREAD_HANDLE cmds_handle; + + initNDS(); + + AT_CODEC_FUNCTIONS_PTRS ptrs = + { + .init = AT_CODEC_Client_init, + .shutdown = AT_CODEC_Client_shutdown, + .open = AT_CODEC_Client_open, + .close = AT_CODEC_Client_close, + .read = AT_CODEC_Client_read, + .write = AT_CODEC_Client_write, + }; + + ATcodec_Init_Library(&ptrs); + + vp_os_thread_create(thread_ATcodec_Commands_Client, 0, &atcodec_test_handle); + vp_os_thread_create(thread_send_commands, 0, &cmds_handle); + vp_os_thread_create(thread_ATcodec_Commands_Server, 0, &atcodec_test_handle2); + + vp_os_thread_join(cmds_handle); + vp_os_thread_join(atcodec_test_handle2); + vp_os_thread_join(atcodec_test_handle); + + iprintf(" Hello DS dev'rs\n"); + iprintf(" www.devkitpro.org\n"); + iprintf(" www.drunkencoders.com"); + + while(1) { + + swiWaitForVBlank(); + touchXY=touchReadXY(); + + // print at using ansi escape sequence \x1b[line;columnH + iprintf("\x1b[10;0HFrame = %d",frame); + iprintf("\x1b[16;0HTouch x = %04X, %04X\n", touchXY.x, touchXY.px); + iprintf("Touch y = %04X, %04X\n", touchXY.y, touchXY.py); + + } + + return EXIT_SUCCESS; +} + diff --git a/ARDroneLib/VP_SDK/Examples/nds/hello_world.c b/ARDroneLib/VP_SDK/Examples/nds/hello_world.c new file mode 100644 index 0000000..f3a4fe1 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/nds/hello_world.c @@ -0,0 +1,70 @@ +/** + * \file examples_oneThread.c + * \brief How to launch a thread with VP_SDK + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include + + +volatile int frame = 0; + + +//--------------------------------------------------------------------------------- +void Vblank() +{ + //--------------------------------------------------------------------------------- + frame++; +} + + +//--------------------------------------------------------------------------------- +void initNDS() +{ + //--------------------------------------------------------------------------------- + irqInit(); + irqSet(IRQ_VBLANK, Vblank); + irqEnable(IRQ_VBLANK); + videoSetMode(0); //not using the main screen + videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text + vramSetBankC(VRAM_C_SUB_BG); + + SUB_BG0_CR = BG_MAP_BASE(31); + + BG_PALETTE_SUB[255] = RGB15(31,31,31); //by default font will be rendered with color 255 + + //consoleInit() is a lot more flexible but this gets you up and running quick + consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); +} + + +//--------------------------------------------------------------------------------- +int main(int argc, char **argv) +{ + //--------------------------------------------------------------------------------- + touchPosition touchXY; + + initNDS(); + + iprintf(" Hello DS dev'rs\n"); + iprintf(" www.devkitpro.org\n"); + iprintf(" www.drunkencoders.com"); + + while(1) { + + swiWaitForVBlank(); + touchXY=touchReadXY(); + + // print at using ansi escape sequence \x1b[line;columnH + iprintf("\x1b[10;0HFrame = %d",frame); + iprintf("\x1b[16;0HTouch x = %04X, %04X\n", touchXY.x, touchXY.px); + iprintf("Touch y = %04X, %04X\n", touchXY.y, touchXY.py); + + } + + return 0; +} + diff --git a/ARDroneLib/VP_SDK/Examples/win32/api_ifile_raw_sdl.c b/ARDroneLib/VP_SDK/Examples/win32/api_ifile_raw_sdl.c new file mode 100755 index 0000000..4890135 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/win32/api_ifile_raw_sdl.c @@ -0,0 +1,184 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define ACQ_WIDTH (176*2) +#define ACQ_HEIGHT (144*2) + +#define NB_STAGES 3 + + +PIPELINE_HANDLE pipeline_handle; + +PROTO_THREAD_ROUTINE(escaper, nomParams); +PROTO_THREAD_ROUTINE(app, nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(escaper, 20) + THREAD_TABLE_ENTRY(app, 20) +END_THREAD_TABLE + + +///*******************************************************************************************************************/// + +typedef struct _buffer_to_picture_config_t +{ + vp_api_picture_t* picture; + +} buffer_to_picture_config_t; + +C_RESULT +buffer_to_picture_open(buffer_to_picture_config_t *cfg) +{ + cfg->picture->format = PIX_FMT_YUV420P; + + cfg->picture->width = ACQ_WIDTH; + cfg->picture->height = ACQ_HEIGHT; + cfg->picture->framerate = 15; + + cfg->picture->y_line_size = ACQ_WIDTH; + cfg->picture->cb_line_size = ACQ_WIDTH / 2; + cfg->picture->cr_line_size = ACQ_WIDTH / 2; + + cfg->picture->y_pad = 0; + cfg->picture->c_pad = 0; + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) cfg->picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + cfg->picture->y_buf = in->buffers[0]; + cfg->picture->cb_buf = in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT; + cfg->picture->cr_buf = in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4; + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +int +main(int argc, char **argv) +{ + if(argc != 2) + { + PRINT("You must specify a filename.\n"); + return EXIT_FAILURE; + } + + START_THREAD(escaper, NO_PARAM); + START_THREAD(app, argv); + + JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_sdl_config_t osc; + buffer_to_picture_config_t bpc; + + vp_os_memset(&ifc,0,sizeof(vp_stages_input_file_config_t)); + + ifc.name = ((char**)argv)[1]; + ifc.buffer_size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + + osc.width = ACQ_WIDTH; + osc.height = ACQ_HEIGHT; + osc.bpp = 16; + osc.window_width = ACQ_WIDTH; + osc.window_height = ACQ_HEIGHT; + osc.pic_width = ACQ_WIDTH; + osc.pic_height = ACQ_HEIGHT; + osc.y_size = ACQ_WIDTH*ACQ_HEIGHT; + osc.c_size = (ACQ_WIDTH*ACQ_HEIGHT) >> 2; + + bpc.picture = &picture; + + stages[0].type = VP_API_INPUT_FILE; + stages[0].cfg = (void *)&ifc; + stages[0].funcs = vp_stages_input_file_funcs; + + stages[1].type = VP_API_FILTER_DECODER; + stages[1].cfg = (void *)&bpc; + stages[1].funcs = buffer_to_picture_funcs; + + stages[2].type = VP_API_OUTPUT_SDL; + stages[2].cfg = (void *)&osc; + stages[2].funcs = vp_stages_output_sdl_funcs; + + pipeline.nb_stages = NB_STAGES; + pipeline.stages = &stages[0]; + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)) + { + vp_os_delay( 100 ); + } + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} diff --git a/ARDroneLib/VP_SDK/Examples/win32/mjpeg_decoder.c b/ARDroneLib/VP_SDK/Examples/win32/mjpeg_decoder.c new file mode 100755 index 0000000..86c96d6 --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/win32/mjpeg_decoder.c @@ -0,0 +1,977 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// #define USE_EULER_ANGLES + +// #define ACQ_WIDTH (176+0*16) +// #define ACQ_HEIGHT (144+0*16) + +// #define QVGA_WIDTH 352 +// #define QVGA_HEIGHT 288 + +#define ACQ_WIDTH (352) +#define ACQ_HEIGHT (288) + +#define NB_STAGES 4 + + +PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(app, nomParams); +PROTO_THREAD_ROUTINE(dct, nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(app, 20) + THREAD_TABLE_ENTRY(dct, 20) +END_THREAD_TABLE + + +///*******************************************************************************************************************/// + + +typedef struct _buffer_to_picture_config_t +{ + vp_api_picture_t* picture; + +} buffer_to_picture_config_t; + +C_RESULT +buffer_to_picture_open(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) cfg->picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + vp_os_memcpy( cfg->picture->y_buf, in->buffers[0], ACQ_WIDTH*ACQ_HEIGHT ); + vp_os_memcpy( cfg->picture->cb_buf, in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT, ACQ_WIDTH*ACQ_HEIGHT/4 ); + vp_os_memcpy( cfg->picture->cr_buf, in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4, ACQ_WIDTH*ACQ_HEIGHT/4 ); + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +///*******************************************************************************************************************/// + + +typedef struct _picture_to_buffer_config_t +{ + vp_api_picture_t* picture; + +} picture_to_buffer_config_t; + +C_RESULT +picture_to_buffer_open(buffer_to_picture_config_t *cfg) +{ + return C_OK; +} + +C_RESULT +picture_to_buffer_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) vp_os_malloc(out->size*sizeof(int8_t) + sizeof(int8_t*)); + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + + out->buffers[0] = (int8_t *)(out->buffers+1); + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + if( in->size == 1 ) + { + // got a picture + vp_os_memcpy( out->buffers[0], cfg->picture->y_buf, ACQ_WIDTH*ACQ_HEIGHT ); + vp_os_memcpy( out->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT, cfg->picture->cb_buf, ACQ_WIDTH*ACQ_HEIGHT/4); + vp_os_memcpy( out->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4, cfg->picture->cr_buf, ACQ_WIDTH*ACQ_HEIGHT/4); + } + } + + // out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +picture_to_buffer_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t picture_to_buffer_funcs = +{ + NULL, + (vp_api_stage_open_t) picture_to_buffer_open, + (vp_api_stage_transform_t) picture_to_buffer_transform, + (vp_api_stage_close_t) picture_to_buffer_close +}; + + +///*******************************************************************************************************************/// + + +enum { + MJPEG_ENCODER, + MJPEG_DECODER +}; + +typedef struct _mjpeg_stage_encoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_encoding_config_t; + +C_RESULT mjpeg_stage_encoding_open(mjpeg_stage_encoding_config_t *cfg) +{ + stream_new( &cfg->stream, INPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_ENCODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_encoding_transform(mjpeg_stage_encoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + C_RESULT res; + uint32_t num_frames; + bool_t got_image; + + res = C_OK; + + vp_os_mutex_lock(&out->lock); + + if( out->status == VP_API_STATUS_INIT ) + { + out->numBuffers = 1; + out->buffers = (int8_t**) vp_os_malloc( sizeof(int8_t*) + cfg->out_buffer_size*sizeof(int8_t) ); + out->buffers[0] = (int8_t*) ( out->buffers + 1 ); + out->indexBuffer = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( out->status == VP_API_STATUS_PROCESSING ) + { + stream_config( &cfg->stream, cfg->out_buffer_size, out->buffers[0] ); + + num_frames = cfg->mjpeg.num_frames; + res = mjpeg_encode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + if( got_image ) + { + PRINT("Frame complete. Size = %d bytes\n", cfg->stream.index); + } + out->size = cfg->stream.index; + } + + if( out->status == VP_API_STATUS_ENDED ) + { + PRINT("End of data\n"); + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_encoding_close(mjpeg_stage_encoding_config_t *cfg) +{ + return mjpeg_release( &cfg->mjpeg ); +} + + +///*******************************************************************************************************************/// + + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + stream_new( &cfg->stream, OUTPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)&cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) + out->status = in->status; + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( out->status == VP_API_STATUS_PROCESSING ) + { + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + + PRINT( "%d picture decoded\n", cfg->mjpeg.num_frames ); + + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} + + +///*******************************************************************************************************************/// + + +const vp_api_stage_funcs_t mjpeg_encoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_encoding_open, + (vp_api_stage_transform_t) mjpeg_stage_encoding_transform, + (vp_api_stage_close_t) mjpeg_stage_encoding_close +}; + + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + + +///*******************************************************************************************************************/// + +int32_t codec = MJPEG_DECODER; + +int +main(int argc, char **argv) +{ + // START_THREAD(escaper, NO_PARAM); + START_THREAD(app, 0); + + // JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app,argv) +{ + uint32_t num_stages = 0; + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_file_config_t ofc; + // vp_stages_output_sdl_config_t osc; + + buffer_to_picture_config_t bpc; + mjpeg_stage_encoding_config_t mec; + + picture_to_buffer_config_t pbc; + mjpeg_stage_decoding_config_t dec; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + + picture.y_pad = 0; + picture.c_pad = 0; + + vp_os_memset(&ifc,0,sizeof(vp_stages_input_file_config_t)); + + ifc.name = "../temp.mjpg"; + ifc.buffer_size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + + ofc.name = "../out.yuv"; + + stages[num_stages].type = VP_API_INPUT_FILE; + stages[num_stages].cfg = (void *)&ifc; + stages[num_stages].funcs = vp_stages_input_file_funcs; + + num_stages++; + + if( codec == MJPEG_ENCODER ) + { + bpc.picture = &picture; + + mec.picture = &picture; + mec.out_buffer_size = 4096 * 4; + + stages[num_stages].type = VP_API_FILTER_DECODER; + stages[num_stages].cfg = (void *)&bpc; + stages[num_stages].funcs = buffer_to_picture_funcs; + + num_stages++; + + stages[num_stages].type = MJPEG_ENCODER; + stages[num_stages].cfg = (void*)&mec; + stages[num_stages].funcs = mjpeg_encoding_funcs; + } + else if( codec == MJPEG_DECODER ) + { + dec.picture = &picture; + dec.out_buffer_size = 4096 * 4; + + pbc.picture = &picture; + + stages[num_stages].type = MJPEG_DECODER; + stages[num_stages].cfg = (void*)&dec; + stages[num_stages].funcs = mjpeg_decoding_funcs; + + num_stages++; + + stages[num_stages].type = VP_API_FILTER_ENCODER; + stages[num_stages].cfg = (void *)&pbc; + stages[num_stages].funcs = picture_to_buffer_funcs; + } + + num_stages++; + + stages[num_stages].type = VP_API_OUTPUT_FILE; + stages[num_stages].cfg = (void*)&ofc; + stages[num_stages].funcs = vp_stages_output_file_funcs; + + num_stages++; + + pipeline.nb_stages = num_stages; + pipeline.stages = &stages[0]; + + PRINT("Pipeline configured with %d stages\n", num_stages); + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + + +///*******************************************************************************************************************/// + + +// static THREAD_HANDLE dct_thread_handle; +static vp_os_mutex_t dct_start_mutex; +static vp_os_cond_t dct_start_cond; +static vp_os_mutex_t critical_section; + +static dct_io_buffer_t* current_io_buffer; +static dct_io_buffer_t* result_io_buffer; + +static void fdct(const unsigned short* in, short* out); +static void idct(const short* in, unsigned short* out); + + +//----------------------------------------------------------------------------- +// DCT Thread +//----------------------------------------------------------------------------- + +PROTO_THREAD_ROUTINE(dct, params) +{ + uint32_t i; + + PRINT("DCT thread start\n"); + + while(1) + { + if( current_io_buffer == NULL ) + { + vp_os_mutex_lock(&dct_start_mutex); + vp_os_cond_wait(&dct_start_cond); + vp_os_mutex_unlock(&dct_start_mutex); + } + + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + vp_os_mutex_lock(&critical_section); + result_io_buffer = current_io_buffer; + current_io_buffer = NULL; + vp_os_mutex_unlock(&critical_section); + } + + return 0; +} + + +//----------------------------------------------------------------------------- +// DCT API +//----------------------------------------------------------------------------- + + +bool_t dct_init(void) +{ + vp_os_mutex_init(&dct_start_mutex); + vp_os_cond_init(&dct_start_cond, &dct_start_mutex); + + vp_os_mutex_init(&critical_section); + + current_io_buffer = NULL; + result_io_buffer = NULL; + + return TRUE; +} + +bool_t dct_compute( dct_io_buffer_t* io_buffer ) +{ + bool_t res = FALSE; + + assert(io_buffer != NULL); + + if( current_io_buffer == NULL && result_io_buffer == NULL ) + { + current_io_buffer = io_buffer; + + res = TRUE; + } + + return res; +} + +dct_io_buffer_t* dct_result( void ) +{ + uint32_t i; + dct_io_buffer_t* io_buffer; + + io_buffer = NULL; + + if( current_io_buffer != NULL) + { + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + io_buffer = current_io_buffer; + current_io_buffer = NULL; + } + + return io_buffer; +} + +//----------------------------------------------------------------------------- +// DCT Computation +//----------------------------------------------------------------------------- + + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +static void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} + +static void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} diff --git a/ARDroneLib/VP_SDK/Examples/win32/mjpeg_encoder.c b/ARDroneLib/VP_SDK/Examples/win32/mjpeg_encoder.c new file mode 100755 index 0000000..559668e --- /dev/null +++ b/ARDroneLib/VP_SDK/Examples/win32/mjpeg_encoder.c @@ -0,0 +1,979 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// #define USE_EULER_ANGLES + +// #define ACQ_WIDTH (176+0*16) +// #define ACQ_HEIGHT (144+0*16) + +// #define QVGA_WIDTH 352 +// #define QVGA_HEIGHT 288 + +#define ACQ_WIDTH (352) +#define ACQ_HEIGHT (288) + +#define NB_STAGES 4 + + +PIPELINE_HANDLE pipeline_handle; + + +PROTO_THREAD_ROUTINE(app, nomParams); +PROTO_THREAD_ROUTINE(dct, nomParams); + +BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY(app, 20) + THREAD_TABLE_ENTRY(dct, 20) +END_THREAD_TABLE + + +///*******************************************************************************************************************/// + + +typedef struct _buffer_to_picture_config_t +{ + vp_api_picture_t* picture; + +} buffer_to_picture_config_t; + +C_RESULT +buffer_to_picture_open(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) cfg->picture; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_ENDED) + { + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + vp_os_memcpy( cfg->picture->y_buf, in->buffers[0], ACQ_WIDTH*ACQ_HEIGHT ); + vp_os_memcpy( cfg->picture->cb_buf, in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT, ACQ_WIDTH*ACQ_HEIGHT/4 ); + vp_os_memcpy( cfg->picture->cr_buf, in->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4, ACQ_WIDTH*ACQ_HEIGHT/4 ); + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +buffer_to_picture_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t)buffer_to_picture_open, + (vp_api_stage_transform_t)buffer_to_picture_transform, + (vp_api_stage_close_t)buffer_to_picture_close +}; + + +///*******************************************************************************************************************/// + + +typedef struct _picture_to_buffer_config_t +{ + vp_api_picture_t* picture; + +} picture_to_buffer_config_t; + +C_RESULT +picture_to_buffer_open(buffer_to_picture_config_t *cfg) +{ + return C_OK; +} + +C_RESULT +picture_to_buffer_transform(buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + out->buffers = (int8_t **) vp_os_malloc(out->size*sizeof(int8_t) + sizeof(int8_t*)); + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + + out->buffers[0] = (int8_t *)(out->buffers+1); + } + + if(out->status == VP_API_STATUS_PROCESSING) + { + if( in->size == 1 ) + { + // got a picture + vp_os_memcpy( out->buffers[0], cfg->picture->y_buf, ACQ_WIDTH*ACQ_HEIGHT ); + vp_os_memcpy( out->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT, cfg->picture->cb_buf, ACQ_WIDTH*ACQ_HEIGHT/4); + vp_os_memcpy( out->buffers[0] + ACQ_WIDTH*ACQ_HEIGHT + ACQ_WIDTH*ACQ_HEIGHT/4, cfg->picture->cr_buf, ACQ_WIDTH*ACQ_HEIGHT/4); + } + } + + // out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (SUCCESS); +} + +C_RESULT +picture_to_buffer_close(buffer_to_picture_config_t *cfg) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t picture_to_buffer_funcs = +{ + NULL, + (vp_api_stage_open_t) picture_to_buffer_open, + (vp_api_stage_transform_t) picture_to_buffer_transform, + (vp_api_stage_close_t) picture_to_buffer_close +}; + + +///*******************************************************************************************************************/// + + +enum { + MJPEG_ENCODER, + MJPEG_DECODER +}; + +typedef struct _mjpeg_stage_encoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_encoding_config_t; + +C_RESULT mjpeg_stage_encoding_open(mjpeg_stage_encoding_config_t *cfg) +{ + stream_new( &cfg->stream, INPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_ENCODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_encoding_transform(mjpeg_stage_encoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + C_RESULT res; + uint32_t num_frames; + bool_t got_image; + + res = C_OK; + + vp_os_mutex_lock(&out->lock); + + if( out->status == VP_API_STATUS_INIT ) + { + out->numBuffers = 1; + out->buffers = (int8_t**) vp_os_malloc( sizeof(int8_t*) + cfg->out_buffer_size*sizeof(int8_t) ); + out->buffers[0] = (int8_t*) ( out->buffers + 1 ); + out->indexBuffer = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( out->status == VP_API_STATUS_PROCESSING ) + { + stream_config( &cfg->stream, cfg->out_buffer_size, out->buffers[0] ); + + num_frames = cfg->mjpeg.num_frames; + res = mjpeg_encode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + if( got_image ) + { + PRINT("Frame complete. Size = %d bytes\n", cfg->stream.index); + } + out->size = cfg->stream.index; + } + + if( out->status == VP_API_STATUS_ENDED ) + { + PRINT("End of data\n"); + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_encoding_close(mjpeg_stage_encoding_config_t *cfg) +{ + return mjpeg_release( &cfg->mjpeg ); +} + + +///*******************************************************************************************************************/// + + +typedef struct _mjpeg_stage_decoding_config_t +{ + stream_t stream; + mjpeg_t mjpeg; + vp_api_picture_t* picture; + + uint32_t out_buffer_size; + +} mjpeg_stage_decoding_config_t; + +C_RESULT mjpeg_stage_decoding_open(mjpeg_stage_decoding_config_t *cfg) +{ + stream_new( &cfg->stream, OUTPUT_STREAM ); + + return mjpeg_init( &cfg->mjpeg, MJPEG_DECODE, cfg->picture->width, cfg->picture->height, cfg->picture->format ); +} + +C_RESULT mjpeg_stage_decoding_transform(mjpeg_stage_decoding_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + bool_t got_image; + + vp_os_mutex_lock( &out->lock ); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)&cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + } + + if( in->status == VP_API_STATUS_ENDED ) + out->status = in->status; + + // Several cases must be handled in this stage + // 1st: Input buffer is too small to decode a complete picture + // 2nd: Input buffer is big enough to decode 1 frame + // 3rd: Input buffer is so big we can decode more than 1 frame + + if( out->status == VP_API_STATUS_PROCESSING ) + { + // Reinit stream with new data + stream_config( &cfg->stream, in->size, in->buffers[in->indexBuffer] ); + } + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + mjpeg_decode( &cfg->mjpeg, cfg->picture, &cfg->stream, &got_image ); + + if( got_image ) + { + // we got one picture (handle case 1) + out->size = 1; + + PRINT( "%d picture decoded\n", cfg->mjpeg.num_frames ); + + // handle case 2 & 3 + if( FAILED(stream_is_empty( &cfg->stream )) ) + { + // Some data are still in stream + // Next time we run this stage we don't want this data to be lost + // So flag it! + out->status = VP_API_STATUS_STILL_RUNNING; + } + } + } + + vp_os_mutex_unlock( &out->lock ); + + return C_OK; +} + +C_RESULT mjpeg_stage_decoding_close(mjpeg_stage_decoding_config_t *cfg) +{ + stream_delete( &cfg->stream ); + + return mjpeg_release( &cfg->mjpeg ); +} + + +///*******************************************************************************************************************/// + + +const vp_api_stage_funcs_t mjpeg_encoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_encoding_open, + (vp_api_stage_transform_t) mjpeg_stage_encoding_transform, + (vp_api_stage_close_t) mjpeg_stage_encoding_close +}; + + +const vp_api_stage_funcs_t mjpeg_decoding_funcs = { + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) mjpeg_stage_decoding_open, + (vp_api_stage_transform_t) mjpeg_stage_decoding_transform, + (vp_api_stage_close_t) mjpeg_stage_decoding_close +}; + + +///*******************************************************************************************************************/// + +int32_t codec = MJPEG_ENCODER; + +int +main(int argc, char **argv) +{ + // START_THREAD(escaper, NO_PARAM); + START_THREAD(app, 0); + + // JOIN_THREAD(escaper); + JOIN_THREAD(app); + + return EXIT_SUCCESS; +} + + +PROTO_THREAD_ROUTINE(app, params) +{ + uint32_t num_stages = 0; + vp_api_picture_t picture; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_stages_input_file_config_t ifc; + vp_stages_output_file_config_t ofc; + // vp_stages_output_sdl_config_t osc; + + buffer_to_picture_config_t bpc; + mjpeg_stage_encoding_config_t mec; + + picture_to_buffer_config_t pbc; + mjpeg_stage_decoding_config_t dec; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + + picture.width = ACQ_WIDTH; + picture.height = ACQ_HEIGHT; + picture.framerate = 15; + + picture.y_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT ); + picture.cr_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + picture.cb_buf = vp_os_malloc( ACQ_WIDTH*ACQ_HEIGHT/4 ); + + picture.y_line_size = ACQ_WIDTH; + picture.cb_line_size = ACQ_WIDTH / 2; + picture.cr_line_size = ACQ_WIDTH / 2; + + picture.y_pad = 0; + picture.c_pad = 0; + + vp_os_memset(&ifc,0,sizeof(vp_stages_input_file_config_t)); + + ifc.name = "../in.yuv"; + ifc.buffer_size = (ACQ_WIDTH*ACQ_HEIGHT*3)/2; + + ofc.name = "../temp.mjpg"; + + stages[num_stages].type = VP_API_INPUT_FILE; + stages[num_stages].cfg = (void *)&ifc; + stages[num_stages].funcs = vp_stages_input_file_funcs; + + num_stages++; + + if( codec == MJPEG_ENCODER ) + { + bpc.picture = &picture; + + mec.picture = &picture; + mec.out_buffer_size = 4096 * 4; + + stages[num_stages].type = VP_API_FILTER_DECODER; + stages[num_stages].cfg = (void *)&bpc; + stages[num_stages].funcs = buffer_to_picture_funcs; + + num_stages++; + + stages[num_stages].type = MJPEG_ENCODER; + stages[num_stages].cfg = (void*)&mec; + stages[num_stages].funcs = mjpeg_encoding_funcs; + } + else if( codec == MJPEG_DECODER ) + { + dec.picture = &picture; + dec.out_buffer_size = 4096 * 4; + + pbc.picture = &picture; + + stages[num_stages].type = MJPEG_DECODER; + stages[num_stages].cfg = (void*)&dec; + stages[num_stages].funcs = mjpeg_decoding_funcs; + + num_stages++; + + stages[num_stages].type = VP_API_FILTER_ENCODER; + stages[num_stages].cfg = (void *)&pbc; + stages[num_stages].funcs = picture_to_buffer_funcs; + } + + num_stages++; + + stages[num_stages].type = VP_API_OUTPUT_FILE; + stages[num_stages].cfg = (void*)&ofc; + stages[num_stages].funcs = vp_stages_output_file_funcs; + + num_stages++; + + pipeline.nb_stages = num_stages; + pipeline.stages = &stages[0]; + + PRINT("Pipeline configured with %d stages\n", num_stages); + + vp_api_open(&pipeline, &pipeline_handle); + out.status = VP_API_STATUS_PROCESSING; + while(SUCCEED(vp_api_run(&pipeline, &out)) && (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING)); + + vp_api_close(&pipeline, &pipeline_handle); + + return EXIT_SUCCESS; +} + + +///*******************************************************************************************************************/// + + +// static THREAD_HANDLE dct_thread_handle; +static vp_os_mutex_t dct_start_mutex; +static vp_os_cond_t dct_start_cond; +static vp_os_mutex_t critical_section; + +static dct_io_buffer_t* current_io_buffer; +static dct_io_buffer_t* result_io_buffer; + +static void fdct(const unsigned short* in, short* out); +static void idct(const short* in, unsigned short* out); + + +//----------------------------------------------------------------------------- +// DCT Thread +//----------------------------------------------------------------------------- + +PROTO_THREAD_ROUTINE(dct, params) +{ + uint32_t i; + + PRINT("DCT thread start\n"); + + while(1) + { + if( current_io_buffer == NULL ) + { + vp_os_mutex_lock(&dct_start_mutex); + vp_os_cond_wait(&dct_start_cond); + vp_os_mutex_unlock(&dct_start_mutex); + } + + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + vp_os_mutex_lock(&critical_section); + result_io_buffer = current_io_buffer; + current_io_buffer = NULL; + vp_os_mutex_unlock(&critical_section); + } + + return 0; +} + + +//----------------------------------------------------------------------------- +// DCT API +//----------------------------------------------------------------------------- + + +bool_t dct_init(void) +{ + vp_os_mutex_init(&dct_start_mutex); + vp_os_cond_init(&dct_start_cond, &dct_start_mutex); + + vp_os_mutex_init(&critical_section); + + current_io_buffer = NULL; + result_io_buffer = NULL; + + return TRUE; +} + +bool_t dct_compute( dct_io_buffer_t* io_buffer ) +{ + bool_t res = FALSE; + + assert(io_buffer != NULL); + + if( current_io_buffer == NULL && result_io_buffer == NULL ) + { + { + current_io_buffer = io_buffer; + + res = TRUE; + } + } + + return res; +} + +dct_io_buffer_t* dct_result( void ) +{ + uint32_t i; + dct_io_buffer_t* io_buffer; + + io_buffer = NULL; + + if( current_io_buffer != NULL) + { + if( current_io_buffer->dct_mode == DCT_MODE_FDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + fdct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + else if( current_io_buffer->dct_mode == DCT_MODE_IDCT ) + { + for( i = 0; i < current_io_buffer->num_total_blocks; i++ ) + { + idct(current_io_buffer->input[i], current_io_buffer->output[i]); + } + } + + io_buffer = current_io_buffer; + current_io_buffer = NULL; + } + + return io_buffer; +} + +//----------------------------------------------------------------------------- +// DCT Computation +//----------------------------------------------------------------------------- + + +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ + +#define INT32 int +#define DCTELEM int +#define DCTSIZE 8 +#define DCTSIZE2 64 +#define CONST_BITS 13 +#define PASS1_BITS 1 +#define ONE ((INT32) 1) +#define MULTIPLY(var,const) ((var) * (const)) +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) + +static void fdct(const unsigned short* in, short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int ctr; + // SHIFT_TEMPS + + int data[DCTSIZE * DCTSIZE]; + int i, j; + int* dataptr = data; + + for( i = 0; i < DCTSIZE; i++ ) + { + for( j = 0; j < DCTSIZE; j++ ) + { + int temp; + + temp = in[i*DCTSIZE + j]; + dataptr[i*DCTSIZE + j] = temp; + } + } + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[0] + dataptr[7]; + tmp7 = dataptr[0] - dataptr[7]; + tmp1 = dataptr[1] + dataptr[6]; + tmp6 = dataptr[1] - dataptr[6]; + tmp2 = dataptr[2] + dataptr[5]; + tmp5 = dataptr[2] - dataptr[5]; + tmp3 = dataptr[3] + dataptr[4]; + tmp4 = dataptr[3] - dataptr[4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents cos(K*pi/16). + * i0..i3 in the paper are tmp4..tmp7 here. + */ + + z1 = tmp4 + tmp7; + z2 = tmp5 + tmp6; + z3 = tmp4 + tmp6; + z4 = tmp5 + tmp7; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } + + for( i = 0; i < DCTSIZE; i++ ) + for( j = 0; j < DCTSIZE; j++ ) + out[i*DCTSIZE + j] = data[i*DCTSIZE + j] >> 3; +} + +static void idct(const short* in, unsigned short* out) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + int* wsptr; + int* outptr; + const short* inptr; + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + int data[DCTSIZE2]; + // SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = in; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if( inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0 ) { + /* AC terms all zero */ + int dcval = inptr[DCTSIZE*0] << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = inptr[DCTSIZE*2]; + z3 = inptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + z2 = inptr[DCTSIZE*0]; + z3 = inptr[DCTSIZE*4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = inptr[DCTSIZE*7]; + tmp1 = inptr[DCTSIZE*5]; + tmp2 = inptr[DCTSIZE*3]; + tmp3 = inptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + outptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); + tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); + + tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS; + tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = (tmp10 + tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[7] = (tmp10 - tmp3) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[1] = (tmp11 + tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[6] = (tmp11 - tmp2) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[2] = (tmp12 + tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[5] = (tmp12 - tmp1) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[3] = (tmp13 + tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + outptr[4] = (tmp13 - tmp0) >> ( CONST_BITS+PASS1_BITS+3 ); + + wsptr += DCTSIZE; /* advance pointer to next row */ + outptr += DCTSIZE; + } + + for(ctr = 0; ctr < DCTSIZE2; ctr++) + out[ctr] = data[ctr]; +} diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api.c b/ARDroneLib/VP_SDK/VP_Api/vp_api.c new file mode 100644 index 0000000..cd3ada5 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api.c @@ -0,0 +1,217 @@ +/** + * @file vp_api.c + * @brief VP Api. Pipeline definition + * @author Sylvain Gaeremynck + * @author Aurelien Morelle + * @author Thomas Landais + * @author Julien Floret + * @version 2.0 + * @date first release 16/03/2007 + * @date modification 24/05/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////// +// STATICS + +static C_RESULT +vp_api_iteration(vp_api_io_pipeline_t *pipeline, vp_api_io_stage_t* previousStage, vp_api_io_stage_t* stage); + + +/////////////////////////////////////////////// +// CODE + +C_RESULT +vp_api_open(vp_api_io_pipeline_t *pipeline, PIPELINE_HANDLE *handle) +{ + C_RESULT res; + + vp_api_io_stage_t *stage; + uint32_t i; + + res = C_OK; + + VP_OS_ASSERT(pipeline); + VP_OS_ASSERT(pipeline->nb_stages > 0 && pipeline->nb_stages <= VP_API_MAX_NUM_STAGES); + VP_OS_ASSERT(pipeline->stages); + + pipeline->nb_still_running = 0; + + for(i = 0 ; i < pipeline->nb_stages && VP_SUCCEEDED(res); i++) + { + stage = &pipeline->stages[i]; + + VP_OS_ASSERT(stage->funcs.open); + VP_OS_ASSERT(stage->funcs.transform); + VP_OS_ASSERT(stage->funcs.close); + + vp_os_mutex_init(&stage->data.lock); + vp_os_mutex_lock(&stage->data.lock); + + res = stage->funcs.open(stage->cfg); + + if( VP_SUCCEEDED(res) ) + + { + // Set all data fields to 0 + stage->data.numBuffers=0; + stage->data.buffers=NULL; + stage->data.indexBuffer=0; + + stage->data.size=0; + stage->data.lineSize=0; + + stage->data.status = VP_API_STATUS_INIT; + /* stage->data.lock = Be_careful_not_to_erase_it; */ + + //vp_os_memset(&stage->data, 0, sizeof(vp_api_io_data_t)); + + } + else + { + // To avoid problems on vp_api_close + pipeline->nb_stages=i+1; + } + } + + pipeline->fifo.pbase = (char *) vp_os_malloc(VP_API_PIPELINE_FIFO_SIZE); + pipeline->fifo.pget = pipeline->fifo.pbase; + pipeline->fifo.ppost = pipeline->fifo.pbase; + pipeline->fifo.nb_waiting = 0; + vp_os_memset(pipeline->fifo.pbase, 0, VP_API_PIPELINE_FIFO_SIZE); + vp_os_mutex_init(&pipeline->fifo.mutex); + + if( VP_SUCCEEDED(res) ) + { + res = vp_api_add_pipeline(pipeline, handle); + } + + return res; +} + + +C_RESULT +vp_api_run(vp_api_io_pipeline_t *pipeline, vp_api_io_data_t *out_data) +{ + vp_api_io_stage_t* previousStage = NULL; + vp_api_io_stage_t* currentStage = NULL; + C_RESULT res = VP_SUCCESS; + uint32_t i=0; + + if(pipeline->fifo.nb_waiting > 0) + if(VP_FAILED(vp_api_handle_messages(pipeline))) + res = VP_FAILURE; + + if(pipeline->nb_still_running != 0) + { + for(i = pipeline->nb_stages-1 ; pipeline->stages[i].data.status != VP_API_STATUS_STILL_RUNNING ; i--) + { + VP_OS_ASSERT(i >= 0); + } + pipeline->nb_still_running--; + if(i > 0) + currentStage = &pipeline->stages[i-1]; + } + + for(; i < pipeline->nb_stages ; i++) + { + previousStage = currentStage; + currentStage = &pipeline->stages[i]; + + RTMON_UVAL(SDK_STAGE_INDEX_UVAL, i); + if(VP_SUCCEEDED(res) && VP_FAILED(vp_api_iteration(pipeline, previousStage, currentStage))) + { + res = VP_FAILURE; + } + + //do not execute next stages if no data is given + if(pipeline->stages[i].data.size == 0) + { + break; + } + } + + if(currentStage!=NULL) + *out_data = currentStage->data; + else + res = VP_FAILURE; + + return res; +} + +C_RESULT +vp_api_flush(vp_api_io_pipeline_t *pipeline) +{ + vp_api_io_data_t data; + C_RESULT res = VP_SUCCESS; + + while(pipeline->nb_still_running != 0) + if(VP_FAILED(vp_api_run(pipeline, &data))) + res = VP_FAILURE; + + return res; +} + +C_RESULT +vp_api_close(vp_api_io_pipeline_t *pipeline, PIPELINE_HANDLE *handle) +{ + vp_api_io_stage_t *stage; + C_RESULT res = VP_SUCCESS; + uint32_t i; + + VP_OS_ASSERT(pipeline->nb_stages > 0 && pipeline->nb_stages <= VP_API_MAX_NUM_STAGES); + + res = vp_api_remove_pipeline(pipeline, handle); + +#ifdef DEBUG_MODE + if( pipeline->fifo.pbase != NULL ) +#endif // DEBUG_MODE + vp_os_free(pipeline->fifo.pbase); + + for(i = 0 ; i < pipeline->nb_stages ; i++) + { + stage = &pipeline->stages[i]; + if(VP_FAILED(stage->funcs.close(stage->cfg))) + res = VP_FAILURE; + + vp_os_mutex_unlock(&stage->data.lock); + vp_os_mutex_destroy(&stage->data.lock); + } + + return res; +} + +static C_RESULT +vp_api_iteration(vp_api_io_pipeline_t *pipeline, vp_api_io_stage_t* previousStage, vp_api_io_stage_t* stage) +{ + C_RESULT res = VP_SUCCESS; + vp_api_io_data_t *previousData = NULL; + + if(previousStage) + { + previousData = &previousStage->data; + } + + vp_os_mutex_unlock(&stage->data.lock); + RTMON_USTART(SDK_STAGE_TRANSFORM_UEVENT); + res = stage->funcs.transform(stage->cfg, previousData, &stage->data); + RTMON_USTOP(SDK_STAGE_TRANSFORM_UEVENT); + + if(stage->data.status == VP_API_STATUS_STILL_RUNNING) + { + pipeline->nb_still_running++; + } + vp_os_mutex_lock(&stage->data.lock); + + return res; +} diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api.h b/ARDroneLib/VP_SDK/VP_Api/vp_api.h new file mode 100644 index 0000000..cf57a45 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api.h @@ -0,0 +1,177 @@ +/** + * @file vp_api.h + * @brief VP Api. Pipeline definition + * @author Sylvain Gaeremynck + * @author Aurelien Morelle + * @author Thomas Landais + * @author Julien Floret + * @version 2.0 + * @date first release 16/03/2007 + * @date modification 24/05/2007 + */ + +#ifndef _VP_API_INCLUDE_H_ +#define _VP_API_INCLUDE_H_ + +#include +#include +#include +#include +#include + + +/** + * @enum _VP_API_IO_TYPES_ + * @brief Available io stages type + */ +typedef enum _VP_API_IO_TYPES_ +{ + // INPUTS + VP_API_INPUT_BUFFER, + VP_API_INPUT_CAMIF, + VP_API_INPUT_FILE, + VP_API_INPUT_SOCKET, + + // FILTERS + VP_API_FILTER_ENCODER, + VP_API_FILTER_DECODER, + VP_API_FFMPEG_ENCODER, + VP_API_FFMPEG_DECODER, + VP_API_FILTER_VISION, + VP_API_VISION_PREPARE, + VP_API_FILTER_YUV2RGB, + VP_API_JPEG_ENCODER, + VP_API_JPEG_DECODER, + VP_API_ARWIZ, + + // OUTPUTS + VP_API_OUTPUT_CONSOLE, + VP_API_OUTPUT_SDL, + VP_API_OUTPUT_LCD, + VP_API_OUTPUT_FILE, + VP_API_OUTPUT_SOCKET, + + // MIXERS + VP_API_PIPE +} +VP_API_IO_TYPE; + +/** + * @enum _VP_API_IO_STATUS_ + * @brief Stage's state definition + */ +typedef enum _VP_API_IO_STATUS_ +{ + VP_API_STATUS_INIT = 0, // needs being equal to zero to ease initialization + VP_API_STATUS_PROCESSING, + VP_API_STATUS_STILL_RUNNING, + VP_API_STATUS_ENDED, + VP_API_STATUS_ERROR +} +VP_API_IO_STATUS; + + +/** + * @struct _vp_api_io_data_ + * @brief This structure is used by stages to share data in a generic way + */ +typedef struct _vp_api_io_data_ +{ + uint32_t numBuffers; + int8_t **buffers; + uint32_t indexBuffer; + + int32_t size; + int32_t *lineSize; + + VP_API_IO_STATUS status; + + vp_os_mutex_t lock; +} +vp_api_io_data_t; + + +/** + * @struct _vp_api_io_stage_ + * @brief Public definition of a stage + * + * This structure is used to configure stages + * The cfg field can be used to share data between stages in a specific way + */ +typedef struct _vp_api_io_stage_ +{ + VP_API_IO_TYPE type; + void *cfg; + vp_api_stage_funcs_t funcs; + vp_api_io_data_t data; +} +vp_api_io_stage_t; + + +/** + * @struct _vp_api_io_pipeline_ + * @brief Public definition of the pipeline + * + * This structure is used to configure the pipeline + */ +typedef struct _vp_api_io_pipeline_ +{ + uint32_t nb_stages; + vp_api_io_stage_t *stages; + vp_api_handle_msg_t handle_msg; + uint32_t nb_still_running; + vp_api_fifo_t fifo; + +} +vp_api_io_pipeline_t; + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @fn C_RESULT vp_api_open(vp_api_io_pipeline_t *pipeline, PIPELINE_HANDLE *handle) + * @brief Creates internally all + * @param pipeline Pipeline definition + * @param handle Pipeline handle + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_api_open(vp_api_io_pipeline_t *pipeline, PIPELINE_HANDLE *handle); + + +/** + * @fn C_RESULT vp_api_run(vp_api_io_pipeline_t *pipeline, vp_api_io_data_t *out_data) + * @brief Runs pipeline + * @param pipeline Pipeline definition + * @param out_data Output data of the last pipeline stage + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_api_run(vp_api_io_pipeline_t *pipeline, vp_api_io_data_t *out_data); + + +/** + * @fn C_RESULT vp_api_flush(vp_api_io_pipeline_t *pipeline) + * @brief Flushes pipeline + * @param pipeline Pipeline definition + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_api_flush(vp_api_io_pipeline_t *pipeline); + +/** + * @fn C_RESULT vp_api_close(vp_api_io_pipeline_t *pipeline) + * @brief Clean up + * @param pipeline Pipeline definition + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_api_close(vp_api_io_pipeline_t *pipeline, PIPELINE_HANDLE *handle); + +#ifdef __cplusplus +} +#endif + +#endif // ! _VP_API_INCLUDE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_config.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_config.h new file mode 100644 index 0000000..77e975a --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_config.h @@ -0,0 +1,91 @@ +/*! \file vp_api_config.h + \brief VP Api. Pipeline configuration + \author Julien Floret + \version 1.0 + \date 22/05/2007 +*/ + + +#ifndef _VP_API_CONFIG_H_ +#define _VP_API_CONFIG_H_ + +#define STAGE_JULIEN + +/////////////////////////////////////////////// +// VP_API_SUPERVISOR + +/** + * @def VP_API_MAX_NUM_PIPELINES + * @brief Encoder buffer size + */ +#define VP_API_MAX_NUM_PIPELINES 16 + +/** + * @def VP_API_MAX_NUM_STAGES + * @brief Encoder buffer size + */ +#define VP_API_MAX_NUM_STAGES 128 + +/** + * @def VP_API_PIPELINE_FIFO_SIZE + * @brief Encoder buffer size + */ +#define VP_API_PIPELINE_FIFO_SIZE 4000 + + +/////////////////////////////////////////////// +// VP_STAGES_IO_FILTER + +/** + * @def VP_STAGES_IO_FILTER_OUTBUF_SIZE + * @brief Encoder buffer size + */ +#define VP_STAGES_IO_FILTER_OUTBUF_SIZE 100000 +#define VP_STAGES_IO_FFMPEG_OUTBUF_SIZE 100000 + +/** + * @def VP_STAGES_IO_FILTER_DECODER_TIME_STATS + * @brief Display number of frames/sec + */ +#define VP_STAGES_IO_FILTER_DECODER_TIME_STATS + +#ifdef VP_STAGES_IO_FILTER_DECODER_TIME_STATS +# define VP_STAGES_IO_FILTER_NB_FRAMES_DISPLAY 500 +#endif // < VP_STAGES_IO_FILTER_DECODER_TIME_STATS + +/////////////////////////////////////////////// +// VP_STAGES_O_LCD + +/** + * @def VP_STAGES_O_LCD_NUMBER_OF_FRAMEBUFFER_MAX + * @brief Max number of LCD buffers. + */ +#define VP_STAGES_O_LCD_NUMBER_OF_FRAMEBUFFER_MAX 3 + +//#define VP_STAGES_O_LCD_CADENCED_DISPLAY + +/** + * @def VP_STAGES_O_LCD_TICKS_FRAME + * @brief Time between two displays. + * + * In case of a cadenced display, this value indicates how much time a frame is displayed. + */ +#define VP_STAGES_O_LCD_TICKS_FRAME 4 + +/////////////////////////////////////////////// +// VP_STAGES_YUV2RGB + +//#define QCIF_TO_QVGA + +#ifdef QCIF_TO_QVGA +# define USE_YUV2RGB_STRETCH +#endif // < QCIF_TO_QVGA + +//#define VP_STAGES_YUV2RGB_NOT_ALL_FRAMES + +#ifdef VP_STAGES_YUV2RGB_NOT_ALL_FRAMES +# define VP_STAGES_YUV2RGB_NB_FRAMES 3 +#endif // < VP_STAGES_YUV2RGB_NOT_ALL_FRAMES + + +#endif // ! _VP_API_CONFIG_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_error.c b/ARDroneLib/VP_SDK/VP_Api/vp_api_error.c new file mode 100644 index 0000000..b393b42 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_error.c @@ -0,0 +1,57 @@ +/** + * \brief VP Api. Error management + * \author Thomas Landais + * \version 2.0 + * \date first release 16/12/2006 + * \date modification 19/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include + +/** + * \struct private definition of structure message + * \brief This structure is used to create the list of error message + * \brief the Parrot Video Software Development Kit + */ +typedef struct _vp_api_msg_ +{ + + uint32_t index; + const char *msg; + +} vp_api_msg_t; + +static const vp_api_msg_t vp_api_errorMsg[] = +{ + {VP_API_OK, "OK" }, + {VP_API_UNKNOW_ERROR, "Unknown error" }, + {VP_API_INPUT_ERROR, "Input error" }, + {VP_API_INPUT_CAMIF_SELECTION, "Input CAMIF" }, + {VP_API_INPUT_CAMIF_ERROR , "Input CAMIF error" }, + {VP_API_INPUT_FILE_SELECTION, "Input FILE" }, + {VP_API_INPUT_FILE_ERROR, "Input FILE error" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_BNEP, "Input Socket Bluetooth BNEP" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_BNEP_ERROR, "Input Socket Bluetooth BNEP Error" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_RFCOMM, "Input Socket Bluetooth RFComm" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_RFCOMM_ERROR, "Input Socket Bluetooth RFComm Error" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_FTP, "Input Socket Bluetooth FTP" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_FTP_ERROR, "Input Socket Bluetooth FTP Error" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_BIP, "Input Socket Bluetooth BIP" }, + {VP_API_INPUT_SOCKET_BLUETOOTH_BIP_ERROR, "Input Socket Bluetooth BIP Error" }, + {VP_API_OUTPUT_FILE_SELECTION, "Output file selection" }, + {VP_API_OUTPUT_SOCKET_SELECTION, "Output socket selection" }, + {VP_API_OUTPUT_BUFFER_SELECTION, "Output buffer selection" }, + {VP_API_OUTPUT_ERROR, "Output error" }, +}; + + +const char* vp_api_format_message(uint32_t error_code) +{ + if(error_code >= VP_API_MAX_NUM_ERROR) + error_code = VP_API_UNKNOW_ERROR; + + return vp_api_errorMsg[error_code & 0xFFFF].msg; +} diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_error.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_error.h new file mode 100644 index 0000000..e84f0aa --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_error.h @@ -0,0 +1,53 @@ +/** + * \brief VP Api. Error management + * \author Thomas Landais + * \version 2.0 + * \date first release 16/12/2006 + * \date modification 19/03/2007 + */ + +#ifndef _VP_API_ERROR_H_ +#define _VP_API_ERROR_H_ + + +#include + + +/** + * \enum List of error state message + */ +enum { + VP_API_OK = (VP_API_SDK_SIGNATURE << 16), + VP_API_UNKNOW_ERROR, + VP_API_INPUT_ERROR, + VP_API_INPUT_CAMIF_SELECTION, + VP_API_INPUT_CAMIF_ERROR, + VP_API_INPUT_FILE_SELECTION, + VP_API_INPUT_FILE_ERROR, + VP_API_INPUT_SOCKET_BLUETOOTH_BNEP, + VP_API_INPUT_SOCKET_BLUETOOTH_BNEP_ERROR, + VP_API_INPUT_SOCKET_BLUETOOTH_RFCOMM, + VP_API_INPUT_SOCKET_BLUETOOTH_RFCOMM_ERROR, + VP_API_INPUT_SOCKET_BLUETOOTH_FTP, + VP_API_INPUT_SOCKET_BLUETOOTH_FTP_ERROR, + VP_API_INPUT_SOCKET_BLUETOOTH_BIP, + VP_API_INPUT_SOCKET_BLUETOOTH_BIP_ERROR, + VP_API_OUTPUT_FILE_SELECTION, + VP_API_OUTPUT_SOCKET_SELECTION, + VP_API_OUTPUT_BUFFER_SELECTION, + VP_API_OUTPUT_ERROR, + VP_API_MAX_NUM_ERROR +}; + + +/** + * @fn error api message process + * @param int errorCode : error message in the list of error state message + * @param char **errorMessage : string of the message + * @return return the error Message + */ +const char* vp_api_format_message(uint32_t error_code); + + + +#endif // _VP_API_ERROR_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.c b/ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.c new file mode 100644 index 0000000..fb0b736 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.c @@ -0,0 +1,70 @@ +/** + * \brief VP Api. Composite Stage Declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 1.0 + * \date first release 21/03/2007 + */ + +#include +#include +#include + +C_RESULT +vp_api_multi_stage_open(vp_api_io_multi_stage_config_t *cfg) +{ + uint32_t i; + + for(i = 0; i < cfg->nb_stages; i++) + { + VP_OS_ASSERT(cfg->stages[i].funcs.open); + VP_OS_ASSERT(cfg->stages[i].funcs.transform); + VP_OS_ASSERT(cfg->stages[i].funcs.close); + + if(VP_FAILED(cfg->stages[i].funcs.open(cfg->stages[i].cfg))) + return (VP_FAILURE); + } + + return (VP_SUCCESS); +} + +C_RESULT +vp_api_multi_stage_transform(vp_api_io_multi_stage_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + uint32_t i; + C_RESULT res = (VP_FAILURE); + + // if a stage is selected then execute only this one + if(cfg->activ_stage >= 0 && cfg->activ_stage < (int32_t)cfg->nb_stages) + res = cfg->stages[cfg->activ_stage].funcs.transform(cfg->stages[cfg->activ_stage].cfg, in, out); + + // Otherwise if activ_stage == -1 then execute all stages + if(cfg->activ_stage == VP_API_EXECUTE_ALL_STAGES) + { + res = VP_SUCCESS; + for(i = 0; i < cfg->nb_stages && res == VP_SUCCESS; i++) + { + res = cfg->stages[i].funcs.transform(cfg->stages[i].cfg, in, out); + } + } + + if(cfg->activ_stage == VP_API_EXECUTE_NO_STAGE) + res = VP_SUCCESS; + + return res; +} + +C_RESULT +vp_api_multi_stage_close(vp_api_io_multi_stage_config_t *cfg) +{ + uint32_t i; + + for(i = 0; i < cfg->nb_stages; i++) + { + if(VP_FAILED(cfg->stages[i].funcs.close(cfg->stages[i].cfg))) + return (VP_FAILURE); + } + + return (VP_SUCCESS); +} diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.h new file mode 100644 index 0000000..32bea99 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_io_multi_stage.h @@ -0,0 +1,69 @@ +/** + * \brief VP Api. Composite Stage Declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \todo This stage need to be tested + * \version 1.0 + * \date first release 21/03/2007 + */ + +#ifndef _VP_API_IO_MULTI_STAGE_H_ +#define _VP_API_IO_MULTI_STAGE_H_ + +#include + + +/////////////////////////////////////////////// +// DEFINES + +#define VP_API_EXECUTE_ALL_STAGES -1 +#define VP_API_EXECUTE_NO_STAGE -2 + +/////////////////////////////////////////////// +// TYPEDEFS + +typedef struct _vp_api_io_multi_stage_config_ +{ + int32_t activ_stage; // if activ_stage == -1 then all stages are executed + uint32_t nb_stages; + vp_api_io_stage_t* stages; +} vp_api_io_multi_stage_config_t; + + +/////////////////////////////////////////////// +// FUNCTIONS + +/** + * @fn Open the multi stage + * @param vp_api_io_multi_stage_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_api_multi_stage_open(vp_api_io_multi_stage_config_t *cfg); + + +/** + * @fn Transform the multi stage + * @param vp_api_io_multi_stage_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_api_multi_stage_transform(vp_api_io_multi_stage_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + + +/** + * @fn Close the multi stage + * @param vp_api_io_multi_stage_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_api_multi_stage_close(vp_api_io_multi_stage_config_t *cfg); + + +#endif // _VP_API_IO_MULTI_STAGE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_io_stage_selector.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_io_stage_selector.h new file mode 100644 index 0000000..9385dde --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_io_stage_selector.h @@ -0,0 +1,34 @@ +/** + * \brief VP Api. Stage selector for a multi stage + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 1.0 + * \date first release 21/03/2007 + */ + +#ifndef _VP_API_IO_STAGE_SELECTOR_H_ +#define _VP_API_IO_STAGE_SELECTOR_H_ + +#include +#include + +/////////////////////////////////////////////// +// TYPEDEFS + +typedef struct _vp_api_io_stage_selector_ +{ + int32_t* activ_stage; // Pointer on the activ_stage of targeted multi_stage +} vp_api_io_stage_selector_t; + + +/////////////////////////////////////////////// +// FUNCTIONS + +// +// No implementation! +// If someone wants to use a stage selector, he needs to implement it, +// because it depends on its needs. +// + +#endif // _VP_API_IO_STAGE_SELECTOR_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_picture.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_picture.h new file mode 100644 index 0000000..dd784f6 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_picture.h @@ -0,0 +1,142 @@ +/** + * \brief VP Api. Output SDL stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 28/03/2007 + */ + +#ifndef _VP_API_PICTURE_H_ +#define _VP_API_PICTURE_H_ + +#include +#ifdef USE_FFMPEG +#include +#else +/** + * Pixel format. Notes: + * + * PIX_FMT_RGBA32 is handled in an endian-specific manner. A RGBA + * color is put together as: + * (A << 24) | (R << 16) | (G << 8) | B + * This is stored as BGRA on little endian CPU architectures and ARGB on + * big endian CPUs. + * + * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized + * image data is stored in AVFrame.data[0]. The palette is transported in + * AVFrame.data[1] and, is 1024 bytes long (256 4-byte entries) and is + * formatted the same as in PIX_FMT_RGBA32 described above (i.e., it is + * also endian-specific). Note also that the individual RGB palette + * components stored in AVFrame.data[1] should be in the range 0..255. + * This is important as many custom PAL8 video codecs that were designed + * to run on the IBM VGA graphics adapter use 6-bit palette components. + */ +enum PixelFormat { + PIX_FMT_NONE= -1, + PIX_FMT_YUV420P, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples) + PIX_FMT_YUV422, ///< Packed pixel, Y0 Cb Y1 Cr + PIX_FMT_RGB24, ///< Packed pixel, 3 bytes per pixel, RGBRGB... + PIX_FMT_BGR24, ///< Packed pixel, 3 bytes per pixel, BGRBGR... + PIX_FMT_YUV422P, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) + PIX_FMT_YUV444P, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples) + PIX_FMT_RGBA32, ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness + PIX_FMT_YUV410P, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples) + PIX_FMT_YUV411P, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples) + PIX_FMT_RGB565, ///< always stored in cpu endianness + PIX_FMT_RGB555, ///< always stored in cpu endianness, most significant bit to 1 + PIX_FMT_GRAY8, + PIX_FMT_MONOWHITE, ///< 0 is white + PIX_FMT_MONOBLACK, ///< 0 is black + PIX_FMT_PAL8, ///< 8 bit with RGBA palette + PIX_FMT_YUVJ420P, ///< Planar YUV 4:2:0 full scale (jpeg) + PIX_FMT_YUVJ422P, ///< Planar YUV 4:2:2 full scale (jpeg) + PIX_FMT_YUVJ444P, ///< Planar YUV 4:4:4 full scale (jpeg) + PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h) + PIX_FMT_XVMC_MPEG2_IDCT, + PIX_FMT_UYVY422, ///< Packed pixel, Cb Y0 Cr Y1 + PIX_FMT_UYVY411, ///< Packed pixel, Cb Y0 Y1 Cr Y2 Y3 + PIX_FMT_NB, +}; +#endif + +#define OVERPAD 16 +#define MB_WIDTH_Y 16 +#define MB_HEIGHT_Y MB_WIDTH_Y +#define MB_WIDTH_C 8 +#define MB_HEIGHT_C MB_WIDTH_C + + +// SQCIF +#define SQCIF_WIDTH 128 +#define SQCIF_HEIGHT 96 +#define SQCIF_SIZE (SQCIF_WIDTH * SQCIF_HEIGHT) + +// QCIF +#define QCIF_WIDTH 176 +#define QCIF_HEIGHT 144 +#define QCIF_SIZE (QCIF_WIDTH * QCIF_HEIGHT) + +#define QQVGA_WIDTH 160 +#define QQVGA_HEIGHT 120 +#define QQVGA_SIZE (QQVGA_WIDTH * QQVGA_HEIGHT) + +// QQCIF +#define QQCIF_WIDTH 88 +#define QQCIF_HEIGHT 72 +#define QQCIF_SIZE (QQCIF_WIDTH * QQCIF_HEIGHT) + +// QQVGA +#define QQVGA_WIDTH 160 +#define QQVGA_HEIGHT 120 +#define QQVGA_SIZE (QQVGA_WIDTH * QQVGA_HEIGHT) + +// QVGA +#define QVGA_WIDTH 320 +#define QVGA_HEIGHT 240 +#define QVGA_SIZE (QVGA_WIDTH * QVGA_HEIGHT) + +// TWEAKY QQVGA +#define TWEAKY_QQVGA_WIDTH 320 +#define TWEAKY_QQVGA_HEIGHT (240-16) +#define TWEAKY_QQVGA_SIZE (TWEAKY_QQVGA_WIDTH * TWEAKY_QQVGA_HEIGHT) + +// CIF +#define CIF_WIDTH 352 +#define CIF_HEIGHT 288 +#define CIF_SIZE (CIF_WIDTH * CIF_HEIGHT) + +// VGA +#define VGA_WIDTH 640 +#define VGA_HEIGHT 480 +#define VGA_SIZE (VGA_WIDTH * VGA_HEIGHT) + + +typedef struct _vp_api_picture_ +{ + enum PixelFormat format; // camif -> encoder : PIX_FMT_YUV420P + + uint32_t width; // camif -> encoder + uint32_t height; // camif -> encoder + uint32_t framerate; // camif -> encoder + + uint8_t *y_buf; // camif -> encoder + uint8_t *cb_buf; // camif -> encoder + uint8_t *cr_buf; // camif -> encoder + + uint32_t y_pad; // 2* camif_config.y_pad + uint32_t c_pad; // 2* camif_config.c_pad + + uint32_t y_line_size; + uint32_t cb_line_size; + uint32_t cr_line_size; + + uint32_t vision_complete; + uint32_t complete; + int32_t blockline; +} +vp_api_picture_t; + + +#endif // ! _VP_API_PICTURE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_stage.c b/ARDroneLib/VP_SDK/VP_Api/vp_api_stage.c new file mode 100644 index 0000000..a4d20fa --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_stage.c @@ -0,0 +1,137 @@ +/** + * \brief VP Api. Stages declaration. + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef USE_LINUX +#include +#endif // > USE_LINUX + +/////////////////////////////////////////////// +// POINTERS + +const vp_api_stage_funcs_t vp_stages_input_file_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_input_file_stage_open, + (vp_api_stage_transform_t) vp_stages_input_file_stage_transform, + (vp_api_stage_close_t) vp_stages_input_file_stage_close +}; + +const vp_api_stage_funcs_t vp_stages_output_file_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_output_file_stage_open, + (vp_api_stage_transform_t) vp_stages_output_file_stage_transform, + (vp_api_stage_close_t) vp_stages_output_file_stage_close +}; + +const vp_api_stage_funcs_t vp_stages_input_buffer_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_input_buffer_stage_open, + (vp_api_stage_transform_t) vp_stages_input_buffer_stage_transform, + (vp_api_stage_close_t) vp_stages_input_buffer_stage_close +}; + +const vp_api_stage_funcs_t vp_stages_output_buffer_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_output_buffer_stage_open, + (vp_api_stage_transform_t) vp_stages_output_buffer_stage_transform, + (vp_api_stage_close_t) vp_stages_output_buffer_stage_close +}; + +const vp_api_stage_funcs_t vp_stages_frame_pipe_sender_funcs = +{ + NULL, + (vp_api_stage_open_t) vp_stages_frame_pipe_sender_open, + (vp_api_stage_transform_t) vp_stages_frame_pipe_sender_transform, + (vp_api_stage_close_t) vp_stages_frame_pipe_sender_close +}; + +const vp_api_stage_funcs_t vp_stages_frame_pipe_receiver_funcs = +{ + NULL, + (vp_api_stage_open_t) vp_stages_frame_pipe_receiver_open, + (vp_api_stage_transform_t) vp_stages_frame_pipe_receiver_transform, + (vp_api_stage_close_t) vp_stages_frame_pipe_receiver_close +}; + +const vp_api_stage_funcs_t vp_stages_buffer_to_picture_funcs = +{ + NULL, + (vp_api_stage_open_t) vp_stages_buffer_to_picture_open, + (vp_api_stage_transform_t) vp_stages_buffer_to_picture_transform, + (vp_api_stage_close_t) vp_stages_buffer_to_picture_close +}; + + +const vp_api_stage_funcs_t vp_stages_picture_to_buffer_funcs = +{ + NULL, + (vp_api_stage_open_t) vp_stages_picture_to_buffer_open, + (vp_api_stage_transform_t) vp_stages_picture_to_buffer_transform, + (vp_api_stage_close_t) vp_stages_picture_to_buffer_close +}; + +const vp_api_stage_funcs_t vp_stages_input_com_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_input_com_stage_open, + (vp_api_stage_transform_t) vp_stages_input_com_stage_transform, + (vp_api_stage_close_t) vp_stages_input_com_stage_close +}; + +const vp_api_stage_funcs_t vp_stages_output_com_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_output_com_stage_open, + (vp_api_stage_transform_t) vp_stages_output_com_stage_transform, + (vp_api_stage_close_t) vp_stages_output_com_stage_close +}; + +const vp_api_stage_funcs_t vp_stages_output_console_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_output_console_stage_open, + (vp_api_stage_transform_t) vp_stages_output_console_stage_transform, + (vp_api_stage_close_t) vp_stages_output_console_stage_close +}; + +#if defined(USE_LINUX) +const vp_api_stage_funcs_t vp_stages_output_sdl_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_output_sdl_stage_open, + (vp_api_stage_transform_t) vp_stages_output_sdl_stage_transform, + (vp_api_stage_close_t) vp_stages_output_sdl_stage_close +}; +#endif // USE_LINUX + +const vp_api_stage_funcs_t vp_stages_yuv2rgb_funcs = +{ + (vp_api_stage_handle_msg_t) NULL, + (vp_api_stage_open_t) vp_stages_yuv2rgb_stage_open, + (vp_api_stage_transform_t) vp_stages_yuv2rgb_stage_transform, + (vp_api_stage_close_t) vp_stages_yuv2rgb_stage_close +}; + diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_stage.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_stage.h new file mode 100644 index 0000000..74008b0 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_stage.h @@ -0,0 +1,110 @@ +/** + * @file vp_api_stage.h + * @brief VP Api. Stages definition + * @author Sylvain Gaeremynck + * @author Aurelien Morelle + * @author Thomas Landais + * @author Julien Floret + * @version 2.0 + * @date first release 16/03/2007 + * @date modification 19/03/2007 + */ + +#ifndef _VP_API_STAGE_H_ +#define _VP_API_STAGE_H_ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct _vp_api_io_data_; + + +/////////////////////////////////////////////// +// TYPEDEFS + + +/** + * @typedef C_RESULT (*vp_api_stage_handle_msg_t)(void *cfg, PIPELINE_MSG msg_id, void *callback, void *param) +Functions prototypes to open, close and update a stage + */ +typedef C_RESULT +(*vp_api_stage_handle_msg_t)(void *cfg, PIPELINE_MSG msg_id, void *callback, void *param); + +typedef C_RESULT +(*vp_api_stage_open_t)(void *cfg); + +typedef C_RESULT +(*vp_api_stage_transform_t)(void *cfg, struct _vp_api_io_data_ *in, struct _vp_api_io_data_ *out); + +typedef C_RESULT +(*vp_api_stage_close_t)(void *cfg); + + +/** + * @struct _vp_api_stage_funcs_ + * @brief A structure that contains all functions pointers to handle a stage + */ +typedef struct _vp_api_stage_funcs_ +{ + vp_api_stage_handle_msg_t handle_msg; + vp_api_stage_open_t open; + vp_api_stage_transform_t transform; + vp_api_stage_close_t close; +} vp_api_stage_funcs_t; + + +/** + * @brief Definition of ready to use stages for vp products + */ +extern const vp_api_stage_funcs_t vp_stages_input_file_funcs; +extern const vp_api_stage_funcs_t vp_stages_output_file_funcs; + +extern const vp_api_stage_funcs_t vp_stages_input_buffer_funcs; +extern const vp_api_stage_funcs_t vp_stages_output_buffer_funcs; + +extern const vp_api_stage_funcs_t vp_stages_frame_pipe_sender_funcs; +extern const vp_api_stage_funcs_t vp_stages_frame_pipe_receiver_funcs; + +extern const vp_api_stage_funcs_t vp_stages_video_mixer_funcs; + +extern const vp_api_stage_funcs_t vp_stages_buffer_to_picture_funcs; +extern const vp_api_stage_funcs_t vp_stages_picture_to_buffer_funcs; + +extern const vp_api_stage_funcs_t vp_stages_decoder_filter_funcs; +extern const vp_api_stage_funcs_t vp_stages_decoder_ffmpeg_funcs; + +extern const vp_api_stage_funcs_t vp_stages_input_com_funcs; +extern const vp_api_stage_funcs_t vp_stages_output_com_funcs; + +extern const vp_api_stage_funcs_t vp_stages_output_console_funcs; + +extern const vp_api_stage_funcs_t vp_stages_output_sdl_funcs; + +extern const vp_api_stage_funcs_t vp_stages_output_lcd_funcs; + +extern const vp_api_stage_funcs_t vp_stages_yuv2rgb_funcs; + +#if defined(USE_JPEG) || defined(USE_JPEG_P6) +extern const vp_api_stage_funcs_t vp_stages_encoder_jpeg_funcs; +extern const vp_api_stage_funcs_t vp_stages_decoder_jpeg_funcs; +#endif // > USE_JPEG + +#ifdef USE_PVSP +extern const vp_api_stage_funcs_t vp_stages_pvsp_funcs; +#endif // USE_PVSP + +#ifdef __cplusplus +} +#endif + + +#endif // ! _VP_API_STAGE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.c b/ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.c new file mode 100644 index 0000000..e9f4406 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.c @@ -0,0 +1,203 @@ +/** + * @file vp_api_supervisor.c + * @brief VP Api. Pipeline supervisor + */ + + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include +#include +#include + + +/////////////////////////////////////////////// +// STATICS + +/** Global array containing pipeline handles. + */ +static PIPELINE_ADDRESS pipelines[VP_API_MAX_NUM_PIPELINES] = {(PIPELINE_ADDRESS)NULL}; + + +/** + * @fn vp_api_get_message(vp_api_io_pipeline_t *, DEST_HANDLE *, PIPELINE_MSG *, void *, void *) + * @brief Get a message. + * + * Get a message from the pipeline fifo. Internally called by vp_api_handle_messages() + * @param pipeline Pipeline definition + * @param dest Message destination + * @param msg_id Message identifier + * @param callback Optional callback function called after processing of the message + * @param param Optional message parameters + * @return C_RESULT : VP_SUCCESS + * @author Julien Floret + * @date 28/05/2007 + */ +static C_RESULT +vp_api_get_message(vp_api_io_pipeline_t *pipeline, DEST_HANDLE *dest, PIPELINE_MSG *msg_id, void **callback, void **param); + + +/////////////////////////////////////////////// +// CODE + +static PIPELINE_HANDLE nb_pipelines = 0; + + +C_RESULT vp_api_add_pipeline(vp_api_io_pipeline_t *pipeline, PIPELINE_HANDLE *handle) +{ + C_RESULT res = VP_SUCCESS; + int i = 0; + + VP_OS_ASSERT(nb_pipelines < VP_API_MAX_NUM_PIPELINES); + + while(pipelines[i] != ((PIPELINE_ADDRESS)NULL)) + { + i++; + } + + pipelines[i] = (PIPELINE_ADDRESS) pipeline; + (*handle) = i; + nb_pipelines ++; + + return res; +} + + +C_RESULT vp_api_remove_pipeline(vp_api_io_pipeline_t *pipeline, PIPELINE_HANDLE *handle) +{ + C_RESULT res = VP_SUCCESS; + + pipelines[*handle] = (PIPELINE_ADDRESS) NULL; + nb_pipelines --; + + return res; +} + + +vp_api_io_pipeline_t * vp_api_get_pipeline(PIPELINE_HANDLE handle) +{ + vp_api_io_pipeline_t *pipeline = (vp_api_io_pipeline_t *) pipelines[handle]; + return (pipeline); +} + + +C_RESULT vp_api_post_message(DEST_HANDLE dest, PIPELINE_MSG msg_id, void *callback, void *param) +{ + C_RESULT res = VP_SUCCESS; + + vp_api_io_pipeline_t *pipeline = (vp_api_io_pipeline_t *) pipelines[dest.pipeline]; + + /* Do not send the message if the pipeline does not exist yet + This happens when calling the callback function of the 'video_channel' configuration + value at drone startup. */ + if (pipeline==NULL) { return VP_FAILURE; } + + VP_OS_ASSERT(pipeline->fifo.nb_waiting >= 0); + + vp_os_mutex_lock(&pipeline->fifo.mutex); + + if((pipeline->fifo.ppost + sizeof(DEST_HANDLE) + sizeof(PIPELINE_MSG) + sizeof(void *) + sizeof(void *)) >= (pipeline->fifo.pbase + VP_API_PIPELINE_FIFO_SIZE)) + pipeline->fifo.ppost = pipeline->fifo.pbase; + + vp_os_memcpy(pipeline->fifo.ppost, &dest, sizeof(DEST_HANDLE)); + pipeline->fifo.ppost += sizeof(DEST_HANDLE); + + vp_os_memcpy(pipeline->fifo.ppost, &msg_id, sizeof(PIPELINE_MSG)); + pipeline->fifo.ppost += sizeof(PIPELINE_MSG); + + if(callback != NULL) + vp_os_memcpy(pipeline->fifo.ppost, &callback, sizeof(void *)); + else + vp_os_memset(pipeline->fifo.ppost, 0, sizeof(void *)); + pipeline->fifo.ppost += sizeof(void *); + + if(param != NULL) + vp_os_memcpy(pipeline->fifo.ppost, ¶m, sizeof(void *)); + + else + vp_os_memset(pipeline->fifo.ppost, 0, sizeof(void *)); + pipeline->fifo.ppost += sizeof(void *); + + pipeline->fifo.nb_waiting ++; + + vp_os_mutex_unlock(&pipeline->fifo.mutex); + + return res; +} + + +static C_RESULT vp_api_get_message(vp_api_io_pipeline_t *pipeline, DEST_HANDLE *dest, PIPELINE_MSG *msg_id, void **callback, void **param) +{ + C_RESULT res = VP_SUCCESS; + + VP_OS_ASSERT(pipeline->fifo.nb_waiting > 0); + + vp_os_mutex_lock(&pipeline->fifo.mutex); + + if((pipeline->fifo.pget + sizeof(PIPELINE_MSG) + sizeof(void *) + sizeof(void *)) >= (pipeline->fifo.pbase + VP_API_PIPELINE_FIFO_SIZE)) + pipeline->fifo.pget = pipeline->fifo.pbase; + + if(dest != NULL) + vp_os_memcpy(dest, pipeline->fifo.pget, sizeof(DEST_HANDLE)); + pipeline->fifo.pget += sizeof(DEST_HANDLE); + + if(msg_id != NULL) + vp_os_memcpy(msg_id, pipeline->fifo.pget, sizeof(PIPELINE_MSG)); + pipeline->fifo.pget += sizeof(PIPELINE_MSG); + + if(callback != NULL) + vp_os_memcpy(callback, pipeline->fifo.pget, sizeof(void *)); + pipeline->fifo.pget += sizeof(void *); + + if(param != NULL) + vp_os_memcpy(param, pipeline->fifo.pget, sizeof(void *)); + pipeline->fifo.pget += sizeof(void *); + + pipeline->fifo.nb_waiting --; + + vp_os_mutex_unlock(&pipeline->fifo.mutex); + + return res; +} + + +C_RESULT vp_api_handle_messages(vp_api_io_pipeline_t *pipeline) +{ + C_RESULT res = VP_SUCCESS; + + DEST_HANDLE dest; + PIPELINE_MSG msg_id; + void *callback = NULL; + void *param = NULL; + uint32_t i; + + while(pipeline->fifo.nb_waiting > 0) + { + if(VP_FAILED(vp_api_get_message(pipeline, &dest, &msg_id, &callback, ¶m))) + res = VP_FAILURE; + else + { + if(dest.stage == VP_API_DEST_PIPELINE_LEVEL) + { + pipeline->handle_msg(pipeline, msg_id, callback, param); + } + else if(dest.stage == VP_API_DEST_STAGE_BROADCAST) + { + for(i=0; i < pipeline->nb_stages; i++) + { + pipeline->stages[i].funcs.handle_msg(pipeline->stages[i].cfg, msg_id, callback, param); + } + } + else if((dest.stage >=0) && (dest.stage < (int16_t)pipeline->nb_stages)) + { + if (pipeline->stages[dest.stage].funcs.handle_msg != NULL) + pipeline->stages[dest.stage].funcs.handle_msg(pipeline->stages[dest.stage].cfg, msg_id, callback, param); + } + } + } + return res; +} diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.h new file mode 100644 index 0000000..5e51248 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_supervisor.h @@ -0,0 +1,193 @@ +/** + * @file vp_api_supervisor.h + * @brief VP Api. Pipeline supervisor + */ + + +#ifndef _VP_API_SUPERVISOR_H_ +#define _VP_API_SUPERVISOR_H_ + +/** + * @addtogroup VP_SDK + * @{ */ + +/** + * @addtogroup VP_Api + * @{ */ + +/** + * @defgroup vp_api_supervisor Api supervisor + * + * \section Brief + * \code + Supervise pipelines : + Handle multiple pipelines per application. + Handle pipeline messages and dispatch them to stages. + * \endcode + * + * \section History + * + * \par date: 2007-06-14 author: + * - Handle different message dispatchs : Pipeline level, stage broadcast + * + * \par date: 2007-05-28 author: + * - Add supervisor + * + * @{ */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include + +/////////////////////////////////////////////// +// GLOBALS + +struct _vp_api_io_pipeline_; + + +/////////////////////////////////////////////// +// DEFINES + +/** + * @def VP_API_DEST_PIPELINE_LEVEL + * Pipeline level : no dispatch to stages + */ +/** + * @def VP_API_DEST_STAGE_BROADCAST + * Broadcast message to all stages + */ + +#define VP_API_DEST_PIPELINE_LEVEL 0x7fff +#define VP_API_DEST_STAGE_BROADCAST 0x7ffe + + +typedef int32_t PIPELINE_ADDRESS; ///< Pipeline address +typedef int16_t PIPELINE_HANDLE; ///< Pipeline handle + + +/** Pipeline message identifiers + */ +typedef enum _PIPELINE_MSG +{ + PIPELINE_MSG_START, + PIPELINE_MSG_STOP, + PIPELINE_MSG_SUSPEND, + PIPELINE_MSG_RESUME, + PIPELINE_MSG_RESET, + PIPELINE_MSG_END, + PIPELINE_MSG_SYNCHRONIZE, + PIPELINE_MSG_COMMAND +} +PIPELINE_MSG; + + +/** + * @brief Pipeline messages fifo + */ +typedef struct _vp_api_fifo_ +{ + char *pbase; ///< Base address of the fifo + char *pget; ///< Pointer to the next message to get + char *ppost; ///< Where to post a new message in the fifo + int32_t nb_waiting; ///< Number of messages waiting to be handled + vp_os_mutex_t mutex; +} +vp_api_fifo_t; + + +/** + * @brief Handle to a message destination + */ +typedef union _DEST_HANDLE +{ + int32_t handle; ///< Pipeline handle (16 bits) + stage number (16bits) + struct + { + PIPELINE_HANDLE pipeline; ///< Pipeline handle + int16_t stage; ///< Stage number + }; +} +DEST_HANDLE; + + +typedef C_RESULT (*vp_api_handle_msg_t)( struct _vp_api_io_pipeline_ *pipeline, + PIPELINE_MSG msg_id, + void *callback, + void *param + ); + + +/////////////////////////////////////////////// +// PROTOTYPES + +/** + * @fn vp_api_add_pipeline(struct _vp_api_io_pipeline_ *, PIPELINE_HANDLE *) + * @brief Add a pipeline and get its handle + * @param pipeline Pipeline to add + * @param handle Handle to the added pipeline + * @return C_RESULT : VP_SUCCESS + * @author Julien Floret + * @date 28/05/2007 + */ +C_RESULT vp_api_add_pipeline(struct _vp_api_io_pipeline_ *pipeline, PIPELINE_HANDLE *handle); + + +/** + * @fn vp_api_remove_pipeline(struct _vp_api_io_pipeline_ *, PIPELINE_HANDLE *) + * @brief Remove a pipeline and release handle + * @param pipeline Pipeline to remove + * @param handle Handle of the pipeline + * @return C_RESULT : VP_SUCCESS + * @author Aurelien Morelle + * @date 18/09/2008 + */ +C_RESULT vp_api_remove_pipeline(struct _vp_api_io_pipeline_ *pipeline, PIPELINE_HANDLE *handle); + + +/** + * @fn vp_api_get_pipeline(PIPELINE_HANDLE) + * @brief Get a pipeline address from its handle + * @param handle Pipeline handle + * @return struct _vp_api_io_pipeline_ * : Pipeline to get + * @author Julien Floret + * @date 28/05/2007 + */ +struct _vp_api_io_pipeline_ * vp_api_get_pipeline(PIPELINE_HANDLE handle); + + +/** + * @fn vp_api_post_message(DEST_HANDLE, PIPELINE_MSG, void *, void *) + * @brief Post a message to a pipeline + * @param dest Message destination + * @param msg_id Message identifier + * @param callback Optional callback function called after processing of the message + * @param param Optional message parameters + * @return C_RESULT : VP_SUCCESS or VP_FAILURE + * @author Julien Floret + * @date 28/05/2007 + */ +C_RESULT vp_api_post_message(DEST_HANDLE dest, PIPELINE_MSG msg_id, void *callback, void *param); + + +/** + * @fn vp_api_handle_messages(struct _vp_api_io_pipeline_ *) + * @brief Handle pipeline messages + * + * This function handles pipeline messages by calling user defined callback functions + * @param pipeline Current pipeline + * @return C_RESULT : VP_SUCCESS + * @author Julien Floret + * @date 28/05/2007 + */ +C_RESULT vp_api_handle_messages(struct _vp_api_io_pipeline_ *pipeline); + +// vp_api_supervisor +/** @} */ +// VP_Api +/** @} */ +// VP_SDK +/** @} */ + +#endif // ! _VP_API_SUPERVISOR_H_ diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.c b/ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.c new file mode 100644 index 0000000..5cdf5f1 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.c @@ -0,0 +1,143 @@ +/** + * \brief VP Api. Thread utility. + * \author Sylvain Gaeremynck + * \version 1.0 + * \date first release 19/12/2006 + * \date modification 26/03/2007 + */ + +#include +#include +#include +#include + +int32_t vp_api_get_thread_idx_tab_by_name(thread_table_entry_t* tab, const char* name) +{ + int32_t i = 0; + while(tab[i].name) + { + if(strcmp(name,tab[i].name) == 0) + return i; + i++; + } + PRINT("Thread %s is not in thread_table_entry_t \n", name); + return -1; +} + +int32_t vp_api_get_thread_idx_tab_by_handle(thread_table_entry_t* tab, THREAD_HANDLE handle, int32_t ret_on_failure) +{ + int32_t i = 0; + + while(tab[i].name && tab[i].handle != handle) i++; + + return tab[i].name ? i : ret_on_failure; +} + +C_RESULT vp_api_start_thread_tab(thread_table_entry_t* tab,int32_t idx,THREAD_PARAMS parameters) +{ + if(idx < 0) + return C_FAIL; + + PRINT("Starting thread %s\n", tab[idx].name); + + if( parameters == NO_PARAM ) + parameters = tab[idx].parameters; + + vp_os_thread_create(tab[idx].routine, + parameters, + &tab[idx].handle, + tab[idx].priority, + tab[idx].name, + (void*)tab[idx].stack, + tab[idx].stackSize, + &tab[idx].thread ); + + return C_OK; +} + +C_RESULT vp_api_join_thread_tab(thread_table_entry_t* tab,int32_t idx) +{ + if(idx < 0) + return C_FAIL; + + if( tab[idx].handle != 0 ) + { + vp_os_thread_join(tab[idx].handle); + } + + return C_OK; +} + +C_RESULT vp_api_start_all_threads_tab(thread_table_entry_t* tab) +{ + int32_t i = 0; + while(tab[i].name) + { + if(VP_FAILED(vp_api_start_thread_tab(tab,i,0))) + PRINT("Thread %d refused to start\n",(int)i); + i++; + } + + return C_OK; +} + +C_RESULT vp_api_change_thread_prio_tab(thread_table_entry_t* tab, int32_t idx, int32_t priority) +{ + if(idx < 0) + return C_FAIL; + + if( tab[idx].handle != 0 ) + { + vp_os_thread_priority( tab[idx].handle, priority ); + } + + return C_OK; +} + +C_RESULT vp_api_resume_thread(thread_table_entry_t* tab, int32_t idx) +{ + if( idx < 0 ) + return C_FAIL; + + if( tab[idx].handle != 0 ) + { + vp_os_thread_resume( tab[idx].handle ); + } + + return C_OK; +} + +C_RESULT vp_api_suspend_thread(thread_table_entry_t* tab, int32_t idx) +{ + if( idx < 0 ) + return C_FAIL; + + if( tab[idx].handle != 0 ) + { + vp_os_thread_suspend( tab[idx].handle ); + } + + return C_OK; +} + +THREAD_HANDLE vp_api_get_thread_handle(thread_table_entry_t* tab, int32_t idx) +{ + if( idx < 0 ) + return 0; + + return tab[idx].handle; +} + +C_RESULT vp_api_suspend_all_threads_tab(thread_table_entry_t* tab, THREAD_HANDLE handle) +{ + int32_t i = 0; + while(tab[i].name) + { + if( handle != tab[i].handle && tab[i].handle != 0 ) + vp_os_thread_suspend(tab[i].handle); + + i++; + } + + return C_OK; +} diff --git a/ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.h b/ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.h new file mode 100644 index 0000000..cfca84d --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Api/vp_api_thread_helper.h @@ -0,0 +1,109 @@ +/** + * \brief VP Api. Thread utility. + * \brief These macros are there to help static declaration of threads and their management. + * \author Sylvain Gaeremynck + * \version 1.0 + * \date first release 19/12/2006 + * \date modification 26/03/2007 + */ + +#ifndef _THREAD_HELPER_H_ +#define _THREAD_HELPER_H_ + +#include +#include + + +#ifdef __cplusplus +extern "C" +{ +#endif + + +# define DEFINE_CYG_THREAD void* thread; +# define DECLARE_CYG_THREAD 0 +# define STACK_ALIGNMENT + +#define BEGIN_THREAD_TABLE \ + thread_table_entry_t threadTable[] = { + +#define END_THREAD_TABLE \ + { 0 } \ + }; + +#define THREAD_TABLE_ENTRY(name, priority) \ + { #name, priority, 0, 0, NO_PARAM, thread_##name, 0, DECLARE_CYG_THREAD }, + +#define THREAD_TABLE_ENTRY_STACK(name, priority) \ + { #name, priority, sizeof stack_##name, stack_##name, NO_PARAM, thread_##name, 0, DECLARE_CYG_THREAD }, + +#define THREAD_TABLE_ENTRY_STACK_PARAM(name, priority, params) \ + { #name, priority, sizeof stack_##name, stack_##name, params, thread_##name, 0, DECLARE_CYG_THREAD }, + +#define DEFINE_THREAD_ROUTINE_STACK(name,params,stackSize) \ + int8_t stack_##name[stackSize] STACK_ALIGNMENT; \ + DEFINE_THREAD_ROUTINE(name,params) + +#define PROTO_THREAD_ROUTINE(name,params) \ + DEFINE_THREAD_ROUTINE(name,params) + +#define PROTO_THREAD_ROUTINE_STACK(name,params,stackSize) \ + extern int8_t stack_##name[stackSize]; \ + DEFINE_THREAD_ROUTINE(name,params) + +#define start_all_threads() vp_api_start_all_threads_tab(threadTable) +#define get_thread_idx(name) vp_api_get_thread_idx_tab_by_name(threadTable, name) +#define start_thread(idx, param) vp_api_start_thread_tab(threadTable, idx, param) +#define join_thread(idx) vp_api_join_thread_tab(threadTable, idx) +#define change_thread_prio(idx, priority) vp_api_change_thread_prio_tab(threadTable, idx, priority) +#define resume_thread(idx) vp_api_resume_thread(threadTable, idx) +#define suspend_thread(idx) vp_api_suspend_thread(threadTable, idx) +#define suspend_all_threads(h) vp_api_suspend_all_threads_tab(threadTable, h) +#define get_thread_handle(idx) vp_api_get_thread_handle(threadTable, idx) + +#define START_THREAD(name,param) start_thread(get_thread_idx(#name), param) + +#define JOIN_THREAD(name) join_thread(get_thread_idx(#name)) + +#define CHANGE_THREAD_PRIO(name, priority) change_thread_prio(get_thread_idx(#name), priority) + +#define GET_THREAD_HANDLE(name) get_thread_handle(get_thread_idx(#name)) + +#define RESUME_THREAD(name) resume_thread(get_thread_idx(#name)) + +#define SUSPEND_THREAD(name) suspend_thread(get_thread_idx(#name)) + +#define NO_PARAM (0) + +typedef struct +{ + char* name; + int32_t priority; + int32_t stackSize; + int8_t* stack; + THREAD_PARAMS parameters; + THREAD_ROUTINE routine; + THREAD_HANDLE handle; + DEFINE_CYG_THREAD +} thread_table_entry_t; + +extern thread_table_entry_t threadTable[]; + +C_RESULT vp_api_start_all_threads_tab(thread_table_entry_t* tab); +int32_t vp_api_get_thread_idx_tab_by_name(thread_table_entry_t* tab, const char* name); +int32_t vp_api_get_thread_idx_tab_by_handle(thread_table_entry_t* tab, THREAD_HANDLE handle, int32_t ret_on_failure); +C_RESULT vp_api_start_thread_tab(thread_table_entry_t* tab, int32_t idx, THREAD_PARAMS parameters); +C_RESULT vp_api_join_thread_tab(thread_table_entry_t* tab, int32_t idx); +C_RESULT vp_api_change_thread_prio_tab(thread_table_entry_t* tab, int32_t idx, int32_t priority); +C_RESULT vp_api_resume_thread(thread_table_entry_t* tab, int32_t idx); +C_RESULT vp_api_suspend_thread(thread_table_entry_t* tab, int32_t idx); +THREAD_HANDLE vp_api_get_thread_handle(thread_table_entry_t* tab, int32_t idx); + +// Suspend all threads but the one passed as second parameters (if it's an application thread) +C_RESULT vp_api_suspend_all_threads_tab(thread_table_entry_t* tab, THREAD_HANDLE handle); + +#ifdef __cplusplus +} +#endif + +#endif // _THREAD_HELPER_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com.c b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com.c new file mode 100644 index 0000000..28c14d2 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com.c @@ -0,0 +1,385 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "vp_com_bluetooth.h" +#include "vp_com_wifi.h" +#include "vp_com_serial.h" +#include "vp_com_wired.h" + +typedef C_RESULT (*VP_COM_x_init)(void); +typedef C_RESULT (*VP_COM_x_shutdown)(void); +typedef C_RESULT (*VP_COM_x_network_adapter_lookup)(vp_com_network_adapter_lookup_t callback); +typedef C_RESULT (*VP_COM_x_inquire)(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); +typedef C_RESULT (*VP_COM_x_local_config)(vp_com_config_t* config); +typedef C_RESULT (*VP_COM_x_connect)(vp_com_t* vp_com, vp_com_connection_t* connection, int32_t numAttempts); +typedef C_RESULT (*VP_COM_x_disconnect)(vp_com_config_t* config, vp_com_connection_t* connection); +typedef C_RESULT (*VP_COM_x_get_rssi)(vp_com_config_t* cfg, int32_t* rssi); +typedef C_RESULT (*VP_COM_x_wait_connections)(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int queueLength); +typedef C_RESULT (*VP_COM_x_open)(vp_com_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +typedef C_RESULT (*VP_COM_x_close)(vp_com_socket_t* socket); + +#define VP_COM_INIT vp_com->init +#define VP_COM_SHUTDOWN vp_com->shutdown +#define VP_COM_NETWORKADAPTERLOOKUP vp_com->network_adapter_lookup +#define VP_COM_INQUIRE vp_com->inquire +#define VP_COM_LOCAL_CONFIG vp_com->local_config +#define VP_COM_CONNECT vp_com->connect +#define VP_COM_DISCONNECT vp_com->disconnect +#define VP_COM_GET_RSSI vp_com->get_rssi +#define VP_COM_WAITCONNECTIONS vp_com->wait_connections +#define VP_COM_OPEN vp_com->open +#define VP_COM_CLOSE vp_com->close + +char vp_com_pin_code[VP_COM_NAME_MAXSIZE]; + +C_RESULT vp_com_init(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_NOTSUPPORTED; + + VP_OS_ASSERT( vp_com != NULL ); + + if(!vp_com->initialized) + { + vp_os_mutex_init(&vp_com->mutex); + vp_com->initialized ++; + } + + vp_os_mutex_lock(&vp_com->mutex); + + if(vp_com->ref_count > 0) + { + vp_com->ref_count ++; + res = VP_COM_OK; + } + else + { +#ifdef USE_WIFI + if(vp_com->type == VP_COM_WIFI) + { + vp_com->init = (VP_COM_x_init) vp_com_wf_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_wf_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_wf_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_wf_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_wf_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_wf_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_wf_disconnect; + vp_com->get_rssi = (VP_COM_x_get_rssi) vp_com_wf_get_rssi; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_wf_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_wf_open; + vp_com->close = (VP_COM_x_close) vp_com_wf_close; + } +#endif // > USE_WIFI + +#ifdef USE_SERIAL + if(vp_com->type == VP_COM_SERIAL) + { + vp_com->init = (VP_COM_x_init) vp_com_serial_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_serial_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_serial_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_serial_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_serial_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_serial_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_serial_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_serial_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_serial_open; + vp_com->close = (VP_COM_x_close) vp_com_serial_close; + } +#endif + +#ifdef USE_WIRED + if( vp_com->type == VP_COM_WIRED ) + { + vp_com->init = (VP_COM_x_init) vp_com_wired_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_wired_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_wired_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_wired_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_wired_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_wired_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_wired_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_wired_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_wired_open; + vp_com->close = (VP_COM_x_close) vp_com_wired_close; + } +#endif + + if(VP_COM_INIT) + res = VP_COM_INIT(); + + if(res == VP_COM_OK) + { + vp_os_install_error_handler( VP_COM_SDK_SIGNATURE, vp_com_formatMessage ); + vp_com->ref_count ++; + } + } + + vp_os_mutex_unlock( &vp_com->mutex ); + + return res; +} + +C_RESULT vp_com_shutdown(vp_com_t* vp_com) +{ + VP_OS_ASSERT( vp_com != NULL ); + + vp_os_mutex_lock( &vp_com->mutex ); + + if(vp_com->ref_count > 0) + { + vp_com->ref_count--; + if(vp_com->ref_count == 0) + { + vp_os_mutex_unlock( &vp_com->mutex ); + vp_os_mutex_destroy( &vp_com->mutex ); + + return VP_COM_SHUTDOWN(); + } + } + + vp_os_mutex_unlock(&vp_com->mutex); + + return VP_COM_OK; +} + +// Convert a char to an hexidecimal value between 0x0 and 0xF +static char ctohex(char c) +{ + if(c >= '0' && c <= '9') + return c - '0'; + if(c >= 'a' && c <= 'f') + return c - 'a' + 0xa; + if(c >= 'A' && c <= 'F') + return c - 'A' + 0xa; + + return 0xFF; +} + +// Convert an hexidecimal value to char +static char hextoc(char h) +{ + if(h < 0xa) + return h + '0'; + + return ((h - 0xa) + 'a'); +} + +C_RESULT vp_com_str_to_address(const char* address, bdaddr_t* addr) +{ + int i = 0; + while(*address) + { + if(*address == ':') + address++; + + addr->b[i] = ctohex(*address++) << 4; + addr->b[i] |= ctohex(*address++); + + i ++; + } + + return VP_COM_OK; +} + +C_RESULT vp_com_address_to_str(const bdaddr_t* addr, char* address) +{ + int i = 0; + char c1 = addr->b[i] & 0xF0; + char c2 = addr->b[i] & 0x0F; + + *address++ = hextoc(c1 >> 4); + *address++ = hextoc(c2); + + for(i = 1;i < 6;i++) + { + c1 = addr->b[i] & 0xF0; + c2 = addr->b[i] & 0x0F; + + *address++ = ':'; + *address++ = hextoc(c1 >> 4); + *address++ = hextoc(c2); + } + + return VP_COM_OK; +} + +C_RESULT vp_com_copy_address(const bdaddr_t* from,bdaddr_t* to) +{ + vp_os_memcpy( to, from, sizeof( bdaddr_t ) ); + + return VP_COM_OK; +} + +C_RESULT vp_com_cmp_address(const bdaddr_t* bd1, const bdaddr_t* bd2) +{ + int32_t i; + + for( i = 0; i < BDADDR_SIZE && ( bd1->b[i] == bd2->b[i] ); i++ ); + + return ( i < BDADDR_SIZE ) ? VP_COM_ERROR : VP_COM_OK; +} + +C_RESULT vp_com_network_adapter_lookup(vp_com_t* vp_com, vp_com_network_adapter_lookup_t callback) +{ + return VP_COM_NETWORKADAPTERLOOKUP( callback ); +} + +C_RESULT vp_com_local_config(vp_com_t* vp_com, vp_com_config_t* config) +{ + C_RESULT res = C_OK; + + VP_OS_ASSERT( vp_com != NULL ); + + if( vp_com->config != config ) + { + + res = VP_COM_LOCAL_CONFIG(config); + + if( SUCCEED( res ) ) + vp_com->config = config; + + } + + return res; +} + +C_RESULT vp_com_inquire(vp_com_t* vp_com, const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + VP_OS_ASSERT( vp_com != NULL ); + + return VP_COM_INQUIRE( deviceName, callback, timeout ); +} + +C_RESULT vp_com_connect(vp_com_t* vp_com, vp_com_connection_t* connection, uint32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; + bool_t already_connected; + + VP_OS_ASSERT( vp_com != NULL ); + + if(vp_com->config != NULL) + { + vp_os_mutex_lock(&vp_com->mutex); + + already_connected = vp_com->connection && vp_com->connection->is_up == 1; + + // TODO voir pour ajouter un test sur l'adresse ethernet de la connection + if( already_connected && vp_com->connection != connection ) + { + already_connected = FALSE; + vp_com_disconnect(vp_com); + } + + if( !already_connected ) + { + res = VP_COM_CONNECT(vp_com, connection, numAttempts); + + if( SUCCEED( res ) ) + { + vp_com->connection = connection; + vp_com->connection->is_up = 1; + } + } + + vp_os_mutex_unlock(&vp_com->mutex); + } + + return res; +} + +C_RESULT vp_com_disconnect(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_ERROR; + + VP_OS_ASSERT( vp_com != NULL ); + + if(vp_com->config != NULL && vp_com->connection != NULL) + { + vp_os_mutex_lock(&vp_com->mutex); + + res = VP_COM_DISCONNECT(vp_com->config, vp_com->connection); + + if( SUCCEED( res ) ) + vp_com->connection->is_up = 0; + + + vp_os_mutex_unlock(&vp_com->mutex); + } + + return res; +} + +C_RESULT vp_com_get_rssi(vp_com_t* vp_com, int32_t* rssi) +{ + C_RESULT res; + + if( vp_com != NULL && vp_com->config != NULL && vp_com->get_rssi != NULL ) + res = VP_COM_GET_RSSI( vp_com->config, rssi ); + else + { + *rssi = 0; + res = C_FAIL; + } + + return res; +} + +C_RESULT vp_com_wait_connections(vp_com_t* vp_com, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + VP_OS_ASSERT( vp_com != NULL ); + + return VP_COM_WAITCONNECTIONS( &vp_com->connection, server, client, queueLength ); +} + +C_RESULT vp_com_open(vp_com_t* vp_com, vp_com_socket_t* socket,Read* read,Write* write) +{ + VP_OS_ASSERT( vp_com != NULL ); + + if( vp_com->ref_count > 0 ) + return VP_COM_OPEN(vp_com->config, vp_com->connection, socket, read, write); + + PRINT("[VP_COM] Trying to open a socket with a non initialized vp_com object\n"); + + return C_FAIL; +} + +C_RESULT vp_com_close(vp_com_t* vp_com, vp_com_socket_t* socket) +{ + VP_OS_ASSERT( vp_com != NULL ); + + if( vp_com->ref_count > 0 ) + return VP_COM_CLOSE( socket ); + + PRINT("[VP_COM] Trying to close a socket with a non initialized vp_com object\n"); + + return C_FAIL; +} + +C_RESULT vp_com_sockopt(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options) +{ + C_RESULT res; + + switch( socket->protocol ) + { +#ifndef NO_COM + case VP_COM_TCP: + res = vp_com_sockopt_ip(vp_com, socket, options); + break; +#endif + case VP_COM_SERIAL: + res = VP_COM_OK; + break; + + default: + res = VP_COM_ERROR; + break; + } + + return res; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.c b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.c new file mode 100644 index 0000000..8a0d58a --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.c @@ -0,0 +1,105 @@ +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +// taken from ifconfig +static int vp_com_set_flag( int skfd, const char *ifname, short flag ) +{ + struct ifreq ifr; + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( ioctl( skfd, SIOCGIFFLAGS, &ifr ) < 0 ) + return -1; + + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + ifr.ifr_flags |= flag; + + if( ioctl(skfd, SIOCSIFFLAGS, &ifr ) < 0 ) + return -1; + + return 0; +} + +static int vp_com_set_ip( int skfd, const char* ifname, int cmd, int ip ) +{ + struct ifreq ifr; + struct sockaddr_in* addr; + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + // Check if an ip is already set + if( ioctl( skfd, SIOCGIFADDR, &ifr ) != -1 ) + { + addr = (struct sockaddr_in*) &ifr.ifr_addr; + + // Is this the same ip? + if( addr->sin_family == AF_INET && ip == addr->sin_addr.s_addr ) + return 0; +/* + // No so we try to delete it + if( ioctl( skfd, SIOCDIFADDR, &ifr ) < 0 ) + { + DEBUG_PRINT_SDK("Unable to delete old ip address - You should remove your interface %s\n", ifname); + return -1; + } +*/ + } + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + addr = (struct sockaddr_in*) &ifr.ifr_addr; + addr->sin_family = AF_INET; + addr->sin_addr.s_addr = ip; + + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( ioctl( skfd, cmd, &ifr ) < 0 ) + return -1; + + return 0; +} + + +int vp_com_config_itf( const char* interface, const char * ip, const char* broadcast, const char* netmask ) +{ + int ret = -1; + + int sck = socket( PF_INET, SOCK_DGRAM, 0 ); + + if( sck < 0 ) + return -1; + + if( vp_com_set_ip( sck, interface, SIOCSIFADDR, inet_addr(ip) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFBRDADDR, inet_addr(broadcast) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFNETMASK, inet_addr(netmask) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_flag( sck, interface, IFF_UP | IFF_RUNNING ) < 0 ) + goto vp_com_config_itf_end; + + ret = 0; + +vp_com_config_itf_end: + + close(sck); + + return ret; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.h b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.h new file mode 100644 index 0000000..d1ff6e9 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_config_itf.h @@ -0,0 +1,6 @@ +#ifndef _COMIP_H_ +#define _COMIP_H_ + +int vp_com_config_itf( const char* interface, const char * ip, const char* broadcast, const char* netmask ); + +#endif // _COMIP_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.c b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.c new file mode 100644 index 0000000..1514e09 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.c @@ -0,0 +1,34 @@ +/** + * \file vp_com_interface.h + * \brief Com Api for video sdk. Private definitions. + * \brief Provide default behavior of a vp products + */ + +#include + +#include +#include +#include "vp_com_interface.h" + +C_RESULT vp_com_start_exti(void) +{ + return VP_COM_OK; +} + +#ifdef USE_WIFI + +C_RESULT vp_com_wait_set_ssid(void) +{ + vp_os_delay(500); + + return VP_COM_OK; +} + +C_RESULT vp_com_wait_scan_complete(void) +{ + vp_os_delay(500); + + return VP_COM_OK; +} + +#endif // < USE_WIFI diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.h b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.h new file mode 100644 index 0000000..5bcf9ba --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_interface.h @@ -0,0 +1,58 @@ +/** + * \file vp_com_interface.h + * \brief Com Api for video sdk. Private definitions. + * \brief Provide default behavior of a vp products + */ + +#ifndef _VP_COM_INTERFACE_H_ +#define _VP_COM_INTERFACE_H_ + +//#include +#include +#include + +extern char vp_com_pin_code[VP_COM_MAX_PINCODE_SIZE]; + +void vp_com_parse_key(const char* passkey); +/** + * \typedef Prototype of an EXTI handler + */ +typedef unsigned int MESSAGE; +typedef unsigned int PARAM; +typedef C_RESULT (*vp_com_interface_handler_cb)(MESSAGE message, PARAM param); + +extern vp_com_interface_handler_cb prod_interface_handler; + +/** start module EXTI + * \par Brief : + * \code + * char tab[] = { + * "bluetooth hardware", + * "bluetooth uart", + * "flash configuration", + * "blues Exti" + * }; + * + * for( x = 0 ; x <= endTab; x++) + * { + * launch tab[x] function specfied by the application + * } + * \endcode + * + * \section History + * + * \par June, 27 2007 - + * - add flash configuration + * + * \par March, 16 2007 - + * - first release + * +*/ +C_RESULT vp_com_start_exti(void) __attribute__((weak)); + +#ifdef USE_WIFI +C_RESULT vp_com_wait_set_ssid(void); +C_RESULT vp_com_wait_scan_complete(void); +#endif + +#endif // _VP_COM_INTERFACE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_serial.c b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_serial.c new file mode 100644 index 0000000..fcd83d4 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_serial.c @@ -0,0 +1,304 @@ +// Header /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * \brief Com Api for video sdk. Private declarations. + * \author Aurelien Morelle + * \version 1.0 + * \date 24/07/2007 + */ + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Include ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "vp_com_serial.h" + +// Static /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static struct termios tio_save; +static vp_os_mutex_t wait_sync_mutex; +static vp_os_mutex_t write_sync_mutex; + +// Forward declarations ///////////////////////////////////////////////////////////////////////////////////////////////////////// + +static C_RESULT vp_com_serial_wait_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket); +static C_RESULT vp_com_serial_write_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket); + +static C_RESULT vp_com_serial_read (vp_com_socket_t* socket, int8_t* buffer, int32_t* size); +static C_RESULT vp_com_serial_write(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size); + +// Functions declaration //////////////////////////////////////////////////////////////////////////////////////////////////////// + +C_RESULT vp_com_serial_init(void) +{ + vp_os_mutex_init(&wait_sync_mutex); + vp_os_mutex_init(&write_sync_mutex); + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_shutdown() +{ + // nothing + return VP_COM_OK; +} + +C_RESULT vp_com_serial_local_config(vp_com_serial_config_t* config) +{ + C_RESULT res = VP_COM_OK; + + // Serial port must be opened before changing config + + return res; +} + +C_RESULT vp_com_serial_connect(vp_com_t* vp_com, vp_com_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; + + res = (connection == NULL) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + connection->is_up = 1; + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_disconnect(vp_com_serial_config_t* config, vp_com_connection_t* connection) +{ + C_RESULT res = (connection == NULL) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + connection->is_up = 0; + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_open(vp_com_serial_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write) +{ + struct termios tio; + speed_t speed; + + VP_OS_ASSERT(config->blocking == 0 || config->blocking == 1); + + if(config->blocking == 0) + socket->priv = (void *)open(&config->itfName[0], O_RDWR|O_NOCTTY|O_NONBLOCK); + else + socket->priv = (void *)open(&config->itfName[0], O_RDWR|O_NOCTTY); + + if(((int)socket->priv) == -1) + { + PRINT("Unable to \"open\" serial device"); + return (VP_COM_ERROR); + } + + /* get current serial port settings */ + if(tcgetattr((int)socket->priv, &tio) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + tio_save = tio; + + if(config->sync) + { + /* set serial settings */ + speed = (speed_t)config->initial_baudrate; + cfsetispeed(&tio, speed); + cfsetospeed(&tio, speed); + cfmakeraw(&tio); + + if(tcsetattr((int)socket->priv, TCSANOW, &tio) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + if(socket->type == VP_COM_CLIENT) + { + if(FAILED(vp_com_serial_write_sync(config, socket))) + return (VP_COM_ERROR); + vp_os_delay(VP_COM_SYNC_DELAY); + } + else if(socket->type == VP_COM_SERVER) + { + if(FAILED(vp_com_serial_wait_sync(config, socket))) + return (VP_COM_ERROR); + vp_os_delay(VP_COM_SYNC_DELAY); + } + } + + /* set serial settings */ + speed = (speed_t)config->baudrate; + cfsetispeed(&tio, speed); + cfsetospeed(&tio, speed); + cfmakeraw(&tio); + + if(tcsetattr((int)socket->priv, TCSANOW, &tio) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + if(read) *read = (Read) vp_com_serial_read; + if(write) *write = (Write) vp_com_serial_write; + + return (VP_COM_OK); +} + +C_RESULT vp_com_serial_close(vp_com_socket_t* socket) +{ + if(tcsetattr((int)socket->priv, TCSANOW, &tio_save) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + close((int)socket->priv); + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_wait_connections(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + vp_os_memcpy(client, server, sizeof(vp_com_socket_t)); + return VP_COM_OK; +} + +C_RESULT vp_com_serial_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ + // nothing + return VP_COM_OK; +} + +C_RESULT vp_com_serial_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + // nothing + return VP_COM_OK; +} + +// Static functions ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static C_RESULT vp_com_serial_read (vp_com_socket_t* socket, int8_t* buffer, int32_t* size) +{ + C_RESULT res; + + *size = read((int)socket->priv, buffer, *size); + + if(*size == -1 && errno != EAGAIN) + { + res = VP_COM_ERROR; + } + else + { + res = VP_COM_OK; + + if(*size == -1) + *size = 0; + } + + return res; +} + +static C_RESULT vp_com_serial_write(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size) +{ + uint32_t remain = *size, written = 0; + + while(remain > 0) + { + written = write((int)socket->priv, buffer+(*size-remain), remain); + + if(written == -1 && errno != EAGAIN) + return VP_COM_ERROR; + else if(written == -1) + written = 0; + + remain -= written; + } + + return VP_COM_OK; +} + +static C_RESULT vp_com_serial_wait_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket) +{ + uint32_t nb; + uint8_t c; + + vp_os_mutex_lock(&wait_sync_mutex); + + if(!config->sync_done) + { + nb = 0; + do + { + if(-1 == read((int)socket->priv, &c, sizeof(int8_t))) + return (FAIL); + if(c == (VP_COM_SYNC_STRING)[nb]) + { + nb++; + } + else + { + nb = 0; + } + } + while(nb != sizeof(VP_COM_SYNC_STRING)); + + config->sync_done = 1; + } + + vp_os_mutex_unlock(&wait_sync_mutex); + + return (SUCCESS); +} + +static C_RESULT vp_com_serial_write_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket) +{ + uint32_t i; + uint8_t c; + + vp_os_mutex_lock(&write_sync_mutex); + + if(!config->sync_done) + { + for(i = 0 ; i < sizeof(VP_COM_SYNC_STRING) ; i++) + { + c = (VP_COM_SYNC_STRING)[i]; + if(-1 == write((int)socket->priv, &c, sizeof(int8_t))) + { + return (FAIL); + } + } + } + + config->sync_done = 1; + + vp_os_mutex_unlock(&write_sync_mutex); + + return (SUCCESS); +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wifi.c b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wifi.c new file mode 100644 index 0000000..830d9e6 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wifi.c @@ -0,0 +1,472 @@ +#include +#include + +#include "vp_com_wifi.h" +#include "vp_com_config_itf.h" + +#include +#include +#include + +#define PROC_NET_DEV "/proc/net/dev" + +#include +#include +#include "vp_com_interface.h" +#include + +#ifdef USE_BROADCOM +#include "vp_com_wlc.h" +#endif + +#ifdef USE_IWLIB +#include +#endif + +#include +#include + + +C_RESULT vp_com_wf_init(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_shutdown(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ + char buff[1024]; + + FILE* fh = fopen( PROC_NET_DEV, "r" ); + + if(fh != NULL) + { + // eat first two lines + if( fgets( buff, sizeof(buff), fh ) && fgets( buff, sizeof(buff), fh ) ) + { + while( fgets( buff, sizeof(buff), fh ) ) + { + // Do parsing here and invoke callback if an interface matches our needs + } + } + + fclose( fh ); + } + + return VP_COM_OK; +} + +C_RESULT vp_com_wf_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + return VP_COM_OK; +} + +#ifdef USE_BROADCOM +C_RESULT vp_com_wf_local_config(vp_com_wifi_config_t* cfg) +{ + C_RESULT res = VP_COM_ERROR; + +#ifdef STA +// wl_scan_results_t* scan_results; +// wl_bss_info_t* bss; uint8_t* ptr; +// int32_t i; +// uint32_t channels_load[10], channel_load, next_channel_load; +#endif + + DEBUG_PRINT_SDK("vp_com_wf_local_config\n"); + + vp_com_config_itf( cfg->itfName, cfg->localHost, cfg->broadcast, cfg->netmask ); + + VP_WLC_BEGIN( cfg->itfName ) + + if( vp_wlc_get_magic() == WLC_IOCTL_MAGIC ) + { + vp_wlc_down(); + vp_wlc_set_country( cfg->country ); + vp_wlc_up(); + + if( vp_wlc_get_radio() != VP_WLC_RADIO_ENABLE ) + vp_wlc_set_radio(VP_WLC_RADIO_ENABLE); + +#ifdef STA + /* for( i = 1; i < 10; i++ ) + channels_load[i] = 0; + + if( vp_wlc_scan() == 0 ) + { + vp_com_wait_scan_complete(); + scan_results = vp_wlc_get_scan_results(); + + PRINT("Wifi scan gave %d results\n", scan_results->count); + + ptr = (void*)&scan_results->bss_info[0]; + for(i=0; i < scan_results->count; i++) + { + int32_t index_min, index, index_max; + + bss = (wl_bss_info_t*) ptr; + ptr = (uint8_t*)bss + bss->length; + + index = bss->chanspec & WL_CHANSPEC_CHAN_MASK; + if( index < 10 ) + { + index_min = index-1; + index_max = index+1; + + channels_load[index] += 5; + if( index_min > 0 ) + channels_load[index_min] += 3; + if( index_max < 10 ) + channels_load[index_max] += 3; + } + + PRINT("\t-bss %s on channel %d\n", bss->SSID, bss->chanspec & WL_CHANSPEC_CHAN_MASK ); + } + + channels_load[0] = 1; + channel_load = channels_load[1] + channels_load[2]; + + for( i = 2; i < 9; i++ ) + { + next_channel_load = channels_load[i-1] + channels_load[i] + channels_load[i+1]; + + if( channel_load > next_channel_load ) + { + channel_load = next_channel_load; + channels_load[0] = i; + } + } + + next_channel_load = channels_load[8] + channels_load[9]; + if( channel_load > next_channel_load ) + { + channel_load = next_channel_load; + channels_load[0] = 9; + } + + vp_wlc_set_channel( channels_load[0] ); + + PRINT("Setting channel %d\n", channels_load[0]); + + }*/ +#endif + + vp_wlc_set_infrastructure( (cfg->infrastructure == 1) ? VP_WLC_INFRASTRUCTURE : VP_WLC_ADHOC ); + vp_wlc_set_authentication( (cfg->secure == 1) ? VP_WLC_AUTH_SHARED : VP_WLC_AUTH_OPEN ); + + res = VP_COM_OK; + } +#ifdef STA + vp_wlc_down(); +#endif + VP_WLC_END + + return res; +} +#endif + +#ifdef USE_IWLIB +C_RESULT vp_com_wf_local_config(vp_com_wifi_config_t* cfg) +{ + C_RESULT res=C_FAIL; + int wlsock = -1; + int16_t key_flags = 0; + wireless_config iwconf; + + // If network is secure, configure it now. + if(cfg && cfg->secure==1) + { + vp_com_config_itf( cfg->itfName, cfg->localHost, cfg->broadcast, cfg->netmask ); + + wlsock = iw_sockets_open(); + + res = ( wlsock < 0 ) ? VP_COM_ERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + iw_get_basic_config( wlsock, cfg->itfName, &iwconf ); + iwconf.has_nwid = 0; + iwconf.has_freq = 0; + iwconf.has_mode = 0; + iwconf.has_key = 0; + + // After watching Linux/kernel/linux/drivers/parrot/net/wireless/ar6000/ar6000/wireless.ext:1041 + // it appears we need to clear ssid before setting passkey + // if (ar->arSsidLen) { + // return -EIO; + // } + // So we do set passkey in two passes, first clear ssid then set new passkey + + iwconf.has_essid = 1; + iwconf.essid_on = 0; + vp_os_memset( &iwconf.essid[0], 0, IW_ESSID_MAX_SIZE+1 ); + + res = iw_set_basic_config( wlsock, cfg->itfName, &iwconf ) < 0 ? C_FAIL : C_OK; + + // Setup security + iwconf.has_essid = 0; + iwconf.has_key = 1; + + if(cfg->secure) + { + iwconf.key_size = iw_in_key_full( wlsock, cfg->itfName, cfg->passkey, (char*)&iwconf.key, &key_flags ); + iwconf.key_flags = IW_ENCODE_ENABLED | IW_ENCODE_RESTRICTED; + } + else + { + vp_os_memset(&iwconf.key[0], 0, IW_ENCODING_TOKEN_MAX); + iwconf.key_flags = IW_ENCODE_DISABLED; + } + + res = iw_set_basic_config( wlsock, cfg->itfName, &iwconf ) < 0 ? C_FAIL : C_OK; + + iw_sockets_close(wlsock); + } + else + { + res=C_OK; + } + return res; +} +#else +#ifndef USE_BROADCOM +C_RESULT vp_com_wf_local_config(vp_com_wifi_config_t* cfg) +{ + return C_OK; +} +#endif +#endif + +#ifdef USE_BROADCOM +C_RESULT vp_com_wf_connect(vp_com_t* vp_com, vp_com_wifi_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res = VP_COM_ERROR; + ///struct bootp* bootp_data = NULL; + vp_com_wifi_config_t* config = (vp_com_wifi_config_t*) vp_com->config; + +#ifdef STA + int32_t attempt; + int32_t ret; + bdaddr_t bdaddr; +#endif + + DEBUG_PRINT_SDK("vp_com_wf_connect\n"); + + VP_WLC_BEGIN(config->itfName) +#ifdef STA + vp_wlc_up(); + + attempt = 0; + + do + { +#endif + vp_wlc_set_ssid(connection->networkName); +#ifdef STA + vp_com_wait_set_ssid(); + attempt ++; + } + while( ((ret = vp_wlc_get_bssid(&bdaddr)) < 0) && attempt < 10 ); + + if(ret >= 0) + { +#endif + + res = VP_COM_OK; + +#ifdef STA + // Disable roaming + vp_wlc_disable_roaming(); + } +#endif + VP_WLC_END + + if( SUCCEED( res ) ) + { +#ifdef STA + PRINT("STA - Joined essid %s\n", connection->networkName); +#else // AP + PRINT("AP - Created essid %s\n", connection->networkName); +#endif // STA + } + else + { + DEBUG_PRINT_SDK("vp_com_wf_connect failed\n"); + } + return res; +} +#endif + +#ifdef USE_IWLIB +C_RESULT vp_com_wf_connect(vp_com_t* vp_com, vp_com_wifi_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res; + int32_t wlsock; + vp_com_wifi_config_t* config = (vp_com_wifi_config_t*)vp_com->config; + wireless_config iwconf; + + wlsock = iw_sockets_open(); + + res = ( wlsock < 0 ) ? VP_COM_ERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + iw_get_basic_config( wlsock, config->itfName, &iwconf ); + + iwconf.has_nwid = 0; + iwconf.has_freq = 0; + iwconf.has_key = 0; + + iwconf.has_mode = 1; + iwconf.mode = config->infrastructure ? IW_MODE_INFRA : IW_MODE_ADHOC; + + iwconf.has_essid = 1; + iwconf.essid_on = 1; + + // No need to set the network name if it has not change. + if(strcmp(&iwconf.essid[0], connection->networkName)!=0) + { + strncpy( &iwconf.essid[0], connection->networkName, IW_ESSID_MAX_SIZE+1 ); + + res = iw_set_basic_config( wlsock, config->itfName, &iwconf ) < 0 ? C_FAIL : C_OK; + } + else + { + res=C_OK; + } + + if( SUCCEED(res) ) + PRINT(" OK!\n"); + else + PRINT(" FAILED!\n"); + + iw_sockets_close(wlsock); + + return res; +} +#else +#ifndef USE_BROADCOM +C_RESULT vp_com_wf_connect(vp_com_t* vp_com, vp_com_wifi_connection_t* connection, int32_t numAttempts) +{ + return C_OK; +} +#endif +#endif + +#ifdef USE_BROADCOM +C_RESULT vp_com_wf_disconnect(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection) +{ + VP_WLC_BEGIN( config->itfName ) +#ifdef STA + vp_wlc_up(); + vp_wlc_set_ssid( NULL ); +// vp_com_wait_set_ssid(); +#endif + vp_wlc_down(); + VP_WLC_END + + return VP_COM_OK; +} +#endif + +#ifdef USE_IWLIB +C_RESULT vp_com_wf_disconnect(vp_com_wifi_config_t* cfg, vp_com_wifi_connection_t* connection) +{ + C_RESULT res; + int wlsock = -1; + int16_t key_flags = 0; + wireless_config iwconf; + + wlsock = iw_sockets_open(); + + VP_COM_CHECK( ( wlsock < 0 ) ? VP_COM_ERROR : VP_COM_OK ); + + vp_os_memset( &iwconf, 0, sizeof(iwconf) ); + + iwconf.has_essid = 1; + + res = iw_set_basic_config( wlsock, cfg->itfName, &iwconf ) < 0 ? C_FAIL : C_OK; + + iw_sockets_close(wlsock); + + return res; +} +#else +#ifndef USE_BROADCOM +C_RESULT vp_com_wf_disconnect(vp_com_wifi_config_t* cfg, vp_com_wifi_connection_t* connection) +{ + return C_OK; +} +#endif +#endif + +C_RESULT vp_com_wf_get_rssi(vp_com_wifi_config_t* cfg, int32_t* rssi) +{ + /*struct iwreq wrq; + iwstats stats; + iwrange range; + + int wlsock = iw_sockets_open(); + + vp_os_memset(&wrq, 0, sizeof(struct iwreq)); + iw_get_stats(wlsock, cfg->itfName, &stats, &range, 1); + iw_sockets_close(wlsock);*/ + +// struct iw_statistics +// { +// __u16 status; // Status * - device dependent for now +// struct iw_quality qual; // Quality of the link * (instant/mean/max) +// struct iw_discarded discard; // Packet discarded counts +// struct iw_missed miss; // Packet missed counts +// }; +// +// struct iw_range +// { +// ... +// // Quality of link & SNR stuff */ +// // Quality range (link, level, noise) +// // If the quality is absolute, it will be in the range [0 ; max_qual], +// // if the quality is dBm, it will be in the range [max_qual ; 0]. +// // Don't forget that we use 8 bit arithmetics... +// struct iw_quality max_qual; // Quality of the link +// // This should contain the average/typical values of the quality +// // indicator. This should be the threshold between a "good" and +// // a "bad" link (example : monitor going from green to orange). +// // Currently, user space apps like quality monitors don't have any +// // way to calibrate the measurement. With this, they can split +// // the range between 0 and max_qual in different quality level +// // (using a geometric subdivision centered on the average). +// // I expect that people doing the user space apps will feedback +// // us on which value we need to put in each driver... +// struct iw_quality avg_qual; // Quality of the link +// ... +// }; +// struct iw_quality +// { +// __u8 qual; // link quality (%retries, SNR, %missed beacons or better...) +// __u8 level; // signal level (dBm) +// __u8 noise; // noise level (dBm) +// __u8 updated; // Flags to know if updated +// }; + + //*rssi = stats.qual.qual; + + return VP_COM_OK; +} + +C_RESULT vp_com_wf_wait_connections(vp_com_wifi_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + return vp_com_wait_socket(server, client, queueLength); +} + +C_RESULT vp_com_wf_open(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection, vp_com_socket_t* sck, Read* read, Write* write) +{ + return vp_com_open_socket(sck, read, write); +} + +C_RESULT vp_com_wf_close(vp_com_socket_t* socket) +{ + return vp_com_close_socket(socket); +} diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wired.c b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wired.c new file mode 100644 index 0000000..d5f8801 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wired.c @@ -0,0 +1,65 @@ +#include +#include + +#include "vp_com_config_itf.h" + +#include + +#include +#include + +#include +#include + +#include + + +C_RESULT vp_com_wired_init(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_shutdown(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ + return VP_COM_ERROR; +} + +C_RESULT vp_com_wired_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + return VP_COM_ERROR; +} + +C_RESULT vp_com_wired_local_config(vp_com_wired_config_t* cfg) +{ + return vp_com_config_itf( cfg->itfName, cfg->localHost, cfg->broadcast, cfg->netmask ); +} + +C_RESULT vp_com_wired_connect(vp_com_t* vp_com, vp_com_wired_connection_t* connection, int32_t numAttempts) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_disconnect(vp_com_wired_config_t* config, vp_com_wired_connection_t* connection) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_wait_connections(vp_com_wired_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + return vp_com_wait_socket(server, client, queueLength); +} + +C_RESULT vp_com_wired_open(vp_com_wired_config_t* config, vp_com_wired_connection_t* connection, vp_com_socket_t* sck, Read* read, Write* write) +{ + return vp_com_open_socket(sck, read, write); +} + +C_RESULT vp_com_wired_close(vp_com_socket_t* socket) +{ + return vp_com_close_socket(socket); +} diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.c b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.c new file mode 100644 index 0000000..e6a1969 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.c @@ -0,0 +1,485 @@ +//#include + +#include +#include +#include + +#include +#include + +#include "vp_com_wlc.h" + +#include +#include +#include + +static int32_t wlsock = 0; +static wl_ioctl_t wldata; +static struct ifreq ifr; +static char buffer[WLC_IOCTL_MAXLEN]; + +////////////////////////////////////////////////////////////////////////////////////////////////////// + +static int vp_wlc_ioctl(int cmd, void *buffer, int length, bool set) +{ + if(wlsock < 0) + return -1; + + wldata.cmd = cmd; + wldata.buf = buffer; + wldata.len = length; + wldata.set = set; + + int result = ioctl(wlsock, SIOCDEVPRIVATE, &ifr); + if (result<0) + { + perror("ioctl(wlsock, SIOCDEVPRIVATE, &ifr)"); + } + return result; +} + +static inline int vp_wlc_get(int cmd, void *data, int len) +{ + return vp_wlc_ioctl(cmd, data, len, FALSE); +} + +static inline int vp_wlc_set(int cmd, void *data, int len) +{ + return vp_wlc_ioctl(cmd, data, len, TRUE); +} + +static inline int vp_wlc_set_var(void* data, int len) +{ + return vp_wlc_set(WLC_SET_VAR, data, len); +} + +////////////////////////////////////////////////////////////////////////////////////////////////////// + +int32_t vp_wlc_begin(const char* itfname) +{ + strcpy(ifr.ifr_name, itfname); + ifr.ifr_data = (caddr_t) &wldata; + + if(wlsock <= 0) + wlsock = socket(AF_INET, SOCK_DGRAM, 0); + + return wlsock; +} + +int32_t vp_wlc_end(void) +{ + if(wlsock > 0) + { + close(wlsock); + wlsock = 0; + } + + return wlsock; +} + +////////////////////////////////////////////////////////////////////////////////////////////////////// + +int32_t vp_wlc_down(void) +{ + return vp_wlc_set(WLC_DOWN, NULL, 0); +} + +int32_t vp_wlc_up(void) +{ + return vp_wlc_set(WLC_UP, NULL, 0); +} + +int32_t vp_wlc_get_magic(void) +{ + if(vp_wlc_get(WLC_GET_MAGIC, buffer, sizeof(int32_t)) < 0) + return -1; + + return *(int32_t*)buffer; +} + +int32_t vp_wlc_set_channel(int32_t channel) +{ + return vp_wlc_set(WLC_SET_CHANNEL, &channel, sizeof(int32_t)); +} + +channel_info_t* vp_wlc_get_channel(int32_t* channel) +{ + channel_info_t* channel_info = (channel_info_t*) buffer; + + *channel = -1; + + if(vp_wlc_get(WLC_GET_CHANNEL, buffer, sizeof(channel_info_t)) < 0) + return NULL; + + *channel = channel_info->target_channel; + + return channel_info; +} + +int32_t vp_wlc_set_country(const char* country) +{ + char *tmp = (char*)country; + return vp_wlc_set(WLC_SET_COUNTRY, (void*)tmp, strlen(country) + 1); +} + +const char* vp_wlc_get_country(void) +{ + if(vp_wlc_get(WLC_GET_COUNTRY, buffer, 4) < 0) + return NULL; + + return (const char*) buffer; +} + +int32_t vp_wlc_set_radio(VP_WLC_RADIO_STATE state) +{ + return vp_wlc_set(WLC_SET_RADIO, &state, sizeof(int32_t)); +} + +int32_t vp_wlc_get_radio(void) +{ + int32_t radio_state; + + if(vp_wlc_get(WLC_GET_RADIO, buffer, sizeof(int32_t)) < 0) + return -1; + + radio_state = *(int32_t*) buffer; + if(radio_state == 0) + return VP_WLC_RADIO_ENABLE; + + return VP_WLC_RADIO_DISABLE; +} + +int32_t vp_wlc_set_infrastructure(VP_WLC_INFRA_MODE value) +{ + return vp_wlc_set(WLC_SET_INFRA, &value, sizeof(int32_t)); +} + +int32_t vp_wlc_get_infrastructure(void) +{ + if(vp_wlc_get(WLC_GET_INFRA, buffer, sizeof(int32_t)) < 0) + return -1; + + return *(int32_t*) buffer; +} + +int32_t vp_wlc_set_authentication(VP_WLC_AUTH_MODE mode) +{ + return vp_wlc_set(WLC_SET_AUTH, &mode, sizeof(int32_t)); +} + +int32_t vp_wlc_get_authentication(void) +{ + if(vp_wlc_get(WLC_GET_AUTH, buffer, sizeof(int32_t)) < 0) + return -1; + + return *(int32_t*) buffer; +} + +int32_t vp_wlc_set_ssid(const char* name) +{ + wlc_ssid_t ssid; + + vp_os_memset(&ssid, 0, sizeof(wlc_ssid_t)); + + if(name) + { + ssid.SSID_len = strlen(name); + strncpy((char *)ssid.SSID, name, ssid.SSID_len); + } + + return vp_wlc_set(WLC_SET_SSID, &ssid, sizeof(wlc_ssid_t)); +} + +wlc_ssid_t* vp_wlc_get_ssid(void) +{ + if(vp_wlc_get(WLC_GET_SSID, buffer, sizeof(wlc_ssid_t)) < 0) + return NULL; + + return (wlc_ssid_t*) buffer; +} + + +int32_t vp_wlc_get_bssid(bdaddr_t* bssid) +{ + if(vp_wlc_get(WLC_GET_BSSID, buffer, sizeof(bdaddr_t)) < 0) + return -1; + + vp_com_copy_address((bdaddr_t*) buffer, bssid); + + return 0; +} + + +int32_t vp_wlc_set_security_mode(int32_t wsec) +{ + return vp_wlc_set(WLC_SET_WSEC, &wsec, sizeof(int32_t)); +} + +int32_t vp_wlc_get_security_mode(void) +{ + if(vp_wlc_get(WLC_GET_WSEC, buffer, sizeof(int32_t)) < 0) + return -1; + + return *(int32_t*)buffer; +} + +int32_t vp_wlc_set_wep128_key(const char* wep_key) +{ + wl_wsec_key_t key; + + vp_os_memset(&key, 0, sizeof(wl_wsec_key_t)); + vp_os_memcpy(&key.data, wep_key, WEP128_KEY_SIZE); + + key.len = WEP128_KEY_SIZE; + key.algo = CRYPTO_ALGO_WEP128; + key.flags |= WL_PRIMARY_KEY; + + return vp_wlc_set(WLC_SET_KEY, &key, sizeof(key)); +} + +int32_t vp_wlc_set_mac_mode(int32_t mode) +{ + return vp_wlc_set(WLC_SET_MACMODE, &mode, sizeof(int32_t)); +} + +int32_t vp_wlc_get_mac_mode(void) +{ + if( vp_wlc_get(WLC_GET_MACMODE, buffer, sizeof(int32_t)) < 0) + return -1; + + return *(int32_t*)buffer; +} + +static int32_t vp_wlc_set_roam_trigger(int32_t value) +{ + return vp_wlc_set(WLC_SET_ROAM_TRIGGER, &value, sizeof(int32_t)); +} + +static int32_t vp_wlc_get_roam_trigger(int32_t* value) +{ + if( vp_wlc_get(WLC_GET_MACMODE, buffer, sizeof(int32_t)) < 0) + return -1; + + *value = *(int32_t*)buffer; + + return 0; +} + +#define ROAMING_ENABLE_VALUE 0 +#define ROAMING_DISABLE_VALUE -99 + +// Enables roaming +int32_t vp_wlc_enable_roaming(void) +{ + return vp_wlc_set_roam_trigger(ROAMING_ENABLE_VALUE); +} + +// Disables roaming +int32_t vp_wlc_disable_roaming(void) +{ + return vp_wlc_set_roam_trigger(ROAMING_DISABLE_VALUE); +} + +// Returns true if roaming is enable. 0 otherwise. +bool_t vp_wlc_roaming_enable(void) +{ + bool_t b = FALSE; + int32_t value; + + if( vp_wlc_get_roam_trigger(&value) == 0 ) + { + switch(value) + { + case ROAMING_ENABLE_VALUE: + b = TRUE; + break; + + case ROAMING_DISABLE_VALUE: + b = FALSE; + break; + + default: + b = FALSE; + break; + } + } + + return b; +} + +int32_t vp_wlc_scan(void) +{ + int32_t ret = 0; + int32_t ap = 0, oldap = 0; + wl_scan_params_t params; + + vp_os_memset(¶ms, 0, sizeof(params)); + vp_os_memset(¶ms.bssid, 0xff, sizeof(params.bssid)); + + params.bss_type = DOT11_BSSTYPE_ANY; + params.scan_type = -1; + params.nprobes = -1; + params.active_time = -1; + params.passive_time = -1; + params.home_time = -1; + + if( vp_wlc_get( WLC_GET_AP, &oldap, sizeof(int32_t) ) < 0 ) + ret = -1; + + if( oldap > 0 ) + vp_wlc_set( WLC_SET_AP, &ap, sizeof(int32_t) ); + + if( vp_wlc_get(WLC_SCAN, ¶ms, 64) < 0 ) + ret = -1; + + if( oldap > 0 ) + vp_wlc_set( WLC_SET_AP, &oldap, sizeof(oldap) ); + + return ret; +} + +wl_scan_results_t* vp_wlc_get_scan_results(void) +{ + wl_scan_results_t* results = (wl_scan_results_t *) buffer; + + results->buflen = WLC_IOCTL_MAXLEN - sizeof(wl_scan_results_t); + + if( vp_wlc_get(WLC_SCAN_RESULTS, buffer, WLC_IOCTL_MAXLEN) < 0 ) + return NULL; + + return results; +} + +static bool swap = FALSE; +#define dtoh32(i) (swap?bcmswap32(i):i) +#define htod32(i) (swap?bcmswap32(i):i) +#define DIV_QUO(num, div) ((num)/div) /* Return the quotient of division to avoid floats */ +#define DIV_REM(num, div) (((num%div) * 100)/div) /* Return the remainder of division */ + +/* Byte swap a 32 bit value */ +#define BCMSWAP32(val) \ + ((uint32)(\ + (((uint32)(val) & (uint32)0x000000ffUL) << 24) | \ + (((uint32)(val) & (uint32)0x0000ff00UL) << 8) | \ + (((uint32)(val) & (uint32)0x00ff0000UL) >> 8) | \ + (((uint32)(val) & (uint32)0xff000000UL) >> 24))) + +static INLINE uint32 +bcmswap32(uint32 val) +{ + return BCMSWAP32(val); +} + +#define QDBM_TABLE_LEN 40 +#define QDBM_OFFSET 153 + +/* Smallest mW value that will round up to the first table entry, QDBM_OFFSET. + * Value is ( mW(QDBM_OFFSET - 1) + mW(QDBM_OFFSET) ) / 2 + */ +#define QDBM_TABLE_LOW_BOUND 6493 /* QDBM_TABLE_LOW_BOUND */ + +static const uint16_t nqdBm_to_mW_map[QDBM_TABLE_LEN] = { +/* qdBm: +0 +1 +2 +3 +4 +5 +6 +7 */ +/* 153: */ 6683, 7079, 7499, 7943, 8414, 8913, 9441, 10000, +/* 161: */ 10593, 11220, 11885, 12589, 13335, 14125, 14962, 15849, +/* 169: */ 16788, 17783, 18836, 19953, 21135, 22387, 23714, 25119, +/* 177: */ 26607, 28184, 29854, 31623, 33497, 35481, 37584, 39811, +/* 185: */ 42170, 44668, 47315, 50119, 53088, 56234, 59566, 63096 +}; + +static uint16_t wl_qdbm_to_mw(uint8_t qdbm) +{ + uint32_t factor = 1; + int idx = qdbm - QDBM_OFFSET; + + if (idx >= QDBM_TABLE_LEN) { + /* clamp to max uint16 mW value */ + return 0xFFFF; + } + + /* scale the qdBm index up to the range of the table 0-40 + * where an offset of 40 qdBm equals a factor of 10 mW. + */ + while (idx < 0) { + idx += 40; + factor *= 10; + } + + /* return the mW value scaled down to the correct factor of 10, + * adding in factor/2 to get proper rounding. + */ + return ((nqdBm_to_mW_map[idx] + factor/2) / factor); +} + +static uint8 wl_mw_to_qdbm(uint16 mw) +{ + uint8 qdbm; + int offset; + uint mw_uint = mw; + uint boundary; + + /* handle boundary case */ + if (mw_uint <= 1) + return 0; + + offset = QDBM_OFFSET; + + /* move mw into the range of the table */ + while (mw_uint < QDBM_TABLE_LOW_BOUND) { + mw_uint *= 10; + offset -= 40; + } + + for (qdbm = 0; qdbm < QDBM_TABLE_LEN-1; qdbm++) { + boundary = nqdBm_to_mW_map[qdbm] + (nqdBm_to_mW_map[qdbm+1] - nqdBm_to_mW_map[qdbm])/2; + if (mw_uint < boundary) break; + } + + qdbm += (uint8)offset; + + return (qdbm); +} + +int32_t vp_wlc_get_instant_power(uint32_t *power) +{ + int val; + uint8_t buffer[WLC_IOCTL_MAXLEN]; + uint32 *int_ptr; + bool override = TRUE; + + strcpy((char*)&buffer[0], "qtxpower"); + if( vp_wlc_get(WLC_GET_VAR, &buffer[0], strlen((char *)&buffer[0]) + 5) < 0) + return -1; + + int_ptr = (uint32 *)&buffer[0]; + val = dtoh32(*int_ptr); + override = (bool)(val & WL_TXPWR_OVERRIDE); + val &= ~WL_TXPWR_OVERRIDE; + *power = wl_qdbm_to_mw((uint8)((val<0xff?val:0xff))); + + return 0; +} + +int32_t vp_wlc_set_instant_power(uint32_t power) +{ + unsigned int new_val = 0; + uint8_t pwr_buf[WLC_IOCTL_MAXLEN]; + uint8_t *int_ptr; + bool override = TRUE; + + strcpy((char *)&pwr_buf[0], "qtxpower"); + + new_val = wl_mw_to_qdbm((uint16)(power<=0xffff?power:0xffff)); + + int_ptr = &pwr_buf[strlen((char *)&pwr_buf[0]) + 1]; + if (override) + new_val |= WL_TXPWR_OVERRIDE; + new_val = htod32(new_val); + memcpy(int_ptr, (const void *)&new_val, sizeof(new_val)); + + if( vp_wlc_set(WLC_SET_VAR, &pwr_buf[0], strlen((char *)&pwr_buf[0])+5) < 0 ) + return -1; + + PRINT("Power set to %d mW\n", power); + return 0; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.h b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.h new file mode 100644 index 0000000..3a2fcda --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/elinux/vp_com_wlc.h @@ -0,0 +1,155 @@ +#ifndef _VP_COM_WLC_H_ +#define _VP_COM_WLC_H_ + +#include +#include + + +// Begin a call sequence +int32_t vp_wlc_begin(const char* itfname); + +// End a call sequence +int32_t vp_wlc_end(void); + +#define VP_WLC_BEGIN(itfname) vp_wlc_begin(itfname); { +#define VP_WLC_END } vp_wlc_end(); + +// Takes the driver out of the UP state. +// Be aware that the DOWN state, resets all driver calibration states. +// To take the driver out of the UP state and keep any run time calibration information, +// use the wlc_out. +int32_t vp_wlc_down(void); + +// Enables the driver after a WLC_DOWN or WLC_OUT command. +int32_t vp_wlc_up(void); + + +// Gets the driver's magic id +int32_t vp_wlc_get_magic(void); + +// Sets the default BSS channel. For IEEE 802.11b and +// IEEE 802.11g solutions, valid channels are generally 1­14. +// Note that the exact valid channel setting is dictated by the +// current country setting. +int32_t vp_wlc_set_channel(int32_t channel); + +// Returns the pointer to a channel_info_t structure. +channel_info_t* vp_wlc_get_channel(int32_t* channel); + + +// Sets the IEEE 802.11d country string. The input parameter can +// either be the full name of the country (CHINA), or a two- +// character abbreviation (CN). +int32_t vp_wlc_set_country(const char* country); + +// Returns the current IEEE 802.11d country string used by the driver. +// The return value is always 4 bytes long. +const char* vp_wlc_get_country(void); + + +// Returns the current instant power of the chip. +int32_t vp_wlc_get_instant_power(uint32_t *power); + +// Sets the current instant power of the chip. +int32_t vp_wlc_set_instant_power(uint32_t power); + + +// Radio states +typedef enum +{ + VP_WLC_RADIO_ENABLE = 0x10000, + VP_WLC_RADIO_DISABLE = 0x10001 +} VP_WLC_RADIO_STATE; + +// Sets the software radio state. +int32_t vp_wlc_set_radio(VP_WLC_RADIO_STATE state); + +// Returns the radio state. +// -1 = Error +int32_t vp_wlc_get_radio(void); + + +typedef enum +{ + VP_WLC_ADHOC = 0, + VP_WLC_INFRASTRUCTURE = 1 +} VP_WLC_INFRA_MODE; + +// Pass 0 to disable infrastructure mode; Pass 1 to enable it. +int32_t vp_wlc_set_infrastructure(VP_WLC_INFRA_MODE value); + +// Returns 1 if in infrastructure mode; 0 otherwise or -1 if error. +int32_t vp_wlc_get_infrastructure(void); + + +typedef enum +{ + VP_WLC_AUTH_OPEN = 0, + VP_WLC_AUTH_SHARED = 1 +} VP_WLC_AUTH_MODE; + +// Sets the authentication mode +int32_t vp_wlc_set_authentication(VP_WLC_AUTH_MODE mode); + +// Returns the authentication mode +int32_t vp_wlc_get_authentication(void); + + +// Sets the ssid +int32_t vp_wlc_set_ssid(const char* ssid); + +// Returns the current SSID. Note that after an SSID has been set, +// the BSS is created. The BSS is with the rate, channel, and other +// settings in their current state. This function should be called only +// after all other parameters have been set. +wlc_ssid_t* vp_wlc_get_ssid(void); + + +// Returns the bssid +int32_t vp_wlc_get_bssid(bdaddr_t* bssid); + + +// Sets the wireless security mode to be used. +// Possible values are +// WEP_ENABLED +// TKIP_ENABLED +// AES_ENABLED +int32_t vp_wlc_set_security_mode(int32_t wsec); + +// Returns a value containing a bit vector representing which +// wireless security modes are currently enabled +int32_t vp_wlc_get_security_mode(void); + + +// Inserts a security key +int32_t vp_wlc_set_wep128_key(const char* wep_key); + +// Sets the mode of the MAC list +// Possible values are +// WLC_MACMODE_DISABLED +// WLC_MACMODE_DENY +// WLC_MACMODE_ALLOW +int32_t vp_wlc_set_mac_mode(int32_t mode); + +// Returns the mac mode +int32_t vp_wlc_get_mac_mode(void); + +/// Roaming + +// Enables roaming +int32_t vp_wlc_enable_roaming(void); + +// Disables roaming +int32_t vp_wlc_disable_roaming(void); + +// Returns true if roaming is enable. 0 otherwise. +bool_t vp_wlc_roaming_enable(void); + + +// Begins a scan sequence +int32_t vp_wlc_scan(void); + +// Gets the result of a previously launched scan +wl_scan_results_t* vp_wlc_get_scan_results(void); + +#endif // _VP_COM_WLC_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/bluez.c b/ARDroneLib/VP_SDK/VP_Com/linux/bluez.c new file mode 100644 index 0000000..98cc890 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/bluez.c @@ -0,0 +1,547 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2006 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include "bluez.h" + +/** + * From bnep.c BlueZ source file + */ + +static int ctl; + +/* Compatibility with old ioctls */ +#define OLD_BNEPCONADD 1 +#define OLD_BNEPCONDEL 2 +#define OLD_BNEPGETCONLIST 3 +#define OLD_BNEPGETCONINFO 4 + +static unsigned long bnepconnadd; +static unsigned long bnepconndel; +static unsigned long bnepgetconnlist; +static unsigned long bnepgetconninfo; + +struct __service_16 { + uint16_t dst; + uint16_t src; +} __attribute__ ((packed)); + +struct __service_32 { + uint16_t unused1; + uint16_t dst; + uint16_t unused2; + uint16_t src; +} __attribute__ ((packed)); + +struct __service_128 { + uint16_t unused1; + uint16_t dst; + uint16_t unused2[8]; + uint16_t src; + uint16_t unused3[7]; +} __attribute__ ((packed)); + +C_RESULT bluez_init(void) +{ + ctl = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_BNEP); + if (ctl < 0) { + perror("Failed to open control socket"); + return VP_COM_ERROR; + } + + /* Temporary ioctl compatibility hack */ + { + struct bnep_connlist_req req; + struct bnep_conninfo ci[1]; + + req.cnum = 1; + req.ci = ci; + + if (!ioctl(ctl, BNEPGETCONNLIST, &req)) { + /* New ioctls */ + bnepconnadd = BNEPCONNADD; + bnepconndel = BNEPCONNDEL; + bnepgetconnlist = BNEPGETCONNLIST; + bnepgetconninfo = BNEPGETCONNINFO; + } else { + /* Old ioctls */ + bnepconnadd = OLD_BNEPCONADD; + bnepconndel = OLD_BNEPCONDEL; + bnepgetconnlist = OLD_BNEPGETCONLIST; + bnepgetconninfo = OLD_BNEPGETCONINFO; + } + } + + return VP_COM_OK; +} + +int bluez_kill_all_connections(void) +{ + struct bnep_connlist_req req; + struct bnep_conninfo ci[48]; + int i; + + req.cnum = 48; + req.ci = ci; + if (ioctl(ctl, bnepgetconnlist, &req)) { + perror("Failed to get connection list"); + return -1; + } + + for (i=0; i < req.cnum; i++) { + struct bnep_conndel_req req; + memcpy(req.dst, ci[i].dst, ETH_ALEN); + req.flags = 0; + if (ioctl(ctl, bnepconndel, &req)) { + perror("Failed to delete connection in connection list"); + return -1; + } + } + + return 0; +} + +static int bnep_connadd(int sk, uint16_t role, char *dev) +{ + struct bnep_connadd_req req; + + strcpy( req.device, dev ); + req.sock = sk; + req.role = role; + if( ioctl( ctl, bnepconnadd, &req ) ) + return -1; + + strcpy( dev, req.device ); + + return 0; +} + +/* Create BNEP connection + * sk - Connect L2CAP socket + * role - Local role + * service - Remote service + * dev - Network device (contains actual dev name on return) + */ +int bnep_create_connection(int sk, uint16_t role, uint16_t svc, char *dev) +{ + struct bnep_setup_conn_req *req; + struct bnep_control_rsp *rsp; + struct __service_16 *s; + unsigned char pkt[BNEP_MTU]; + int r; + + // Send request + req = (void *) pkt; + req->type = BNEP_CONTROL; + req->ctrl = BNEP_SETUP_CONN_REQ; + req->uuid_size = 2; // 16bit UUID + s = (void *) req->service; + s->dst = htons(svc); + s->src = htons(role); + + if (send(sk, pkt, sizeof(*req) + sizeof(*s), 0) < 0) + return -1; + +receive: + // Get response + r = recv(sk, pkt, BNEP_MTU, 0); + if (r <= 0) + return -1; + + errno = EPROTO; + + if (r < sizeof(*rsp)) + return -1; + + rsp = (void *) pkt; + if (rsp->type != BNEP_CONTROL) + return -1; + + if (rsp->ctrl != BNEP_SETUP_CONN_RSP) + goto receive; + + r = ntohs(rsp->resp); + + switch (r) { + case BNEP_SUCCESS: + break; + + case BNEP_CONN_INVALID_DST: + case BNEP_CONN_INVALID_SRC: + case BNEP_CONN_INVALID_SVC: + errno = EPROTO; + return -1; + + case BNEP_CONN_NOT_ALLOWED: + errno = EACCES; + return -1; + } + + return bnep_connadd( sk, role, dev ); +} + +/** + * From pand.c BlueZ source file + */ + +enum { + NONE, + SHOW, + LISTEN, + CONNECT, + KILL +} modes; + +static uint16_t role = BNEP_SVC_PANU; /* Local role (ie service) */ +static uint16_t service = BNEP_SVC_NAP; /* Remote service */ + +//static int detach = 0; +static int persist; +//static int use_sdp = 1; +//static int use_cache; +//static int auth; +//static int secure; +//static int master; +//static int cleanup; +//static int search_duration = 10; + +/*TODO +static struct { + int valid; + char dst[40]; + bdaddr_t bdaddr; +} cache; +*/ + +static char netdev[16] = "bnep%d"; +//static char *pidfile = NULL; +//static bdaddr_t src_addr = *BDADDR_ANY; +//static int src_dev = -1; +//static bdaddr_t connection; + +volatile int terminate; + +//static void do_kill(char *dst); +/* +static void run_devup(char *dev, char *dst, int sk, int nsk) +{ + execl("/sbin/ifconfig", "ifconfig", "bnep0", "192.168.2.2", NULL); + //exit(1); + exit(-1); +} +*/ +/* Connect and initiate BNEP session + * Returns: + * -1 - critical error (exit persist mode) + * 1 - non critical error + * 0 - success + */ +static int create_connection(bdaddr_t* src, bdaddr_t *bdaddr) +{ + struct l2cap_options l2o; + struct sockaddr_l2 l2a; +// struct hci_dev_info di; + socklen_t olen; + int sk, r = 0; + + // memcpy(&src_addr,src,sizeof(bdaddr_t)); + + sk = socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); + if (sk < 0) { + syslog(LOG_ERR, "Cannot create L2CAP socket. %s(%d)", + strerror(errno), errno); + return -1; + } + + /* Setup L2CAP options according to BNEP spec */ + memset(&l2o, 0, sizeof(l2o)); + olen = sizeof(l2o); + getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen); + l2o.imtu = l2o.omtu = BNEP_MTU; + setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, sizeof(l2o)); + + memset(&l2a, 0, sizeof(l2a)); + l2a.l2_family = AF_BLUETOOTH; + bacpy(&l2a.l2_bdaddr, src); + + if (bind(sk, (struct sockaddr *) &l2a, sizeof(l2a))) + syslog(LOG_ERR, "Bind failed. %s(%d)", + strerror(errno), errno); + + memset(&l2a, 0, sizeof(l2a)); + l2a.l2_family = AF_BLUETOOTH; + bacpy(&l2a.l2_bdaddr, bdaddr); + l2a.l2_psm = htobs(BNEP_PSM); + + if (!connect(sk, (struct sockaddr *) &l2a, sizeof(l2a)) && + !bnep_create_connection(sk, role, service, netdev)) { + + syslog(LOG_INFO, "%s connected", netdev); return 0; +/* + switch(fork()) + { + case -1: + r = 1; + break; + case 0: + run_devup(netdev, dst, sk, -1); + return -1; + break; + default: + break; + } +*/ +/* if (persist) { */ +/* w4_hup(sk); */ + +/* if (terminate && cleanup) { */ +/* syslog(LOG_INFO, "Disconnecting from %s.", dst); */ +/* do_kill(dst); */ +/* } */ +/* } */ + +/* r = 0; */ + } else { +// syslog(LOG_ERR, "Connect to %s failed. %s(%d)",dst, strerror(errno), errno); + r = 1; + } + +/* close(sk); */ + +/* if (use_cache) { */ +/* if (!r) { */ +/* /\* Succesesful connection, validate cache *\/ */ +/* strcpy(cache.dst, dst); */ +/* bacpy(&cache.bdaddr, bdaddr); */ +/* cache.valid = use_cache; */ +/* } else */ +/* cache.valid--; */ +/* } */ + + return r; +} + +static int accept_connection(int sk, uint16_t role, char *dev) +{ + struct bnep_setup_conn_req *req; + struct bnep_control_rsp *rsp; + unsigned char pkt[BNEP_MTU]; + int r; + + r = recv(sk, pkt, BNEP_MTU, 0); + if (r <= 0) + return -1; + + errno = EPROTO; + + if (r < sizeof(*req)) + return -1; + + req = (void *) pkt; + if (req->type != BNEP_CONTROL || req->ctrl != BNEP_SETUP_CONN_REQ) + return -1; + + /* FIXME: Check role UUIDs */ + + rsp = (void *) pkt; + rsp->type = BNEP_CONTROL; + rsp->ctrl = BNEP_SETUP_CONN_RSP; + rsp->resp = htons(BNEP_SUCCESS); + if (send(sk, rsp, sizeof(*rsp), 0) < 0) + return -1; + + return bnep_connadd(sk, role, dev); +} + +/* Search and connect + * Returns: + * -1 - critical error (exit persist mode) + * 1 - non critical error + * 0 - success + */ +static int do_connect(bdaddr_t* src,bdaddr_t* dst) +{ + // inquiry_info *ii; + int reconnect = 0; + // int i, n; + int r = 0; + + do { + if (reconnect) + sleep(persist); + reconnect = 1; + + //TODO if (cache.valid > 0) { + /* Use cached bdaddr */ + // r = create_connection(cache.dst, &cache.bdaddr); + r = create_connection(src,dst); + if (r < 0) { + terminate = 1; + break; + } + continue; + //TODO } + + } while (!terminate && persist); + + return r; +} + +void sig_hup(int sig) +{ + return; +} + +void sig_term(int sig) +{ + terminate = 1; +} + +// src is ethernet address of local bluetooth device +// dst is ethernet address of distant bluetooth device +C_RESULT bluez_create_connection( bdaddr_t* src, bdaddr_t* dst ) +{ + struct sigaction sa; + + /* Initialize signals */ + memset(&sa, 0, sizeof(sa)); + sa.sa_flags = SA_NOCLDSTOP; + sa.sa_handler = SIG_IGN; + sigaction(SIGCHLD, &sa, NULL); + sigaction(SIGPIPE, &sa, NULL); + + sa.sa_handler = sig_hup; + sigaction(SIGHUP, &sa, NULL); + + sa.sa_handler = sig_term; + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGINT, &sa, NULL); + + if(do_connect(src,dst)) + return VP_COM_ERROR; + + return VP_COM_OK; +} + +C_RESULT bluez_listen_connection(bdaddr_t* src_addr) +{ + struct l2cap_options l2o; + struct sockaddr_l2 l2a; + socklen_t olen; + int sk, lm; + socklen_t alen = sizeof(l2a); + int nsk; + + *src_addr = *BDADDR_ANY; + + /* Create L2CAP socket and bind it to PSM BNEP */ + sk = socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); + if (sk < 0) { + syslog(LOG_ERR, "Cannot create L2CAP socket. %s(%d)", + strerror(errno), errno); + return VP_COM_ERROR; + } + + memset(&l2a, 0, sizeof(l2a)); + l2a.l2_family = AF_BLUETOOTH; + bacpy(&l2a.l2_bdaddr, src_addr); + l2a.l2_psm = htobs(BNEP_PSM); + + if (bind(sk, (struct sockaddr *) &l2a, sizeof(l2a))) { + syslog(LOG_ERR, "Bind failed. %s(%d)", strerror(errno), errno); + return VP_COM_ERROR; + } + + /* Setup L2CAP options according to BNEP spec */ + memset(&l2o, 0, sizeof(l2o)); + olen = sizeof(l2o); + if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen) < 0) { + syslog(LOG_ERR, "Failed to get L2CAP options. %s(%d)", + strerror(errno), errno); + return VP_COM_ERROR; + } + + l2o.imtu = l2o.omtu = BNEP_MTU; + if (setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, sizeof(l2o)) < 0) { + syslog(LOG_ERR, "Failed to set L2CAP options. %s(%d)", + strerror(errno), errno); + return VP_COM_ERROR; + } + + /* Set link mode */ + lm = 0; + lm |= L2CAP_LM_MASTER; + lm |= L2CAP_LM_AUTH; + lm |= L2CAP_LM_ENCRYPT; + lm |= L2CAP_LM_SECURE; + + if (lm && setsockopt(sk, SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) < 0) { + syslog(LOG_ERR, "Failed to set link mode. %s(%d)", strerror(errno), errno); + return VP_COM_ERROR; + } + + listen(sk,1); + + nsk = accept(sk, (struct sockaddr *) &l2a, &alen); + if(nsk < 0) + return VP_COM_ERROR; + + if(accept_connection(nsk, role, netdev) != 0) + { + close(nsk); + return VP_COM_ERROR; + } + + bacpy(src_addr, &l2a.l2_bdaddr); + + return VP_COM_OK; +} + diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/bluez.h b/ARDroneLib/VP_SDK/VP_Com/linux/bluez.h new file mode 100644 index 0000000..d55a078 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/bluez.h @@ -0,0 +1,36 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2006 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef _COMBLUEZ_H_ +#define _COMBLUEZ_H_ + +struct bdaddr_t; + +// Create a connection between src (i.e. local adapter) and dst (i.e. remote adapter) +C_RESULT bluez_init(void); +C_RESULT bluez_create_connection(bdaddr_t* src, bdaddr_t* dst); +C_RESULT bluez_listen_connection(bdaddr_t* src_addr); +C_RESULT bluez_kill_all_connections(); + +#endif // _COMBLUEZ_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/vp_com.c b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com.c new file mode 100644 index 0000000..3107352 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com.c @@ -0,0 +1,360 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef USE_WIFI +# include "vp_com_wifi.h" +#endif +#ifdef USE_SERIAL +# include "vp_com_serial.h" +#endif +#ifdef USE_WIRED +# include "vp_com_wired.h" +#endif + +typedef C_RESULT (*VP_COM_x_init)(void); +typedef C_RESULT (*VP_COM_x_shutdown)(void); +typedef C_RESULT (*VP_COM_x_network_adapter_lookup)(vp_com_network_adapter_lookup_t callback); +typedef C_RESULT (*VP_COM_x_inquire)(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); +typedef C_RESULT (*VP_COM_x_local_config)(vp_com_config_t* config); +typedef C_RESULT (*VP_COM_x_connect)(vp_com_t* vp_com, vp_com_connection_t* connection, int32_t numAttempts); +typedef C_RESULT (*VP_COM_x_disconnect)(vp_com_config_t* config, vp_com_connection_t* connection); +typedef C_RESULT (*VP_COM_x_get_rssi)(vp_com_config_t* cfg, int32_t* rssi); +typedef C_RESULT (*VP_COM_x_wait_connections)(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int queueLength); +typedef C_RESULT (*VP_COM_x_open)(vp_com_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +typedef C_RESULT (*VP_COM_x_close)(vp_com_socket_t* socket); + +#define VP_COM_INIT vp_com->init +#define VP_COM_SHUTDOWN vp_com->shutdown +#define VP_COM_NETWORKADAPTERLOOKUP vp_com->network_adapter_lookup +#define VP_COM_INQUIRE vp_com->inquire +#define VP_COM_LOCAL_CONFIG vp_com->local_config +#define VP_COM_CONNECT vp_com->connect +#define VP_COM_DISCONNECT vp_com->disconnect +#define VP_COM_GET_RSSI vp_com->get_rssi +#define VP_COM_WAITCONNECTIONS vp_com->wait_connections +#define VP_COM_OPEN vp_com->open +#define VP_COM_CLOSE vp_com->close + +char vp_com_pin_code[VP_COM_NAME_MAXSIZE]; + +C_RESULT vp_com_init(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_NOTSUPPORTED; + + VP_OS_ASSERT( vp_com != NULL ); + + if(!vp_com->initialized) + { + vp_os_mutex_init(&vp_com->mutex); + vp_com->initialized ++; + } + vp_os_mutex_lock(&vp_com->mutex); + + if(vp_com->ref_count > 0) + { + vp_com->ref_count ++; + res = VP_COM_OK; + } + else + { +#ifndef NO_COM +#ifdef USE_BLUEZ + if(vp_com->type == VP_COM_BLUETOOTH) + { + vp_com->init = (VP_COM_x_init) vp_com_bt_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_bt_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_bt_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_bt_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_bt_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_bt_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_bt_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_bt_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_bt_open; + vp_com->close = (VP_COM_x_close) vp_com_bt_close; + } +#endif + +#ifdef USE_WIFI + if(vp_com->type == VP_COM_WIFI) + { + vp_com->init = (VP_COM_x_init) vp_com_wf_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_wf_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_wf_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_wf_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_wf_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_wf_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_wf_disconnect; + vp_com->get_rssi = (VP_COM_x_get_rssi) vp_com_wf_get_rssi; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_wf_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_wf_open; + vp_com->close = (VP_COM_x_close) vp_com_wf_close; + } +#endif // > USE_WIFI +#endif // > NO_COM + +#ifdef USE_SERIAL + if(vp_com->type == VP_COM_SERIAL) + { + vp_com->init = (VP_COM_x_init) vp_com_serial_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_serial_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_serial_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_serial_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_serial_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_serial_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_serial_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_serial_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_serial_open; + vp_com->close = (VP_COM_x_close) vp_com_serial_close; + } +#endif + +#ifdef USE_WIRED + if( vp_com->type == VP_COM_WIRED ) + { + vp_com->init = (VP_COM_x_init) vp_com_wired_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_wired_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_wired_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_wired_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_wired_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_wired_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_wired_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_wired_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_wired_open; + vp_com->close = (VP_COM_x_close) vp_com_wired_close; + } +#endif + if(VP_COM_INIT) + res = VP_COM_INIT(); + + if(res == VP_COM_OK) + { + vp_os_install_error_handler( VP_COM_SDK_SIGNATURE, vp_com_formatMessage ); + vp_com->ref_count ++; + } + } + + vp_os_mutex_unlock( &vp_com->mutex ); + + return res; +} + +C_RESULT vp_com_shutdown(vp_com_t* vp_com) +{ + VP_OS_ASSERT( vp_com != NULL ); + + vp_os_mutex_lock( &vp_com->mutex ); + + if(vp_com->ref_count > 0) + { + vp_com->ref_count--; + if(vp_com->ref_count == 0) + { + vp_os_mutex_unlock( &vp_com->mutex ); + vp_os_mutex_destroy( &vp_com->mutex ); + + return VP_COM_SHUTDOWN(); + } + } + + vp_os_mutex_unlock(&vp_com->mutex); + + return VP_COM_OK; +} +#ifdef USE_BLUEZ +C_RESULT vp_com_str_to_address(const char* address, bdaddr_t* addr) +{ + str2ba( address,addr ); + + return VP_COM_OK; +} + +C_RESULT vp_com_address_to_str(const bdaddr_t* addr, char* address) +{ + ba2str( addr, address ); + + return VP_COM_OK; +} +#endif + +C_RESULT vp_com_copy_address(const bdaddr_t* from,bdaddr_t* to) +{ + vp_os_memcpy( to, from, sizeof( bdaddr_t ) ); + + return VP_COM_OK; +} + +C_RESULT vp_com_cmp_address(const bdaddr_t* bd1, const bdaddr_t* bd2) +{ + int32_t i; + + for( i = 0; i < BDADDR_SIZE && ( bd1->b[i] == bd2->b[i] ); i++ ); + + return ( i < BDADDR_SIZE ) ? VP_COM_ERROR : VP_COM_OK; +} + +C_RESULT vp_com_network_adapter_lookup(vp_com_t* vp_com, vp_com_network_adapter_lookup_t callback) +{ + return VP_COM_NETWORKADAPTERLOOKUP( callback ); +} + +C_RESULT vp_com_local_config(vp_com_t* vp_com, vp_com_config_t* config) +{ + C_RESULT res = C_OK; + + VP_OS_ASSERT( vp_com != NULL ); + + if( vp_com->config != config ) + { + res = VP_COM_LOCAL_CONFIG(config); + + if( SUCCEED( res ) ) + vp_com->config = config; + + } + + return res; +} + +C_RESULT vp_com_inquire(vp_com_t* vp_com, const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + VP_OS_ASSERT( vp_com != NULL ); + + return VP_COM_INQUIRE( deviceName, callback, timeout ); +} + +C_RESULT vp_com_connect(vp_com_t* vp_com, vp_com_connection_t* connection, uint32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; + bool_t already_connected; + + VP_OS_ASSERT( vp_com != NULL ); + + if(vp_com->config != NULL) + { + vp_os_mutex_lock(&vp_com->mutex); + + already_connected = vp_com->connection && vp_com->connection->is_up == 1; + + // TODO voir pour ajouter un test sur l'adresse ethernet de la connection + if( already_connected && vp_com->connection != connection ) + { + already_connected = FALSE; + vp_com_disconnect(vp_com); + } + + if( !already_connected ) + { + res = VP_COM_CONNECT(vp_com, connection, numAttempts); + + if( SUCCEED( res ) ) + { + vp_com->connection = connection; + vp_com->connection->is_up = 1; + } + } + + vp_os_mutex_unlock(&vp_com->mutex); + } + + return res; +} + +C_RESULT vp_com_disconnect(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_ERROR; + + VP_OS_ASSERT( vp_com != NULL ); + + if(vp_com->config != NULL && vp_com->connection != NULL) + { + vp_os_mutex_lock(&vp_com->mutex); + + res = VP_COM_DISCONNECT(vp_com->config, vp_com->connection); + + if( SUCCEED( res ) ) + vp_com->connection->is_up = 0; + + + vp_os_mutex_unlock(&vp_com->mutex); + } + + return res; +} + +C_RESULT vp_com_get_rssi(vp_com_t* vp_com, int32_t* rssi) +{ + C_RESULT res; + + if( vp_com != NULL && vp_com->config != NULL && vp_com->get_rssi != NULL ) + res = VP_COM_GET_RSSI( vp_com->config, rssi ); + else + { + *rssi = 0; + res = C_FAIL; + } + + return res; +} + +C_RESULT vp_com_wait_connections(vp_com_t* vp_com, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + VP_OS_ASSERT( vp_com != NULL ); + + return VP_COM_WAITCONNECTIONS( &vp_com->connection, server, client, queueLength ); +} + +C_RESULT vp_com_open(vp_com_t* vp_com, vp_com_socket_t* socket,Read* read,Write* write) +{ + VP_OS_ASSERT( vp_com != NULL ); + + if( vp_com->ref_count > 0 ) + return VP_COM_OPEN(vp_com->config, vp_com->connection, socket, read, write); + + PRINT("[VP_COM] Trying to open a socket with a non initialized vp_com object\n"); + + return C_FAIL; +} + +C_RESULT vp_com_close(vp_com_t* vp_com, vp_com_socket_t* socket) +{ + VP_OS_ASSERT( vp_com != NULL ); + + if( vp_com->ref_count > 0 ) + return VP_COM_CLOSE( socket ); + + PRINT("[VP_COM] Trying to close a socket with a non initialized vp_com object\n"); + + return C_FAIL; +} + +C_RESULT vp_com_sockopt(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options) +{ + C_RESULT res; + + switch( socket->protocol ) + { +#ifndef NO_COM + case VP_COM_TCP: + res = vp_com_sockopt_ip(vp_com, socket, options); + break; +#endif + case VP_COM_SERIAL: + res = VP_COM_OK; + break; + + default: + res = VP_COM_ERROR; + break; + } + + return res; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_bluetooth.c b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_bluetooth.c new file mode 100644 index 0000000..2464f7d --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_bluetooth.c @@ -0,0 +1,254 @@ + +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "bluez.h" +#include "vp_com_bluetooth.h" +#include "vp_com_config_itf.h" + +#define SOCKET_LISTEN_QUEUE_LENGTH 1 + +extern char vp_com_pin_code[VP_COM_NAME_MAXSIZE]; + +static C_RESULT vp_com_open_rfcomm_socket( vp_com_bluetooth_connection_t* connection, vp_com_socket_t* sck, Read* read, Write* write ); + +C_RESULT vp_com_bt_init( void ) +{ + return bluez_init(); +} + +C_RESULT vp_com_bt_shutdown( void ) +{ + return VP_COM_OK; +} + +static int hciDevCallback( int dd, int dev_id, long arg ) +{ + vp_com_network_adapter_lookup_t callback = ( vp_com_network_adapter_lookup_t ) arg; + struct hci_dev_info hciDevInfo; + + hci_devinfo( dev_id, &hciDevInfo ); + callback( hciDevInfo.name ); + + return 0; // just to remove warning +} + +C_RESULT vp_com_bt_network_adapter_lookup( vp_com_network_adapter_lookup_t callback ) +{ + hci_for_each_dev( 0, hciDevCallback, (long)callback ); + + return VP_COM_OK; +} + +C_RESULT vp_com_bt_inquire( const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout ) +{ + int i = 0; + int num_rsp = 0; + int dd = -1; + inquiry_info* info = NULL; + + int devid = hci_devid( deviceName ); + + if(devid < 0) + return VP_COM_INITERROR; + + dd = hci_open_dev( devid ); + if(dd < 0) + return VP_COM_ADAPTORERROR; + + timeout = timeout / 1280; + + num_rsp = hci_inquiry( devid, timeout, num_rsp, NULL, &info, 0 ); + for(i = 0;i < num_rsp;i++){ + bdaddr_t addr; + char name[248] = {0}; + vp_os_memset( name, 0, sizeof( name ) ); + hci_read_remote_name( dd, &(info+i)->bdaddr, sizeof(name), name, 0 ); + + baswap( &addr, &(info+i)->bdaddr ); + callback( &addr,(unsigned char*)name ); + } + + close( dd ); + vp_os_free( info ); + + return VP_COM_OK; +} + +C_RESULT vp_com_bt_local_config( vp_com_bluetooth_config_t* cfg ) +{ + return VP_COM_OK; +} + +static int8_t vp_com_bt_match_itf(const char* itfname) +{ + int32_t i; + static const char itfref[5] = "bnep?"; + + for(i = 0; (i < 4) && (itfname[i] == itfref[i]); i++); + + return itfname[i]; +} + +static C_RESULT vp_com_local_bt_address(const char* itfname, bdaddr_t* address) +{ + C_RESULT res; + int devid; + + static char hci_name[4] = "hci?"; + + hci_name[3] = vp_com_bt_match_itf(itfname); + + devid = hci_devid( hci_name ); + + res = (devid < 0) ? VP_COM_ADAPTORNOTFOUND : VP_COM_OK; + VP_COM_CHECK( res ); + + hci_devba( devid, address ); + + return res; +} + +C_RESULT vp_com_bt_connect(vp_com_t* vp_com, vp_com_bluetooth_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res; + bdaddr_t local_address; + vp_com_bluetooth_config_t* config = (vp_com_bluetooth_config_t*) vp_com->config; + + res = (connection == NULL) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + res = vp_com_local_bt_address( config->itfName, &local_address ); + VP_COM_CHECK( res ); + + res = bluez_create_connection( &local_address, &connection->address ); + VP_COM_CHECK( res ); + + // configure l'addresse ip de l'interface choisie + res = vp_com_config_itf( config->itfName, config->localHost, config->broadcast, config->netmask ); + VP_COM_CHECK( res ); + + return res; +} + +C_RESULT vp_com_bt_disconnect( vp_com_bluetooth_config_t* config, vp_com_bluetooth_connection_t* connection ) +{ + bluez_kill_all_connections(); + + return VP_COM_OK; +} + +C_RESULT vp_com_bt_wait_connections( vp_com_bluetooth_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength ) +{ + static vp_com_bluetooth_connection_t connection = { 0 }; + + C_RESULT res = VP_COM_OK; + + if(server->type != VP_COM_RFCOMM) + { + if( *c == NULL ) + *c = &connection; + + if( connection.is_up != 1 ) + { + res = bluez_listen_connection( &connection.address ); + VP_COM_CHECK( res ); + + connection.is_up = 1; + } + } + + return vp_com_wait_socket( server, client, queueLength ); +} + +C_RESULT vp_com_bt_open( vp_com_bluetooth_config_t* config, vp_com_bluetooth_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write ) +{ + C_RESULT res; + + res = ( socket == NULL ) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + switch( socket->protocol ) + { + case VP_COM_RFCOMM: + res = vp_com_open_rfcomm_socket( connection, socket, read, write ); + break; + + case VP_COM_TCP: + case VP_COM_UDP: + res = vp_com_open_socket( socket, read, write ); + break; + + default: + res = VP_COM_NOTSUPPORTED; + break; + } + + return res; +} + +C_RESULT vp_com_bt_close( vp_com_socket_t* socket ) +{ + return vp_com_close_socket( socket ); +} + +static C_RESULT vp_com_open_rfcomm_socket( vp_com_bluetooth_connection_t* connection, vp_com_socket_t* sck, Read* read, Write* write ) +{ + C_RESULT res; + + int s = socket( AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM ); + + struct sockaddr_rc raddr = { 0 }; + raddr.rc_family = AF_BLUETOOTH; + raddr.rc_channel = sck->scn; + + res = (s < 0) ? VP_COM_ERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + switch( sck->type ) + { + case VP_COM_SERVER: + vp_com_copy_address( BDADDR_ANY, &raddr.rc_bdaddr ); + bind( s, (struct sockaddr*)&raddr, sizeof(struct sockaddr_rc) ); + break; + + case VP_COM_CLIENT: + vp_com_copy_address( &connection->address, &raddr.rc_bdaddr ); + if(connect( s, (struct sockaddr*)&raddr, sizeof(struct sockaddr_rc) ) != 0) + { + close( s ); + res = VP_COM_ERROR; + } + break; + + default: + res = VP_COM_PARAMERROR; + break; + } + + VP_COM_CHECK( res ); + + sck->priv = (void*) s; + + if(read) *read = (Read) vp_com_read_socket; + if(write) *write = (Write) vp_com_write_socket; + + return res; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.c b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.c new file mode 100644 index 0000000..cab1d97 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.c @@ -0,0 +1,124 @@ +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/******************************************************************** + * Static function declarations + *******************************************************************/ +static int vp_com_set_interface_flags( int skfd, const char *ifname, int isUp ); + +/******************************************************************** + * Static functions + *******************************************************************/ +// taken from ifconfig +static int vp_com_set_interface_flags( int skfd, const char *ifname, int isUp) +{ + struct ifreq ifr; + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( ioctl( skfd, SIOCGIFFLAGS, &ifr ) < 0 ) + return -1; + + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( isUp ) + ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); + else + ifr.ifr_flags &= ~IFF_UP; + + if( ioctl(skfd, SIOCSIFFLAGS, &ifr ) < 0 ) + return -1; + + return 0; +} + +static int vp_com_set_ip( int skfd, const char* ifname, int cmd, int ip ) +{ + struct ifreq ifr; + struct sockaddr_in* addr; + struct sockaddr_in local_sin; + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + // Check if an ip is already set + if( ioctl( skfd, SIOCGIFADDR, &ifr ) != -1 ) + { + addr = (struct sockaddr_in*) &ifr.ifr_addr; + + // Is this the same ip? + if( addr->sin_family == AF_INET && ip == addr->sin_addr.s_addr ) + return 0; +/* + // No so we try to delete it + if( ioctl( skfd, SIOCDIFADDR, &ifr ) < 0 ) + { + DEBUG_PRINT_SDK("Unable to delete old ip address - You should remove your interface %s\n", ifname); + return -1; + } +*/ + } + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + vp_os_memset( &local_sin, 0, sizeof(local_sin) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + addr = (struct sockaddr_in*) &ifr.ifr_addr; + + local_sin.sin_family = AF_INET; + local_sin.sin_addr.s_addr = ip; + vp_os_memcpy(addr,&local_sin,sizeof(local_sin)); + + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( ioctl( skfd, cmd, &ifr ) < 0 ) + return -1; + + return 0; +} + + +int vp_com_config_itf( const char* interface, const char * ip, const char* broadcast, const char* netmask ) +{ + int ret = -1; + + int sck = socket( PF_INET, SOCK_DGRAM, 0 ); + + if( sck < 0 ) + return -1; + + if( vp_com_set_interface_flags( sck, interface, 0 ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFADDR, inet_addr(ip) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFBRDADDR, inet_addr(broadcast) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFNETMASK, inet_addr(netmask) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_interface_flags( sck, interface, 1 ) < 0 ) + goto vp_com_config_itf_end; + + ret = 0; + +vp_com_config_itf_end: + + close(sck); + + return ret; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.h b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.h new file mode 100644 index 0000000..d1ff6e9 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_config_itf.h @@ -0,0 +1,6 @@ +#ifndef _COMIP_H_ +#define _COMIP_H_ + +int vp_com_config_itf( const char* interface, const char * ip, const char* broadcast, const char* netmask ); + +#endif // _COMIP_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_serial.c b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_serial.c new file mode 100644 index 0000000..d88f1f2 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_serial.c @@ -0,0 +1,308 @@ +// Header /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * \brief Com Api for video sdk. Private declarations. + * \author Aurelien Morelle + * \version 1.0 + * \date 24/07/2007 + */ + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Include ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "vp_com_serial.h" + +// Static /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static struct termios tio_save; +static vp_os_mutex_t wait_sync_mutex; +static vp_os_mutex_t write_sync_mutex; + +// Forward declarations ///////////////////////////////////////////////////////////////////////////////////////////////////////// + +static C_RESULT vp_com_serial_wait_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket); +static C_RESULT vp_com_serial_write_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket); + +static C_RESULT vp_com_serial_read (vp_com_socket_t* socket, int8_t* buffer, int32_t* size); +static C_RESULT vp_com_serial_write(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size); + +// Functions declaration //////////////////////////////////////////////////////////////////////////////////////////////////////// + +C_RESULT vp_com_serial_init(void) +{ + vp_os_mutex_init(&wait_sync_mutex); + vp_os_mutex_init(&write_sync_mutex); + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_shutdown() +{ + // nothing + return VP_COM_OK; +} + +C_RESULT vp_com_serial_local_config(vp_com_serial_config_t* config) +{ + C_RESULT res = VP_COM_OK; + + // Serial port must be opened before changing config + + return res; +} + +C_RESULT vp_com_serial_connect(vp_com_t* vp_com, vp_com_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; + + res = (connection == NULL) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + connection->is_up = 1; + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_disconnect(vp_com_serial_config_t* config, vp_com_connection_t* connection) +{ + C_RESULT res = (connection == NULL) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + connection->is_up = 0; + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_open(vp_com_serial_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write) +{ + struct termios tio; + speed_t speed; + + VP_OS_ASSERT(config->blocking == 0 || config->blocking == 1); + + if(config->blocking == 0) + socket->priv = (void *)open(&config->itfName[0], O_RDWR|O_NOCTTY|O_NONBLOCK); + else + socket->priv = (void *)open(&config->itfName[0], O_RDWR|O_NOCTTY); + + if(((int)socket->priv) == -1) + { + PRINT("Unable to \"open\" serial device"); + return (VP_COM_ERROR); + } + + /* get current serial port settings */ + if(tcgetattr((int)socket->priv, &tio) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + tio_save = tio; + + if(config->sync) + { + /* set serial settings */ + speed = (speed_t)config->initial_baudrate; + cfsetispeed(&tio, speed); + cfsetospeed(&tio, speed); + cfmakeraw(&tio); + + if(tcsetattr((int)socket->priv, TCSANOW, &tio) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + if(socket->type == VP_COM_CLIENT) + { + if(FAILED(vp_com_serial_write_sync(config, socket))) + return (VP_COM_ERROR); + vp_os_delay(VP_COM_SYNC_DELAY); + } + else if(socket->type == VP_COM_SERVER) + { + if(FAILED(vp_com_serial_wait_sync(config, socket))) + return (VP_COM_ERROR); + vp_os_delay(VP_COM_SYNC_DELAY); + } + } + + /* set serial settings */ + speed = (speed_t)config->baudrate; + cfsetispeed(&tio, speed); + cfsetospeed(&tio, speed); + cfmakeraw(&tio); + + if(tcsetattr((int)socket->priv, TCSANOW, &tio) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + if(read) *read = (Read) vp_com_serial_read; + if(write) *write = (Write) vp_com_serial_write; + + return (VP_COM_OK); +} + +C_RESULT vp_com_serial_close(vp_com_socket_t* socket) +{ + if(tcsetattr((int)socket->priv, TCSANOW, &tio_save) != 0) + { + PRINT("Serial device configuration failure (%s)", strerror(errno)); + close((int)socket->priv); + return (VP_COM_ERROR); + } + + close((int)socket->priv); + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_wait_connections(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + vp_os_memcpy(client, server, sizeof(vp_com_socket_t)); + return VP_COM_OK; +} + +C_RESULT vp_com_serial_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ + // nothing + return VP_COM_OK; +} + +C_RESULT vp_com_serial_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + // nothing + return VP_COM_OK; +} + +// Static functions ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static C_RESULT vp_com_serial_read (vp_com_socket_t* socket, int8_t* buffer, int32_t* size) +{ + *size = read((int)socket->priv, buffer, *size); + + if(*size == -1 && errno != EAGAIN) + { + return VP_COM_ERROR; + } + else + { + if(*size == -1) + *size = 0; +#if 0 + int i; + for(i = 0 ; i < red ; i++) + { + PRINT("%02X", (buffer+(*size-remain))[i]); + } + PRINT(" (%d)\n", red); +#endif + } + + return VP_COM_OK; +} + +static C_RESULT vp_com_serial_write(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size) +{ + uint32_t remain = *size, written = 0; + + while(remain > 0) + { + written = write((int)socket->priv, buffer+(*size-remain), remain); + + if(written == -1 && errno != EAGAIN) + return VP_COM_ERROR; + else if(written == -1) + written = 0; + + remain -= written; + } + + return VP_COM_OK; +} + +static C_RESULT vp_com_serial_wait_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket) +{ + uint32_t nb; + uint8_t c; + + vp_os_mutex_lock(&wait_sync_mutex); + + if(!config->sync_done) + { + nb = 0; + do + { + if(-1 == read((int)socket->priv, &c, sizeof(int8_t))) + return (FAIL); + if(c == (VP_COM_SYNC_STRING)[nb]) + { + nb++; + } + else + { + nb = 0; + } + } + while(nb != sizeof(VP_COM_SYNC_STRING)); + + config->sync_done = 1; + } + + vp_os_mutex_unlock(&wait_sync_mutex); + + return (SUCCESS); +} + +static C_RESULT vp_com_serial_write_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket) +{ + uint32_t i; + uint8_t c; + + vp_os_mutex_lock(&write_sync_mutex); + + if(!config->sync_done) + { + for(i = 0 ; i < sizeof(VP_COM_SYNC_STRING) ; i++) + { + c = (VP_COM_SYNC_STRING)[i]; + if(-1 == write((int)socket->priv, &c, sizeof(int8_t))) + { + return (FAIL); + } + } + } + + config->sync_done = 1; + + vp_os_mutex_unlock(&write_sync_mutex); + + return (SUCCESS); +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wifi.c b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wifi.c new file mode 100644 index 0000000..436efd4 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wifi.c @@ -0,0 +1,223 @@ +#include +#include + +#include "vp_com_wifi.h" +#include "vp_com_config_itf.h" + +#include +#include +#include + +#ifdef USE_IWLIB +# include +#endif + +#include +#include + +#include +#include + +#ifndef PROC_NET_WIRELESS +#define PROC_NET_WIRELESS "/proc/net/wireless" +#endif + +C_RESULT vp_com_wf_init(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_shutdown(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ +#ifdef USE_IWLIB + char buff[1024]; + char* ret=NULL; + + FILE* fh = fopen( PROC_NET_WIRELESS, "r" ); + + if(fh != NULL) + { + ret=fgets( buff, sizeof(buff), fh ); + + ret=fgets( buff, sizeof(buff), fh ); + while( fgets( buff, sizeof(buff), fh ) ) + { + char name[IFNAMSIZ + 1]; + char *s = buff; // start + char *e = buff + strlen(buff); // end + + vp_os_memset( name, 0, IFNAMSIZ + 1 ); + + while( *s == ' ') s++; // skip leading separator + + while( e != s ) + { + if( *e == ':' ) + break; + e--; + } + + if( e != s ) + { // it's a valid name + strncpy( name, s, e - s ); + callback( name ); + } + } + + fclose( fh ); + + } +#endif + return VP_COM_OK; +} + +C_RESULT vp_com_wf_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_local_config(vp_com_wifi_config_t* cfg) +{ + return vp_com_config_itf( cfg->itfName, cfg->localHost, cfg->broadcast, cfg->netmask ) < 0 ? VP_COM_ERROR : VP_COM_OK; +} + +C_RESULT vp_com_wf_connect(vp_com_t* vp_com, vp_com_wifi_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; +#ifdef USE_IWLIB + int32_t wlsock; + vp_com_wifi_config_t* config = (vp_com_wifi_config_t*)vp_com->config; + wireless_config iwconf; + + wlsock = iw_sockets_open(); + + res = ( wlsock < 0 ) ? VP_COM_ERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + iw_get_basic_config( wlsock, config->itfName, &iwconf ); + + iwconf.has_nwid = 0; + iwconf.has_freq = 0; + iwconf.has_key = 0; + + iwconf.has_mode = 1; + iwconf.mode = config->infrastructure ? IW_MODE_INFRA : IW_MODE_ADHOC; + + iwconf.has_essid = 1; + iwconf.essid_on = 1; + strncpy( &iwconf.essid[0], connection->networkName, IW_ESSID_MAX_SIZE+1 ); + + res = iw_set_basic_config( wlsock, config->itfName, &iwconf ) < 0 ? C_FAIL : C_OK; + + if( SUCCEED(res) ) + PRINT(" OK!\n"); + else + PRINT(" FAILED!\n"); + + iw_sockets_close(wlsock); + +#endif + return res; +} + +C_RESULT vp_com_wf_disconnect(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection) +{ + C_RESULT res = VP_COM_OK; +#ifdef USE_IWLIB + struct iwreq wrq; + char essid[IW_ESSID_MAX_SIZE + 1]; + + int wlsock = iw_sockets_open(); + + vp_os_memset(&wrq, 0, sizeof(struct iwreq)); + + strncpy(essid, connection->networkName, strlen(connection->networkName)); + wrq.u.essid.flags = 0; + wrq.u.essid.pointer = (caddr_t) essid; + wrq.u.essid.length = strlen(essid); + if(iw_get_kernel_we_version() < 21) + wrq.u.essid.length++; // Get version from kernel, device may not have range... + + res = ( iw_set_ext( wlsock, config->itfName, SIOCSIWESSID, &wrq) < 0 ) ? VP_COM_ERROR : VP_COM_OK; + + iw_sockets_close(wlsock); +#endif + + return res; +} + +C_RESULT vp_com_wf_get_rssi(vp_com_wifi_config_t* cfg, int32_t* rssi) +{ +#ifdef USE_IWLIB + struct iwreq wrq; + iwstats stats; + iwrange range; + + int wlsock = iw_sockets_open(); + + vp_os_memset(&wrq, 0, sizeof(struct iwreq)); + iw_get_stats(wlsock, cfg->itfName, &stats, &range, 1); + iw_sockets_close(wlsock); + +// struct iw_statistics +// { +// __u16 status; // Status * - device dependent for now +// struct iw_quality qual; // Quality of the link * (instant/mean/max) +// struct iw_discarded discard; // Packet discarded counts +// struct iw_missed miss; // Packet missed counts +// }; +// +// struct iw_range +// { +// ... +// // Quality of link & SNR stuff */ +// // Quality range (link, level, noise) +// // If the quality is absolute, it will be in the range [0 ; max_qual], +// // if the quality is dBm, it will be in the range [max_qual ; 0]. +// // Don't forget that we use 8 bit arithmetics... +// struct iw_quality max_qual; // Quality of the link +// // This should contain the average/typical values of the quality +// // indicator. This should be the threshold between a "good" and +// // a "bad" link (example : monitor going from green to orange). +// // Currently, user space apps like quality monitors don't have any +// // way to calibrate the measurement. With this, they can split +// // the range between 0 and max_qual in different quality level +// // (using a geometric subdivision centered on the average). +// // I expect that people doing the user space apps will feedback +// // us on which value we need to put in each driver... +// struct iw_quality avg_qual; // Quality of the link +// ... +// }; +// struct iw_quality +// { +// __u8 qual; // link quality (%retries, SNR, %missed beacons or better...) +// __u8 level; // signal level (dBm) +// __u8 noise; // noise level (dBm) +// __u8 updated; // Flags to know if updated +// }; + + *rssi = stats.qual.qual; + +#endif + return VP_COM_OK; +} + +C_RESULT vp_com_wf_wait_connections(vp_com_wifi_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + return vp_com_wait_socket(server, client, queueLength); +} + +C_RESULT vp_com_wf_open(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection, vp_com_socket_t* sck, Read* read, Write* write) +{ + return vp_com_open_socket(sck, read, write); +} + +C_RESULT vp_com_wf_close(vp_com_socket_t* socket) +{ + return vp_com_close_socket(socket); +} diff --git a/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wired.c b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wired.c new file mode 100644 index 0000000..d5f8801 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/linux/vp_com_wired.c @@ -0,0 +1,65 @@ +#include +#include + +#include "vp_com_config_itf.h" + +#include + +#include +#include + +#include +#include + +#include + + +C_RESULT vp_com_wired_init(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_shutdown(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ + return VP_COM_ERROR; +} + +C_RESULT vp_com_wired_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + return VP_COM_ERROR; +} + +C_RESULT vp_com_wired_local_config(vp_com_wired_config_t* cfg) +{ + return vp_com_config_itf( cfg->itfName, cfg->localHost, cfg->broadcast, cfg->netmask ); +} + +C_RESULT vp_com_wired_connect(vp_com_t* vp_com, vp_com_wired_connection_t* connection, int32_t numAttempts) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_disconnect(vp_com_wired_config_t* config, vp_com_wired_connection_t* connection) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wired_wait_connections(vp_com_wired_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + return vp_com_wait_socket(server, client, queueLength); +} + +C_RESULT vp_com_wired_open(vp_com_wired_config_t* config, vp_com_wired_connection_t* connection, vp_com_socket_t* sck, Read* read, Write* write) +{ + return vp_com_open_socket(sck, read, write); +} + +C_RESULT vp_com_wired_close(vp_com_socket_t* socket) +{ + return vp_com_close_socket(socket); +} diff --git a/ARDroneLib/VP_SDK/VP_Com/nds/vp_com.c b/ARDroneLib/VP_SDK/VP_Com/nds/vp_com.c new file mode 100644 index 0000000..2b905b4 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/nds/vp_com.c @@ -0,0 +1,347 @@ +#include +#include + +#include +#include + +#include + +#ifdef __linux__ +#define CYGPKG_NET 1 +#endif + +//#include +#include +#include + +typedef C_RESULT (*VP_COM_x_init)(void); +typedef C_RESULT (*VP_COM_x_shutdown)(void); +typedef C_RESULT (*VP_COM_x_network_adapter_lookup)(vp_com_network_adapter_lookup_t callback); +typedef C_RESULT (*VP_COM_x_inquire)(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); +typedef C_RESULT (*VP_COM_x_local_config)(vp_com_config_t* config); +typedef C_RESULT (*VP_COM_x_connect)(vp_com_config_t* config, vp_com_connection_t* connection); +typedef C_RESULT (*VP_COM_x_disconnect)(vp_com_config_t* config, vp_com_connection_t* connection); +typedef C_RESULT (*VP_COM_x_wait_connections)(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int queueLength); +typedef C_RESULT (*VP_COM_x_open)(vp_com_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +typedef C_RESULT (*VP_COM_x_close)(vp_com_socket_t* socket); + +#define VP_COM_INIT vp_com->init +#define VP_COM_SHUTDOWN vp_com->shutdown +#define VP_COM_NETWORKADAPTERLOOKUP vp_com->network_adapter_lookup +#define VP_COM_INQUIRE vp_com->inquire +#define VP_COM_LOCAL_CONFIG vp_com->local_config +#define VP_COM_CONNECT vp_com->connect +#define VP_COM_DISCONNECT vp_com->disconnect +#define VP_COM_WAITCONNECTIONS vp_com->wait_connections +#define VP_COM_OPEN vp_com->open +#define VP_COM_CLOSE vp_com->close + +C_RESULT vp_com_init(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_NOTSUPPORTED; + +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* if(!vp_com->initialized) */ +/* { */ +/* vp_os_mutex_init(&vp_com->mutex); */ +/* vp_com->initialized ++; */ +/* } */ + +/* vp_os_mutex_lock(&vp_com->mutex); */ + +/* if(vp_com->ref_count > 0) */ +/* { */ +/* vp_com->ref_count ++; */ +/* res = VP_COM_OK; */ +/* } */ +/* else */ +/* { */ +/* #ifndef NO_COM */ + +/* #ifdef USE_WIFI */ +/* if(vp_com->type == VP_COM_WIFI) */ +/* { */ +/* vp_com->init = (VP_COM_x_init) vp_com_wf_init; */ +/* vp_com->shutdown = (VP_COM_x_shutdown) vp_com_wf_shutdown; */ +/* vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_wf_network_adapter_lookup; */ +/* vp_com->local_config = (VP_COM_x_local_config) vp_com_wf_local_config; */ +/* vp_com->inquire = (VP_COM_x_inquire) vp_com_wf_inquire; */ +/* vp_com->connect = (VP_COM_x_connect) vp_com_wf_connect; */ +/* vp_com->disconnect = (VP_COM_x_disconnect) vp_com_wf_disconnect; */ +/* vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_wf_wait_connections; */ +/* vp_com->open = (VP_COM_x_open) vp_com_wf_open; */ +/* vp_com->close = (VP_COM_x_close) vp_com_wf_close; */ +/* } */ +/* #endif // > USE_WIFI */ + +/* #endif // > NO_COM */ + +/* if(VP_COM_INIT) */ +/* res = VP_COM_INIT(); */ + +/* if(res == VP_COM_OK) */ +/* { */ +/* vp_os_install_error_handler(VP_COM_SDK_SIGNATURE, vp_com_formatMessage); */ +/* vp_com->ref_count ++; */ +/* } */ +/* } */ + +/* vp_os_mutex_unlock(&vp_com->mutex); */ + + return res; +} + +C_RESULT vp_com_shutdown(vp_com_t* vp_com) +{ +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* vp_os_mutex_lock(&vp_com->mutex); */ + +/* if(vp_com->ref_count > 0) */ +/* { */ +/* vp_com->ref_count--; */ +/* if(vp_com->ref_count == 0) */ +/* { */ +/* vp_os_mutex_unlock(&vp_com->mutex); */ +/* vp_os_mutex_destroy(&vp_com->mutex); */ + +/* return VP_COM_SHUTDOWN(); */ +/* } */ +/* } */ + +/* vp_os_mutex_unlock(&vp_com->mutex); */ + + return VP_COM_OK; +} + +C_RESULT vp_com_network_adapter_lookup(vp_com_t* vp_com, vp_com_network_adapter_lookup_t callback) +{ + C_RESULT res; + +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* vp_os_mutex_lock(&vp_com->mutex); */ + +/* res = VP_COM_NETWORKADAPTERLOOKUP(callback); */ + +/* vp_os_mutex_unlock(&vp_com->mutex); */ + + return res; +} + +C_RESULT vp_com_inquire(vp_com_t* vp_com, const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + C_RESULT res; + +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* vp_os_mutex_lock(&vp_com->mutex); */ + +/* res = VP_COM_INQUIRE(deviceName, callback, timeout); */ + +/* vp_os_mutex_unlock(&vp_com->mutex); */ + + return res; +} + +C_RESULT vp_com_local_config(vp_com_t* vp_com, vp_com_config_t* config) +{ + C_RESULT res = C_OK; + +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* if( vp_com->config != config ) */ +/* { */ + +/* vp_os_mutex_lock(&vp_com->mutex); */ + +/* res = VP_COM_LOCAL_CONFIG(config); */ + +/* if( SUCCEED( res ) ) */ +/* vp_com->config = config; */ + +/* vp_os_mutex_unlock(&vp_com->mutex); */ + +/* } */ + + return res; +} + +C_RESULT vp_com_connect(vp_com_t* vp_com, vp_com_connection_t* connection, uint32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; +/* bool_t already_connected; */ + +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* if(vp_com->config != NULL) */ +/* { */ +/* vp_os_mutex_lock(&vp_com->mutex); */ + +/* already_connected = vp_com->connection && vp_com->connection->is_up == 1; */ + +/* // TODO voir pour ajouter un test sur l'adresse ethernet de la connection */ +/* if( already_connected && vp_com->connection != connection ) */ +/* { */ +/* already_connected = false; */ +/* vp_com_disconnect(vp_com); */ +/* } */ + +/* if( !already_connected ) */ +/* { */ +/* res = VP_COM_CONNECT(vp_com->config, connection); */ + +/* if( SUCCEED( res ) ) */ +/* { */ +/* vp_com->connection = connection; */ +/* vp_com->connection->is_up = 1; */ +/* } */ +/* } */ + +/* vp_os_mutex_unlock(&vp_com->mutex); */ +/* } */ + + return res; +} + +C_RESULT vp_com_disconnect(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_ERROR; + +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* if(vp_com->config != NULL) */ +/* { */ +/* vp_os_mutex_lock(&vp_com->mutex); */ + +/* res = VP_COM_DISCONNECT(vp_com->config, vp_com->connection); */ + +/* if( SUCCEED( res ) ) */ +/* vp_com->connection->is_up = 0; */ + + +/* vp_os_mutex_unlock(&vp_com->mutex); */ +/* } */ + + return res; +} + +C_RESULT vp_com_wait_connections(vp_com_t* vp_com, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* return VP_COM_WAITCONNECTIONS( &vp_com->connection, server, client, queueLength); */ + + return C_OK; +} + +C_RESULT vp_com_open(vp_com_t* vp_com, vp_com_socket_t* socket, Read* read, Write* write) +{ +/* VP_OS_ASSERT( vp_com != NULL ); */ + +/* return VP_COM_OPEN(vp_com->config, vp_com->connection, socket, read, write); */ + + return C_OK; +} + +C_RESULT vp_com_close(vp_com_t* vp_com, vp_com_socket_t* socket) +{ +/* return VP_COM_CLOSE( socket ); */ + + return C_OK; +} + +C_RESULT vp_com_sockopt(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options) +{ + C_RESULT res = VP_COM_ERROR; + +/* #ifdef CYGPKG_NET */ +/* switch( socket->protocol ) */ +/* { */ +/* case VP_COM_TCP: */ +/* res = vp_com_sockopt_ip(vp_com, socket, options); */ +/* break; */ + +/* case VP_COM_SERIAL: */ +/* res = VP_COM_OK; */ +/* break; */ + +/* default: */ +/* break; */ +/* } */ +/* #endif // -> CYGPKG_NET */ + + return res; +} + +// Convert a char to an hexidecimal value between 0x0 and 0xF +static char ctohex(char c) +{ + if(c >= '0' && c <= '9') + return c - '0'; + if(c >= 'a' && c <= 'f') + return c - 'a' + 0xa; + if(c >= 'A' && c <= 'F') + return c - 'A' + 0xa; + + return 0xFF; +} + +// Convert an hexidecimal value to char +static char hextoc(char h) +{ + if(h < 0xa) + return h + '0'; + + return h + 'a'; +} + +C_RESULT vp_com_str_to_address(const char* address, bdaddr_t* addr) +{ + int i = 5; + while(*address) + { + if(*address == ':') + address++; + + addr->b[i] = ctohex(*address++) << 4; + addr->b[i] |= ctohex(*address++); + + i --; + } + + return VP_COM_OK; +} + +C_RESULT vp_com_address_to_str(const bdaddr_t* addr, char* address) +{ + int i = 0; + for(i = 0;i < 6;i++) + { + char c1 = addr->b[i] && 0xF0; + char c2 = addr->b[i] && 0xF0; + + *address++ = hextoc(c1); + *address++ = hextoc(c2); + *address++ = hextoc(':'); + } + + return VP_COM_OK; +} + +C_RESULT vp_com_copy_address(const bdaddr_t* from, bdaddr_t* to) +{ + vp_os_memcpy(to,from,sizeof(bdaddr_t)); + + return VP_COM_OK; +} + +C_RESULT vp_com_cmp_address(const bdaddr_t* bd1, const bdaddr_t* bd2) +{ + int32_t i; + + for( i = 0; i < BDADDR_SIZE && ( bd1->b[i] == bd2->b[i] ); i++ ); + + return ( i < BDADDR_SIZE ) ? VP_COM_ERROR : VP_COM_OK; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com.h b/ARDroneLib/VP_SDK/VP_Com/vp_com.h new file mode 100644 index 0000000..207d22c --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com.h @@ -0,0 +1,446 @@ +/** + * \brief Com Api for video sdk. Public definitions. + * \author Sylvain Gaeremynck + * \version 3.0 + * \date 16/03/2007 + * \warning Subject to completion + */ + +#ifndef _VP_COM_INCLUDE_H_ +#define _VP_COM_INCLUDE_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#if defined(USE_ELINUX) +#if defined(BR2_PACKAGE_BCM4318_AP) +# define AP +# else +# define STA +# endif // BR2_PACKAGE_BCM4318_AP +# endif // USE_ELINUX + +#define VP_COM_NAME_MAXSIZE 32 /* String's max size for vp_com */ +#define VP_COM_MAX_NUM_DEVICES 256 /* Max number of devices we can record when discovering devices */ +#define VP_COM_MAX_PINCODE_SIZE 32 /* passkey/pincode max length */ + +#define VP_COM_THREAD_SERVER_STACK_SIZE 8192 /* vp_com_server thread stack size */ +#define VP_COM_THREAD_NUM_MAX_CLIENTS 16 /* Max client vp_com_server thread can handle */ +#define VP_COM_THREAD_LOCAL_BUFFER_SIZE 2048 +#define VP_COM_THREAD_LOCAL_BUFFER_MAX_SIZE 4096 + /* Max size of vp_com_server's local buffer to bufferize incoming data */ + /* For instance this value is INTERNAL_BUFFER_SIZE/2 (see ATcodec impl) */ + +#ifdef USE_MINGW32 + +#define socklen_t int + +#endif + +struct _vp_com_socket_t; +struct in_addr; + +/**************************************************** + * Definitions * + ****************************************************/ + +/** + * \enum Types of wireless connection (Bluetooth or Wifi) + */ +typedef enum _VP_COM_WL_TYPE_ +{ + VP_COM_BLUETOOTH, /// Bluetooth + VP_COM_WIFI, /// Wifi + VP_COM_SERIAL, + VP_COM_WIRED +} VP_COM_WL_TYPE; + +/** + * \enum Types of socket (client or server) + */ +typedef enum _VP_COM_SOCKET_TYPE_ +{ + VP_COM_CLIENT, /// Client + VP_COM_SERVER /// Server +} VP_COM_SOCKET_TYPE; + +/** + * \enum Protocol for the socket to be opened + */ +typedef enum _VP_COM_SOCKET_PROTOCOL_ +{ + VP_COM_RFCOMM, /// Rfcomm (RS232 emulation available only in bluetooth mode) + VP_COM_TCP, /// TCP/IP + VP_COM_UDP /// UDP/IP +} VP_COM_SOCKET_PROTOCOL; + +typedef enum _VP_COM_SOCKET_OPTIONS_ +{ + VP_COM_NON_BLOCKING = 1, + VP_COM_NO_DELAY = 2, + VP_COM_MULTICAST_ON = 4, +} VP_COM_SOCKET_OPTIONS; + +typedef enum _VP_COM_WIFI_EVENTS_ +{ + VP_COM_WIFI_EVENT_LINK = 0, /// Link up or down + VP_COM_WIFI_EVENT_BEACONS = 1 /// Beacons received or not +} VP_COM_WIFI_EVENTS; + +typedef enum _VP_COM_SOCKET_STATE_ { + VP_COM_SOCKET_SELECT_ENABLE = 0, + VP_COM_SOCKET_SELECT_DISABLE = 1 +} VP_COM_SOCKET_STATE; + +typedef enum _vp_com_autoip_t { + VP_COM_AUTOIP_DISABLE = 0, + VP_COM_AUTOIP_ENABLE = 1, // Use of autoip +} vp_com_autoip_t; + +typedef enum _VP_COM_SOCKET_BLOCKING_OPTIONS { + VP_COM_DEFAULT = 0, + VP_COM_WAITALL = 1, + VP_COM_DONTWAIT = 2, +} VP_COM_SOCKET_BLOCKING_OPTIONS; + + +typedef C_RESULT (*select_cb) (struct _vp_com_socket_t* server_socket, struct _vp_com_socket_t* client_socket, VP_COM_SOCKET_STATE state, Write write); + +typedef struct _vp_com_config_t +{ + char itfName[VP_COM_NAME_MAXSIZE]; +} vp_com_config_t; + +typedef struct _vp_com_wired_config_t +{ + char itfName[VP_COM_NAME_MAXSIZE]; /// eth0, .... + char localHost[VP_COM_NAME_MAXSIZE]; /// ip of the localhost + char netmask[VP_COM_NAME_MAXSIZE]; /// subnetwork mask + char broadcast[VP_COM_NAME_MAXSIZE]; /// broadcast address +} vp_com_wired_config_t; + +typedef struct _vp_com_wifi_config_t +{ + char itfName[VP_COM_NAME_MAXSIZE]; /// wl0, rausb0 .... + char localHost[VP_COM_NAME_MAXSIZE]; /// ip of the localhost + char netmask[VP_COM_NAME_MAXSIZE]; /// subnetwork mask + char broadcast[VP_COM_NAME_MAXSIZE]; /// broadcast address + char gateway[VP_COM_NAME_MAXSIZE]; /// ip of gateway + char server[VP_COM_NAME_MAXSIZE]; /// ip of server + + uint32_t infrastructure; /// if infrastructure == 1 then we need an access point + uint32_t secure; /// if secure == 1 then we use the defined passkey + char passkey[VP_COM_MAX_PINCODE_SIZE]; /// passkey to use for futur connection + char country[4]; /// Wifi country code. See Broadcom BCM4318 SDIO Country Code + +} vp_com_wifi_config_t; + +typedef struct _vp_com_bluetooth_config_t +{ + char itfName[VP_COM_NAME_MAXSIZE]; /// bnep0, .... + char localHost[VP_COM_NAME_MAXSIZE]; /// ip of localhost + char netmask[VP_COM_NAME_MAXSIZE]; /// subnetwork mask + char broadcast[VP_COM_NAME_MAXSIZE]; /// broadcast address + char gateway[VP_COM_NAME_MAXSIZE]; /// ip of gateway + char server[VP_COM_NAME_MAXSIZE]; /// ip of server + + uint32_t secure; /// if secure == 1 then we use the defined passkey + char passkey[VP_COM_MAX_PINCODE_SIZE]; /// passkey to use for futur connection +} vp_com_bluetooth_config_t; + +#if defined(__LINUX__) || defined(__ELINUX__) +typedef struct _vp_com_serial_config_t +{ + char itfName[VP_COM_NAME_MAXSIZE]; /// /dev/ser0, /dev/ttyS0, /dev/ttyUSB0, etc. + vp_com_baudrate_t baudrate; /// baudrate + vp_com_baudrate_t initial_baudrate; /// baudrate used to wait sync + uint32_t sync; /// if sync == 1 then we wait synchronization data + uint32_t sync_done; /// if sync == 1 then we wait synchronization data + uint32_t blocking; /// if blocking == 0 then it is non-blocking mode + char sync_string[VP_COM_NAME_MAXSIZE]; /// if sync == 1 then sync_string is + /// the string we sent to synchronise +} vp_com_serial_config_t; +#endif + +/** + * \struct Connection's definition + */ +typedef struct _vp_com_connection_t +{ + uint32_t is_up; /// == 1 if connection is up. 0 otherwise +} vp_com_connection_t; + +typedef struct _vp_com_bluetooth_connection_t +{ + uint32_t is_up; /// == 1 if connection is up. 0 otherwise + bdaddr_t address; +} vp_com_bluetooth_connection_t; + +typedef struct _vp_com_wifi_connection_t +{ + uint32_t is_up; /// == 1 if connection is up. 0 otherwise + char networkName[VP_COM_NAME_MAXSIZE]; /// ssid +} vp_com_wifi_connection_t; + +typedef struct _vp_com_wired_connection_t +{ + uint32_t is_up; /// == 1 if connection is up. 0 otherwise +} vp_com_wired_connection_t; + +typedef C_RESULT (*Read_from) (void* s, int8_t* buffer, int32_t* size, uint32_t from_ip); + + +/** + * \struct Socket's definition + */ +typedef struct _vp_com_socket_t +{ + VP_COM_SOCKET_TYPE type; /// Socket type (Server or client) + VP_COM_SOCKET_PROTOCOL protocol; /// Protocol (Rfcomm, Tcp or Udp) + VP_COM_SOCKET_BLOCKING_OPTIONS block; /// Blocking policy for Tcp/Udp sockets + + uint32_t scn; /// Channel used for the connection (only for a Rfcomm socket) + uint32_t port; /// Port for the connection (only for ip based protocol) + char serverHost[VP_COM_NAME_MAXSIZE]; /// ip of the serverhost (if client) + uint32_t remotePort; /// port used by client when incoming connection opened + select_cb select; /// callback when a (de)connection is received + Read_from read; /// callback when data are received + + uint32_t is_multicast; /// tells if the socket is in multicast mode or not + uint32_t multicast_base_addr; /// base address used to compute multicast address to use + + /// Private data + void* priv; /// socket number + VP_COM_SOCKET_STATE is_disable; /// tells if the socket is enable or not + struct _vp_com_socket_t* server; /// Param only used when socket is client + uint32_t queue_length; /// only for server socket + +} vp_com_socket_t; + +/** + * \typedef Prototypes of discovery callback functions + */ +typedef void (*vp_com_network_adapter_lookup_t)(const char* name); +typedef void (*vp_com_inquiry_t)(bdaddr_t* address, const uint8_t* name); + +typedef struct _vp_com_t { + + VP_COM_WL_TYPE type; /// Mandatory! This field must be filled before any call to VP_Com functions + + bool_t initialized; + uint32_t ref_count; + vp_os_mutex_t mutex; + + vp_com_config_t* config; + vp_com_connection_t* connection; + + /// autoip + vp_com_autoip_t autoip; /// Use zeroconf to configure interface (ip will be in range 169.254.x.y) + void (*pick_ip)(struct in_addr *ip); + + /// callbacks + C_RESULT (*init)(void); + C_RESULT (*shutdown)(void); + C_RESULT (*network_adapter_lookup)(vp_com_network_adapter_lookup_t callback); + C_RESULT (*inquire)(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); + C_RESULT (*local_config)(vp_com_config_t* config); + C_RESULT (*connect)(struct _vp_com_t* vp_com, vp_com_connection_t* connection, int32_t num_attempts); + C_RESULT (*disconnect)(vp_com_config_t* config, vp_com_connection_t* connection); + C_RESULT (*get_rssi)(vp_com_config_t* config, int32_t* rssi); + C_RESULT (*wait_connections)(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int queueLength); + C_RESULT (*open)(vp_com_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); + C_RESULT (*close)(vp_com_socket_t* socket); + +} vp_com_t; + + +/**************************************************** + * Functions * + ****************************************************/ + +/** + * \fn init com api + * \param A com object with the first field set to the choosen protocol and all other fields set to 0 + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_init(vp_com_t* vp_com); + +/** + * \fn shutdown com api + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_shutdown(vp_com_t* vp_com); + +/** + * \fn Configure ip allocation strategy - The prototype of this function could change + * \param vp_com a com object + * \param autoip the allocation strategy to use + * \param pick_ip the ip generation function (used in VP_COM_AUTOIP_EX mode) + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_ip_alloc(vp_com_t* vp_com, vp_com_autoip_t autoip, void (*pick_ip)(struct in_addr *ip) ); + +/** + * \fn Configure the local network interface + * \param Configuration parameters + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_local_config(vp_com_t* vp_com, vp_com_config_t* config); + +/** + * \fn Connect to an access point + * \param Connection parameters + * \param Number of attempts to try connection + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_connect(vp_com_t* vp_com, vp_com_connection_t* connection, uint32_t numAttempts); + +/** + * \fn Disconnect from an access point + * \param Connection parameters + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_disconnect(vp_com_t* vp_com); + +/** + * \fn Returns wifi link's quality + * \param rssi signal quality is a percent. A value of 100 means we have an excellent connection. + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_get_rssi(vp_com_t* vp_com, int32_t* rssi); + +/** + * \fn Open a socket + * \param Socket parameters + * \param Used to get a function pointer on a read compatible with the socket parameters (can be NULL) + * \param Used to get a function pointer on a write compatible with the socket parameters (can be NULL) + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_open(vp_com_t* vp_com, vp_com_socket_t* socket, Read* read, Write* write); + +/** + * \fn Close a socket + * \param Socket parameters + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_close(vp_com_t* vp_com, vp_com_socket_t* socket); + +/** + * \fn Set socket option + * \param Socket parameters + * \param options + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_sockopt(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options); + +/** + * \fn Wait for incomming connections + * \param Socket server parameters + * \param Socket client parameters (filled by the function) + * \param Queue length + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_wait_connections(vp_com_t* vp_com, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength); + + + +/**************************************************** + * Utility functions * + ****************************************************/ + + +/** + * \fn Parse a string to create a bd address + * \param [in] address (string format) + * \param [out] address (bd format) + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_str_to_address(const char* address, bdaddr_t* addr); + +/** + * \fn Transform a bdaddr from its binary format to string format + * \param [in] address (bd format) + * \param [out] address (string format) + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_address_to_str(const bdaddr_t* addr, char* address); + +/** + * \fn Copy a bd address + * \param [in] address + * \param [out] address + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_copy_address(const bdaddr_t* from, bdaddr_t* to); + +/** + * \fn Compare two bd addresses + * \param [in] address1 + * \param [in] address2 + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_cmp_address(const bdaddr_t* bd1, const bdaddr_t* bd2); + +/** + * \fn Look for available network adapter + * \param Callback function (see Definitions) + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_network_adapter_lookup(vp_com_t* vp_com, vp_com_network_adapter_lookup_t callback); + +/** + * \fn Look for available network + * \param device to use + * \param Callback function (see Definitions) + * \param timeout to stop the inquiry + * \return VP_SUCCESS or VP_FAILURE + */ +C_RESULT vp_com_inquire(vp_com_t* vp_com, const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); + +/**************************************************** + * Threads * + ****************************************************/ + +/** + * Declaration of a thread that handles incomming connections in a generic way + * + */ + +#include + +typedef struct _vp_com_server_thread_param_t { + bool_t run; + + vp_com_t* com; + vp_com_config_t* config; + vp_com_connection_t* connection; + + uint32_t num_servers; + vp_com_socket_t* servers; + + bool_t timer_enable; + int32_t wait_sec; + int32_t wait_usec; +} vp_com_server_thread_param_t; + +// This thread can be launched to handle incomming connections +// You must call vp_com_start_server to start this thread +PROTO_THREAD_ROUTINE_STACK( vp_com_server, thread_params, VP_COM_THREAD_SERVER_STACK_SIZE ); + +/** + * Start thread server + * + */ +C_RESULT vp_com_init_server(void); // This function must be called before starting thread server +C_RESULT vp_com_wait_for_server_up(void); // Wait until com layer is initialized +C_RESULT vp_com_timed_wait_for_server_up(uint32_t ms); // Wait some ms until com layer is initialized + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // _VP_COM_INCLUDE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_bluetooth.h b/ARDroneLib/VP_SDK/VP_Com/vp_com_bluetooth.h new file mode 100644 index 0000000..3b9c4b3 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_bluetooth.h @@ -0,0 +1,34 @@ +/** + * \brief Com Api for video sdk. Private definitions. + * \author Sylvain Gaeremynck + * \version 3.0 + * \date 16/03/2007 + */ + +#ifndef _VP_COM_BLUETOOTH_H_ +#define _VP_COM_BLUETOOTH_H_ + +#include + +/// Init & Shutdown Com +C_RESULT vp_com_bt_init(void); +C_RESULT vp_com_bt_shutdown(void); + +C_RESULT vp_com_bt_local_config(vp_com_bluetooth_config_t* config); + +/// Connect to a server (client side) +C_RESULT vp_com_bt_connect(vp_com_t* vp_com, vp_com_bluetooth_connection_t* connection, int32_t numAttempts); +C_RESULT vp_com_bt_disconnect(vp_com_bluetooth_config_t* config, vp_com_bluetooth_connection_t* connection); + +/// Open & close sockets +C_RESULT vp_com_bt_open(vp_com_bluetooth_config_t* config, vp_com_bluetooth_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +C_RESULT vp_com_bt_close(vp_com_socket_t* socket); + +/// Listen for incomming connections (server side) +C_RESULT vp_com_bt_wait_connections(vp_com_bluetooth_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength); + +/// Utility functions +C_RESULT vp_com_bt_network_adapter_lookup(vp_com_network_adapter_lookup_t callback); +C_RESULT vp_com_bt_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); + +#endif // _VP_COM_BLUETOOTH_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_error.c b/ARDroneLib/VP_SDK/VP_Com/vp_com_error.c new file mode 100644 index 0000000..5c7775f --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_error.c @@ -0,0 +1,28 @@ +#include + +typedef struct _vp_com_msg_t +{ + int index; + const char *msg; +} vp_com_msg_t; + +static const vp_com_msg_t comMsg[] = { + { VP_COM_OK, "OK" }, + { VP_COM_UNKNOW_ERROR, "Unknow error" }, + { VP_COM_ADAPTORNOTFOUND, "Local ethernet adaptor not found" }, + { VP_COM_PARAMERROR, "Bad parameter" }, + { VP_COM_NOTSUPPORTED, "Not supported" }, + { VP_COM_INITERROR, "Com not initialized" }, + { VP_COM_ADAPTORERROR, "Local ethernet adaptor error" }, + { VP_COM_HOSTNOTREACHABLE, "Unable to reach remote device" }, + { VP_COM_SOCKETERROR, "Socket error" }, + { VP_COM_NOTCONNECTED, "Not connected" } +}; + +const char* vp_com_formatMessage(int32_t error_code) +{ + if(error_code >= VP_COM_MAX_NUM_ERROR) + error_code = VP_COM_UNKNOW_ERROR; + + return comMsg[error_code & 0xFFFF].msg; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_error.h b/ARDroneLib/VP_SDK/VP_Com/vp_com_error.h new file mode 100644 index 0000000..2c8411d --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_error.h @@ -0,0 +1,34 @@ +/** + * \brief Com Api for video sdk. Error handling. + * \author Sylvain Gaeremynck + * \version 2.0 + * \date 20/12/2006 + */ + +#ifndef _VP_COM_ERROR_H_ +#define _VP_COM_ERROR_H_ + + +#include + + +#define VP_COM_CHECK(res) if(res != VP_COM_OK) return res + +enum { + VP_COM_ERROR = -1, + VP_COM_OK = (VP_COM_SDK_SIGNATURE << 16), + VP_COM_UNKNOW_ERROR, + VP_COM_ADAPTORNOTFOUND, + VP_COM_PARAMERROR, + VP_COM_NOTSUPPORTED, + VP_COM_INITERROR, + VP_COM_ADAPTORERROR, + VP_COM_HOSTNOTREACHABLE, + VP_COM_SOCKETERROR, + VP_COM_NOTCONNECTED, + VP_COM_MAX_NUM_ERROR +}; + +const char* vp_com_formatMessage(int32_t errorCode); + +#endif // _VP_COM_ERROR_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_serial.h b/ARDroneLib/VP_SDK/VP_Com/vp_com_serial.h new file mode 100644 index 0000000..9e5c315 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_serial.h @@ -0,0 +1,41 @@ +/** + * \brief Com Api for video sdk. Private definitions. + * \author Aurelien Morelle + * \version 1.0 + * \date 24/07/2007 + */ + +#ifndef _VP_COM_SERIAL_H_ +#define _VP_COM_SERIAL_H_ + +#if !defined(__NDS__) && !defined(__MACOSX__) + +#include + +#define VP_COM_SYNC_DELAY 100 +#define VP_COM_SYNC_STRING "VP_C0M_SERIAL_SYNCHR0" + +/// Init & Shutdown Com +C_RESULT vp_com_serial_init(void); +C_RESULT vp_com_serial_shutdown(void); + +C_RESULT vp_com_serial_local_config(vp_com_serial_config_t* config); + +/// Connect to a server (client side) +C_RESULT vp_com_serial_connect(vp_com_t* vp_com, vp_com_connection_t* connection, int32_t numAttempts); +C_RESULT vp_com_serial_disconnect(vp_com_serial_config_t* config, vp_com_connection_t* connection); + +/// Open & close sockets +C_RESULT vp_com_serial_open(vp_com_serial_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +C_RESULT vp_com_serial_close(vp_com_socket_t* socket); + +/// Listen for incomming connections (server side) +C_RESULT vp_com_serial_wait_connections(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength); + +/// Utility functions +C_RESULT vp_com_serial_network_adapter_lookup(vp_com_network_adapter_lookup_t callback); +C_RESULT vp_com_serial_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); + +#endif // ! __NDS__ && ! __MACOSX__ + +#endif // _VP_COM_SERIAL_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_socket.c b/ARDroneLib/VP_SDK/VP_Com/vp_com_socket.c new file mode 100644 index 0000000..c3246bb --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_socket.c @@ -0,0 +1,678 @@ +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef __linux__ +#include +#include +#include +#include +#include + +#define CYGPKG_NET 1 +#endif + +#if defined(USE_MINGW32) || defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) + +#define MSG_NOSIGNAL 0 + +#define CYGPKG_NET 1 +#endif // USE_MINGW32 || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +#ifdef CYGPKG_NET + +#ifndef USE_MINGW32 +extern int inet_addr(const char *); +#endif + +C_RESULT vp_com_open_socket(vp_com_socket_t* sck, Read* read, Write* write) +{ + C_RESULT res = VP_COM_OK; + + int s = -1, type; + struct sockaddr_in name = { 0 }; + + switch( sck->protocol ) + { + case VP_COM_TCP: + s = socket( AF_INET, SOCK_STREAM, 0 ); + res = ( s < 0 ) ? VP_COM_ERROR : VP_COM_OK; + type = sck->type; + break; + + case VP_COM_UDP: + s = socket( AF_INET, SOCK_DGRAM, 0 ); + sck->scn = inet_addr(sck->serverHost); // Cache destination in int format + res = ( s < 0 ) ? VP_COM_ERROR : VP_COM_OK; + type = VP_COM_SERVER; // Make sure we will bind the socket in the connection-less protocol + break; + + default: + type = VP_COM_CLIENT; + res = VP_COM_PARAMERROR; + break; + } + + if( FAILED(res) ) + { + PRINT("\nSocket opening failed\n"); + } + + VP_COM_CHECK( res ); + + name.sin_family = AF_INET; + name.sin_port = htons( sck->port ); + switch( type ) + { + case VP_COM_CLIENT: + name.sin_addr.s_addr = inet_addr(sck->serverHost); + if ( connect( s, (struct sockaddr*)&name, sizeof( name ) ) == -1 ) + res = VP_COM_ERROR; + break; + + case VP_COM_SERVER: + name.sin_addr.s_addr = INADDR_ANY; + + if ( bind( s, (struct sockaddr*)&name, sizeof(struct sockaddr)) < 0 ) + res = VP_COM_ERROR; + + if ( sck->is_multicast == 1 ) + { + + if ( sck->multicast_base_addr == 0 ) + { + PRINT("Error : multicast base address is not defined\n"); + res = VP_COM_ERROR; + break; + } + + in_addr_t multicast_address, drone_address; + vp_com_wifi_config_t *wifi_cfg = (vp_com_wifi_config_t*) wifi_config(); + + // compute remote address according to local address + drone_address = inet_addr(wifi_cfg->server); + multicast_address = htonl( sck->multicast_base_addr | (ntohl(drone_address) & 0xFF) ); + + struct ip_mreq mreq; + mreq.imr_interface.s_addr = inet_addr(wifi_cfg->localHost); + mreq.imr_multiaddr.s_addr = multicast_address; + + if ( setsockopt( s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq) ) < 0) { + PRINT("!!! Error enabling multicast !!!\n"); + } + } + + break; + + default: + res = VP_COM_PARAMERROR; + break; + } + + if(res == VP_COM_OK) + { + sck->priv = (void*) s; + + switch( sck->protocol ) + { + case VP_COM_TCP: + if(read) *read = (Read) vp_com_read_socket; + if(write) *write = (Write) vp_com_write_socket; + break; + + case VP_COM_UDP: + if(read) *read = (Read) vp_com_read_udp_socket; + if(write) *write = (Write) vp_com_write_udp_socket; + break; + + default: + if(read) *read = NULL; + if(write) *write = NULL; + break; + } + } + else + { + close( s ); + } + + if (sck->block != VP_COM_DEFAULT && + sck->block != VP_COM_WAITALL && + sck->block != VP_COM_DONTWAIT) + { + sck->block = VP_COM_DEFAULT; + } + + return res; +} + +C_RESULT vp_com_close_socket(vp_com_socket_t* socket) +{ + if(socket == NULL) + return VP_COM_PARAMERROR; + + // shutdown( (int) socket->priv, SHUT_RDWR ); + close( (int) socket->priv ); + + socket->priv = NULL; + + return VP_COM_OK; +} + +C_RESULT vp_com_wait_socket(vp_com_socket_t* server, vp_com_socket_t* client, int32_t queue_length) +{ + C_RESULT res = VP_COM_OK; + + if(server == NULL) + return VP_COM_PARAMERROR; + + int s = (int) server->priv; + int c = 0; + socklen_t l = sizeof(struct sockaddr_in); + struct sockaddr_in raddr = { 0 }; // remote address + + server->queue_length = queue_length; + + listen(s, queue_length); + c = accept( s, (struct sockaddr*)&raddr, &l ); + if( c < 0 ) + res = VP_COM_ERROR; + + if(SUCCEED( res )) + { + vp_os_memcpy( client, server, sizeof(vp_com_socket_t) ); + client->priv = (void*) c; + } + + return res; +} + +#endif + +C_RESULT vp_com_sockopt_ip(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options) +{ + int32_t one = 1; + int32_t zero = 0; + + C_RESULT res = VP_COM_ERROR; +#ifdef CYGPKG_NET + int s = (int) socket->priv; + + if( options & VP_COM_NON_BLOCKING ) + { +#ifndef USE_MINGW32 + int32_t arg = 1; + + PRINT("Setting socket %d to non blocking\n", s); + res = ioctl( s, FIONBIO, &arg ) < 0 ? C_FAIL : C_OK; +#endif + + if( FAILED(res) ) + PRINT("error setting non blocking\n"); + } + + if( options & VP_COM_NO_DELAY ) + { + PRINT("Disabling the Nagle (TCP No Delay) algorithm for socket %d\n", s); + + res = setsockopt( s, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof(one) ) < 0 ? C_FAIL : C_OK; + + if( FAILED(res) ) + PRINT("error disabling the Nagle algorithm\n"); + } + + if ( options & VP_COM_MULTICAST_ON ) + { + res = setsockopt( s, IPPROTO_IP, IP_MULTICAST_LOOP, &zero, sizeof(zero) ); + if ( FAILED(res) ) + PRINT("Error : cannot set IP_MULTICAST_LOOP to 0\n"); + + struct in_addr interface_addr; + interface_addr.s_addr = INADDR_ANY; + res = setsockopt( s, IPPROTO_IP, IP_MULTICAST_IF, &interface_addr, sizeof(interface_addr) ); + if ( FAILED(res) ) { + PRINT("Error : cannot enable multicast.\n"); + } + } +#endif + return res; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef CYGPKG_NET + +C_RESULT vp_com_read_udp_socket(vp_com_socket_t* sck, int8_t* buffer, int32_t* size) +{ + C_RESULT res; + int s = (int) sck->priv; + struct sockaddr_in from; + + socklen_t from_len = sizeof(from); + + int flags = MSG_NOSIGNAL; + if (VP_COM_DONTWAIT == sck->block) + flags |= MSG_DONTWAIT; + else if (VP_COM_WAITALL == sck->block) + flags |= MSG_WAITALL; + + + if(s >= 0) + { + res = VP_COM_OK; + *size = recvfrom(s, (char*)buffer, *size, flags, (struct sockaddr*)&from, &from_len ); + + if(*size < 0) + { + +#ifdef USE_MINGW32 + switch( WSAGetLastError() ) + { + case WSAEOPNOTSUPP: + PRINT("MSG_NOSIGNAL is not supported on this platform\n"); + res = VP_COM_ERROR; + break; + + case WSAEINTR: + *size = 0; + break; + + case WSAENETDOWN: + case WSAETIMEDOUT: + case WSAECONNRESET: + PRINT("Connection with peer is not enabled\n"); + res = VP_COM_ERROR; + break; + } +#else + switch( errno ) + { + case EAGAIN: + case EINTR: + *size = 0; + break; + + case EOPNOTSUPP: + PRINT("MSG_NOSIGNAL is not supported on this platform\n"); + res = VP_COM_ERROR; + break; + + case EPIPE: + case ENOTCONN: + case ECONNRESET: + PRINT("Connection with peer is not enabled\n"); + res = VP_COM_ERROR; + break; + + default: + PRINT("recvfrom fails with error: %s\n", strerror(errno)); + res = VP_COM_ERROR; + break; + } +#endif // USE_MINGW32 + } + else + { + sck->scn = from.sin_addr.s_addr; + sck->port = ntohs(from.sin_port); + } + } + else + { + res = VP_COM_ERROR; + } + + return res; +} + +C_RESULT vp_com_make_udp_target( vp_com_socket_t* sck ) +{ + C_RESULT res = C_FAIL; + + if( sck->protocol == VP_COM_UDP ) + { + sck->scn = inet_addr(sck->serverHost); // We use scn field to store ip in order to avoid a call to inet_addr each time we call write + res = C_OK; + } + + return res; +} + +C_RESULT vp_com_write_udp_socket(vp_com_socket_t* sck, const int8_t* buffer, int32_t* size) +{ + C_RESULT res; + int s = (int) sck->priv; + struct sockaddr_in to; + + int flags = 0; + if (VP_COM_DONTWAIT == sck->block) + flags |= MSG_DONTWAIT; + else if (VP_COM_WAITALL == sck->block) + flags |= MSG_WAITALL; + + if(s >= 0) + { + res = VP_COM_OK; + + vp_os_memset( (char*)&to, 0, sizeof(to) ); + to.sin_family = AF_INET; + to.sin_addr.s_addr = sck->scn; + if ( sck -> remotePort ) + to.sin_port = htons(sck->remotePort); + else + to.sin_port = htons(sck->port); + + *size = sendto( s, (char*)buffer, *size, flags, (struct sockaddr*)&to, sizeof(to) ); + + if(*size < 0) + { +#ifdef USE_MINGW32 + + switch( WSAGetLastError() ) + { + case WSAEOPNOTSUPP: + PRINT("MSG_NOSIGNAL is not supported on this platform\n"); + res = VP_COM_ERROR; + break; + + case WSAEINTR: + *size = 0; + break; + + case WSAENETDOWN: + case WSAETIMEDOUT: + case WSAECONNRESET: + PRINT("Connection with peer is not enabled\n"); + res = VP_COM_ERROR; + break; + } + +#else + if( errno == EAGAIN ) + { + *size = 0; + } + else + { + switch( errno ) + { + case EOPNOTSUPP: + PRINT("MSG_NOSIGNAL is not supported on this platform\n"); + break; + + case EPIPE: + case ENOTCONN: + case ECONNRESET: + PRINT("Connection with peer is not enabled\n"); + break; + + default: + PRINT("sendto fails with error: %d - %s\n", errno, strerror(errno)); + break; + } + + res = VP_COM_ERROR; + } +#endif // USE_MINGW32 + } + } + else + { + res = VP_COM_ERROR; + } + + return res; +} + +C_RESULT vp_com_read_socket(vp_com_socket_t* socket, int8_t* buffer, int32_t* size) +{ + C_RESULT res; + int s = (int) socket->priv; + + int flags = 0; + if (VP_COM_DONTWAIT == socket->block) + flags |= MSG_DONTWAIT; + else if (VP_COM_WAITALL == socket->block) + flags |= MSG_WAITALL; + + if(s >= 0) + { + res = VP_COM_OK; + *size = recv(s, buffer, *size, flags); + if(*size < 0) + { + if( errno == EAGAIN ) + { + *size = 0; + } + else + { + res = VP_COM_ERROR; + } + } + } + else + { + res = VP_COM_ERROR; + } + + return res; +} + +C_RESULT vp_com_write_socket(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size) +{ + C_RESULT res; + int s = (int) socket->priv; + + int flags = 0; + if (VP_COM_DONTWAIT == socket->block) + flags |= MSG_DONTWAIT; + else if (VP_COM_WAITALL == socket->block) + flags |= MSG_WAITALL; + + if(s >= 0) + { + res = VP_COM_OK; + *size = send(s, buffer, *size, flags); + if(*size < 0) + { + if( errno == EAGAIN ) + { + *size = 0; + } + else + { + res = VP_COM_ERROR; + } + } + } + else + { + res = VP_COM_ERROR; + } + + return res; +} + +#endif + +///////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static vp_os_mutex_t server_initialisation_mutex; +static vp_os_cond_t server_initialisation_wait; +static bool_t server_init_not_finished = FALSE; + +C_RESULT vp_com_init_server(void) +{ + server_init_not_finished = TRUE; + vp_os_mutex_init(&server_initialisation_mutex); + vp_os_cond_init(&server_initialisation_wait, &server_initialisation_mutex); + + return C_OK; +} + +C_RESULT vp_com_wait_for_server_up(void) +{ + if( server_init_not_finished ) + { + vp_os_mutex_lock(&server_initialisation_mutex); + vp_os_cond_wait(&server_initialisation_wait); + vp_os_mutex_unlock(&server_initialisation_mutex); + } + + return C_OK; +} + +C_RESULT vp_com_timed_wait_for_server_up(uint32_t ms) +{ + C_RESULT res = C_OK; + + if( server_init_not_finished ) + { + vp_os_mutex_lock(&server_initialisation_mutex); + res = vp_os_cond_timed_wait(&server_initialisation_wait, ms); + vp_os_mutex_unlock(&server_initialisation_mutex); + } + + return res; +} + +extern int32_t vp_com_fill_read_fs(vp_com_socket_t* sockets, int32_t num_sockets, int32_t max, fd_set* read_fs ); +extern void vp_com_close_client_sockets(vp_com_socket_t* client_sockets, int32_t num_client_sockets); +extern C_RESULT vp_com_client_open_socket(vp_com_socket_t* server_socket, vp_com_socket_t* client_socket); +extern void vp_com_client_receive( vp_com_socket_t *client_socket ); + +DEFINE_THREAD_ROUTINE_STACK( vp_com_server, thread_params, VP_COM_THREAD_SERVER_STACK_SIZE ) +{ +#ifdef CYGPKG_NET + vp_com_socket_t client_sockets[VP_COM_THREAD_NUM_MAX_CLIENTS]; + struct timeval tv, *ptv; + + // This thread setup connection then loop & wait for a socket event + vp_com_server_thread_param_t* params = (vp_com_server_thread_param_t*) thread_params; + + int32_t i, rc, ncs, s, max = 0, num_server_sockets = params->num_servers, num_client_sockets = 0; + vp_com_socket_t* server_sockets = params->servers; + fd_set read_fs; + + vp_os_memset( client_sockets, 0, sizeof( client_sockets )); + + if(FAILED(vp_com_init(params->com))) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to init com\n"); + vp_com_shutdown(params->com); + } + else if(FAILED(vp_com_local_config(params->com, params->config))) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to configure com\n"); + vp_com_shutdown(params->com); + } + else if(FAILED(vp_com_connect(params->com, params->connection, 1))) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to connect\n"); + vp_com_shutdown(params->com); + } + else + { + vp_os_mutex_lock(&server_initialisation_mutex); + vp_os_cond_signal(&server_initialisation_wait); + vp_os_mutex_unlock(&server_initialisation_mutex); + + server_init_not_finished = FALSE; + + for( i = 0; i < num_server_sockets; i++ ) + { + if(FAILED( vp_com_open_socket(&server_sockets[i], NULL, NULL) )) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Unable to open server socket\n"); + server_sockets[i].is_disable = TRUE; + } + else + { + listen((int32_t)server_sockets[i].priv, server_sockets[i].queue_length); + } + } + + params->run = TRUE; + + while( params->run == TRUE ) + { + if( params->timer_enable == FALSE || ( params->wait_sec == 0 && params->wait_usec == 0 ) ) + { + ptv = NULL; + } + else + { + tv.tv_sec = params->wait_sec; + tv.tv_usec = params->wait_usec; + ptv = &tv; + } + + FD_ZERO(&read_fs); + max = vp_com_fill_read_fs( &server_sockets[0], num_server_sockets, 0, &read_fs ); + max = vp_com_fill_read_fs( &client_sockets[0], num_client_sockets, max, &read_fs ); + + rc = select( max + 1, &read_fs, NULL, NULL, ptv ); + if( rc == -1 && ( errno == EINTR || errno == EAGAIN ) ) + continue; + + if( rc == 0 ) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] select timeout\n"); + + vp_com_close_client_sockets(&client_sockets[0], num_client_sockets); + num_client_sockets = 0; + + params->timer_enable = FALSE; + vp_os_memset( client_sockets, 0, sizeof( client_sockets )); + } + + for( i = 0; i < num_server_sockets && rc != 0; i++ ) + { + s = (int32_t) server_sockets[i].priv; + + if( ( !server_sockets[i].is_disable ) && FD_ISSET( s, &read_fs) ) + { + rc --; + + // Recycle previously released sockets + for( ncs = 0; ncs < num_client_sockets && client_sockets[ncs].priv != NULL; ncs++ ); + + if( ncs < VP_COM_THREAD_NUM_MAX_CLIENTS) + { + if( SUCCEED(vp_com_client_open_socket(&server_sockets[i], &client_sockets[ncs])) && ( ncs == num_client_sockets ) ) + num_client_sockets ++; + } + } + } + + for( i = 0; i < num_client_sockets && rc != 0; i++ ) + { + s = (int32_t) client_sockets[i].priv; + if( ( !client_sockets[i].is_disable ) && FD_ISSET( s, &read_fs) ) + { + rc--; + + vp_com_client_receive( &client_sockets[i] ); + } + } + } + + for( i = 0; i < num_server_sockets; i++ ) + { + vp_com_close_socket(&server_sockets[i]); + } + } + + vp_com_disconnect(params->com); + vp_com_shutdown(params->com); +#endif + + THREAD_RETURN( 0 ); +} diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_socket.h b/ARDroneLib/VP_SDK/VP_Com/vp_com_socket.h new file mode 100644 index 0000000..532348d --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_socket.h @@ -0,0 +1,25 @@ +#ifndef _VP_COM_SOCKET_H_ +#define _VP_COM_SOCKET_H_ + +#include + +C_RESULT vp_com_open_socket( vp_com_socket_t* sck, Read* read, Write* write ); + +C_RESULT vp_com_close_socket( vp_com_socket_t* socket ); + +C_RESULT vp_com_wait_socket( vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength ); + +/// If the destination of your writes for your udp socket change, you have to call this function to notify the socket +C_RESULT vp_com_make_udp_target( vp_com_socket_t* sck ); + +/// Read / Write functions that vp_com will return when you open an udp socket +C_RESULT vp_com_read_udp_socket(vp_com_socket_t* sck, int8_t* buffer, int32_t* size); +C_RESULT vp_com_write_udp_socket(vp_com_socket_t* sck, const int8_t* buffer, int32_t* size); + +/// Read / Write functions that vp_com will return when you open a tcp socket +C_RESULT vp_com_read_socket( vp_com_socket_t* socket, int8_t* buffer, int32_t* size ); +C_RESULT vp_com_write_socket( vp_com_socket_t* socket, const int8_t* buffer, int32_t* size ); + +C_RESULT vp_com_sockopt_ip(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options); + +#endif // _VP_COM_IP_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_socket_utils.c b/ARDroneLib/VP_SDK/VP_Com/vp_com_socket_utils.c new file mode 100644 index 0000000..ca9eea7 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_socket_utils.c @@ -0,0 +1,223 @@ +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef __linux__ +#include +#include +#include +#include +#include + +#define CYGPKG_NET 1 +#endif + +int32_t vp_com_fill_read_fs(vp_com_socket_t* sockets, int32_t num_sockets, int32_t max, fd_set* read_fs ) +{ + while( num_sockets > 0 ) + { + if( !sockets->is_disable ) + { + int32_t s = (int32_t) sockets->priv; + + FD_SET( s, read_fs); // add the socket + + if( s > max ) + max = s; + } + + sockets ++; + num_sockets--; + } + + return max; +} + +void vp_com_close_client_sockets(vp_com_socket_t* client_sockets, int32_t num_client_sockets) +{ + int32_t s; + + // Select timed out - We close all sockets because it should mean we lost connection with client + while( num_client_sockets > 0 ) + { + if( !client_sockets->is_disable ) + { + s = (int32_t) client_sockets->priv; + + DEBUG_PRINT_SDK("[VP_COM_SERVER] Closing socket %d\n", (int)s); + + client_sockets->select( client_sockets->server, + client_sockets, + VP_COM_SOCKET_SELECT_DISABLE, + (Write) vp_com_write_socket ); + + if( client_sockets->protocol == VP_COM_TCP ) + { + close( s ); + } + + vp_os_memset( client_sockets, 0, sizeof(vp_com_socket_t) ); + client_sockets->is_disable = TRUE; + } + + client_sockets++; + num_client_sockets--; + } +} + +C_RESULT vp_com_client_open_socket(vp_com_socket_t* server_socket, vp_com_socket_t* client_socket) +{ + C_RESULT res; + struct sockaddr_in raddr = { 0 }; // remote address + + socklen_t l = sizeof(raddr); + int32_t s = (int32_t) server_socket->priv; + + Write write = (Write) (server_socket->protocol == VP_COM_TCP ? vp_com_write_socket : vp_com_write_udp_socket); + + vp_os_memcpy( client_socket, server_socket, sizeof(vp_com_socket_t) ); + + res = server_socket->select( server_socket, client_socket, VP_COM_SOCKET_SELECT_ENABLE, write ); + + if( SUCCEED(res) ) + { + if( server_socket->protocol == VP_COM_TCP ) + { + client_socket->priv = (void*)accept( s, (struct sockaddr*)&raddr, &l ); + } + + DEBUG_PRINT_SDK("[VP_COM_SERVER] Opening socket for server %d\n", (int)s); + + client_socket->server = server_socket; + } + else + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to open socket for server %d\n", (int)s); + vp_os_memset( client_socket, 0, sizeof(vp_com_socket_t) ); + } + + return res; +} + +void vp_com_client_receive( vp_com_socket_t *client_socket ) +{ + + static int8_t *local_buffer=NULL ;//[VP_COM_THREAD_LOCAL_BUFFER_MAX_SIZE]; + static int8_t *new_buffer=NULL; + static int32_t local_buffer_length=0; + + struct sockaddr_in from; + socklen_t fromlen; + int32_t s, received,available; + + s = (int32_t) client_socket->priv; + + fromlen = sizeof(from); + + switch(client_socket->protocol) + { + case VP_COM_TCP: + /* TCP : read as much information as we can */ + + /* Resize the buffer */ + if (local_buffer==NULL || local_buffer_lengthport); + client_socket->select( client_socket->server, client_socket, VP_COM_SOCKET_SELECT_DISABLE, (Write) vp_com_write_socket ); + close( s ); + vp_os_memset( client_socket, 0, sizeof(vp_com_socket_t) ); + client_socket->is_disable = TRUE; + } + /* If some data were received, we pass them to the application. */ + else if( received>=0 && client_socket->read != NULL ) + { + client_socket->remotePort = ntohs(from.sin_port); + client_socket->read( (void*) client_socket, local_buffer, &received, (&from)->sin_addr.s_addr ); + } + + break; // End of TCP processing + + case VP_COM_UDP: + /* UDP : read one packet */ + + /* Query packet size */ + available = recvfrom(s, (char*)local_buffer,0, MSG_PEEK|MSG_TRUNC, (struct sockaddr*)&from, &fromlen); + + /* Resize the buffer */ + if(available>0){ + if (available>VP_COM_THREAD_LOCAL_BUFFER_MAX_SIZE) { + PRINT("UDP packet is bigger than maximum authorized size. Dropping packet.\n"); return; + } + if (local_buffer==NULL || local_buffer_lengthport); + client_socket->select( client_socket->server, client_socket, VP_COM_SOCKET_SELECT_DISABLE, (Write) vp_com_write_socket ); + close( s ); + vp_os_memset( client_socket, 0, sizeof(vp_com_socket_t) ); + client_socket->is_disable = TRUE; + } + + /* If some data were received, we pass them to the application. */ + else if( received>=0 && client_socket->read != NULL ) + { + client_socket->remotePort = ntohs(from.sin_port); + client_socket->read( (void*) client_socket, local_buffer, &received, (&from)->sin_addr.s_addr ); + } + + break; // End of UDP processing + + default: break; + + } + + //DEBUG_STEPH - debugging the fact that an empty UDP packet crashes the Mykonos program + + /* PRINT("Received (%i bytes) from (ip %i.%i.%i.%i) on (port %i) - ", + received, + ((((struct sockaddr_in*)&from)->sin_addr.s_addr))&0x0FF, + ((((struct sockaddr_in*)&from)->sin_addr.s_addr)>>8)&0x0FF, + ((((struct sockaddr_in*)&from)->sin_addr.s_addr)>>16)&0x0FF, + ((((struct sockaddr_in*)&from)->sin_addr.s_addr)>>24)&0x0FF, + ntohs(((struct sockaddr_in*)&from)->sin_port) + ); + + switch(client_socket->protocol){ + case VP_COM_UDP: printf(" UDP"); break; + case VP_COM_TCP: printf(" TCP"); break; + default : printf("unknown\n"); break; + } +*/ + +} diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_wifi.h b/ARDroneLib/VP_SDK/VP_Com/vp_com_wifi.h new file mode 100644 index 0000000..52f5330 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_wifi.h @@ -0,0 +1,38 @@ +/** + * \brief Com Api for video sdk. Private definitions. + * \author Sylvain Gaeremynck + * \version 3.0 + * \date 16/03/2007 + */ + +#ifndef _VP_COM_WIFI_H_ +#define _VP_COM_WIFI_H_ + +#include + +/// Init & Shutdown Com +C_RESULT vp_com_wf_init(void); +C_RESULT vp_com_wf_shutdown(void); + +/// Config local interface +C_RESULT vp_com_wf_local_config(vp_com_wifi_config_t* config); + +/// Connect to a server (client side) +C_RESULT vp_com_wf_connect(vp_com_t* vp_com, vp_com_wifi_connection_t* connection, int32_t numAttempts); +C_RESULT vp_com_wf_disconnect(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection); + +/// Get stats about current connection +C_RESULT vp_com_wf_get_rssi(vp_com_wifi_config_t* cfg, int32_t* rssi); + +/// Open & close sockets +C_RESULT vp_com_wf_open(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +C_RESULT vp_com_wf_close(vp_com_socket_t* socket); + +/// Listen for incomming connections (server side) +C_RESULT vp_com_wf_wait_connections(vp_com_wifi_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength); + +/// Utility functions +C_RESULT vp_com_wf_network_adapter_lookup(vp_com_network_adapter_lookup_t callback); +C_RESULT vp_com_wf_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); + +#endif // _VP_COM_WIFI_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/vp_com_wired.h b/ARDroneLib/VP_SDK/VP_Com/vp_com_wired.h new file mode 100644 index 0000000..4156c38 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/vp_com_wired.h @@ -0,0 +1,35 @@ +/** + * \brief Com Api for video sdk. Private definitions. + * \author Sylvain Gaeremynck + * \version 1.0 + * \date 22/01/2008 + */ + +#ifndef _VP_COM_WIRED_H_ +#define _VP_COM_WIRED_H_ + +#include + +/// Init & Shutdown Com +C_RESULT vp_com_wired_init(void); +C_RESULT vp_com_wired_shutdown(void); + +/// Config local interface +C_RESULT vp_com_wired_local_config(vp_com_wired_config_t* config); + +/// Connect to a server (client side) +C_RESULT vp_com_wired_connect(vp_com_t* vp_com, vp_com_wired_connection_t* connection); +C_RESULT vp_com_wired_disconnect(vp_com_wired_config_t* config, vp_com_wired_connection_t* connection); + +/// Open & close sockets +C_RESULT vp_com_wired_open(vp_com_wired_config_t* config, vp_com_wired_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +C_RESULT vp_com_wired_close(vp_com_socket_t* socket); + +/// Listen for incomming connections (server side) +C_RESULT vp_com_wired_wait_connections(vp_com_wired_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength); + +/// Utility functions +C_RESULT vp_com_wired_network_adapter_lookup(vp_com_network_adapter_lookup_t callback); +C_RESULT vp_com_wired_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); + +#endif // _VP_COM_WIRED_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/win32/vp_com.c b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com.c new file mode 100755 index 0000000..7ac8034 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com.c @@ -0,0 +1,347 @@ +//#include + +#include + +#include +#include + +#include +#include + +#ifndef _WIN32 +#include +#endif + +#include + +typedef C_RESULT (*VP_COM_x_init)(void); +typedef C_RESULT (*VP_COM_x_shutdown)(void); +typedef C_RESULT (*VP_COM_x_network_adapter_lookup)(vp_com_network_adapter_lookup_t callback); +typedef C_RESULT (*VP_COM_x_inquire)(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout); +typedef C_RESULT (*VP_COM_x_local_config)(vp_com_config_t* config); +typedef C_RESULT (*VP_COM_x_connect)(vp_com_t* vp_com, vp_com_connection_t* connection, int32_t numAttempts); +typedef C_RESULT (*VP_COM_x_disconnect)(vp_com_config_t* config, vp_com_connection_t* connection); +typedef C_RESULT (*VP_COM_x_get_rssi)(vp_com_config_t* cfg, int32_t* rssi); +typedef C_RESULT (*VP_COM_x_wait_connections)(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int queueLength); +typedef C_RESULT (*VP_COM_x_open)(vp_com_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write); +typedef C_RESULT (*VP_COM_x_close)(vp_com_socket_t* socket); + +#define VP_COM_INIT vp_com->init +#define VP_COM_SHUTDOWN vp_com->shutdown +#define VP_COM_NETWORKADAPTERLOOKUP vp_com->network_adapter_lookup +#define VP_COM_INQUIRE vp_com->inquire +#define VP_COM_LOCAL_CONFIG vp_com->local_config +#define VP_COM_CONNECT vp_com->connect +#define VP_COM_DISCONNECT vp_com->disconnect +#define VP_COM_GET_RSSI vp_com->get_rssi +#define VP_COM_WAITCONNECTIONS vp_com->wait_connections +#define VP_COM_OPEN vp_com->open +#define VP_COM_CLOSE vp_com->close + +C_RESULT vp_com_init(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_NOTSUPPORTED; + + VP_OS_ASSERT( vp_com != NULL ); + + if(!vp_com->initialized) + { + vp_os_mutex_init(&vp_com->mutex); + vp_com->initialized ++; + } + + vp_os_mutex_lock(&vp_com->mutex); + + if(vp_com->ref_count > 0) + { + vp_com->ref_count ++; + res = VP_COM_OK; + } + else + { + + if(vp_com->type == VP_COM_WIFI) + { + vp_com->init = (VP_COM_x_init) vp_com_wf_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_wf_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_wf_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_wf_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_wf_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_wf_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_wf_disconnect; + vp_com->get_rssi = (VP_COM_x_get_rssi) vp_com_wf_get_rssi; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_wf_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_wf_open; + vp_com->close = (VP_COM_x_close) vp_com_wf_close; + } + + +/*#ifndef NO_COM + + if(vp_com->type == VP_COM_BLUETOOTH) + { + vp_com->init = (VP_COM_x_init) vp_com_bt_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_bt_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_bt_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_bt_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_bt_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_bt_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_bt_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_bt_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_bt_open; + vp_com->close = (VP_COM_x_close) vp_com_bt_close; + } + + + +#endif // > NO_COM*/ + +#ifndef _WIN32 + + + if(vp_com->type == VP_COM_SERIAL) + { + vp_com->init = (VP_COM_x_init) vp_com_serial_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_serial_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_serial_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_serial_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_serial_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_serial_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_serial_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_serial_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_serial_open; + vp_com->close = (VP_COM_x_close) vp_com_serial_close; + } +#endif + +/* if( vp_com->type == VP_COM_WIRED ) + { + vp_com->init = (VP_COM_x_init) vp_com_wired_init; + vp_com->shutdown = (VP_COM_x_shutdown) vp_com_wired_shutdown; + vp_com->network_adapter_lookup = (VP_COM_x_network_adapter_lookup) vp_com_wired_network_adapter_lookup; + vp_com->local_config = (VP_COM_x_local_config) vp_com_wired_local_config; + vp_com->inquire = (VP_COM_x_inquire) vp_com_wired_inquire; + vp_com->connect = (VP_COM_x_connect) vp_com_wired_connect; + vp_com->disconnect = (VP_COM_x_disconnect) vp_com_wired_disconnect; + vp_com->get_rssi = NULL; + vp_com->wait_connections = (VP_COM_x_wait_connections) vp_com_wired_wait_connections; + vp_com->open = (VP_COM_x_open) vp_com_wired_open; + vp_com->close = (VP_COM_x_close) vp_com_wired_close; + }*/ + + if(VP_COM_INIT) + res = VP_COM_INIT(); + + if(res == VP_COM_OK) + { + vp_os_install_error_handler( VP_COM_SDK_SIGNATURE, vp_com_formatMessage ); + vp_com->ref_count ++; + } + } + + vp_os_mutex_unlock( &vp_com->mutex ); + + return res; +} + +C_RESULT vp_com_shutdown(vp_com_t* vp_com) +{ + VP_OS_ASSERT( vp_com != NULL ); + + vp_os_mutex_lock( &vp_com->mutex ); + + if(vp_com->ref_count > 0) + { + vp_com->ref_count--; + if(vp_com->ref_count == 0) + { + vp_os_mutex_unlock( &vp_com->mutex ); + vp_os_mutex_destroy( &vp_com->mutex ); + + return VP_COM_SHUTDOWN(); + } + } + + vp_os_mutex_unlock(&vp_com->mutex); + + return VP_COM_OK; +} + +/*C_RESULT vp_com_str_to_address(const char* address, bdaddr_t* addr) +{ + str2ba( address,addr ); + + return VP_COM_OK; +} + +C_RESULT vp_com_address_to_str(const bdaddr_t* addr, char* address) +{ + ba2str( addr, address ); + + return VP_COM_OK; +} + +C_RESULT vp_com_copy_address(const bdaddr_t* from,bdaddr_t* to) +{ + vp_os_memcpy( to, from, sizeof( bdaddr_t ) ); + + return VP_COM_OK; +} + +C_RESULT vp_com_cmp_address(const bdaddr_t* bd1, const bdaddr_t* bd2) +{ + int32_t i; + + for( i = 0; i < BDADDR_SIZE && ( bd1->b[i] == bd2->b[i] ); i++ ); + + return ( i < BDADDR_SIZE ) ? VP_COM_ERROR : VP_COM_OK; +} +*/ +C_RESULT vp_com_network_adapter_lookup(vp_com_t* vp_com, vp_com_network_adapter_lookup_t callback) +{ + return VP_COM_NETWORKADAPTERLOOKUP( callback ); +} + +C_RESULT vp_com_local_config(vp_com_t* vp_com, vp_com_config_t* config) +{ + C_RESULT res = C_OK; + + VP_OS_ASSERT( vp_com != NULL ); + + if( vp_com->config != config ) + { + + res = VP_COM_LOCAL_CONFIG(config); + + if( VP_SUCCEEDED( res ) ) + vp_com->config = config; + + } + + return res; +} + +C_RESULT vp_com_inquire(vp_com_t* vp_com, const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + VP_OS_ASSERT( vp_com != NULL ); + + return VP_COM_INQUIRE( deviceName, callback, timeout ); +} + +C_RESULT vp_com_connect(vp_com_t* vp_com, vp_com_connection_t* connection, uint32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; + bool_t already_connected; + + VP_OS_ASSERT( vp_com != NULL ); + + if(vp_com->config != NULL) + { + vp_os_mutex_lock(&vp_com->mutex); + + already_connected = vp_com->connection && vp_com->connection->is_up == 1; + + // TODO voir pour ajouter un test sur l'adresse ethernet de la connection + if( already_connected && vp_com->connection != connection ) + { + already_connected = FALSE; + vp_com_disconnect(vp_com); + } + + if( !already_connected ) + { + res = VP_COM_CONNECT(vp_com, connection, numAttempts); + + if( VP_SUCCEEDED( res ) ) + { + vp_com->connection = connection; + vp_com->connection->is_up = 1; + } + } + + vp_os_mutex_unlock(&vp_com->mutex); + } + + return res; +} + +C_RESULT vp_com_disconnect(vp_com_t* vp_com) +{ + C_RESULT res = VP_COM_ERROR; + + VP_OS_ASSERT( vp_com != NULL ); + + if(vp_com->config != NULL && vp_com->connection != NULL) + { + vp_os_mutex_lock(&vp_com->mutex); + + res = VP_COM_DISCONNECT(vp_com->config, vp_com->connection); + + if( VP_SUCCEEDED( res ) ) + vp_com->connection->is_up = 0; + + + vp_os_mutex_unlock(&vp_com->mutex); + } + + return res; +} +/* +C_RESULT vp_com_get_rssi(vp_com_t* vp_com, int32_t* rssi) +{ + C_RESULT res; + + if( vp_com != NULL && vp_com->config != NULL && vp_com->get_rssi != NULL ) + res = VP_COM_GET_RSSI( vp_com->config, rssi ); + else + { + *rssi = 0; + res = C_FAIL; + } + + return res; +} +*/ +C_RESULT vp_com_wait_connections(vp_com_t* vp_com, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + VP_OS_ASSERT( vp_com != NULL ); + + return VP_COM_WAITCONNECTIONS( &vp_com->connection, server, client, queueLength ); +} + +C_RESULT vp_com_open(vp_com_t* vp_com, vp_com_socket_t* socket, Read* read, Write* write) +{ + VP_OS_ASSERT( vp_com != NULL ); + + return VP_COM_OPEN(vp_com->config, vp_com->connection, socket, read, write); +} + +C_RESULT vp_com_close(vp_com_t* vp_com, vp_com_socket_t* socket) +{ + return VP_COM_CLOSE( socket ); +} + +C_RESULT vp_com_sockopt(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options) +{ + C_RESULT res; + + switch( socket->protocol ) + { +/*#ifndef NO_COM + case VP_COM_TCP: + res = vp_com_sockopt_ip(vp_com, socket, options); + break; +#endif*/ + case VP_COM_SERIAL: + res = VP_COM_OK; + break; + + default: + res = VP_COM_ERROR; + break; + } + + return res; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.c b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.c new file mode 100755 index 0000000..d1c10ca --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.c @@ -0,0 +1,131 @@ +/* Modified version for the Win32 example. +stephane.piskorski.ext@parrot.com +July 2010. +*/ + +#include +#include +#include +#include +//#include + + +/******************************************************************** + * Static function declarations + *******************************************************************/ +static int vp_com_set_interface_flags( int skfd, const char *ifname, int isUp ); + +/******************************************************************** + * Static functions + *******************************************************************/ +// taken from ifconfig +static int vp_com_set_interface_flags( int skfd, const char *ifname, int isUp) +{ +#ifndef _WIN32 + + struct ifreq ifr; + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( ioctl( skfd, SIOCGIFFLAGS, &ifr ) < 0 ) + return -1; + + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( isUp ) + ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); + else + ifr.ifr_flags &= ~IFF_UP; + + if( ioctl(skfd, SIOCSIFFLAGS, &ifr ) < 0 ) + return -1; + */ +#endif + return 0; +} + +static int vp_com_set_ip( int skfd, const char* ifname, int cmd, int ip ) +{ + #ifndef _WIN32 + struct ifreq ifr; + struct sockaddr_in* addr; + struct sockaddr_in local_sin; + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + // Check if an ip is already set + if( ioctl( skfd, SIOCGIFADDR, &ifr ) != -1 ) + { + addr = (struct sockaddr_in*) &ifr.ifr_addr; + + // Is this the same ip? + if( addr->sin_family == AF_INET && ip == addr->sin_addr.s_addr ) + return 0; +/* + // No so we try to delete it + if( ioctl( skfd, SIOCDIFADDR, &ifr ) < 0 ) + { + DEBUG_PRINT_SDK("Unable to delete old ip address - You should remove your interface %s\n", ifname); + return -1; + } +*/ + } + + vp_os_memset( &ifr, 0, sizeof(struct ifreq) ); + vp_os_memset( &local_sin, 0, sizeof(local_sin) ); + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + addr = (struct sockaddr_in*) &ifr.ifr_addr; + + local_sin.sin_family = AF_INET; + local_sin.sin_addr.s_addr = ip; + vp_os_memcpy(addr,&local_sin,sizeof(local_sin)); + + strncpy( ifr.ifr_name, ifname, IFNAMSIZ ); + + if( ioctl( skfd, cmd, &ifr ) < 0 ) + return -1; +#endif + return 0; +} + + +int vp_com_config_itf( const char* _interface, const char * _ip, const char* _broadcast, const char* _netmask ) +{ + int ret = -1; + #ifndef _WIN32 + + + int sck = socket( PF_INET, SOCK_DGRAM, 0 ); + + if( sck < 0 ) + return -1; + + if( vp_com_set_interface_flags( sck, interface, 0 ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFADDR, inet_addr(ip) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFBRDADDR, inet_addr(broadcast) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_ip( sck, interface, SIOCSIFNETMASK, inet_addr(netmask) ) < 0 ) + goto vp_com_config_itf_end; + + if( vp_com_set_interface_flags( sck, interface, 1 ) < 0 ) + goto vp_com_config_itf_end; + + ret = 0; + +vp_com_config_itf_end: + + close(sck); +#else + /* Dont change configuration under Windows. The user must do it manually. */ + ret = 0; +#endif + return ret; +} diff --git a/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.h b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.h new file mode 100755 index 0000000..b03f71f --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_config_itf.h @@ -0,0 +1,10 @@ +#ifndef _COMIP_H_ +#define _COMIP_H_ + +int vp_com_config_itf( + const char* _interface, + const char * _ip, + const char* _broadcast, + const char* _netmask ); + +#endif // _COMIP_H_ diff --git a/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_serial.c b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_serial.c new file mode 100644 index 0000000..afda2da --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_serial.c @@ -0,0 +1,294 @@ +// Header /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * \brief Com Api for video sdk. Private declarations. + * \author Mayeul Rigo + * \version 1.0 + * \date 11/02/09 + */ + +//pour les ports de COM >= 10 utiliser la syntaxe \\\\.\\COM10 + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Include ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include + +#include +#include +#include +#include + +#include "vp_com_serial.h" + +// Static /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static DCB tio_save; +static vp_os_mutex_t wait_sync_mutex; +static vp_os_mutex_t write_sync_mutex; + +// Forward declarations ///////////////////////////////////////////////////////////////////////////////////////////////////////// + +static C_RESULT vp_com_serial_wait_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket); +static C_RESULT vp_com_serial_write_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket); + +static C_RESULT vp_com_serial_read (vp_com_socket_t* socket, int8_t* buffer, int32_t* size); +static C_RESULT vp_com_serial_write(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size); + +// Functions declaration //////////////////////////////////////////////////////////////////////////////////////////////////////// + +C_RESULT vp_com_serial_init(void) +{ + vp_os_mutex_init(&wait_sync_mutex); + vp_os_mutex_init(&write_sync_mutex); + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_shutdown() +{ + // nothing + return VP_COM_OK; +} + +C_RESULT vp_com_serial_local_config(vp_com_serial_config_t* config) +{ + C_RESULT res = VP_COM_OK; + + // Serial port must be opened before changing config + + return res; +} + +C_RESULT vp_com_serial_connect(vp_com_t* vp_com, vp_com_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; + + res = (connection == NULL) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + connection->is_up = 1; + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_disconnect(vp_com_serial_config_t* config, vp_com_connection_t* connection) +{ + C_RESULT res = (connection == NULL) ? VP_COM_PARAMERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + connection->is_up = 0; + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_open(vp_com_serial_config_t* config, vp_com_connection_t* connection, vp_com_socket_t* socket, Read* read, Write* write) +{ + DCB tio; + COMMTIMEOUTS commtimeouts; + + VP_OS_ASSERT(config->blocking == 0 || config->blocking == 1); + + socket->priv = (void *)CreateFile(&config->itfName[0],GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); + if (socket->priv == INVALID_HANDLE_VALUE) return VP_COM_ERROR; + + if(config->blocking == 0) { + commtimeouts.ReadIntervalTimeout = 0; + commtimeouts.ReadTotalTimeoutMultiplier = 0; + commtimeouts.ReadTotalTimeoutConstant = 1; + commtimeouts.WriteTotalTimeoutMultiplier = 0; + commtimeouts.WriteTotalTimeoutConstant = 1; + } else { + commtimeouts.ReadTotalTimeoutMultiplier = 0; + commtimeouts.ReadTotalTimeoutConstant = 0; + commtimeouts.WriteTotalTimeoutMultiplier = 0; + commtimeouts.WriteTotalTimeoutConstant = 0; + }; + if (SetCommTimeouts(socket->priv,&commtimeouts) == 0) return VP_COM_ERROR; + + if(((int)socket->priv) == 0) + { + PRINT("Unable to \"open\" serial device"); + return VP_COM_ERROR; + } + + /* get current serial port settings */ + if (GetCommState(socket->priv,&tio) == 0) { + PRINT("Serial device configuration failure (119) (%s)", strerror(errno)); + CloseHandle((HANDLE)socket->priv); + return (VP_COM_ERROR); + }; + tio_save = tio; + + if(config->sync) { + /* set serial settings */ + tio.BaudRate = config->initial_baudrate; + tio.fBinary = TRUE; + tio.fParity = FALSE; + tio.fOutxCtsFlow = FALSE; + tio.fOutxDsrFlow = FALSE; + tio.fDtrControl = DTR_CONTROL_DISABLE; + tio.fDsrSensitivity = FALSE; + tio.fTXContinueOnXoff = TRUE; + tio.fOutX = FALSE; + tio.fInX = FALSE; + tio.fErrorChar = FALSE; + tio.fNull = FALSE; + tio.fRtsControl = RTS_CONTROL_DISABLE; + tio.fAbortOnError = FALSE; + tio.Parity = NOPARITY; + tio.StopBits = ONESTOPBIT; + + if (SetCommState(socket->priv,&tio) == 0) { + PRINT("Serial device configuration failure (145) (%s)", strerror(errno)); + CloseHandle((HANDLE)socket->priv); + return (VP_COM_ERROR); + }; + + if(socket->type == VP_COM_CLIENT) { + if(FAILED(vp_com_serial_write_sync(config, socket))) return (VP_COM_ERROR); + vp_os_delay(VP_COM_SYNC_DELAY); + } else if(socket->type == VP_COM_SERVER) { + if(FAILED(vp_com_serial_wait_sync(config, socket))) return (VP_COM_ERROR); + vp_os_delay(VP_COM_SYNC_DELAY); + } + } + + tio.BaudRate = config->baudrate; + tio.fBinary = TRUE; + tio.fParity = FALSE; + tio.fOutxCtsFlow = FALSE; + tio.fOutxDsrFlow = FALSE; + tio.fDtrControl = DTR_CONTROL_DISABLE; + tio.fDsrSensitivity = FALSE; + tio.fTXContinueOnXoff = TRUE; + tio.fOutX = FALSE; + tio.fInX = FALSE; + tio.fErrorChar = FALSE; + tio.fNull = FALSE; + tio.fRtsControl = RTS_CONTROL_DISABLE; + tio.fAbortOnError = FALSE; + tio.Parity = NOPARITY; + tio.StopBits = ONESTOPBIT; + + if (SetCommState(socket->priv,&tio) == 0) { + PRINT("Serial device configuration failure (177) (%s)", strerror(errno)); + CloseHandle((HANDLE)socket->priv); + return (VP_COM_ERROR); + }; + + if(read) *read = (Read) vp_com_serial_read; + if(write) *write = (Write) vp_com_serial_write; + + return (VP_COM_OK); +} + +C_RESULT vp_com_serial_close(vp_com_socket_t* socket) +{ + if(SetCommState(socket->priv,&tio_save) == 0) + { + PRINT("Serial device configuration failure (191) (%s)", strerror(errno)); + CloseHandle((HANDLE)socket->priv); + return (VP_COM_ERROR); + } + + CloseHandle((HANDLE)socket->priv); + + return VP_COM_OK; +} + +C_RESULT vp_com_serial_wait_connections(vp_com_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + vp_os_memcpy(client, server, sizeof(vp_com_socket_t)); + return VP_COM_OK; +} + +C_RESULT vp_com_serial_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ + // nothing + return VP_COM_OK; +} + +C_RESULT vp_com_serial_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + // nothing + return VP_COM_OK; +} + +// Static functions ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static C_RESULT vp_com_serial_read (vp_com_socket_t* socket, int8_t* buffer, int32_t* size) +{ + uint32_t byte_read = 0; + if (ReadFile((HANDLE)socket->priv, buffer, *size, &byte_read, 0) == 0) { + if (errno != EAGAIN) return VP_COM_ERROR; + else *size = 0; + } else *size = byte_read; + return VP_COM_OK; +} + +static C_RESULT vp_com_serial_write(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size) +{ + uint32_t remain = *size, written = 0; + while (remain > 0) { + if (WriteFile((HANDLE)socket->priv, buffer + (*size-remain), remain, &written, 0) == 0) { + if (errno != EAGAIN) return VP_COM_ERROR; + else written = 0; + }; + remain -= written; + }; + + return VP_COM_OK; +} + +static C_RESULT vp_com_serial_wait_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket) +{ + uint32_t nb; + uint8_t c; + + vp_os_mutex_lock(&wait_sync_mutex); + + if (!config->sync_done) { + nb = 0; + do { + if (ReadFile((HANDLE)socket->priv, &c, sizeof(int8_t), 0, 0) == 0) return (FAIL); + if (c == (VP_COM_SYNC_STRING)[nb]) { + nb++; + } else { + nb = 0; + } + } while(nb != sizeof(VP_COM_SYNC_STRING)); + config->sync_done = 1; + } + + vp_os_mutex_unlock(&wait_sync_mutex); + + return (SUCCESS); +} + +static C_RESULT vp_com_serial_write_sync(vp_com_serial_config_t* config, vp_com_socket_t* socket) +{ + uint32_t i; + uint8_t c; + + vp_os_mutex_lock(&write_sync_mutex); + + if(!config->sync_done) { + for(i = 0 ; i < sizeof(VP_COM_SYNC_STRING) ; i++) { + c = (VP_COM_SYNC_STRING)[i]; + if (WriteFile((HANDLE)socket->priv, &c, sizeof(int8_t), 0, 0) == 0) return (FAIL); + } + } + + config->sync_done = 1; + + vp_os_mutex_unlock(&write_sync_mutex); + + return (SUCCESS); +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket.c b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket.c new file mode 100755 index 0000000..9bd2cdf --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket.c @@ -0,0 +1,659 @@ +#include +#include +#include + +#include +#include +#include + +#include +#include + + + +#if defined(_WIN32) +typedef int socklen_t; +#define MSG_NOSIGNAL 0 + + + + +C_RESULT vp_com_open_socket(vp_com_socket_t* sck, Read* read, Write* write) +{ + C_RESULT res = VP_COM_OK; + + BOOL reuseaddroption = TRUE; + BOOL exclusiveaddroption = FALSE; + + + SOCKET s = -1; + struct sockaddr_in name = { 0 }; + struct sockaddr_in local_address = { 0 }; + struct sockaddr_in remote_address = { 0 }; + int err; + int res_setsockopt=0,res_connect=0,res_bind=0; + + switch( sck->protocol ) + { + case VP_COM_TCP: + s = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ); + res = ( s == INVALID_SOCKET ) ? VP_COM_ERROR : VP_COM_OK; + break; + + case VP_COM_UDP: + s = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP ); + sck->scn = inet_addr(sck->serverHost); // Cache destination in int format + res = ( s == INVALID_SOCKET ) ? VP_COM_ERROR : VP_COM_OK; + break; + + default: + sck->type = VP_COM_CLIENT; + res = VP_COM_PARAMERROR; + break; + } + + if( VP_FAILED(res) ) + { + PRINT("\nSocket opening failed\n"); + } + + VP_COM_CHECK( res ); + + // res_setsockopt = setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char*)&reuseaddroption,sizeof(reuseaddroption)); + res_setsockopt = setsockopt(s,SOL_SOCKET,SO_EXCLUSIVEADDRUSE,(char*)&exclusiveaddroption,sizeof(exclusiveaddroption)); + + name.sin_family = AF_INET; + name.sin_port = htons( sck->port ); + switch( sck->type ) + { + case VP_COM_CLIENT: + remote_address.sin_family = AF_INET; + remote_address.sin_port = htons( sck->port ); + remote_address.sin_addr.s_addr = inet_addr(sck->serverHost); + + if ( sck->protocol ==VP_COM_UDP) + { + local_address.sin_addr.s_addr= INADDR_ANY; + local_address.sin_family = AF_INET; + local_address.sin_port = htons( sck->port ); /* Bind to any available port */ + res_bind = bind(s,(const struct sockaddr*)&local_address,sizeof(local_address)); + err = WSAGetLastError(); + res = (res_bind==0)? VP_COM_OK : VP_COM_ERROR; /* Convert from Win32 error code to VP SDK error code */ + } + + if (VP_SUCCEEDED(res))// && (sck->protocol !=VP_COM_UDP)) + { + res_connect = connect( s, (struct sockaddr*)&remote_address, sizeof( remote_address ) ); + if( res_connect == -1 ){ res = VP_COM_ERROR; err = WSAGetLastError(); } + } + + break; + + case VP_COM_SERVER: + /* Local TCP/UDP address on which we wait for connections */ + local_address.sin_family = AF_INET; + local_address.sin_port = htons( sck->port ); + local_address.sin_addr.s_addr = INADDR_ANY; /* Accept connections on any network interface */ + res_bind = bind( s, (const struct sockaddr*)&local_address, sizeof(local_address) ); + res = (res_bind==0)? VP_COM_OK : VP_COM_ERROR ; /* Convert from Win32 error code to VP SDK error code */ + break; + + default: + res = VP_COM_PARAMERROR; + break; + } + + if(res == VP_COM_OK) + { + sck->priv = (void*) s; + + switch( sck->protocol ) + { + case VP_COM_TCP: + if(read) *read = (Read) vp_com_read_socket; + if(write) *write = (Write) vp_com_write_socket; + break; + + case VP_COM_UDP: + if(read) *read = (Read) vp_com_read_udp_socket; + if(write) *write = (Write) vp_com_write_udp_socket; + break; + + default: + if(read) *read = NULL; + if(write) *write = NULL; + break; + } + } + else + { + closesocket( s ); + } + + if (sck->block != VP_COM_DEFAULT && + sck->block != VP_COM_WAITALL && + sck->block != VP_COM_DONTWAIT) + { + sck->block = VP_COM_DEFAULT; + } + + return res; +} + +C_RESULT vp_com_close_socket(vp_com_socket_t* socket) +{ + if(socket == NULL) + return VP_COM_PARAMERROR; + + // shutdown( (int) socket->priv, SHUT_RDWR ); + closesocket( (int) socket->priv ); + + socket->priv = NULL; + + return VP_COM_OK; +} + +C_RESULT vp_com_wait_socket(vp_com_socket_t* server, vp_com_socket_t* client, int32_t queue_length) +{ + int s; + int c=0; + int l = sizeof(struct sockaddr_in); + struct sockaddr_in raddr = { 0 }; // remote address + + C_RESULT res = VP_COM_OK; + + if(server == NULL) + return VP_COM_PARAMERROR; + + s = (int) server->priv; + c = 0; + + + server->queue_length = queue_length; + + listen(s, queue_length); + c = accept( s, (struct sockaddr*)&raddr, &l ); + if( c < 0 ) + res = VP_COM_ERROR; + + if(VP_SUCCEEDED( res )) + { + vp_os_memcpy( client, server, sizeof(vp_com_socket_t) ); + client->priv = (void*) c; + } + + return res; +} + +#endif + +C_RESULT vp_com_sockopt_ip(vp_com_t* vp_com, vp_com_socket_t* socket, VP_COM_SOCKET_OPTIONS options) +{ + C_RESULT res = VP_COM_ERROR; + int s = (int) socket->priv; + + if( options & VP_COM_NON_BLOCKING ) + { +/*#ifndef USE_MINGW32 + int32_t arg = 1; + + PRINT("Setting socket %d to non blocking\n", s); + res = ioctl( s, FIONBIO, &arg ) < 0 ? C_FAIL : C_OK; +#endif*/ + + if( VP_FAILED(res) ) + PRINT("error setting non blocking\n"); + } + + if( options & VP_COM_NO_DELAY ) + { + int32_t flag = 1; + + PRINT("Disabling the Nagle (TCP No Delay) algorithm for socket %d\n", s); + + res = setsockopt( s, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag) ) < 0 ? C_FAIL : C_OK; + + if( VP_FAILED(res) ) + PRINT("error disabling the Nagle algorithm\n"); + } + +/* +#ifdef __linux__ + flags = fcntl(s, F_GETFL, 0); +#endif // __linux__ + if( flags >= 0 ) + { + flags |= O_NONBLOCK; + + flags = fcntl(s, F_SETFL, flags ); + + res = VP_COM_OK; + } + else + { + DEBUG_PRINT_SDK("Get Socket Options failed because of %d\n", errno); + } +*/ + + return res; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + + +C_RESULT vp_com_read_udp_socket(vp_com_socket_t* sck, int8_t* buffer, int32_t* size) +{ + C_RESULT res; + int s = (int) sck->priv; + struct sockaddr_in from; + int err; + + socklen_t from_len = sizeof(from); + + int flags = 0; + if (VP_COM_WAITALL == sck->block) + flags |= MSG_WAITALL; + else if (VP_COM_DONTWAIT == sck->block) + { + u_long iMode = 1; + ioctlsocket (s, FIONBIO, &iMode); + } + + if(s >= 0) + { + res = VP_COM_OK; + + *size = recvfrom(s, (char*)buffer, *size, flags, (struct sockaddr*)&from, &from_len ); + + + if(*size < 0) + { + + switch( err=WSAGetLastError() ) + { + case WSAEOPNOTSUPP: + PRINT("MSG_NOSIGNAL is not supported on this platform\n"); + res = VP_COM_ERROR; + break; + + case WSAEINTR: + *size = 0; + break; + + case WSAENETDOWN: + case WSAETIMEDOUT: + PRINT("Connection timed out\n"); + res = VP_COM_ERROR; + break; + case WSAECONNRESET: + PRINT("Connection with peer is not enabled\n"); + res = VP_COM_ERROR; + break; + } + + } + else + { + //sck->scn = from.sin_addr.s_addr; + //sck->port = ntohs(from.sin_port); + } + } + else + { + res = VP_COM_ERROR; + } + + if (VP_COM_DONTWAIT == sck->block) + { + u_long iMode = 0; + ioctlsocket (s, FIONBIO, &iMode); + } + + + return res; +} + +C_RESULT vp_com_make_udp_target( vp_com_socket_t* sck ) +{ + C_RESULT res = C_FAIL; + + if( sck->protocol == VP_COM_UDP ) + { + sck->scn = inet_addr(sck->serverHost); // We use scn field to store ip in order to avoid a call to inet_addr each time we call write + res = C_OK; + } + + return res; +} + +C_RESULT vp_com_write_udp_socket(vp_com_socket_t* sck, const int8_t* buffer, int32_t* size) +{ + C_RESULT res; + int s = (int) sck->priv; + struct sockaddr_in to; + + int flags = 0; + if (VP_COM_WAITALL == sck->block) + flags |= MSG_WAITALL; + else if (VP_COM_DONTWAIT == sck->block) + { + u_long iMode = 1; + ioctlsocket (s, FIONBIO, &iMode); + } + + if(s >= 0) + { + res = VP_COM_OK; + + vp_os_memset( (char*)&to, 0, sizeof(to) ); + to.sin_family = AF_INET; + to.sin_addr.s_addr = sck->scn; + to.sin_port = htons(sck->port); + + //*size = sendto( s, (char*)buffer, *size, 0, (struct sockaddr*)&to, sizeof(to) ); + *size = send( s, (char*)buffer, *size, flags); + + if(*size < 0) + { + + + switch( WSAGetLastError() ) + { + case WSAEOPNOTSUPP: + PRINT("MSG_NOSIGNAL is not supported on this platform\n"); + res = VP_COM_ERROR; + break; + + case WSAEINTR: + *size = 0; + break; + + case WSAENETDOWN: + case WSAETIMEDOUT: + case WSAECONNRESET: + PRINT("Connection with peer is not enabled\n"); + res = VP_COM_ERROR; + break; + } + + } + } + else + { + res = VP_COM_ERROR; + } + + if (VP_COM_DONTWAIT == sck->block) + { + u_long iMode = 0; + ioctlsocket (s, FIONBIO, &iMode); + } + + return res; +} + +C_RESULT vp_com_read_socket(vp_com_socket_t* socket, int8_t* buffer, int32_t* size) +{ + C_RESULT res; + SOCKET s = (SOCKET) socket->priv; + + int flags = 0; + if (VP_COM_WAITALL == socket->block) + flags |= MSG_WAITALL; + else if (VP_COM_DONTWAIT == socket->block) + { + u_long iMode = 1; + ioctlsocket (s, FIONBIO, &iMode); + } + + if(s >= 0) + { + res = VP_COM_OK; + *size = /*read*/recv(s, buffer, *size, flags); + if(*size < 0) + { + if( errno == EAGAIN ) + { + *size = 0; + } + else + { + res = VP_COM_ERROR; + } + } + } + else + { + res = VP_COM_ERROR; + } + + if (VP_COM_DONTWAIT == socket->block) + { + u_long iMode = 0; + ioctlsocket (s, FIONBIO, &iMode); + } + + return res; +} + +C_RESULT vp_com_write_socket(vp_com_socket_t* socket, const int8_t* buffer, int32_t* size) +{ + C_RESULT res; + SOCKET s = (SOCKET) socket->priv; + + int flags = 0; + if (VP_COM_WAITALL == socket->block) + flags |= MSG_WAITALL; + else if (VP_COM_DONTWAIT == socket->block) + { + u_long iMode = 1; + ioctlsocket (s, FIONBIO, &iMode); + } + + if(s >= 0) + { + res = VP_COM_OK; + *size = send(s, buffer, *size, flags); + if(*size < 0) + { + if( errno == EAGAIN ) + { + *size = 0; + } + else + { + res = VP_COM_ERROR; + } + } + } + else + { + res = VP_COM_ERROR; + } + + if (VP_COM_DONTWAIT == socket->block) + { + u_long iMode = 0; + ioctlsocket (s, FIONBIO, &iMode); + } + + return res; +} + + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static vp_os_mutex_t server_initialisation_mutex; +static vp_os_cond_t server_initialisation_wait; +static bool_t server_init_not_finished = FALSE; + +C_RESULT vp_com_init_server(void) +{ + server_init_not_finished = TRUE; + vp_os_mutex_init(&server_initialisation_mutex); + vp_os_cond_init(&server_initialisation_wait, &server_initialisation_mutex); + + return C_OK; +} + +C_RESULT vp_com_wait_for_server_up(void) +{ + if( server_init_not_finished ) + { + vp_os_mutex_lock(&server_initialisation_mutex); + vp_os_cond_wait(&server_initialisation_wait); + vp_os_mutex_unlock(&server_initialisation_mutex); + } + + return C_OK; +} + +C_RESULT vp_com_timed_wait_for_server_up(uint32_t ms) +{ + C_RESULT res = C_OK; + + if( server_init_not_finished ) + { + vp_os_mutex_lock(&server_initialisation_mutex); + res = vp_os_cond_timed_wait(&server_initialisation_wait, ms); + vp_os_mutex_unlock(&server_initialisation_mutex); + } + + return res; +} + +extern int32_t vp_com_fill_read_fs(vp_com_socket_t* sockets, int32_t num_sockets, int32_t max, fd_set* read_fs ); +extern void vp_com_close_client_sockets(vp_com_socket_t* client_sockets, int32_t num_client_sockets); +extern C_RESULT vp_com_client_open_socket(vp_com_socket_t* server_socket, vp_com_socket_t* client_socket); +extern void vp_com_client_receive( vp_com_socket_t *client_socket ); + +DEFINE_THREAD_ROUTINE_STACK( vp_com_server, thread_params, VP_COM_THREAD_SERVER_STACK_SIZE ) +{ + + vp_com_socket_t client_sockets[VP_COM_THREAD_NUM_MAX_CLIENTS]; + struct timeval tv, *ptv; + + // This thread setup connection then loop & wait for a socket event + vp_com_server_thread_param_t* params = (vp_com_server_thread_param_t*) thread_params; + + int32_t i, rc, ncs, s, max = 0, num_server_sockets = params->num_servers, num_client_sockets = 0; + vp_com_socket_t* server_sockets = params->servers; + fd_set read_fs; + + vp_os_memset( client_sockets, 0, sizeof( client_sockets )); + + if(VP_FAILED(vp_com_init(params->com))) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to init com\n"); + vp_com_shutdown(params->com); + } + else if(VP_FAILED(vp_com_local_config(params->com, params->config))) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to configure com\n"); + vp_com_shutdown(params->com); + } + else if(VP_FAILED(vp_com_connect(params->com, params->connection, 1))) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to connect\n"); + vp_com_shutdown(params->com); + } + else + { + vp_os_mutex_lock(&server_initialisation_mutex); + vp_os_cond_signal(&server_initialisation_wait); + vp_os_mutex_unlock(&server_initialisation_mutex); + + server_init_not_finished = FALSE; + + for( i = 0; i < num_server_sockets; i++ ) + { + if(VP_FAILED( vp_com_open_socket(&server_sockets[i], NULL, NULL) )) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Unable to open server socket\n"); + server_sockets[i].is_disable = TRUE; + } + else + { + listen((int32_t)server_sockets[i].priv, server_sockets[i].queue_length); + } + } + + params->run = TRUE; + + while( params->run == TRUE ) + { + if( params->timer_enable == FALSE || ( params->wait_sec == 0 && params->wait_usec == 0 ) ) + { + ptv = NULL; + } + else + { + tv.tv_sec = params->wait_sec; + tv.tv_usec = params->wait_usec; + ptv = &tv; + } + + FD_ZERO(&read_fs); + max = vp_com_fill_read_fs( &server_sockets[0], num_server_sockets, 0, &read_fs ); + max = vp_com_fill_read_fs( &client_sockets[0], num_client_sockets, max, &read_fs ); + + rc = select( max + 1, &read_fs, NULL, NULL, ptv ); + if( rc == -1 && ( errno == EINTR || errno == EAGAIN ) ) + continue; + + if( rc == 0 ) + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] select timeout\n"); + + vp_com_close_client_sockets(&client_sockets[0], num_client_sockets); + num_client_sockets = 0; + + params->timer_enable = FALSE; + vp_os_memset( client_sockets, 0, sizeof( client_sockets )); + } + + for( i = 0; i < num_server_sockets && rc != 0; i++ ) + { + s = (int32_t) server_sockets[i].priv; + + if( ( !server_sockets[i].is_disable ) && FD_ISSET( s, &read_fs) ) + { + rc --; + + // Recycle previously released sockets + for( ncs = 0; ncs < num_client_sockets && client_sockets[ncs].priv != NULL; ncs++ ); + + if( ncs < VP_COM_THREAD_NUM_MAX_CLIENTS) + { + if( VP_SUCCEEDED(vp_com_client_open_socket(&server_sockets[i], &client_sockets[ncs])) && ( ncs == num_client_sockets ) ) + num_client_sockets ++; + } + } + } + + for( i = 0; i < num_client_sockets && rc != 0; i++ ) + { + s = (int32_t) client_sockets[i].priv; + if( ( !client_sockets[i].is_disable ) && FD_ISSET( s, &read_fs) ) + { + rc--; + + vp_com_client_receive( &client_sockets[i] ); + } + } + } + + for( i = 0; i < num_server_sockets; i++ ) + { + vp_com_close_socket(&server_sockets[i]); + } + } + + vp_com_disconnect(params->com); + vp_com_shutdown(params->com); + + + THREAD_RETURN( 0 ); +} diff --git a/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket_utils.c b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket_utils.c new file mode 100755 index 0000000..f0c79f7 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_socket_utils.c @@ -0,0 +1,129 @@ +#ifdef _WIN32 + +#include +#include + +#include +#include +#include + +#include +#include + + +typedef int socklen_t; + +int32_t vp_com_fill_read_fs(vp_com_socket_t* sockets, int32_t num_sockets, int32_t max, fd_set* read_fs ) +{ + while( num_sockets > 0 ) + { + if( !sockets->is_disable ) + { + int32_t s = (int32_t) sockets->priv; + + FD_SET( s, read_fs); // add the socket + + if( s > max ) + max = s; + } + + sockets ++; + num_sockets--; + } + + return max; +} + +void vp_com_close_client_sockets(vp_com_socket_t* client_sockets, int32_t num_client_sockets) +{ + int32_t s; + + // Select timed out - We close all sockets because it should mean we lost connection with client + while( num_client_sockets > 0 ) + { + if( !client_sockets->is_disable ) + { + s = (int32_t) client_sockets->priv; + + DEBUG_PRINT_SDK("[VP_COM_SERVER] Closing socket %d\n", (int)s); + + client_sockets->select( client_sockets->server, + client_sockets, + VP_COM_SOCKET_SELECT_DISABLE, + (Write) vp_com_write_socket ); + + if( client_sockets->protocol == VP_COM_TCP ) + { + closesocket( s ); + } + + vp_os_memset( client_sockets, 0, sizeof(vp_com_socket_t) ); + client_sockets->is_disable = TRUE; + } + + client_sockets++; + num_client_sockets--; + } +} + +C_RESULT vp_com_client_open_socket(vp_com_socket_t* server_socket, vp_com_socket_t* client_socket) +{ + C_RESULT res; + struct sockaddr_in raddr = { 0 }; // remote address + + socklen_t l = sizeof(raddr); + int32_t s = (int32_t) server_socket->priv; + + Write write = (Write) (server_socket->protocol == VP_COM_TCP ? vp_com_write_socket : vp_com_write_udp_socket); + + vp_os_memcpy( client_socket, server_socket, sizeof(vp_com_socket_t) ); + + res = server_socket->select( server_socket, client_socket, VP_COM_SOCKET_SELECT_ENABLE, write ); + + if( VP_SUCCEEDED(res) ) + { + if( server_socket->protocol == VP_COM_TCP ) + { + client_socket->priv = (void*)accept( s, (struct sockaddr*)&raddr, &l ); + } + + DEBUG_PRINT_SDK("[VP_COM_SERVER] Opening socket for server %d\n", (int)s); + + client_socket->server = server_socket; + } + else + { + DEBUG_PRINT_SDK("[VP_COM_SERVER] Failed to open socket for server %d\n", (int)s); + vp_os_memset( client_socket, 0, sizeof(vp_com_socket_t) ); + } + + return res; +} + +void vp_com_client_receive( vp_com_socket_t *client_socket ) +{ + static int8_t local_buffer[VP_COM_THREAD_LOCAL_BUFFER_MAX_SIZE]; + struct sockaddr from; + socklen_t fromlen; + int32_t s, received; + + s = (int32_t) client_socket->priv; + + fromlen = sizeof(from); + received = recvfrom(s, (char*)local_buffer, sizeof(local_buffer)/*VP_COM_THREAD_LOCAL_BUFFER_MAX_SIZE*/, 0, &from, &fromlen); + + if( received == 0 ) + { + client_socket->select( client_socket->server, client_socket, VP_COM_SOCKET_SELECT_DISABLE, (Write) vp_com_write_socket ); + closesocket( s ); + vp_os_memset( client_socket, 0, sizeof(vp_com_socket_t) ); + client_socket->is_disable = TRUE; + } + else if( client_socket->read != NULL ) + { + client_socket->read( (void*) client_socket, local_buffer, &received, ((struct sockaddr_in*)&from)->sin_addr.s_addr ); + } +} + + +#endif diff --git a/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_wifi.c b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_wifi.c new file mode 100755 index 0000000..befd155 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Com/win32/vp_com_wifi.c @@ -0,0 +1,233 @@ +#include +#include + +#include + +#ifndef _WIN32 +#include +#else +#include "vp_com_config_itf.h" +#endif + +#include +#include +#include + +#ifdef USE_IWLIB +# include +#endif + +#ifndef _WIN32 + #include + #include + + #include + #include + + #ifndef PROC_NET_WIRELESS + #define PROC_NET_WIRELESS "/proc/net/wireless" + #endif + +#endif + + + +C_RESULT vp_com_wf_init(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_shutdown(void) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_network_adapter_lookup(vp_com_network_adapter_lookup_t callback) +{ +#ifdef USE_IWLIB + char buff[1024]; + char* ret=NULL; + + FILE* fh = fopen( PROC_NET_WIRELESS, "r" ); + + if(fh != NULL) + { + ret=fgets( buff, sizeof(buff), fh ); + + ret=fgets( buff, sizeof(buff), fh ); + while( fgets( buff, sizeof(buff), fh ) ) + { + char name[IFNAMSIZ + 1]; + char *s = buff; // start + char *e = buff + strlen(buff); // end + + vp_os_memset( name, 0, IFNAMSIZ + 1 ); + + while( *s == ' ') s++; // skip leading separator + + while( e != s ) + { + if( *e == ':' ) + break; + e--; + } + + if( e != s ) + { // it's a valid name + strncpy( name, s, e - s ); + callback( name ); + } + } + + fclose( fh ); + + } +#endif + return VP_COM_OK; +} + +C_RESULT vp_com_wf_inquire(const char* deviceName, vp_com_inquiry_t callback, uint32_t timeout) +{ + return VP_COM_OK; +} + +C_RESULT vp_com_wf_local_config(vp_com_wifi_config_t* cfg) +{ + return vp_com_config_itf( cfg->itfName, cfg->localHost, cfg->broadcast, cfg->netmask ) < 0 ? VP_COM_ERROR : VP_COM_OK; +} + +C_RESULT vp_com_wf_connect(vp_com_t* vp_com, vp_com_wifi_connection_t* connection, int32_t numAttempts) +{ + C_RESULT res = VP_COM_OK; +#ifdef USE_IWLIB + int32_t wlsock; + vp_com_wifi_config_t* config = (vp_com_wifi_config_t*)vp_com->config; + wireless_config iwconf; + + wlsock = iw_sockets_open(); + + res = ( wlsock < 0 ) ? VP_COM_ERROR : VP_COM_OK; + VP_COM_CHECK( res ); + + iw_get_basic_config( wlsock, config->itfName, &iwconf ); + + iwconf.has_nwid = 0; + iwconf.has_freq = 0; + iwconf.has_key = 0; + + iwconf.has_mode = 1; + iwconf.mode = config->infrastructure ? IW_MODE_INFRA : IW_MODE_ADHOC; + + iwconf.has_essid = 1; + iwconf.essid_on = 1; + strncpy( &iwconf.essid[0], connection->networkName, IW_ESSID_MAX_SIZE+1 ); + + res = iw_set_basic_config( wlsock, config->itfName, &iwconf ) < 0 ? C_FAIL : C_OK; + + if( VP_SUCCEEDED(res) ) + PRINT(" OK!\n"); + else + PRINT(" VP_FAILED!\n"); + + iw_sockets_close(wlsock); + +#endif + return res; +} + +C_RESULT vp_com_wf_disconnect(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection) +{ + C_RESULT res = VP_COM_OK; +#ifdef USE_IWLIB + struct iwreq wrq; + char essid[IW_ESSID_MAX_SIZE + 1]; + + int wlsock = iw_sockets_open(); + + vp_os_memset(&wrq, 0, sizeof(struct iwreq)); + + strncpy(essid, connection->networkName, strlen(connection->networkName)); + wrq.u.essid.flags = 0; + wrq.u.essid.pointer = (caddr_t) essid; + wrq.u.essid.length = strlen(essid); + if(iw_get_kernel_we_version() < 21) + wrq.u.essid.length++; // Get version from kernel, device may not have range... + + res = ( iw_set_ext( wlsock, config->itfName, SIOCSIWESSID, &wrq) < 0 ) ? VP_COM_ERROR : VP_COM_OK; + + iw_sockets_close(wlsock); +#endif + + return res; +} + +C_RESULT vp_com_wf_get_rssi(vp_com_wifi_config_t* cfg, int32_t* rssi) +{ +#ifdef USE_IWLIB + struct iwreq wrq; + iwstats stats; + iwrange range; + + int wlsock = iw_sockets_open(); + + vp_os_memset(&wrq, 0, sizeof(struct iwreq)); + iw_get_stats(wlsock, cfg->itfName, &stats, &range, 1); + iw_sockets_close(wlsock); + +// struct iw_statistics +// { +// __u16 status; // Status * - device dependent for now +// struct iw_quality qual; // Quality of the link * (instant/mean/max) +// struct iw_discarded discard; // Packet discarded counts +// struct iw_missed miss; // Packet missed counts +// }; +// +// struct iw_range +// { +// ... +// // Quality of link & SNR stuff */ +// // Quality range (link, level, noise) +// // If the quality is absolute, it will be in the range [0 ; max_qual], +// // if the quality is dBm, it will be in the range [max_qual ; 0]. +// // Don't forget that we use 8 bit arithmetics... +// struct iw_quality max_qual; // Quality of the link +// // This should contain the average/typical values of the quality +// // indicator. This should be the threshold between a "good" and +// // a "bad" link (example : monitor going from green to orange). +// // Currently, user space apps like quality monitors don't have any +// // way to calibrate the measurement. With this, they can split +// // the range between 0 and max_qual in different quality level +// // (using a geometric subdivision centered on the average). +// // I expect that people doing the user space apps will feedback +// // us on which value we need to put in each driver... +// struct iw_quality avg_qual; // Quality of the link +// ... +// }; +// struct iw_quality +// { +// __u8 qual; // link quality (%retries, SNR, %missed beacons or better...) +// __u8 level; // signal level (dBm) +// __u8 noise; // noise level (dBm) +// __u8 updated; // Flags to know if updated +// }; + + *rssi = stats.qual.qual; + +#endif + return VP_COM_OK; +} + +C_RESULT vp_com_wf_wait_connections(vp_com_wifi_connection_t** c, vp_com_socket_t* server, vp_com_socket_t* client, int32_t queueLength) +{ + return vp_com_wait_socket(server, client, queueLength); +} + +C_RESULT vp_com_wf_open(vp_com_wifi_config_t* config, vp_com_wifi_connection_t* connection, vp_com_socket_t* sck, Read* read, Write* write) +{ + return vp_com_open_socket(sck, read, write); +} + +C_RESULT vp_com_wf_close(vp_com_socket_t* socket) +{ + return vp_com_close_socket(socket); +} diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/intrin.h b/ARDroneLib/VP_SDK/VP_Os/elinux/intrin.h new file mode 100644 index 0000000..178b006 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/intrin.h @@ -0,0 +1,8 @@ + +#ifndef _ELINUX_INTRIN_H_ +#define _ELINUX_INTRIN_H_ + +#include + +#endif // _ELINUX_INTRIN_H_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_delay.c b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_delay.c new file mode 100644 index 0000000..66289cd --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_delay.c @@ -0,0 +1,20 @@ +/** + * @file delay.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include + +#include "VP_Os/vp_os_delay.h" + +void vp_os_delay(uint32_t ms) +{ + usleep(1000*ms); +} + +void vp_os_delay_us(uint32_t us) +{ + usleep(us); +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.c b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.c new file mode 100644 index 0000000..bb97683 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.c @@ -0,0 +1,3 @@ +#include "vp_os_ltt.h" + +int fd_ltt=-1; diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.h b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.h new file mode 100644 index 0000000..5f54fef --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_ltt.h @@ -0,0 +1,22 @@ +/* + * vp_os_ltt.h + * + * Created on: Sep 15, 2009 + * Author: pierre + */ +//#define LTT_TRACE +#ifndef VP_OS_LTT_H_ +#define VP_OS_LTT_H_ + +#if defined(LTT_TRACE) && defined (USE_ELINUX) +#include +extern int fd_ltt; +# define LTT_START() if (fd_ltt == -1)fd_ltt = trace_open(); +# define LTT_STOP() trace_close(fd_ltt);fd_ltt=-1; +# define LTT_WRITEF(...) if (fd_ltt!=-1)trace_writef(fd_ltt,__VA_ARGS__); +#else +# define LTT_START() do{}while(0) +# define LTT_STOP() do{}while(0) +# define LTT_WRITEF(...) do{}while(0) +#endif +#endif diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_serial.h b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_serial.h new file mode 100644 index 0000000..2b13162 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_serial.h @@ -0,0 +1,52 @@ +/** + * \brief Baudrate definitions. + * \author Aurelien Morelle + * \version 1.0 + * \date 25/07/2007 + */ + +#ifndef _VP_OS_SERIAL_H_ +#define _VP_OS_SERIAL_H_ + +#include + +typedef enum _vp_com_baudrates_ +{ + VP_COM_BAUDRATE_0 = B0, // hang up + VP_COM_BAUDRATE_50 = B50, + VP_COM_BAUDRATE_75 = B75, + VP_COM_BAUDRATE_110 = B110, + VP_COM_BAUDRATE_134 = B134, + VP_COM_BAUDRATE_150 = B150, + VP_COM_BAUDRATE_200 = B200, + VP_COM_BAUDRATE_300 = B300, + VP_COM_BAUDRATE_600 = B600, + VP_COM_BAUDRATE_1200 = B1200, + VP_COM_BAUDRATE_1800 = B1800, + VP_COM_BAUDRATE_2400 = B2400, + VP_COM_BAUDRATE_3600 = B0, // not supported, so hang up + VP_COM_BAUDRATE_4800 = B4800, + VP_COM_BAUDRATE_7200 = B0, // not supported, so hang up + VP_COM_BAUDRATE_9600 = B9600, + VP_COM_BAUDRATE_14400 = B0, // not supported, so hang up + VP_COM_BAUDRATE_19200 = B19200, + VP_COM_BAUDRATE_38400 = B38400, + VP_COM_BAUDRATE_57600 = B57600, + VP_COM_BAUDRATE_115200 = B115200, + VP_COM_BAUDRATE_230400 = B230400, + VP_COM_BAUDRATE_460800 = B460800, + VP_COM_BAUDRATE_500000 = B500000, + VP_COM_BAUDRATE_576000 = B576000, + VP_COM_BAUDRATE_921600 = B921600, + VP_COM_BAUDRATE_1000000 = B1000000, + VP_COM_BAUDRATE_1152000 = B1152000, + VP_COM_BAUDRATE_1500000 = B1500000, + VP_COM_BAUDRATE_2000000 = B2000000, + VP_COM_BAUDRATE_2500000 = B2500000, + VP_COM_BAUDRATE_3000000 = B3000000, + VP_COM_BAUDRATE_3500000 = B3500000, + VP_COM_BAUDRATE_4000000 = B4000000, +} +vp_com_baudrate_t; + +#endif // _VP_OS_SERIAL_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal.c b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal.c new file mode 100644 index 0000000..00381fb --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal.c @@ -0,0 +1,95 @@ +/** + * @file signal.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include "VP_Os/vp_os_signal.h" + +#ifndef __USE_GNU +#define __USE_GNU +#endif +#include +#include + +void +vp_os_mutex_init(vp_os_mutex_t *mutex) +{ + pthread_mutex_init((pthread_mutex_t *)mutex, NULL); +} + + +void +vp_os_mutex_destroy(vp_os_mutex_t *mutex) +{ + pthread_mutex_destroy((pthread_mutex_t *)mutex); +} + + +void +vp_os_mutex_lock(vp_os_mutex_t *mutex) +{ + pthread_mutex_lock((pthread_mutex_t *)mutex); +} + +C_RESULT +vp_os_mutex_trylock(vp_os_mutex_t *mutex) +{ + return pthread_mutex_trylock((pthread_mutex_t *)mutex) ? C_FAIL : C_OK; +} + +void +vp_os_mutex_unlock(vp_os_mutex_t *mutex) +{ + pthread_mutex_unlock((pthread_mutex_t *)mutex); +} + + +void +vp_os_cond_init(vp_os_cond_t *cond, vp_os_mutex_t *mutex) +{ + pthread_cond_init(&cond->cond, NULL); + cond->mutex = mutex; +} + + +void +vp_os_cond_destroy(vp_os_cond_t *cond) +{ + pthread_cond_destroy(&cond->cond); +} + + +void +vp_os_cond_wait(vp_os_cond_t *cond) +{ + pthread_cond_wait(&cond->cond, (pthread_mutex_t *)cond->mutex); +} + + +C_RESULT +vp_os_cond_timed_wait(vp_os_cond_t *cond, uint32_t ms) +{ + struct timespec ts; + struct timeval tv; + gettimeofday(&tv, NULL); + TIMEVAL_TO_TIMESPEC(&tv, &ts); +/* ts.tv_sec += ms/1000; +// ts.tv_nsec += (ms%1000)*1000; + ts.tv_nsec += (ms%1000)*1000000;*/ + + int tmp; + ts.tv_nsec += ms * 1000000; + tmp = ts.tv_nsec / (1000 * 1000000); + ts.tv_sec += tmp; + ts.tv_nsec -= tmp * (1000 * 1000000); + return ( pthread_cond_timedwait(&cond->cond, (pthread_mutex_t *)cond->mutex, &ts) == ETIMEDOUT ? FAIL : SUCCESS ); +} + + +void +vp_os_cond_signal(vp_os_cond_t *cond) +{ + pthread_cond_signal(&cond->cond); +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal_dep.h b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal_dep.h new file mode 100644 index 0000000..d9feeb9 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_signal_dep.h @@ -0,0 +1,25 @@ +/** + * @file vp_os_signal_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _SIGNAL_INCLUDE_OS_DEP_ +#define _SIGNAL_INCLUDE_OS_DEP_ + + +#include + + +typedef pthread_mutex_t vp_os_mutex_t; + +typedef struct _vp_os_cond_t_ +{ + pthread_cond_t cond; + vp_os_mutex_t *mutex; +} +vp_os_cond_t; + + +#endif // ! _SIGNAL_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread.c b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread.c new file mode 100644 index 0000000..074f7d0 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread.c @@ -0,0 +1,231 @@ +/** + * @file thread.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include +#include +#include + +#include +#include +#include +#include + +#define SIGRESUME SIGUSR1 +#define SIGSUSPEND SIGUSR2 + +/*#define SUP_THREAD_MINPRIORITY 31 +#define SUP_THREAD_INVALID_HANDLE NULL*/ + +typedef struct _pthread_data_t +{ + THREAD_HANDLE handle; + pthread_attr_t attr; + uint32_t isSleeping; +} pthread_data_t; + +static const THREAD_HANDLE NULL_THREAD_HANDLE = 0; + +static uint32_t threadTabSize = 0; +static pthread_data_t* threadTab = NULL; + +static pthread_once_t once; +static vp_os_mutex_t thread_mutex; + + +#include +static void suspendSignalHandler(int sig) +{ + sigset_t signal_set; + + /* Block all signals except PTHREAD_RESUME while suspended. */ + sigfillset(&signal_set); + sigdelset(&signal_set, SIGRESUME); + sigsuspend(&signal_set); +} + +static void resumeSignalHandler(int sig) +{ +} + +static void init_thread(void) { + struct sigaction sigsuspend, sigresume; + + vp_os_mutex_init(&thread_mutex); + + sigresume.sa_flags = 0; + sigsuspend.sa_flags = 0; + + sigemptyset(&sigresume.sa_mask); + sigemptyset(&sigsuspend.sa_mask); + sigaddset(&sigsuspend.sa_mask, SIGSUSPEND); + sigaddset(&sigresume.sa_mask, SIGRESUME); + + sigresume.sa_handler = resumeSignalHandler; + sigsuspend.sa_handler = suspendSignalHandler; + + sigaction(SIGRESUME,&sigresume,NULL); + sigaction(SIGSUSPEND,&sigsuspend,NULL); +} + +static pthread_data_t* findThread(THREAD_HANDLE handle) +{ + uint32_t i = 0; + + if(threadTab == NULL) + return NULL; + + for(i = 0;i < threadTabSize;i++) + { + if( pthread_equal(handle,threadTab[i].handle) ) + return &threadTab[i]; + } + + return NULL; +} + +void +vp_os_thread_create(THREAD_ROUTINE f, THREAD_PARAMS parameters, THREAD_HANDLE *handle, ...) +{ + int32_t priority; + char* name; + void* stack_base; + unsigned int stack_size; + va_list va; + + pthread_data_t* freeSlot = NULL; + + pthread_once(&once,&init_thread); + + vp_os_mutex_lock(&thread_mutex); + + freeSlot = findThread( NULL_THREAD_HANDLE ); + while(freeSlot == NULL) + { + /* BUG Fix on 2010/07/19 : some data were written beyond the end of the array */ + + int old_size = threadTabSize; + threadTabSize += 128; + threadTab = ( pthread_data_t* )vp_os_realloc( threadTab, threadTabSize * sizeof( pthread_data_t ) ); + vp_os_memset( threadTab + old_size, 0, (threadTabSize-old_size) * sizeof( pthread_data_t ) ); + + freeSlot = findThread( NULL_THREAD_HANDLE ); + } + + vp_os_mutex_unlock(&thread_mutex); + + pthread_attr_init( &freeSlot->attr ); + + va_start(va, handle); + priority = va_arg(va, int32_t); + name = va_arg(va, char *); + stack_base = va_arg(va, void *); + stack_size = va_arg(va, unsigned int); +/* thread = va_arg(va, cyg_thread *);*/ + va_end(va); + + pthread_create( &freeSlot->handle, &freeSlot->attr, f, parameters); + + *handle = freeSlot->handle; + + vp_os_thread_priority(freeSlot->handle, priority); +} + +void +vp_os_thread_join(THREAD_HANDLE handle) +{ + PRINT("vp_os_thread_join\n %d\n", (int)handle); + + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + vp_os_mutex_unlock(&thread_mutex); + + if( freeSlot != NULL ) + { + void *res; + + vp_os_memset(freeSlot, 0, sizeof(pthread_data_t)); + pthread_join( handle, &res); + } +} + +THREAD_HANDLE +vp_os_thread_self(void) +{ + return pthread_self(); +} + +void +vp_os_thread_suspend(THREAD_HANDLE handle) +{ + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + vp_os_mutex_unlock(&thread_mutex); + + if( freeSlot != NULL ) + { + if(!freeSlot->isSleeping) + { + freeSlot->isSleeping = 1; + pthread_kill(handle,SIGSUSPEND); + } + } +} + +void +vp_os_thread_resume(THREAD_HANDLE handle) +{ + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + vp_os_mutex_unlock(&thread_mutex); + + if( freeSlot != NULL ) + { + if(freeSlot->isSleeping) + { + pthread_kill(handle,SIGRESUME); + freeSlot->isSleeping = 0; + } + } +} + +void +vp_os_thread_yield(void) +{ + sched_yield(); +} + +void +vp_os_thread_priority(THREAD_HANDLE handle, int32_t priority) +{ + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + vp_os_mutex_unlock(&thread_mutex); + + if( freeSlot != NULL ) + { + int rc, policy = SCHED_OTHER; + struct sched_param param; + + vp_os_memset(¶m, 0, sizeof(param)); + + rc = pthread_getschedparam(handle, &policy, ¶m); + + if( policy == SCHED_OTHER) + { + policy = SCHED_FIFO; + } + param.__sched_priority = 99-priority; + rc = pthread_setschedparam(handle, policy, ¶m); + } +} diff --git a/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread_dep.h b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread_dep.h new file mode 100644 index 0000000..bd7d203 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/elinux/vp_os_thread_dep.h @@ -0,0 +1,22 @@ +/** + * @file vp_os_thread_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _THREAD_INCLUDE_OS_DEP_ +#define _THREAD_INCLUDE_OS_DEP_ + + +#include + + +typedef pthread_t THREAD_HANDLE; +typedef void *THREAD_PARAMS; +typedef void *THREAD_RET; +typedef THREAD_RET (*THREAD_ROUTINE) (THREAD_PARAMS); + +#define THREAD_RETURN(value) return ((void*)value) + +#endif // ! _THREAD_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/linux/intrin.h b/ARDroneLib/VP_SDK/VP_Os/linux/intrin.h new file mode 100644 index 0000000..9e469a4 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/linux/intrin.h @@ -0,0 +1,96 @@ + +#ifndef __INTRIN__H__ +#define __INTRIN__H__ + +#include + +// #undef always_inline +#if defined(__GNUC__) + +#if TARGET_CPU_X86 == 1 + +static INLINE uint32_t _BitScanReverse(uint32_t* index, uint32_t mask) +{ + __asm__("bsrl %[mask], %[index]" : [index] "=r" (*index) : [mask] "mr" (mask)); + + return mask ? 1 : 0; +} + + +static INLINE uint32_t _byteswap_ulong(uint32_t value) +{ + __asm("bswap %0": + "=r" (value): + "0" (value)); + + return value; +} + +static inline uint32_t clz(uint32_t code) +{ + uint32_t index = 0; + if( code ) + { + _BitScanReverse(&index, code); + index ^= 31; + } + + return index; +} + +#endif // TARGET_CPU_X86 + +#if TARGET_CPU_ARM == 1 + +#ifdef TARGET_OS_IPHONE + +static INLINE uint32_t _byteswap_ulong(uint32_t value) +{ + uint32_t ret; + + __asm __volatile ( + " rev %0, %1\n" + : "=r" (ret) + : "r" (value) + ); + + return ret; +} + +#define usat16( value, imm ) __asm __volatile( "usat16 %0, %1, %0" : "=r" (value) : "0" (value), "I" (imm) ) +#define usat( value, imm, shift ) __asm __volatile( "usat %0, %2, %0, asr %3" :"=r" (value) :"0" (value), "I" (imm), "I" (shift) ) + +#define uxtb( ret, value, imm ) __asm __volatile ( "uxtb %0, %1, ror %2" : "=r" (ret) : "r" (value), "I" (imm) ) +#define uxtb16( ret, value, imm ) __asm __volatile ( "uxtb16 %0, %1, ror %2" : "=r" (ret) : "r" (value), "I" (imm) ) +#define uxth( ret, value, imm ) __asm __volatile ( "uxth %0, %1, ror %2" : "=r" (ret) : "r" (value), "I" (imm) ) + +#else + +static INLINE uint32_t _byteswap_ulong(uint32_t value) +{ + int32_t tmp; + + __asm __volatile( + "eor %1, %2, %2, ror #16\n" + "bic %1, %1, #0x00ff0000\n" + "mov %0, %2, ror #8\n" + "eor %0, %0, %1, lsr #8" + : "=r" (value), "=r" (tmp) + : "r" (value) + ); + + return value; +} + +#endif // TARGET_OS_IPHONE + +#define clz __builtin_clz + +#endif // TARGET_CPU_ARM + +#define bswap _byteswap_ulong + +#endif // __GNUC__ + +#endif // ! __INTRIN__H__ + diff --git a/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_delay.c b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_delay.c new file mode 100644 index 0000000..66289cd --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_delay.c @@ -0,0 +1,20 @@ +/** + * @file delay.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include + +#include "VP_Os/vp_os_delay.h" + +void vp_os_delay(uint32_t ms) +{ + usleep(1000*ms); +} + +void vp_os_delay_us(uint32_t us) +{ + usleep(us); +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_serial.h b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_serial.h new file mode 100644 index 0000000..2b13162 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_serial.h @@ -0,0 +1,52 @@ +/** + * \brief Baudrate definitions. + * \author Aurelien Morelle + * \version 1.0 + * \date 25/07/2007 + */ + +#ifndef _VP_OS_SERIAL_H_ +#define _VP_OS_SERIAL_H_ + +#include + +typedef enum _vp_com_baudrates_ +{ + VP_COM_BAUDRATE_0 = B0, // hang up + VP_COM_BAUDRATE_50 = B50, + VP_COM_BAUDRATE_75 = B75, + VP_COM_BAUDRATE_110 = B110, + VP_COM_BAUDRATE_134 = B134, + VP_COM_BAUDRATE_150 = B150, + VP_COM_BAUDRATE_200 = B200, + VP_COM_BAUDRATE_300 = B300, + VP_COM_BAUDRATE_600 = B600, + VP_COM_BAUDRATE_1200 = B1200, + VP_COM_BAUDRATE_1800 = B1800, + VP_COM_BAUDRATE_2400 = B2400, + VP_COM_BAUDRATE_3600 = B0, // not supported, so hang up + VP_COM_BAUDRATE_4800 = B4800, + VP_COM_BAUDRATE_7200 = B0, // not supported, so hang up + VP_COM_BAUDRATE_9600 = B9600, + VP_COM_BAUDRATE_14400 = B0, // not supported, so hang up + VP_COM_BAUDRATE_19200 = B19200, + VP_COM_BAUDRATE_38400 = B38400, + VP_COM_BAUDRATE_57600 = B57600, + VP_COM_BAUDRATE_115200 = B115200, + VP_COM_BAUDRATE_230400 = B230400, + VP_COM_BAUDRATE_460800 = B460800, + VP_COM_BAUDRATE_500000 = B500000, + VP_COM_BAUDRATE_576000 = B576000, + VP_COM_BAUDRATE_921600 = B921600, + VP_COM_BAUDRATE_1000000 = B1000000, + VP_COM_BAUDRATE_1152000 = B1152000, + VP_COM_BAUDRATE_1500000 = B1500000, + VP_COM_BAUDRATE_2000000 = B2000000, + VP_COM_BAUDRATE_2500000 = B2500000, + VP_COM_BAUDRATE_3000000 = B3000000, + VP_COM_BAUDRATE_3500000 = B3500000, + VP_COM_BAUDRATE_4000000 = B4000000, +} +vp_com_baudrate_t; + +#endif // _VP_OS_SERIAL_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal.c b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal.c new file mode 100644 index 0000000..810614d --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal.c @@ -0,0 +1,104 @@ +/** + * @file signal.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include "VP_Os/vp_os_signal.h" + +#ifndef __USE_GNU +#define __USE_GNU +#endif + +#include +#include + + +void +vp_os_mutex_init(vp_os_mutex_t *mutex) +{ + pthread_mutex_init((pthread_mutex_t *)mutex, NULL); +} + + +void +vp_os_mutex_destroy(vp_os_mutex_t *mutex) +{ + pthread_mutex_destroy((pthread_mutex_t *)mutex); +} + + +void +vp_os_mutex_lock(vp_os_mutex_t *mutex) +{ + pthread_mutex_lock((pthread_mutex_t *)mutex); +} + +C_RESULT +vp_os_mutex_trylock(vp_os_mutex_t *mutex) +{ + return pthread_mutex_trylock((pthread_mutex_t *)mutex) ? C_FAIL : C_OK; +} + + +void +vp_os_mutex_unlock(vp_os_mutex_t *mutex) +{ + pthread_mutex_unlock((pthread_mutex_t *)mutex); +} + + +void +vp_os_cond_init(vp_os_cond_t *cond, vp_os_mutex_t *mutex) +{ + pthread_cond_init(&cond->cond, NULL); + cond->mutex = mutex; +} + + +void +vp_os_cond_destroy(vp_os_cond_t *cond) +{ + pthread_cond_destroy(&cond->cond); +} + + +void +vp_os_cond_wait(vp_os_cond_t *cond) +{ + pthread_cond_wait(&cond->cond, (pthread_mutex_t *)cond->mutex); +} + +#ifdef USE_ANDROID +#ifndef TIMEVAL_TO_TIMESPEC +#define TIMEVAL_TO_TIMESPEC(tv, ts) do { \ + (ts)->tv_sec = (tv)->tv_sec; \ + (ts)->tv_nsec = (tv)->tv_usec * 1000; \ +} while (FALSE) +#endif +#endif + +C_RESULT +vp_os_cond_timed_wait(vp_os_cond_t *cond, uint32_t ms) +{ + struct timespec ts; + struct timeval tv; + gettimeofday(&tv, NULL); + TIMEVAL_TO_TIMESPEC(&tv, &ts); + ts.tv_sec += ms/1000; + ts.tv_nsec += (ms%1000)*1000; + return ( pthread_cond_timedwait(&cond->cond, (pthread_mutex_t *)cond->mutex, &ts) == ETIMEDOUT ? FAIL : SUCCESS ); +} + + +void +vp_os_cond_signal(vp_os_cond_t *cond) +{ + pthread_cond_signal(&cond->cond); +} + +void +vp_os_cond_broadcast(vp_os_cond_t *cond) +{ + pthread_cond_broadcast(&cond->cond); +} diff --git a/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal_dep.h b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal_dep.h new file mode 100644 index 0000000..d9feeb9 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_signal_dep.h @@ -0,0 +1,25 @@ +/** + * @file vp_os_signal_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _SIGNAL_INCLUDE_OS_DEP_ +#define _SIGNAL_INCLUDE_OS_DEP_ + + +#include + + +typedef pthread_mutex_t vp_os_mutex_t; + +typedef struct _vp_os_cond_t_ +{ + pthread_cond_t cond; + vp_os_mutex_t *mutex; +} +vp_os_cond_t; + + +#endif // ! _SIGNAL_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread.c b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread.c new file mode 100644 index 0000000..6d9ef03 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread.c @@ -0,0 +1,219 @@ +/** + * @file thread.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include +#include +#include + +#include +#include +#include +#include + +#define SIGRESUME SIGUSR1 +#define SIGSUSPEND SIGUSR2 + +typedef struct _pthread_data_t +{ + THREAD_HANDLE handle; + pthread_attr_t attr; + uint32_t isSleeping; +} pthread_data_t; + +static const THREAD_HANDLE NULL_THREAD_HANDLE = 0; + +static uint32_t threadTabSize = 128; +//static uint32_t numCreatedThread = 0; +static pthread_data_t* threadTab = NULL; + +static pthread_once_t once; +static vp_os_mutex_t thread_mutex; + + +static void suspendSignalHandler(int sig) +{ + sigset_t signal_set; + + /* Block all signals except PTHREAD_RESUME while suspended. */ + sigfillset(&signal_set); + sigdelset(&signal_set, SIGRESUME); + sigsuspend(&signal_set); +} + +static void resumeSignalHandler(int sig) +{ +} + +static void init_thread(void) +{ + struct sigaction sigsuspend, sigresume; + + vp_os_mutex_init(&thread_mutex); + + sigresume.sa_flags = 0; + sigsuspend.sa_flags = 0; + + sigemptyset(&sigresume.sa_mask); + sigemptyset(&sigsuspend.sa_mask); + sigaddset(&sigsuspend.sa_mask, SIGSUSPEND); + sigaddset(&sigresume.sa_mask, SIGRESUME); + + sigresume.sa_handler = resumeSignalHandler; + sigsuspend.sa_handler = suspendSignalHandler; + + sigaction(SIGRESUME,&sigresume,NULL); + sigaction(SIGSUSPEND,&sigsuspend,NULL); +} + +static pthread_data_t* findThread(THREAD_HANDLE handle) +{ + uint32_t i = 0; + + if(threadTab == NULL) + return NULL; + + for(i = 0;i < threadTabSize;i++) + { + if( pthread_equal(handle,threadTab[i].handle) ) + return &threadTab[i]; + } + + return NULL; +} + +void +vp_os_thread_create(THREAD_ROUTINE f, THREAD_PARAMS parameters, THREAD_HANDLE *handle, ...) +{ + pthread_data_t* freeSlot = NULL; + + pthread_once(&once,&init_thread); + + vp_os_mutex_lock(&thread_mutex); + + freeSlot = findThread( NULL_THREAD_HANDLE ); + while(freeSlot == NULL) + { + /* BUG Fix on 2010/07/19 : first half of the array was never initialized. */ + + if (threadTab!=NULL){ + /* Doubles the size of the array */ + threadTab = ( pthread_data_t* )vp_os_realloc( threadTab, 2 * threadTabSize * sizeof( pthread_data_t ) ); + /* Initializes the newly created second half */ + vp_os_memset( threadTab + threadTabSize, 0, threadTabSize * sizeof( pthread_data_t ) ); + threadTabSize *= 2; + + }else{ + threadTab = ( pthread_data_t* )vp_os_malloc( threadTabSize * sizeof( pthread_data_t ) ); + vp_os_memset( threadTab , 0, threadTabSize * sizeof( pthread_data_t ) ); + } + + + freeSlot = findThread( NULL_THREAD_HANDLE ); + } + + pthread_attr_init( &freeSlot->attr ); + pthread_create( &freeSlot->handle, &freeSlot->attr, f, parameters); + + *handle = freeSlot->handle; + + vp_os_mutex_unlock(&thread_mutex); +} + +void +vp_os_thread_join(THREAD_HANDLE handle) +{ + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + if( freeSlot != NULL ) + { + void *res; + + vp_os_memset(freeSlot, 0, sizeof(pthread_data_t)); + pthread_join( handle, &res); + } + + vp_os_mutex_unlock(&thread_mutex); +} + +THREAD_HANDLE +vp_os_thread_self(void) +{ + return pthread_self(); +} + +void +vp_os_thread_suspend(THREAD_HANDLE handle) +{ + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + if( freeSlot != NULL ) + { + if(!freeSlot->isSleeping) + { + freeSlot->isSleeping = 1; + pthread_kill(handle,SIGSUSPEND); + } + } + + vp_os_mutex_unlock(&thread_mutex); +} + +void +vp_os_thread_resume(THREAD_HANDLE handle) +{ + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + if( freeSlot != NULL ) + { + if(freeSlot->isSleeping) + { + pthread_kill(handle,SIGRESUME); + freeSlot->isSleeping = 0; + } + } + + vp_os_mutex_unlock(&thread_mutex); +} + +void +vp_os_thread_yield(void) +{ + sched_yield(); +} + +void +vp_os_thread_priority(THREAD_HANDLE handle, int32_t priority) +{ + vp_os_mutex_lock(&thread_mutex); + + pthread_data_t* freeSlot = findThread( handle ); + + if( freeSlot != NULL ) + { + int rc, policy = SCHED_OTHER; + struct sched_param param; + + vp_os_memset(¶m, 0, sizeof(param)); + + rc = pthread_getschedparam(handle, &policy, ¶m); + + if( policy == SCHED_OTHER ) + { + policy = SCHED_FIFO; + } + param.sched_priority = priority; + + rc = pthread_setschedparam(handle, policy, ¶m); + } + + vp_os_mutex_unlock(&thread_mutex); +} diff --git a/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread_dep.h b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread_dep.h new file mode 100644 index 0000000..bd7d203 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/linux/vp_os_thread_dep.h @@ -0,0 +1,22 @@ +/** + * @file vp_os_thread_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _THREAD_INCLUDE_OS_DEP_ +#define _THREAD_INCLUDE_OS_DEP_ + + +#include + + +typedef pthread_t THREAD_HANDLE; +typedef void *THREAD_PARAMS; +typedef void *THREAD_RET; +typedef THREAD_RET (*THREAD_ROUTINE) (THREAD_PARAMS); + +#define THREAD_RETURN(value) return ((void*)value) + +#endif // ! _THREAD_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_delay.c b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_delay.c new file mode 100644 index 0000000..72741e3 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_delay.c @@ -0,0 +1,24 @@ +/** + * @file vp_os_delay.c + * @author aurelien.morelle@parrot.com + * @date 2007/03/04 + */ + +#include "VP_Os/vp_os_delay.h" + +#ifdef ARM7 +# define HW_CPU_CLOCK HW_CPU_CLOCK_ARM7 +#endif // ! ARM7 + +#ifdef ARM9 +# define HW_CPU_CLOCK HW_CPU_CLOCK_ARM9 +#endif // ! ARM9 + +void vp_os_delay(uint32_t ms) +{ +} + +void vp_os_delay_us(uint32_t us) +{ +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal.c b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal.c new file mode 100644 index 0000000..179c931 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal.c @@ -0,0 +1,56 @@ +/** + * @file signal.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include "VP_Os/vp_os_signal.h" + + +void +vp_os_mutex_init(vp_os_mutex_t *mutex) +{ +} + + +void +vp_os_mutex_destroy(vp_os_mutex_t *mutex) +{ +} + + +void +vp_os_mutex_lock(vp_os_mutex_t *mutex) +{ +} + + +void +vp_os_mutex_unlock(vp_os_mutex_t *mutex) +{ +} + + +void +vp_os_cond_init(vp_os_cond_t *cond, vp_os_mutex_t *mutex) +{ +} + + +void +vp_os_cond_destroy(vp_os_cond_t *cond) +{ +} + + +void +vp_os_cond_wait(vp_os_cond_t *cond) +{ +} + + +void +vp_os_cond_signal(vp_os_cond_t *cond) +{ +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal_dep.h b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal_dep.h new file mode 100644 index 0000000..c26994c --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_signal_dep.h @@ -0,0 +1,17 @@ +/** + * @file vp_os_signal_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _SIGNAL_INCLUDE_OS_DEP_ +#define _SIGNAL_INCLUDE_OS_DEP_ + + +typedef void *vp_os_mutex_t; + +typedef void *vp_os_cond_t; + + +#endif // ! _SIGNAL_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread.c b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread.c new file mode 100644 index 0000000..75d213e --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread.c @@ -0,0 +1,41 @@ +/** + * @file vp_os_thread.c + * @author aurelien.morelle@parrot.com + * @date 2007/03/04 + */ + +#include +#include +#include + +void +vp_os_thread_create(THREAD_ROUTINE f, THREAD_PARAMS parameters, THREAD_HANDLE *handle, ...) +{ +} + + +void +vp_os_thread_join(THREAD_HANDLE handle) +{ +} + +void +vp_os_thread_suspend(THREAD_HANDLE handle) +{ +} + +void +vp_os_thread_resume(THREAD_HANDLE handle) +{ +} + +void +vp_os_thread_yield(void) +{ +} + +void +vp_os_thread_priority(THREAD_HANDLE handle, int32_t priority) +{ +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread_dep.h b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread_dep.h new file mode 100644 index 0000000..cacbbfb --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/nds/vp_os_thread_dep.h @@ -0,0 +1,18 @@ +/** + * @file vp_os_thread_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _THREAD_INCLUDE_OS_DEP_ +#define _THREAD_INCLUDE_OS_DEP_ + + +typedef void *THREAD_HANDLE; +typedef void *THREAD_PARAMS; +typedef void THREAD_RET; +typedef THREAD_RET (*THREAD_ROUTINE) (THREAD_PARAMS); + + +#endif // ! _THREAD_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/default_config.h b/ARDroneLib/VP_SDK/VP_Os/parrotos/default_config.h new file mode 100644 index 0000000..f1a3347 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/default_config.h @@ -0,0 +1,27 @@ +#ifndef _PARROTOS_CONFIG_H_ +#define _PARROTOS_CONFIG_H_ + +#ifdef DEBUG_MODE +#define POSIX_DEBUG +#endif // DEBUG_MODE + +/** PAL_STACKSIZE range from 4096 to 65536 **/ +#define PAL_STACKSIZE_DEFAULT 6144 + +#define PAL_STACKSIZE PAL_STACKSIZE_DEFAULT + +/** Trace pal functions execution **/ +#define PAL_TRACE_ALARM_VAL 0 +#define PAL_TRACE_COND_VAL 0 +#define PAL_TRACE_FLAG_VAL 0 +#define PAL_TRACE_HWALARM_VAL 0 +#define PAL_TRACE_MBOX_VAL 0 +#define PAL_TRACE_MUTEX_VAL 0 +#define PAL_TRACE_SEM_VAL 0 +#define PAL_TRACE_SYS_VAL 0 +#define PAL_TRACE_THREAD_VAL 0 +#define PAL_TRACE_TIME_VAL 0 +#define PAL_TRACE_UART_VAL 0 +#define PAL_TRACE_GPIO_VAL 0 + +#endif // _PARROTOS_CONFIG_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/intrin.h b/ARDroneLib/VP_SDK/VP_Os/parrotos/intrin.h new file mode 100644 index 0000000..dacb5fe --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/intrin.h @@ -0,0 +1,8 @@ + +#ifndef _PARROTOS_INTRIN_H_ +#define _PARROTOS_INTRIN_H_ + +#include + +#endif // ! _PARROTOS_INTRIN_H_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_delay.c b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_delay.c new file mode 100644 index 0000000..057075e --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_delay.c @@ -0,0 +1,16 @@ +#include + +#undef TRUE +#undef FALSE +#include "parrotOS_thread.h" + +void vp_os_delay(uint32_t ms) +{ + sup_thread_delay(ms); +} + +void vp_os_delay_us(uint32_t us) +{ + sup_thread_udelay(us); +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_serial.h b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_serial.h new file mode 100644 index 0000000..2b13162 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_serial.h @@ -0,0 +1,52 @@ +/** + * \brief Baudrate definitions. + * \author Aurelien Morelle + * \version 1.0 + * \date 25/07/2007 + */ + +#ifndef _VP_OS_SERIAL_H_ +#define _VP_OS_SERIAL_H_ + +#include + +typedef enum _vp_com_baudrates_ +{ + VP_COM_BAUDRATE_0 = B0, // hang up + VP_COM_BAUDRATE_50 = B50, + VP_COM_BAUDRATE_75 = B75, + VP_COM_BAUDRATE_110 = B110, + VP_COM_BAUDRATE_134 = B134, + VP_COM_BAUDRATE_150 = B150, + VP_COM_BAUDRATE_200 = B200, + VP_COM_BAUDRATE_300 = B300, + VP_COM_BAUDRATE_600 = B600, + VP_COM_BAUDRATE_1200 = B1200, + VP_COM_BAUDRATE_1800 = B1800, + VP_COM_BAUDRATE_2400 = B2400, + VP_COM_BAUDRATE_3600 = B0, // not supported, so hang up + VP_COM_BAUDRATE_4800 = B4800, + VP_COM_BAUDRATE_7200 = B0, // not supported, so hang up + VP_COM_BAUDRATE_9600 = B9600, + VP_COM_BAUDRATE_14400 = B0, // not supported, so hang up + VP_COM_BAUDRATE_19200 = B19200, + VP_COM_BAUDRATE_38400 = B38400, + VP_COM_BAUDRATE_57600 = B57600, + VP_COM_BAUDRATE_115200 = B115200, + VP_COM_BAUDRATE_230400 = B230400, + VP_COM_BAUDRATE_460800 = B460800, + VP_COM_BAUDRATE_500000 = B500000, + VP_COM_BAUDRATE_576000 = B576000, + VP_COM_BAUDRATE_921600 = B921600, + VP_COM_BAUDRATE_1000000 = B1000000, + VP_COM_BAUDRATE_1152000 = B1152000, + VP_COM_BAUDRATE_1500000 = B1500000, + VP_COM_BAUDRATE_2000000 = B2000000, + VP_COM_BAUDRATE_2500000 = B2500000, + VP_COM_BAUDRATE_3000000 = B3000000, + VP_COM_BAUDRATE_3500000 = B3500000, + VP_COM_BAUDRATE_4000000 = B4000000, +} +vp_com_baudrate_t; + +#endif // _VP_OS_SERIAL_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal.c b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal.c new file mode 100644 index 0000000..bcf187f --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal.c @@ -0,0 +1,60 @@ +#include + +void vp_os_mutex_init(vp_os_mutex_t *mutex) +{ + sup_mutex_init(mutex, FALSE); +} + + +void vp_os_mutex_destroy(vp_os_mutex_t *mutex) +{ + sup_mutex_destroy(mutex); +} + + +void vp_os_mutex_lock(vp_os_mutex_t *mutex) +{ + sup_mutex_lock(mutex); +} + +C_RESULT vp_os_mutex_trylock(vp_os_mutex_t *mutex) +{ + return sup_mutex_trylock(mutex) ? C_FAIL : C_OK; +} + + +void vp_os_mutex_unlock(vp_os_mutex_t *mutex) +{ + sup_mutex_unlock(mutex); +} + + +void vp_os_cond_init(vp_os_cond_t *cond, vp_os_mutex_t *mutex) +{ + sup_cond_init(cond, mutex); +} + + +void vp_os_cond_destroy(vp_os_cond_t *cond) +{ + sup_cond_destroy(cond); +} + + +void vp_os_cond_wait(vp_os_cond_t *cond) +{ + sup_cond_wait(cond); +} + + +C_RESULT vp_os_cond_timed_wait(vp_os_cond_t *cond, uint32_t ms) +{ + return sup_cond_timedwait(cond, sup_time_current()+((ms/10)*WAIT10MS)) == 0 ? C_OK : C_FAIL; +} + + +void vp_os_cond_signal(vp_os_cond_t *cond) +{ + sup_cond_signal(cond); +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal_dep.h b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal_dep.h new file mode 100644 index 0000000..dc80768 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_signal_dep.h @@ -0,0 +1,22 @@ +/** + * @file vp_os_signal_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _SIGNAL_INCLUDE_OS_DEP_ +#define _SIGNAL_INCLUDE_OS_DEP_ + + +#include "parrotOS_mutex.h" +#include "parrotOS_cond.h" + +#include + + +#define vp_os_mutex_t SUP_MUTEX +#define vp_os_cond_t SUP_COND + + +#endif // ! _SIGNAL_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread.c b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread.c new file mode 100644 index 0000000..50ddb3c --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread.c @@ -0,0 +1,140 @@ +#include +#include + +#include + +typedef struct _pthread_data_t +{ + uint32_t free; // bit array representing thread array allocation state (0 means free) + SUP_THREAD thread[32]; // thread array + struct _pthread_data_t* next; +} pthread_data_t; + +static pthread_data_t* threadTab = NULL; + +static INLINE uint32_t bittest(uint32_t word, uint32_t pos) +{ + return (word & (1 << pos)); +} + +static INLINE uint32_t bitset(uint32_t word, uint32_t pos) +{ + return word |= (1 << pos); +} + +static INLINE uint32_t bitreset(uint32_t word, uint32_t pos) +{ + return word &= ~(1 << pos); +} + +static int32_t findFreeIndex(uint32_t word) +{ + int32_t bit; + int32_t index; + + index = *(int32_t*)&word; + + if( index != -1 ) + { + index = 0; + bit = 1; + + while( word & bit ) + { + index ++; + bit <<= 1; + } + } + + return index; +} + +static SUP_THREAD* findFreeSlot(void) +{ + int32_t index; + pthread_data_t *tab, *prev; + + prev = threadTab; + tab = threadTab; + + while( tab != NULL ) + { + index = findFreeIndex( tab->free ); + if( index >= 0 ) + { + tab->free = bitset( tab->free, index ); + return &tab->thread[index]; + } + + prev = tab; + tab = tab->next; + } + + // If we are here it means we lack free memory + + if(prev) + { + prev->next = (pthread_data_t*)calloc( 1, sizeof(pthread_data_t) ); + tab = prev->next; + } + else + { + tab = (pthread_data_t*)calloc( 1, sizeof(pthread_data_t) ); + threadTab=tab; + } + + + tab->free = bitset( tab->free, 0 ); + return &tab->thread[0]; +} + +void vp_os_thread_create(THREAD_ROUTINE entry, THREAD_PARAMS data, THREAD_HANDLE *handle, ...) +{ + int32_t priority; + char* name; + void* stack_base; + unsigned int stack_size; + va_list va; + + + va_start(va, (char*)handle); + priority = va_arg(va, int32_t); + name = va_arg(va, char *); + stack_base = va_arg(va, void *); + stack_size = va_arg(va, unsigned int); + va_end(va); + + SUP_THREAD* thread = findFreeSlot(); + + sup_thread_create(handle, thread, priority, entry, data, stack_size, name); + sup_thread_resume(*handle); +} + +void vp_os_thread_join(THREAD_HANDLE handle) +{ +} + +THREAD_HANDLE vp_os_thread_self(void) +{ + return sup_thread_current(); +} + +void vp_os_thread_suspend(THREAD_HANDLE handle) +{ + sup_thread_suspend(handle); +} + +void vp_os_thread_resume(THREAD_HANDLE handle) +{ + sup_thread_resume(handle); +} + +void vp_os_thread_yield(void) +{ + sup_thread_yield(); +} + +void vp_os_thread_priority(THREAD_HANDLE handle, int32_t priority) +{ + sup_thread_setpriority(handle, priority); +} diff --git a/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread_dep.h b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread_dep.h new file mode 100644 index 0000000..ea7590e --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/parrotos/vp_os_thread_dep.h @@ -0,0 +1,24 @@ +/** + * @file vp_os_thread_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _THREAD_INCLUDE_OS_DEP_ +#define _THREAD_INCLUDE_OS_DEP_ + + +#include "parrotOS_thread.h" + +#include + +#define THREAD_HANDLE SUP_THREAD_HANDLE +#define THREAD_ROUTINE SUP_THREAD_ENTRY + +typedef void THREAD_RET; +typedef void *THREAD_PARAMS; + +#define THREAD_RETURN(value) + +#endif // ! _THREAD_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/syslog.h b/ARDroneLib/VP_SDK/VP_Os/syslog.h new file mode 100644 index 0000000..eff2327 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/syslog.h @@ -0,0 +1,11 @@ +#ifndef _SYSLOG_H_ +#define _SYSLOG_H_ + +#define LOG_PID 0x01 +#define LOG_CONS 0x02 +#define LOG_PERROR 0x20 +#define openlog(A,B,C) (void)(A); (void)(B) +#define syslog(A,B,C) +#define closelog() + +#endif // _SYSLOG_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os.h b/ARDroneLib/VP_SDK/VP_Os/vp_os.h new file mode 100644 index 0000000..fac597e --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os.h @@ -0,0 +1,139 @@ +/** +*************************************************************************** +* +* Copyright (C) 2007 Parrot S.A. +* +* \date First Release 03/01/2007 +* \date Last Modified 15/06/2009 +*************************************************************************** +*/ + +#ifndef _OS_H_ +#define _OS_H_ + +#include + + +/* + * Platforms support + */ + +#ifdef _WIN32 +#include +#include +#endif // _WIN32 + +#ifdef __MACOSX__ +#include "TargetConditionals.h" +#endif // + + +#undef INLINE + +/* + * Compilers support + */ +#ifdef _MSC_VER // Microsoft visual C++ + +//#undef FAILED +#define inline __inline +#define INLINE __forceinline + +#define WEAK + +#endif // _MSC_VER + +#ifdef __GNUC__ // The Gnu Compiler Collection + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#ifndef USE_MINGW32 +#define WINAPI +#else // USE_MINGW32 +//#undef FAILED +#endif // USE_MINGW32 + +#define INLINE __inline__ __attribute__((always_inline)) + +#define WEAK __attribute__((weak)) +#define NO_INSTRUMENT __attribute__ ((no_instrument_function)) + +#endif // __GNUC__ + +#endif // _OS_H_ + +/*! \mainpage Video Product SDK + +The VP_SDK is a small library that aims to ease video application developpment. +However it can be used to write portable code, to ease network initialization and to +stream any kind of data. + +


+ +

VP_SDK as an abstraction layer

+ +VP_SDK provides abstraction for + +
    +
  • Delay (ms and us) +
  • Signal (mutexes and conditionals) +
  • threads +
+ +on the following platforms + +
    +
  • linux +
  • embedded linux +
  • Win32 +
+ +On top of this, we also encapsulated ParrotOs with our syntax. + +

VP_SDK main concepts

+ +VP_SDK has two main concepts: + +
    +
  • Stages +
  • Pipeline +
+ +\section Stages + +A stage is a piece of code with standardized input and output. Usually a stage is created to transform +some sort of data from one representation to another. Stages can be seen as a way to separate concerns, to +maximize reusability and to ease debugging. + +\section Pipeline + +A pipeline contains a set of stages and the link between them. Pipelines aim to ease data streaming. +The canonical example of pipelines is to have on an embedded system a camera and a wifi adapter and on PC +you have a wifi adapter and a screen. You'll define two pipelines. +The first one on your embedded system will have three stages: + +
    +
  • Camera acquisition (camif or V4L for example) +
  • Compression (VLIB for example) +
  • Output Com (wifi for example) +
+ +The second one on your PC will have three stages too: + +
    +
  • Input Com (wifi in our example) +
  • Deompression (VLIB in our example) +
  • Display (SDL for example) +
+ +

Intrinsics

+ +VP_SDK provides also defines that map to processor instruction so they can be used in C. + +
    +
  • clz counts number of leading zero +
  • bswap transforms an int from little endian to big endian +
+*/ diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_assert.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_assert.h new file mode 100644 index 0000000..813b35e --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_assert.h @@ -0,0 +1,21 @@ +/** + * @file assert.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/27 + */ + +#ifndef _ASSERT_INCLUDE_OS_ +#define _ASSERT_INCLUDE_OS_ + + +#include + +#ifdef DEBUG_MODE +# define VP_OS_ASSERT(expr) assert(expr) +#else // ! DEBUG_MODE +# define VP_OS_ASSERT(expr) ((void)0) +#endif // <- DEBUG_MODE + + +#endif // ! _ASSERT_INCLUDE_OS_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_delay.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_delay.h new file mode 100644 index 0000000..245f9ea --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_delay.h @@ -0,0 +1,40 @@ +/** + * @file delay.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _DELAY_INCLUDE_OS_ +#define _DELAY_INCLUDE_OS_ + + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * Waits until delay is elapsed. + * + * @param ms Delay in milliseconds + */ +void +vp_os_delay(uint32_t ms); + +/** + * Waits until delay is elapsed. + * + * @param us Delay in microseconds + */ +void +vp_os_delay_us(uint32_t us); + +#ifdef __cplusplus +} +#endif + + +#endif // ! _DELAY_INCLUDE_OS_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.c b/ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.c new file mode 100644 index 0000000..a7bd237 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.c @@ -0,0 +1,59 @@ +/** + * \brief VP OS. Error Handling + * \author Sylvain Gaeremynck + * \version 1.0 + * \date first release 26/03/2007 + */ + +#include +#include + +#define VP_OS_ERROR_MESSAGE "Erreur" + +typedef struct _vp_os_error_handlers_t +{ + + uint32_t signature; + vp_os_error_handler_t error_handler; + +} vp_os_error_handlers_t; + +static uint32_t vp_os_num_handlers = 0; +static vp_os_error_handlers_t vp_os_error_handlers[VP_OS_MAX_NUM_ERROR_HANDLERS]; +static char vp_os_error_message[VP_OS_MAX_NUM_ERROR_MESSAGE_SIZE]; + +void vp_os_install_error_handler(uint32_t signature, vp_os_error_handler_t error_handler) +{ + vp_os_error_handlers[vp_os_num_handlers].signature = signature; + vp_os_error_handlers[vp_os_num_handlers].error_handler = error_handler; + + vp_os_num_handlers ++; +} + +const char* vp_os_get_error_message(uint32_t error_code) +{ + uint32_t signature = error_code >> 16; + uint32_t found = 0; + uint32_t i; + + vp_os_memset(vp_os_error_message, 0, VP_OS_MAX_NUM_ERROR_MESSAGE_SIZE); + + for( i = 0; !found && i < vp_os_num_handlers; i++) + { + if(signature == vp_os_error_handlers[i].signature) + found++; + } + + if(found) + { + strcpy(vp_os_error_message, vp_os_error_handlers[i].error_handler(error_code) ); + } + else + { + // generic error message + strcpy(vp_os_error_message, VP_OS_ERROR_MESSAGE); + return vp_os_error_message; + } + + return vp_os_error_message; +} diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.h new file mode 100644 index 0000000..7f27430 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_error_handling.h @@ -0,0 +1,40 @@ +/** + * \brief VP OS. Error Handling + * \author Sylvain Gaeremynck + * \version 1.0 + * \date first release 26/03/2007 + */ + +#ifndef _VP_OS_ERROR_HANDLING_H_ +#define _VP_OS_ERROR_HANDLING_H_ + + +#include + + +#define VP_OS_MAX_NUM_ERROR_HANDLERS 8 +#define VP_OS_MAX_NUM_ERROR_MESSAGE_SIZE 256 + + +/** + * \brief API_SDK_SIGNATURE definition is used to parse the error messages. + * \brief COM_SDK_SIGNATURE definition is used to parse the error messages. + * \todo Put these declarations in the makefile if possible + */ +#define VP_API_SDK_SIGNATURE 0x00AA +#define VP_COM_SDK_SIGNATURE 0x00BB +#define API_SDK_VERSION 1 +#define COM_SDK_VERSION 1 + +typedef const char* (*vp_os_error_handler_t)(int32_t errorCode); + +void vp_os_install_error_handler(uint32_t signature, vp_os_error_handler_t handler); + +/** + * @fn error api message display + * @param int errorCode : error message in the list of error state message + * @return return the error Message + */ +const char* vp_os_get_error_message(uint32_t errorCode); + +#endif // _VP_OS_ERROR_HANDLING_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.c b/ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.c new file mode 100644 index 0000000..fd2d658 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.c @@ -0,0 +1,176 @@ +/** + * @file malloc.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/19 + */ + +#include "VP_Os/vp_os_malloc.h" + + +#undef calloc +#undef malloc +#undef memset +#undef free +#undef realloc + + +void * +vp_os_calloc(size_t nmemb, size_t size) +{ +#ifdef DEBUG_MODE + void *res = calloc(nmemb, size); + assert(res); + return (res); +#else // ! DEBUG_MODE + return calloc(nmemb, size); +#endif // <- DEBUG_MODE +} + +void * +vp_os_malloc(size_t size) +{ +#ifdef DEBUG_MODE + void *res = malloc(size); + assert(res); + return (res); +#else // ! DEBUG_MODE + return malloc(size); +#endif // <- DEBUG_MODE +} + +void * +vp_os_malloc_no_assert(size_t size) +{ + return malloc(size); +} + +void +vp_os_free(void *ptr) +{ +#ifdef DEBUG_MODE + assert(ptr); + free(ptr); +#else // ! DEBUG_MODE + free(ptr); +#endif // <- DEBUG_MODE +} + +void +vp_os_sfree(void **ptr) +{ +#ifdef DEBUG_MODE + assert(*ptr); + free(*ptr); +#else // ! DEBUG_MODE + free(*ptr); +#endif // <- DEBUG_MODE + *ptr=NULL; +} + +// align_size has to be a power of two !!! +// +// The basic working of this algorithm is to allocate a bigger chunk of data than requested. +// This chunk of data must be big enough to contain an address aligned on requested boundary +// We also alloc 2 more words to keep base ptr (bptr) & requested size (size) of allocation +// bptr is the base pointer of this allocation +// _____ ______ ______ __________ +// ... | bptr | size | .... | +// _____|______|______|__________| +// +void* vp_os_aligned_malloc(size_t size, size_t align_size) +{ + char *ptr, *aligned_ptr; + int* ptr2; + int allocation_size; + size_t align_mask = align_size - 1; + + // Check if align_size is a power of two + // If the result of this test is non zero then align_size is not a power of two + if( align_size & align_mask ) + return NULL; + + // Allocation size is : + // - Requested user size + // - a size (align_size) to make sure we can align on the requested boundary + // - 8 more bytes to register base adress & allocation size + allocation_size = size + align_size + 2*sizeof(int); + + ptr = (char*) vp_os_malloc(allocation_size); + if(ptr == NULL) + return NULL; + + ptr2 = (int*)(ptr + 2*sizeof(int)); + aligned_ptr = ptr + 2*sizeof(int) + (align_size - ((size_t) ptr2 & align_mask)); + + ptr2 = (int*)(aligned_ptr - 2*sizeof(int)); + *ptr2++ = (int) (aligned_ptr - ptr); + *ptr2 = size; + + return aligned_ptr; +} + +void vp_os_aligned_free(void *ptr) +{ + int* ptr2 = (int*)ptr - 2; + + vp_os_free( ((char*)ptr - *ptr2) ); +} + +void* +vp_os_aligned_realloc(void* ptr, size_t size, size_t align_size) +{ + void* ptr_ret; + void* aligned_ptr; + + if( size == 0 ) + { + ptr_ret = NULL; + if( ptr != NULL ) + vp_os_aligned_free(ptr); + } + else + { + if( ptr != NULL ) + { + int* ptr2 = (int*)ptr - 1; + size_t old_size; + + aligned_ptr = ptr; + + old_size = *ptr2--; + + ptr_ret = vp_os_aligned_malloc(size, align_size); + + // Compute smallest size + if( size > old_size ) + { + size = old_size; + } + + // Copy old data + vp_os_memcpy( ptr_ret, aligned_ptr, size ); + + vp_os_free( ((char*)ptr - *ptr2) ); + } + else + { + ptr_ret = vp_os_aligned_malloc(size, align_size); + } + } + + return ptr_ret; +} + +void* +vp_os_realloc(void *ptr, size_t size) +{ +#ifdef DEBUG_MODE + void *res = realloc(ptr, size); + if (res==NULL) { perror(__FUNCTION__); } + assert(res!=NULL); + return (res); +#else // ! DEBUG_MODE + return realloc(ptr, size); +#endif // <- DEBUG_MODE +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.h new file mode 100644 index 0000000..31ea96b --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_malloc.h @@ -0,0 +1,128 @@ +/** + * @file malloc.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/19 + */ + +#ifndef _MALLOC_INCLUDE_OS_ +#define _MALLOC_INCLUDE_OS_ + +#include +#include +#include + + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * Same as calloc, see + */ +void * +vp_os_calloc(size_t nmemb, size_t size); + +/** + * Same as malloc, see + */ +void * +vp_os_malloc(size_t size); + +/** + * Same as vp_os_malloc, but without assert even if debug mode + */ +void * +vp_os_malloc_no_assert(size_t size); + +/** + * Same as free, see + */ +void +vp_os_free(void *ptr); +void +vp_os_sfree(void **ptr); +/** + * Same as realloc, see + */ +void * +vp_os_realloc(void *ptr, size_t size); + +/** + * Same as vp_os_malloc, but returned value is aligned on align_size boundaries + * -> align_size has to be a power of two !!! + */ +void* +vp_os_aligned_malloc(size_t size, size_t align_size); + + +/** + * Must be used to free memory allocated by vp_os_aligned_malloc correctly + */ +void +vp_os_aligned_free(void *ptr); + +/** + * Allow reallocation of aligned data + * -> align_size has to be a power of two !!! + */ +void* +vp_os_aligned_realloc(void* ptr, size_t size, size_t align_size); + +static inline void * +vp_os_memset(void *s, int c, size_t n) +{ +#ifdef DEBUG_MODE + void *res; + assert(s); + res = memset(s, c, n); + assert(res == s); + return (res); +#else // ! DEBUG_MODE + return memset(s, c, n); +#endif // <- DEBUG_MODE +} + + +static inline void * +vp_os_memcpy(void *dest, const void *src, size_t n) +{ +#ifdef DEBUG_MODE + void *res; + assert(dest); + res = memcpy(dest, src, n); + assert(res == dest); + return (res); +#else // ! DEBUG_MODE + return memcpy(dest, src, n); +#endif // <- DEBUG_MODE +} + + +extern void *please_use_vp_os_calloc(size_t nmemb, size_t size); +extern void *please_use_vp_os_malloc(size_t size); +extern void please_use_vp_os_free(void *ptr); +extern void *please_use_vp_os_realloc(void *ptr, size_t size); +extern void *please_use_vp_os_memset(void *s, int c, size_t n); + +#undef calloc +#undef malloc +#undef memset +#undef free +#undef realloc + +#define calloc please_use_vp_os_calloc +#define malloc please_use_vp_os_malloc +#define memset please_use_vp_os_memset +#define free please_use_vp_os_free +#define realloc please_use_vp_os_realloc + +#ifdef __cplusplus +} +#endif + + +#endif // ! _MALLOC_INCLUDE_OS_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_print.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_print.h new file mode 100644 index 0000000..03c554f --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_print.h @@ -0,0 +1,44 @@ +// ---------------------------------------------- +// +// Author : +// Date : 03/01/2007 +// +// Parrot Video SDK : Os API +// +// ---------------------------------------------- + +#ifndef _OS_PRINT_H_ +#define _OS_PRINT_H_ + +#include + +#ifdef __MACOSX__ +#ifdef DEBUG_MODE +#define PRINT printf +#else +#define PRINT +#endif // DEBUG_MODE +#else +#define PRINT printf +#endif // __MACOSX__ + +#ifdef USE_ANDROID +#include +#undef PRINT +#define PRINT(_fmt_, args...) \ + __android_log_print(ANDROID_LOG_INFO, "ARDrone", _fmt_, ##args) +#endif + +#ifdef DEBUG_MODE + #define DEBUG_PRINT_SDK(...) printf(__VA_ARGS__) +#else + #define DEBUG_PRINT_SDK(...) +#endif + +#ifdef DEBUG_MODE + #define DEBUG_PRINT(...) printf(__VA_ARGS__) +#else + #define DEBUG_PRINT(...) +#endif + +#endif // _OS_PRINT_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_rtmon.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_rtmon.h new file mode 100644 index 0000000..ed7b5eb --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_rtmon.h @@ -0,0 +1,96 @@ +/** + * \brief VP Os RTMon defines. + * \author Aurelien Morelle + * \version 1.0 + * \date first release 2008/04/23 + */ + +#ifndef _OS_RTMON_H_ +#define _OS_RTMON_H_ + +# define RTMON_NEED_DEFINITIONS + +#ifdef RTMON_NEED_DEFINITIONS +# define RTMON_START(cfg) do{}while(0) +# define RTMON_STOP() do{}while(0) +# define RTMON_FLUSH(...) do{}while(0) +# define RTMON_USTART(id) do{}while(0) +# define RTMON_USTOP(id) do{}while(0) +# define RTMON_UVAL(id,value) do{}while(0) +#endif // RTMON_NEED_DEFINITIONS + +typedef enum _RTMON_UEVENT_IDS_ +{ + NON_LINEAR_FUSION_UEVENT=0, + VIDEO_VLIB_ENCODE_EVENT=1, + VIDEO_VLIB_BLOCKLINE_TO_MB=2, + VIDEO_VLIB_QUANTIZE=3, + VIDEO_VLIB_DOQUANTIZE=4, + VIDEO_VLIB_PACKET=5, + VIDEO_VLIB_DCT_COMPUTE_UEVENT=6, + VIDEO_VLIB_DCT_WAIT_UEVENT=7, + IPHONE_ACCELEROS=8, + // free : UEVENT_09=9, + BCM43XX_BCMSDIOH_UEVENT_10=10, + BCM43XX_BCMSDIOH_UEVENT_11=11, + OPPONENT_DETECTION_UEVENT=12, + ME_COMPUTE_UEVENT=13, + PICTURE_REDUCTION_UEVENT=14, + TRACKING_PREPARE_UEVENT=15, + TRACKING_COMPUTE_UEVENT=16, + TRACKING_UPDATE_UEVENT=17, + TRANSLATION_ESTIMATION_UEVENT=18, + TRACKER_REPLACE_UEVENT=19, + SDIO_P5P_PRIVATE_UEVENT_20=20, + SDIO_P5P_PRIVATE_UEVENT_21=21, + SDIO_P5P_PRIVATE_UEVENT_22=22, + SDIO_P5P_PRIVATE_UEVENT_23=23, + SDIO_P5P_PRIVATE_UEVENT_24=24, + // free : UEVENT_25=25, + VISION_LOOP_LED_DETECT_UEVENT=26, + VISION_TEST_DETECT_UEVENT=27, + // free : UEVENT_28=28, + // free : UEVENT_29=29, + // free : UEVENT_30=30, + SDK_STAGE_TRANSFORM_UEVENT=31 +} +RTMON_UEVENT_ID; + +typedef enum _RTMON_UVAL_IDS_ +{ + // todo ? ADC_FSM_STATE_UVAL=0, + // todo ? ACQ_FSM_STATE_UVAL=1, + // todo ? CTRL_FSM_STATE_UVAL=2, + VISON_NUM_ANGLES_UVAL=3, + // free : UVAL_04=4, + // free : UVAL_05=5, + // free : UVAL_06=6, + // free : UVAL_07=7, + // free : UVAL_08=8, + // free : UVAL_09=9, + BCM43XX_BCMSDIOH_UVAL_10=10, + BCM43XX_BCMSDIOH_UVAL_11=11, + BCM43XX_BCMSDIOH_UVAL_12=12, + // free : UVAL_13=13, + // free : UVAL_14=14, + // free : UVAL_15=15, + // free : UVAL_16=16, + // free : UVAL_17=17, + SDK_STAGE_INDEX_UVAL=18, + // free : UVAL_19=19, + SDIO_P5P_PRIVATE_UVAL_20=20, + ICAMIF_SERVER_BLOCKLINE_UVAL=21, + ICAMIF_CLIENT_BLOCKLINE_UVAL=22, + ICAMIF_BLOCKLINE_UVAL=23, + CAMIF_CONSUME=24, + CAMIF_BLOCKLINE_UVAL=25, + CAMIF_LINES_UVAL=26, + CAPTURED_BLOCKLINE_UVAL=27, + CAPTURED_PICTURE_UVAL=28, + NB_TRACKERS_DEFINED_UVAL=29, + ENCODED_BLOCKLINE_SIZE_UVAL=30, + ENCODED_PICTURE_UVAL=31 +} +RTMON_UVAL_ID; + +#endif // _OS_RTMON_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_signal.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_signal.h new file mode 100644 index 0000000..e36d43f --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_signal.h @@ -0,0 +1,119 @@ +/** + * @file signal.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _SIGNAL_INCLUDE_OS_ +#define _SIGNAL_INCLUDE_OS_ + + +#include + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/** + * Initializes a mutex. + * + * @param mutex The mutex to initialize + */ +void +vp_os_mutex_init(vp_os_mutex_t *mutex); + +/** + * Destroys a mutex. + * + * @param mutex The mutex to destroy + */ +void +vp_os_mutex_destroy(vp_os_mutex_t *mutex); + +/** + * Locks a mutex. + * + * @param mutex The mutex to lock + */ +void +vp_os_mutex_lock(vp_os_mutex_t *mutex); + +/** + * Tries to lock a mutex. + * + * @param mutex The mutex to lock + */ +C_RESULT +vp_os_mutex_trylock(vp_os_mutex_t *mutex); + + +/** + * Unlocks a mutex. + * + * @param mutex The mutex to unlock + */ +void +vp_os_mutex_unlock(vp_os_mutex_t *mutex); + +/** + * Initializes a condition variable. + * + * @param cond The condition to initialize + * @param mutex The mutex associated to this condition variable + */ +void +vp_os_cond_init(vp_os_cond_t *cond, vp_os_mutex_t *mutex); + +/** + * Destroys a condition variable. + * + * @param cond The condition to destroy + */ +void +vp_os_cond_destroy(vp_os_cond_t *cond); + +/** + * Waits for the signal of a condition variable. + * + * @param cond The condition to wait for + */ +void +vp_os_cond_wait(vp_os_cond_t *cond); + +/** + * Waits for the signal of a condition variable. + * + * @param cond The condition to wait for + * @param ms Time to wait in milliseconds + * + * @return VP_SUCCESS or VP_FAILURE (if delay has been reached before or not) + */ +C_RESULT +vp_os_cond_timed_wait(vp_os_cond_t *cond, uint32_t ms); + +/** + * Signals a condition variable. + * + * @param cond The condition to signal + */ +void +vp_os_cond_signal(vp_os_cond_t *cond); + +/** + * Broadcasts a condition variable. + * + * @param cond The condition to signal + */ +void +vp_os_cond_broadcast(vp_os_cond_t *cond); + +#ifdef __cplusplus +} +#endif + +#endif // ! _SIGNAL_INCLUDE_OS_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_thread.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_thread.h new file mode 100644 index 0000000..9526a86 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_thread.h @@ -0,0 +1,61 @@ +/** + * @file thread.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _THREAD_INCLUDE_OS_ +#define _THREAD_INCLUDE_OS_ + +#include +#include "vp_os_thread_dep.h" + + +/** + * Prototype definition of a thread routine. + */ +#define DEFINE_THREAD_ROUTINE(NomRoutine,NomParams) THREAD_RET WINAPI thread_##NomRoutine(THREAD_PARAMS NomParams) + + +/** + * Creates and starts a thread. + * + * @param f The thread routine + * @param parameters The parameters passed to the thread routine + * @param handle The returned handle of the created thread + * + * Variadic parameters : only for eCos + * @param sched_info Sechduling priority + * @param name Thread name + * @param stack_base Stack address + * @param stack_size Stack size + * @param thread cyg_thread_t object + */ +void +vp_os_thread_create(THREAD_ROUTINE f, THREAD_PARAMS parameters, THREAD_HANDLE *handle, ...); + +/** + * Waits for a thread to terminate. + * + * @param handle The handle of the thread to wait for the termination + */ +void +vp_os_thread_join(THREAD_HANDLE handle); + +THREAD_HANDLE +vp_os_thread_self(void); + +void +vp_os_thread_suspend(THREAD_HANDLE handle); + +void +vp_os_thread_resume(THREAD_HANDLE handle); + +void +vp_os_thread_yield(void); + +void +vp_os_thread_priority(THREAD_HANDLE handle, int32_t priority); + +#endif // ! _THREAD_INCLUDE_OS_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/vp_os_types.h b/ARDroneLib/VP_SDK/VP_Os/vp_os_types.h new file mode 100644 index 0000000..b71342a --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/vp_os_types.h @@ -0,0 +1,147 @@ +/** + * \brief VP OS. Types declaration. + * \brief These types are used to provide clean types declaration for portability between OSes + * \author Sylvain Gaeremynck + * \version 1.0 + * \date first release 19/12/2006 + * \date modification 26/03/2007 + */ + +#ifndef _VP_SDK_TYPES_H_ +#define _VP_SDK_TYPES_H_ + +#include + +#if defined(USE_LINUX) || defined(__ELINUX__) +# include "vp_os_serial.h" +#endif // USE_LINUX + +#define C_RESULT int +#define C_OK 0 +#define C_FAIL -1 + +#define VP_SUCCESS (0) +#define VP_FAILURE (!VP_SUCCESS) + +#define VP_SUCCEEDED(a) (((a) & 0xffff) == VP_SUCCESS) +#define VP_FAILED(a) (((a) & 0xffff) != VP_SUCCESS) + +#ifndef _WIN32 + /* + Those macros have been used in the SDK but are already defined in Windows.h + and thus used with a wrong value when compiling under Windows, leading to a crash. + VP_xxx macros should be used to avoid confusion. + */ + #define SUCCESS VP_SUCCESS + #define FAIL VP_FAILURE + + #define SUCCEED VP_SUCCEEDED + #define FAILED VP_FAILED +#endif + +#ifdef USE_MINGW32 +#include +#include +//typedef unsigned __int64 off64_t; +#endif + +#if defined(_WIN32) || defined(USE_MINGW32) + +// Definition des types entiers +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + +#endif // < _WIN32 + +#if defined(__NDS__) || defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) + +#ifdef __NDS__ +#include +#endif // ! __NDS__ + +#ifndef NULL +#define NULL (void*)0 +#endif + +#endif // < __NDS__ || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +typedef float float32_t; +typedef double float64_t; + +#if defined(__linux__) && !defined(USE_MINGW32) +#include +#include + +#define CBOOL int + +#endif // < __linux__ + +#if defined(USE_ANDROID) + +#include +#undef __FD_ZERO +#define __FD_ZERO(fdsetp) (vp_os_memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp)))) +#undef FD_ZERO +#define FD_ZERO(fdsetp) __FD_ZERO(fdsetp) + +#endif + +#define bool_t int32_t + +#if defined(USE_PARROTOS_CORE) +#include +#define TYPEDEF_BOOL +#endif + +#if !defined(USE_MINGW32) + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#endif // < USE_MINGW32 + +#if !defined(USE_ANDROID) +typedef volatile uint8_t vuint8; +typedef volatile uint16_t vuint16; +typedef volatile uint32_t vuint32; +typedef volatile uint64_t vuint64; + +typedef volatile int8_t vint8; +typedef volatile int16_t vint16; +typedef volatile int32_t vint32; +typedef volatile int64_t vint64; + +#ifndef INT_MAX +#define INT_MAX 2147483647 +#endif // ! INT_MAX + +#endif // !USE_ANDROID + +#ifdef __linux__ +# include +#endif + +#define BDADDR_SIZE 6 + +#if !defined(__BLUETOOTH_H) +typedef struct _bdaddr_t +{ + uint8_t b[BDADDR_SIZE]; +} bdaddr_t; +#endif // !defined(__BLUETOOTH_H) + +typedef C_RESULT (*Read) (void* s, int8_t* buffer, int32_t* size); +typedef C_RESULT (*Write) (void* s, const int8_t* buffer, int32_t* size); + +#endif // _TYPES_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/win32/intrin.h b/ARDroneLib/VP_SDK/VP_Os/win32/intrin.h new file mode 100644 index 0000000..faa1912 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/win32/intrin.h @@ -0,0 +1,56 @@ + +#ifndef __INTRIN__H__ +#define __INTRIN__H__ + +#ifdef _WIN32 + //For ByteSwap + #include +#endif + +#ifdef USE_MINGW32 + +// #undef always_inline + +#ifdef __GNUC__ + +static INLINE uint32_t _BitScanReverse(uint32_t* index, uint32_t mask) +{ + __asm__("bsrl %[mask], %[index]" : [index] "=r" (*index) : [mask] "mr" (mask)); + + return mask ? 1 : 0; +} + + +static INLINE uint32_t _byteswap_ulong(uint32_t value) +{ + __asm("bswap %0": + "=r" (value): + "0" (value)); + + return value; +} + +#endif // __GNUC__ + +#else // USE_MINGW32 +#endif // USE_MINGW32 + + +static inline uint32_t clz(uint32_t code) +{ + uint32_t index = 0; + if( code ) + { + _BitScanReverse(&index, code); + index ^= 31; + } + + return index; +} + + +#define bswap _byteswap_ulong + + +#endif // ! __INTRIN__H__ + diff --git a/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_delay.c b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_delay.c new file mode 100644 index 0000000..cf2c51b --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_delay.c @@ -0,0 +1,21 @@ +/** + * @file delay.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include + +#include "VP_Os/vp_os_delay.h" + + +void vp_os_delay(uint32_t ms) +{ + Sleep((DWORD)ms); +} + +void vp_os_delay_us(uint32_t us) +{ + vp_os_delay(us/1000); +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_serial.h b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_serial.h new file mode 100644 index 0000000..12bc5b1 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_serial.h @@ -0,0 +1,32 @@ +/** + * \brief Baudrate definitions. + * \author Sylvain Gaeremynck + * \version 1.0 + * \date 15/02/2008 + */ + +#ifndef _VP_OS_SERIAL_H_ +#define _VP_OS_SERIAL_H_ + +#include + +typedef enum _vp_com_baudrates_ +{ + VP_COM_BAUDRATE_110 = CBR_110, + VP_COM_BAUDRATE_300 = CBR_300, + VP_COM_BAUDRATE_600 = CBR_600, + VP_COM_BAUDRATE_1200 = CBR_1200, + VP_COM_BAUDRATE_2400 = CBR_2400, + VP_COM_BAUDRATE_4800 = CBR_4800, + VP_COM_BAUDRATE_9600 = CBR_9600, + VP_COM_BAUDRATE_14400 = CBR_14400, + VP_COM_BAUDRATE_19200 = CBR_19200, + VP_COM_BAUDRATE_38400 = CBR_38400, + VP_COM_BAUDRATE_57600 = CBR_57600, + VP_COM_BAUDRATE_115200 = CBR_115200, + VP_COM_BAUDRATE_128000 = CBR_128000, + VP_COM_BAUDRATE_256000 = CBR_256000, + VP_COM_BAUDRATE_460800 = CBR_256000, // TODO Added only for +} vp_com_baudrate_t; + +#endif // _VP_OS_SERIAL_H_ diff --git a/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal.c b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal.c new file mode 100644 index 0000000..8568783 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal.c @@ -0,0 +1,145 @@ +/** + * @file signal.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include "VP_Os/vp_os_signal.h" + + #if defined USE_WINDOWS_CONDITION_VARIABLES + #elif defined USE_PTHREAD_FOR_WIN32 + #else + #endif + +void +vp_os_mutex_init(vp_os_mutex_t *mutex) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + InitializeCriticalSection((CRITICAL_SECTION *)mutex); + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_mutex_init((pthread_mutex_t *)mutex, NULL); + #else + #endif +} + + +void +vp_os_mutex_destroy(vp_os_mutex_t *mutex) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + DeleteCriticalSection((CRITICAL_SECTION *)mutex); + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_mutex_destroy((pthread_mutex_t *)mutex); + #else + #endif +} + + +void +vp_os_mutex_lock(vp_os_mutex_t *mutex) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + EnterCriticalSection((CRITICAL_SECTION *)mutex); + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_mutex_lock((pthread_mutex_t *)mutex); + #else + #endif +} + + +void +vp_os_mutex_unlock(vp_os_mutex_t *mutex) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + LeaveCriticalSection((CRITICAL_SECTION *)mutex); + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_mutex_unlock((pthread_mutex_t *)mutex); + #else + #endif + +} + + +void +vp_os_cond_init(vp_os_cond_t *cond, vp_os_mutex_t *mutex) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + InitializeConditionVariable(&cond->cond); + cond->mutex = mutex; + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_cond_init(&cond->cond, NULL); + cond->mutex = mutex; + #else + /**/ + #endif +} + + +void +vp_os_cond_destroy(vp_os_cond_t *cond) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + /**/ + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_cond_destroy(&cond->cond); + #else + /**/ + #endif + +} + + +void +vp_os_cond_wait(vp_os_cond_t *cond) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + SleepConditionVariableCS(&cond->cond, (CRITICAL_SECTION *)cond->mutex, INFINITE); + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_cond_wait(&cond->cond, (pthread_mutex_t *)cond->mutex); + #else + WaitForSingleObject(cond->LockSemaphore,INFINITE); // TODO: to test + #endif +} + + +int gettimeofday(struct timeval *tv, struct timezone *tz); + +C_RESULT +vp_os_cond_timed_wait(vp_os_cond_t *cond, uint32_t ms) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + return SleepConditionVariableCS(&cond->cond, (CRITICAL_SECTION *)cond->mutex, ms) == WAIT_TIMEOUT ? VP_FAILURE : VP_SUCCESS; + #elif defined USE_PTHREAD_FOR_WIN32 + struct timespec ts; + struct timeval tv; + gettimeofday(&tv, NULL); + ts.tv_sec = tv.tv_sec + ms/1000; + ts.tv_nsec = (tv.tv_usec + (ms%1000))*1000; + return ( pthread_cond_timedwait(&cond->cond, (pthread_mutex_t *)cond->mutex, &ts) == ETIMEDOUT ? VP_FAILURE : VP_SUCCESS ); + #else + return WaitForSingleObject(cond->LockSemaphore, ms) == WAIT_TIMEOUT ? VP_FAILURE : VP_SUCCESS; // TODO: to test + #endif +} + +void +vp_os_cond_signal(vp_os_cond_t *cond) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + WakeConditionVariable(&cond->cond); + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_cond_signal(&cond->cond); + #endif +} + + +void +vp_os_cond_broadcast(vp_os_cond_t *cond) +{ + #if defined USE_WINDOWS_CONDITION_VARIABLES + /**/ + #elif defined USE_PTHREAD_FOR_WIN32 + pthread_cond_broadcast(&cond->cond); + #endif + +} + diff --git a/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal_dep.h b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal_dep.h new file mode 100644 index 0000000..8da0a8c --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_signal_dep.h @@ -0,0 +1,59 @@ +/** + * \brief OS Api for video sdk. Public definitions. + * \author Aurelien Morelle + * \author Sylvain Gaeremynck + * \version 2.0 + * \date 2006/12/15 + */ + +#ifndef _SIGNAL_INCLUDE_OS_DEP_ +#define _SIGNAL_INCLUDE_OS_DEP_ + +/* +IMPORTANT - select here whether to use condition variables from + the Windows SDK (Vista and later) or from the 'Pthread for Win32' library (XP and earlier). +*/ +#define USE_WINDOWS_CONDITION_VARIABLES +//#define USE_PTHREAD_FOR_WIN32 + + + +#include + + + + +#if defined USE_WINDOWS_CONDITION_VARIABLES + /* CONDITION_VARIABLE only work on VISTA/SEVEN/Server 2008 */ + typedef CRITICAL_SECTION vp_os_mutex_t; + + typedef struct + { + CONDITION_VARIABLE cond; + vp_os_mutex_t *mutex; + } + vp_os_cond_t; + + +#elif defined USE_PTHREAD_FOR_WIN32 + #include + + typedef pthread_mutex_t vp_os_mutex_t; + + typedef struct _vp_os_cond_t_ + { + pthread_cond_t cond; + vp_os_mutex_t *mutex; + } + vp_os_cond_t; + +#else + + typedef CRITICAL_SECTION vp_os_cond_t; + typedef CRITICAL_SECTION vp_os_mutex_t; + +#endif + + +#endif // ! _SIGNAL_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread.c b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread.c new file mode 100644 index 0000000..c98abc2 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread.c @@ -0,0 +1,60 @@ +/** + * @file thread.c + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#include "VP_Os/vp_os_thread.h" +#include "VP_Os/vp_os_assert.h" + +void +vp_os_thread_create(THREAD_ROUTINE f, void *parameters, THREAD_HANDLE *handle, ...) +{ + unsigned long id; + + *handle = CreateThread + ( + NULL, // security + 0, // stack size (common) + f, // start (common) + parameters,// parameters given to thread routine (common) + 0, // creation flags + &id // id + ); +} + +THREAD_HANDLE +vp_os_thread_self(void) +{ + return GetCurrentThread(); +} + +void +vp_os_thread_join(THREAD_HANDLE handle) +{ + WaitForSingleObject(handle, INFINITE); +} + +void +vp_os_thread_suspend(THREAD_HANDLE handle) +{ + SuspendThread(handle); +} + +void +vp_os_thread_resume(THREAD_HANDLE handle) +{ + ResumeThread(handle); +} + +void +vp_os_thread_yield(void) +{ + VP_OS_ASSERT(0==1); +} + +void +vp_os_thread_priority(THREAD_HANDLE handle, int32_t priority) +{ + SetThreadPriority(handle, priority); +} diff --git a/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread_dep.h b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread_dep.h new file mode 100644 index 0000000..2a001f9 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Os/win32/vp_os_thread_dep.h @@ -0,0 +1,21 @@ +/** + * @file vp_os_thread_dep.h + * @author aurelien.morelle@parrot.fr + * @date 2006/12/15 + */ + +#ifndef _THREAD_INCLUDE_OS_DEP_ +#define _THREAD_INCLUDE_OS_DEP_ + + +#include + +typedef HANDLE THREAD_HANDLE; +typedef LPTHREAD_START_ROUTINE THREAD_ROUTINE; +typedef LPVOID THREAD_PARAMS; +typedef DWORD THREAD_RET; + +#define THREAD_RETURN(value) return (value) + +#endif // ! _THREAD_INCLUDE_OS_DEP_ + diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.c new file mode 100644 index 0000000..05c5b5d --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.c @@ -0,0 +1,266 @@ +#include + +#include +#include +#include +#include + +// +// Buffer to Picture conversion +// +static int32_t copy_input_to_buffer( uint8_t* buffer, int32_t input_size, int32_t max_size, vp_stages_buffer_to_picture_config_t *cfg ) +{ + int32_t size_to_copy; + + size_to_copy = input_size; + if( size_to_copy > max_size ) + size_to_copy = max_size; + vp_os_memcpy( buffer, cfg->input_ptr, size_to_copy ); + + if( cfg != NULL ) + { + cfg->cumulated_size += size_to_copy; + cfg->input_ptr += size_to_copy; + } + + return size_to_copy; +} + + +C_RESULT vp_stages_buffer_to_picture_open(vp_stages_buffer_to_picture_config_t *cfg) +{ + cfg->num_picture_decoded = 0; + + return C_OK; +} + + +C_RESULT vp_stages_buffer_to_picture_transform(vp_stages_buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->buffers = (int8_t**)(int8_t*) cfg->picture; + out->indexBuffer = 0; + out->lineSize = 0; + + out->status = VP_API_STATUS_PROCESSING; + + cfg->y_buf_ptr = cfg->picture->y_buf; + if(!cfg->luma_only) + { + cfg->cr_buf_ptr = cfg->picture->cr_buf; + cfg->cb_buf_ptr = cfg->picture->cb_buf; + } + cfg->cumulated_size = 0; + cfg->input_ptr = NULL; + + if( cfg->custom_data_size > 0 ) + { + cfg->custom_data_ptr = vp_os_malloc( cfg->custom_data_size ); + } + } + + if( in->status == VP_API_STATUS_ENDED ) + out->status = in->status; + + if( out->status == VP_API_STATUS_PROCESSING ) + cfg->input_ptr = (uint8_t*)in->buffers[in->indexBuffer]; + + if(out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) + { + int32_t copied_size, y_size, c_size = 0; + // If out->size == 1 it means picture is ready + out->size = 0; + out->status = VP_API_STATUS_PROCESSING; + + y_size = cfg->block_mode_enable ? cfg->y_blockline_size : cfg->y_buffer_size; + c_size = cfg->luma_only ? 0 : y_size / 4; + + while(in->size > 0 && cfg->y_current_size < cfg->y_buffer_size) + { + if( in->size > 0 && cfg->cumulated_size < y_size ) + { + copied_size = copy_input_to_buffer( cfg->y_buf_ptr, in->size, y_size - cfg->cumulated_size, cfg ); + + cfg->y_buf_ptr += copied_size; + in->size -= copied_size; + } + + if(!cfg->luma_only) + { + if( in->size > 0 && cfg->cumulated_size >= y_size && (cfg->cumulated_size < y_size + c_size) ) + { + copied_size = copy_input_to_buffer( cfg->cb_buf_ptr, in->size, y_size + c_size - cfg->cumulated_size, cfg ); + + cfg->cb_buf_ptr += copied_size; + in->size -= copied_size; + } + + if( in->size > 0 && (cfg->cumulated_size >= y_size + c_size) && (cfg->cumulated_size < y_size + 2*c_size) ) + { + copied_size = copy_input_to_buffer( cfg->cr_buf_ptr, in->size, y_size + 2*c_size - cfg->cumulated_size, cfg ); + + cfg->cr_buf_ptr += copied_size; + in->size -= copied_size; + } + } + + if( cfg->cumulated_size == y_size + 2*c_size ) + { + cfg->cumulated_size = 0; + cfg->y_current_size += y_size; + } + } + + if( cfg->custom_data_size > 0 && cfg->y_current_size >= cfg->y_buffer_size ) + { + // we got one picture (handle case 1) + if( in->size > 0 && cfg->custom_data_read != cfg->custom_data_size ) + { + copied_size = copy_input_to_buffer( cfg->custom_data_ptr + cfg->custom_data_read, + in->size, cfg->custom_data_size - cfg->custom_data_read, + cfg ); + + cfg->custom_data_read += copied_size; + in->size -= copied_size; + + cfg->y_current_size += copied_size; + cfg->cumulated_size = 0; + } + } + + // All buffers are full but there's still data + if( in->size > 0 ) + out->status = VP_API_STATUS_STILL_RUNNING; + + if( cfg->y_current_size == (cfg->y_buffer_size+cfg->custom_data_size) ) + { + // we got one picture (handle case 1) + out->size = 1; + + cfg->num_picture_decoded++; + + cfg->custom_data_read = 0; + cfg->y_current_size = 0; + cfg->y_buf_ptr = cfg->picture->y_buf; + if(!cfg->luma_only) + { + cfg->cb_buf_ptr = cfg->picture->cb_buf; + cfg->cr_buf_ptr = cfg->picture->cr_buf; + } + + if( cfg->custom_data_handler != NULL ) + { + cfg->custom_data_handler( (void*)&cfg->custom_data_ptr[0], cfg->custom_data_size ); + } + } + } + + vp_os_mutex_unlock(&out->lock); + + return C_OK; +} + + +C_RESULT vp_stages_buffer_to_picture_close(vp_stages_buffer_to_picture_config_t *cfg) +{ + return C_OK; +} + + + +// +// Picture to Buffer conversion +// +C_RESULT vp_stages_picture_to_buffer_open(vp_stages_picture_to_buffer_config_t *cfg) +{ + return C_OK; +} + +C_RESULT vp_stages_picture_to_buffer_transform(vp_stages_picture_to_buffer_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + int32_t y_size, c_size; + + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + + cfg->y_buffer_size = cfg->picture->width*cfg->picture->height; + cfg->y_blockline_size = cfg->picture->width*CAMIF_BLOCKLINES; // each blockline have 16 lines + + y_size = cfg->block_mode_enable ? cfg->y_blockline_size : cfg->y_buffer_size; + c_size = cfg->luma_only ? 0 : y_size / 4; + + // We alloc an array big enough to hold all ours data + out->buffers = (int8_t**) vp_os_malloc( (y_size+2*c_size+cfg->custom_data_size)*sizeof(int8_t) + sizeof(int8_t*)); + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + + out->buffers[0] = (int8_t *)(out->buffers+1); + } + else + { + y_size = cfg->block_mode_enable ? cfg->y_blockline_size : cfg->y_buffer_size; + c_size = cfg->luma_only ? 0 : y_size / 4; + } + + out->size = 0; + + if( out->status == VP_API_STATUS_PROCESSING && in->size > 0 ) + { + uint8_t *y_ptr; + + y_ptr = cfg->picture->y_buf; + + if( cfg->block_mode_enable ) + { + // Find blockline + y_ptr += cfg->picture->blockline*y_size; + } + + vp_os_memcpy( out->buffers[0], y_ptr, y_size ); + out->size = y_size; + + if( !cfg->luma_only ) + { + uint8_t *cb_ptr, *cr_ptr; + + cb_ptr = cfg->picture->cb_buf; + cr_ptr = cfg->picture->cr_buf; + + if( cfg->block_mode_enable ) + { + cb_ptr += cfg->picture->blockline*c_size; + cr_ptr += cfg->picture->blockline*c_size; + } + + vp_os_memcpy( out->buffers[0] + y_size, cb_ptr, c_size); + vp_os_memcpy( out->buffers[0] + y_size + c_size, cr_ptr, c_size); + + out->size += 2*c_size; + } + + if( cfg->custom_data_handler && cfg->picture->complete ) + { + cfg->custom_data_handler( out->buffers[0] + out->size, cfg->custom_data_size ); + + out->size += cfg->custom_data_size; + } + } + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return C_OK; +} + +C_RESULT vp_stages_picture_to_buffer_close(vp_stages_picture_to_buffer_config_t *cfg) +{ + return C_OK; +} diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.h new file mode 100644 index 0000000..351a50e --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_buffer_to_picture.h @@ -0,0 +1,66 @@ + +#ifndef _BUFFER_TO_PICTURE_H_ +#define _BUFFER_TO_PICTURE_H_ + + +#include +#include + +typedef void (*custom_data_handler_cb)(void* data, int32_t custom_data_size); + +typedef struct _vp_stages_buffer_to_picture_config_t +{ + vp_api_picture_t* picture; + int32_t y_buffer_size; + int32_t y_blockline_size; + int32_t y_current_size; + + int32_t num_frames; + + uint8_t* y_buf_ptr; + uint8_t* cr_buf_ptr; + uint8_t* cb_buf_ptr; + + bool_t luma_only; + bool_t block_mode_enable; + + int32_t cumulated_size; + uint8_t* input_ptr; + + int32_t num_picture_decoded; + + uint32_t custom_data_size; + uint32_t custom_data_read; + uint8_t* custom_data_ptr; + custom_data_handler_cb custom_data_handler; + +} vp_stages_buffer_to_picture_config_t; + +typedef struct _vp_stages_picture_to_buffer_config_t +{ + vp_api_picture_t* picture; + int32_t y_buffer_size; + int32_t y_blockline_size; + + bool_t luma_only; + bool_t block_mode_enable; + + int32_t num_picture_encoded; + + uint32_t custom_data_size; + custom_data_handler_cb custom_data_handler; + +} vp_stages_picture_to_buffer_config_t; + + +C_RESULT vp_stages_buffer_to_picture_open(vp_stages_buffer_to_picture_config_t *cfg); +C_RESULT vp_stages_buffer_to_picture_transform(vp_stages_buffer_to_picture_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT vp_stages_buffer_to_picture_close(vp_stages_buffer_to_picture_config_t *cfg); + + +C_RESULT vp_stages_picture_to_buffer_open(vp_stages_picture_to_buffer_config_t *cfg); +C_RESULT vp_stages_picture_to_buffer_transform(vp_stages_picture_to_buffer_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); +C_RESULT vp_stages_picture_to_buffer_close(vp_stages_picture_to_buffer_config_t *cfg); + +#endif // _BUFFER_TO_PICTURE_H_ + diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.c new file mode 100644 index 0000000..7a83204 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.c @@ -0,0 +1,251 @@ + +/** + * \brief VP Stages. Vision Stage default configurations + * \author Aurelien Morelle + * \version 1.0 + * \date first release 2007/11/06 + */ + + +#include +#include +#include + +#include + +#include + +#if defined(USE_LINUX) +# include +#endif // USE_LINUX + +vp_api_picture_t vp_api_picture; + +#if defined(USE_LINUX) +static vp_stages_output_sdl_config_t +decoding_qcif_sdl_config = { + .width = QVGA_WIDTH, + .height = QVGA_HEIGHT, + .bpp = 16, + .window_width = QVGA_WIDTH, + .window_height = QVGA_HEIGHT, + .pic_width = QCIF_WIDTH, + .pic_height = QCIF_HEIGHT, + .y_size = QCIF_WIDTH*QCIF_HEIGHT, + .c_size = (QCIF_WIDTH*QCIF_HEIGHT)>>2, +}; + + +static vp_stages_output_sdl_config_t +raw_qcif_sdl_config = { + .width = QVGA_WIDTH, + .height = QVGA_HEIGHT, + .bpp = 16, + .window_width = QVGA_WIDTH, + .window_height = QVGA_HEIGHT, + .pic_width = QCIF_WIDTH, + .pic_height = QCIF_HEIGHT, + .y_size = QCIF_WIDTH*QCIF_HEIGHT, + .c_size = 0, +}; + + +static vp_stages_output_sdl_config_t +raw_qqcif_sdl_config = { + .width = QVGA_WIDTH, + .height = QVGA_HEIGHT, + .bpp = 16, + .window_width = QVGA_WIDTH, + .window_height = QVGA_HEIGHT, + .pic_width = QQCIF_WIDTH, + .pic_height = QQCIF_HEIGHT, + .y_size = QQCIF_WIDTH*QQCIF_HEIGHT, + .c_size = 0, +}; + + +static vp_stages_output_sdl_config_t +decoding_qvga_sdl_config = { + .width = QVGA_WIDTH, + .height = QVGA_HEIGHT, + .bpp = 16, + .window_width = QVGA_WIDTH, + .window_height = QVGA_HEIGHT, + .pic_width = QVGA_WIDTH, + .pic_height = QVGA_HEIGHT, + .y_size = QVGA_WIDTH*QVGA_HEIGHT, + .c_size = (QVGA_WIDTH*QVGA_HEIGHT)>>2, +}; + + +static vp_stages_output_sdl_config_t +raw_qvga_sdl_config = { + .width = QVGA_WIDTH, + .height = QVGA_HEIGHT, + .bpp = 16, + .window_width = QVGA_WIDTH, + .window_height = QVGA_HEIGHT, + .pic_width = QVGA_WIDTH, + .pic_height = QVGA_HEIGHT, + .y_size = QVGA_WIDTH*QVGA_HEIGHT, + .c_size = 0, +}; + +static vp_stages_output_sdl_config_t +raw_tweaky_qqvga_sdl_config = { + .width = QVGA_WIDTH, + .height = QVGA_HEIGHT, + .bpp = 16, + .window_width = QVGA_WIDTH, + .window_height = QVGA_HEIGHT, + .pic_width = TWEAKY_QQVGA_WIDTH, + .pic_height = TWEAKY_QQVGA_HEIGHT, + .y_size = TWEAKY_QQVGA_WIDTH*TWEAKY_QQVGA_HEIGHT, + .c_size = 0, +}; +#endif // ! __linux__ || USE_MINGW32 + +#if defined(USE_LINUX) +static vp_com_serial_config_t +uart0_serial_config = { +#ifdef __linux__ + .itfName = "/dev/ttyUSB0", +#else // ! __linux__ + .itfName = "/dev/ser0", +#endif // -> __linux__ + .blocking = 1, + .sync = 1, + .sync_done = 0, + .initial_baudrate = VP_COM_BAUDRATE_115200, + .baudrate = VP_COM_BAUDRATE_460800, +}; + + +static vp_com_serial_config_t +uart1_serial_config = { +#ifdef __linux__ + .itfName = "/dev/ttyUSB1", +#else // ! __linux__ + .itfName = "/dev/ser1", +#endif // -> __linux__ + .blocking = 1, + .sync = 1, + .sync_done = 0, + .initial_baudrate = VP_COM_BAUDRATE_115200, + .baudrate = VP_COM_BAUDRATE_460800, +}; +#endif // ! __NDS__ + + +#if defined(USE_BLUEZ) +static vp_com_bluetooth_config_t +bluetooth_config = { + .itfName = "bnep0", +#ifdef __linux__ + .localHost = "192.168.2.58", +#else // ! __linux__ + .localHost = "192.168.2.23", +#endif // -> __linux__ + .netmask = "255.255.255.0", + .broadcast = "192.168.2.255", + .gateway = "192.168.2.0", + .server = "192.168.2.0", + .secure = 1, + .passkey = "1234", +}; +#endif // ! defined(USE_BLUEZ) + + +#ifdef USE_WIFI +static vp_com_wifi_config_t +wifi_config = { +#ifdef __linux__ + .itfName = "rausb0", + .localHost = "10.10.10.2", +#else // ! __linux__ + .itfName = "wl0", + .localHost = "10.10.10.1", +#endif // -> __linux__ + .netmask = "255.255.255.0", + .broadcast = "10.10.10.255", + .gateway = "10.10.10.2", + .server = "10.10.10.1", + .secure = 1, + .passkey = "9F1C3EE11CBA230B27BF1C1B6F", + .infrastructure = 1, +}; +#endif // ! USE_WIFI + + +#define _internal_vp_stages_fill_default_config(cfg, config, size) \ + do \ + { \ + VP_OS_ASSERT(size >= sizeof(config)); \ + vp_os_memcpy(cfg, &config, sizeof(config)); \ + } \ + while(0) + + +C_RESULT +vp_stages_fill_default_config(DEFAULT_STAGE_CONFIG config, void *cfg, size_t size) +{ + C_RESULT res = VP_SUCCESS; + + VP_OS_ASSERT(cfg); + VP_OS_ASSERT(size); + + vp_os_memset(cfg, 0, size); + + switch(config) + { + +#if defined(USE_LINUX) + case SDL_RAW_QCIF_CONFIG: + _internal_vp_stages_fill_default_config(cfg, raw_qcif_sdl_config, size); + break; + case SDL_RAW_QQCIF_CONFIG: + _internal_vp_stages_fill_default_config(cfg, raw_qqcif_sdl_config, size); + break; + case SDL_DECODING_QCIF_CONFIG: + _internal_vp_stages_fill_default_config(cfg, decoding_qcif_sdl_config, size); + break; + case SDL_RAW_QVGA_CONFIG: + _internal_vp_stages_fill_default_config(cfg, raw_qvga_sdl_config, size); + break; + case SDL_RAW_TWEAKY_QQVGA_CONFIG: + _internal_vp_stages_fill_default_config(cfg, raw_tweaky_qqvga_sdl_config, size); + break; + case SDL_DECODING_QVGA_CONFIG: + _internal_vp_stages_fill_default_config(cfg, decoding_qvga_sdl_config, size); + break; +#endif // ! __linux__ || USE_MINGW32 || USE_ELINUX + +#if defined(USE_LINUX) + case UART0_COM_CONFIG: + _internal_vp_stages_fill_default_config(cfg, uart0_serial_config, size); + break; + case UART1_COM_CONFIG: + _internal_vp_stages_fill_default_config(cfg, uart1_serial_config, size); + break; +#endif // ! __NDS__ + +#if defined(USE_BLUEZ) + case BLUETOOTH_COM_CONFIG: + _internal_vp_stages_fill_default_config(cfg, bluetooth_config, size); + break; +#endif // ! defined(USE_BLUEZ) +#ifdef USE_WIFI + case WIFI_COM_CONFIG: + _internal_vp_stages_fill_default_config(cfg, wifi_config, size); + break; +#endif // ! USE_WIFI + default: + res = VP_FAILURE; + break; + } + + return res; +} + +#undef _internal_vp_stages_fill_default_config + diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.h new file mode 100644 index 0000000..6cb6122 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_configs.h @@ -0,0 +1,54 @@ + +/** + * \brief VP Stages. Vision Stage default configurations + * \author Aurelien Morelle + * \version 1.0 + * \date first release 2007/11/06 + */ + +#ifndef _VP_STAGES_DEFAULT_CONFIG_ +#define _VP_STAGES_DEFAULT_CONFIG_ + + +#include +#include + + +extern vp_api_picture_t vp_api_picture; + + +typedef enum _DEFAULT_STAGE_CONFIG_ + { + CONFIG_LB, + + CAMIF_RAW_QCIF_VS6524_CONFIG, + CAMIF_ENCODING_QCIF_VS6524_CONFIG, + CAMIF_RAW_QCIF_OV7720_CONFIG, + CAMIF_ENCODING_QCIF_OV7720_CONFIG, + + ENCODER_MPEG4_CONFIG, + DECODER_MPEG4_CONFIG, + + SDL_RAW_QCIF_CONFIG, + SDL_RAW_QQCIF_CONFIG, + SDL_DECODING_QCIF_CONFIG, + SDL_RAW_QVGA_CONFIG, + SDL_DECODING_QVGA_CONFIG, + SDL_RAW_TWEAKY_QQVGA_CONFIG, + + UART0_COM_CONFIG, + UART1_COM_CONFIG, + BLUETOOTH_COM_CONFIG, + WIFI_COM_CONFIG, + + CONFIG_UB + } +DEFAULT_STAGE_CONFIG; + + +C_RESULT +vp_stages_fill_default_config(DEFAULT_STAGE_CONFIG config, void *cfg, size_t size); + + +#endif // ! _VP_STAGES_DEFAULT_CONFIG_ + diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.c new file mode 100644 index 0000000..c33d6d0 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.c @@ -0,0 +1,135 @@ +#include +#include +#ifdef USE_ELINUX +#include "dma_malloc.h" +#define vp_os_malloc(a) dma_malloc(a) +#endif +//#include + +// Sender function +C_RESULT +vp_stages_frame_pipe_sender_open(vp_stages_frame_pipe_config_t *cfg) +{ + if (cfg->inPicture == NULL) + return C_FAIL; + else + return C_OK; +} + +C_RESULT +vp_stages_frame_pipe_sender_transform(vp_stages_frame_pipe_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + uint32_t y_length; + uint32_t cc_length; + + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + // initialize receiver vp_api_picture + cfg->outPicture.format = cfg->inPicture->format; + cfg->outPicture.width = cfg->inPicture->width; + cfg->outPicture.height = cfg->inPicture->height; + cfg->outPicture.framerate = cfg->inPicture->framerate; + + cfg->outPicture.y_pad = cfg->inPicture->y_pad; + cfg->outPicture.c_pad = cfg->inPicture->c_pad; + cfg->outPicture.y_line_size = cfg->inPicture->y_line_size; + cfg->outPicture.cb_line_size = cfg->inPicture->cb_line_size; + cfg->outPicture.cr_line_size = cfg->inPicture->cr_line_size; + cfg->outPicture.vision_complete = cfg->inPicture->vision_complete; + cfg->outPicture.complete = cfg->inPicture->complete; + cfg->outPicture.blockline = cfg->inPicture->blockline; + + + y_length = cfg->inPicture->y_line_size * cfg->inPicture->height; + cc_length = cfg->inPicture->cb_line_size * cfg->inPicture->height>>1; + + cfg->frame_size = y_length + 2*cc_length; + + cfg->outPicture.y_buf = vp_os_malloc (cfg->frame_size * sizeof(int8_t)); + cfg->outPicture.cb_buf = cfg->outPicture.y_buf + y_length; + cfg->outPicture.cr_buf = cfg->outPicture.cb_buf + cc_length; + + // wire in to out + vp_os_memcpy (out, in, sizeof(vp_api_io_data_t)); + out->status = VP_API_STATUS_PROCESSING; + } + + if( out->status == VP_API_STATUS_PROCESSING ) + { + vp_os_mutex_lock(&(cfg->pipe_mut)); + { + if (cfg->pipe_state == WAIT_RECEPTION) + { + // send buffer + //LTT_WRITEF ("Pipe start"); + vp_os_memcpy (cfg->outPicture.y_buf,in->buffers[in->indexBuffer],in->size); + //LTT_WRITEF ("Pipe stop"); + // signal end of copy + cfg->pipe_state = PAUSE; + vp_os_cond_signal (&(cfg->buffer_sent)); + } + } + vp_os_mutex_unlock(&(cfg->pipe_mut)); + } + + vp_os_mutex_unlock(&out->lock); + + return C_OK; +} + +C_RESULT +vp_stages_frame_pipe_sender_close(vp_stages_frame_pipe_config_t *cfg) +{ + return C_OK; +} + +// Receiver function +C_RESULT +vp_stages_frame_pipe_receiver_open(vp_stages_frame_pipe_config_t *cfg) +{ + return C_OK; +} + +C_RESULT +vp_stages_frame_pipe_receiver_transform(vp_stages_frame_pipe_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->indexBuffer = 0; + out->status = VP_API_STATUS_PROCESSING; + } + + if( out->status == VP_API_STATUS_PROCESSING ) + { + vp_os_mutex_lock(&(cfg->pipe_mut)); + { + cfg->pipe_state = WAIT_RECEPTION; + vp_os_cond_wait (&(cfg->buffer_sent)); + // at this moment, we are sure that cfg->outPicture was initialized by the sender + out->buffers = (int8_t**)&(cfg->outPicture.y_buf); + out->size = cfg->frame_size; + } + vp_os_mutex_unlock(&(cfg->pipe_mut)); + + if (cfg->callback != NULL) + cfg->callback(); + } + + vp_os_mutex_unlock(&out->lock); + + return C_OK; +} + +C_RESULT +vp_stages_frame_pipe_receiver_close(vp_stages_frame_pipe_config_t *cfg) +{ + vp_os_free (cfg->outPicture.y_buf); + vp_os_cond_destroy (&(cfg->buffer_sent)); + vp_os_mutex_destroy (&(cfg->pipe_mut)); + return C_OK; +} diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.h new file mode 100644 index 0000000..c5be706 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_frame_pipe.h @@ -0,0 +1,63 @@ +#ifndef _VP_STAGES_FRAME_PIPE_H_ +#define _VP_STAGES_FRAME_PIPE_H_ + + +#include +#include + +/////////////////////////////////////////////// +// TYPEDEFS + + +typedef enum _BUFFER_PIPE_STATE +{ + WAIT_RECEPTION, + PAUSE +} BUFFER_PIPE_STATE; + + +/** + * \typedef pipe parameters definition + */ +typedef struct _vp_stages_frame_pipe_config_ +{ + // public + vp_api_picture_t* inPicture; + vp_api_picture_t outPicture; + + // private + BUFFER_PIPE_STATE pipe_state; + vp_os_mutex_t pipe_mut; + vp_os_cond_t buffer_sent; + uint32_t frame_size; + + void (*callback)(void); +} +vp_stages_frame_pipe_config_t; + + +/////////////////////////////////////////////// +// FUNCTIONS + +// Sender function +C_RESULT +vp_stages_frame_pipe_sender_open(vp_stages_frame_pipe_config_t *cfg); + +C_RESULT +vp_stages_frame_pipe_sender_transform(vp_stages_frame_pipe_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +C_RESULT +vp_stages_frame_pipe_sender_close(vp_stages_frame_pipe_config_t *cfg); + +// Receiver function +C_RESULT +vp_stages_frame_pipe_receiver_open(vp_stages_frame_pipe_config_t *cfg); + +C_RESULT +vp_stages_frame_pipe_receiver_transform(vp_stages_frame_pipe_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +C_RESULT +vp_stages_frame_pipe_receiver_close(vp_stages_frame_pipe_config_t *cfg); +#endif + + diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_i_camif.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_i_camif.h new file mode 100644 index 0000000..830d29a --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_i_camif.h @@ -0,0 +1,70 @@ +/** + * \file vp_stages_i_camif.h + * \brief VP_Stages. camif stage declaration + */ + +#ifndef _VP_STAGES_I_CAMIF_H_ +#define _VP_STAGES_I_CAMIF_H_ + +/** + * @defgroup VP_SDK + * @{ */ + +/** + * @defgroup VP_Stages + * @{ */ + +/** + * @defgroup vp_stages_i_camif input camif stage + * @{ */ + +#include +#include +#define ICAMIF_STACK_SIZE 8192 + +#ifdef _INCLUDED_FOR_DOXYGEN_ +#else // ! _INCLUDED_FOR_DOXYGEN_ + +#include + +//! a block is 2^4 = 16 lines +# define CAMIF_BLOCKLINES_LOG2 4 +# define CAMIF_BLOCKLINES (1 << CAMIF_BLOCKLINES_LOG2) + +#define CAMIF_MAX_BUFFERS 8 +#define CAMIF_MIN_BUFFERS 4 + +typedef enum _CAMIF_RESOLUTION +{ + CAMIF_RES_LB, + + CAMIF_RES_SQCIF, + CAMIF_RES_QCIF, + CAMIF_RES_QVGA, + CAMIF_RES_CIF, + CAMIF_RES_VGA, + CAMIF_RES_QQCIF, + CAMIF_RES_TWEAKY_QQVGA, + + CAMIF_RES_UB +} CAMIF_RESOLUTION; +#endif // < _INCLUDED_FOR_DOXYGEN_ + + +/////////////////////////////////////////////// +// TYPEDEFS + +typedef enum _CAPTURE_STATE +{ + RUNNING, + STOPPED +} CAPTURE_STATE; + +// vp_stages_i_camif +/** @} */ +// VP_Stages +/** @} */ +// VP_SDK +/** @} */ + +#endif // > _VP_STAGES_I_CAMIF_H_ diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.c new file mode 100644 index 0000000..6d292f4 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.c @@ -0,0 +1,116 @@ +/** + * \brief VP Stages. Buffer stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + + +#include +#include +#include +#include +#include + + +C_RESULT +vp_stages_input_buffer_stage_open(vp_stages_input_buffer_config_t *cfg) +{ + VP_OS_ASSERT(cfg->buffer); + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_input_buffer_stage_transform(vp_stages_input_buffer_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = 0; + out->buffers = &cfg->buffer; + out->indexBuffer = 0; + cfg->remaining_size = cfg->total_size; + } + + if(cfg->remaining_size != 0) + { + out->status = VP_API_STATUS_PROCESSING; + out->buffers[out->indexBuffer] += out->size; + out->size = (cfg->remaining_size < cfg->send_size ? cfg->remaining_size : cfg->send_size); + cfg->remaining_size -= out->size; + } + else + { + out->status = VP_API_STATUS_ENDED; + } + + vp_os_mutex_unlock(&out->lock); + + DEBUG_PRINT_SDK("vp_stages_input_buffer : size=%d buffer=%08X remaining=%d\n", (int)out->size, (int)out->buffers[out->indexBuffer], (int)cfg->remaining_size); + + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_input_buffer_stage_close(vp_stages_input_buffer_config_t *cfg) +{ + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_buffer_stage_open(vp_stages_output_buffer_config_t *cfg) +{ + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_buffer_stage_transform(vp_stages_output_buffer_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = in->size; + out->buffers = (int8_t **)vp_os_malloc(sizeof(int8_t *)+out->size*sizeof(int8_t)); + out->buffers[0] = (int8_t *)(out->buffers+1); + out->indexBuffer = 0; + // out->lineSize not used + out->status = VP_API_STATUS_PROCESSING; + } + + // \todo test + if(in->status == VP_API_STATUS_PROCESSING) + { + PRINT("One frame.\n"); + vp_os_memcpy(out->buffers[0], &in->buffers[in->indexBuffer][0], in->size*sizeof(int8_t)); + } + + if(in->status == VP_API_STATUS_ENDED) + vp_os_free(out->buffers); + + out->status = in->status; + + vp_os_mutex_unlock(&out->lock); + + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_buffer_stage_close(vp_stages_output_buffer_config_t *cfg) +{ + return (VP_SUCCESS); +} diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.h new file mode 100644 index 0000000..55e008d --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_buffer.h @@ -0,0 +1,123 @@ +/** + * \brief VP Stages. Buffer stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +#ifndef _VP_STAGES_IO_BUFFER_H_ +#define _VP_STAGES_IO_BUFFER_H_ + +/** + * @defgroup VP_SDK + * @{ */ + +/** + * @defgroup VP_Stages + * @{ */ + +/** + * @defgroup vp_stages_io_buffer input/output buffers stage + * @{ */ + + +/////////////////////////////////////////////// +// INCLUDE + +#include + + +/////////////////////////////////////////////// +// TYPEDEFS + +/** + * \typedef enumerate all the camera resolution supported in camif + */ + +typedef struct _vp_stages_input_buffer_config_ +{ + int8_t *buffer; + uint32_t total_size; + uint32_t send_size; + + // private + uint32_t remaining_size; +} vp_stages_input_buffer_config_t; + +typedef struct _vp_stages_output_buffer_config_ vp_stages_output_buffer_config_t; + + + +/////////////////////////////////////////////// +// FUNCTIONS + + +/** + * @fn Open the input buffer stage + * @param vp_stages_input_buffer_config_t *cfg : configuration of buffer parameters + * @todo modify the return + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_buffer_stage_open(vp_stages_input_buffer_config_t *cfg); + +/** + * @fn Transform the buffer input stage + * @brief Select the right indexbuffer of cfg and increment the size and the data pointer to the output + * @param vp_stages_input_buffer_config_t *cfg : data cfg buffer is send to out buffer + * @param vp_api_io_data_t *in : not used here + * @param vp_api_io_data_t *out : used to send the data + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_stages_input_buffer_stage_transform(vp_stages_input_buffer_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Close the input buffer stage + * @brief Nothing to do + * @param vp_stages_input_buffer_config_t *cfg + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_buffer_stage_close(vp_stages_input_buffer_config_t *cfg); + +/** + * @fn Open the output buffer stage + * @brief Nothing to do + * @param vp_stages_input_buffer_config_t *cfg + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_buffer_stage_open(vp_stages_output_buffer_config_t *cfg); + +/** + * @fn Transform the output buffer stage + * @param vp_stages_input_buffer_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_stages_output_buffer_stage_transform(vp_stages_output_buffer_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Close the output buffer stage + * @brief Nothing to do + * @param vp_stages_input_buffer_config_t *cfg + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_buffer_stage_close(vp_stages_output_buffer_config_t *cfg); + +// vp_stages_io_buffer +/** @} */ +// VP_Stages +/** @} */ +// VP_SDK +/** @} */ + +#endif // ! _VP_STAGES_IO_BUFFER_H_ diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.c new file mode 100644 index 0000000..2c3eed8 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.c @@ -0,0 +1,190 @@ +/** + * \brief VP Stages. Com stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +#include +#include +#include +#include +#include + +C_RESULT +vp_stages_input_com_stage_open(vp_stages_input_com_config_t *cfg) +{ + C_RESULT res; + + res = vp_com_init(cfg->com); + + if( VP_SUCCEEDED(res) ) + { + vp_com_local_config(cfg->com, cfg->config); + + if(cfg->connection && !cfg->connection->is_up) + { + res = vp_com_connect(cfg->com, cfg->connection, 1); + } + } + + if( VP_SUCCEEDED(res) ) + res = vp_com_open(cfg->com, &cfg->socket, &cfg->read, 0); + + if( VP_SUCCEEDED(res) ) + { + if(cfg->socket.type == VP_COM_SERVER) + { + res = vp_com_wait_connections(cfg->com, &cfg->socket, &cfg->socket_client, 1); + } + else + { + vp_os_memcpy(&cfg->socket_client, &cfg->socket, sizeof(vp_com_socket_t)); + } + vp_com_sockopt(cfg->com, &cfg->socket_client, cfg->sockopt); + } + + // \todo test + return res; +} + + +C_RESULT +vp_stages_input_com_stage_transform(vp_stages_input_com_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = cfg->buffer_size; + out->buffers = (int8_t **) vp_os_malloc (sizeof(int8_t *)+out->size*sizeof(int8_t)); + out->buffers[0] = (int8_t *)(out->buffers+1); + out->indexBuffer = 0; + // out->lineSize not used + + out->status = VP_API_STATUS_PROCESSING; + } + + if(out->status == VP_API_STATUS_PROCESSING && cfg->read != NULL) + { + out->size = cfg->buffer_size; + + if(VP_FAILED(cfg->read(&cfg->socket_client, out->buffers[0], &out->size))) + out->status = VP_API_STATUS_ERROR; + } + + vp_os_mutex_unlock(&out->lock); + + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_input_com_stage_close(vp_stages_input_com_config_t *cfg) +{ + // \todo test + + // \todo Faire ca dans le transform en detectant la fin d'une connection + vp_com_close(cfg->com, &cfg->socket_client); + + if(cfg->socket.type == VP_COM_SERVER) + vp_com_close(cfg->com, &cfg->socket); + + if(cfg->connection && cfg->connection->is_up) + vp_com_disconnect(cfg->com); + + vp_com_shutdown(cfg->com); + + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_com_stage_open(vp_stages_output_com_config_t *cfg) +{ + C_RESULT res; + + res = vp_com_init(cfg->com); + + if( VP_SUCCEEDED(res) ) + { + vp_com_local_config(cfg->com, cfg->config); + + if(cfg->connection && !cfg->connection->is_up) + { + res = vp_com_connect(cfg->com, cfg->connection, 1); + } + } + + if( VP_SUCCEEDED(res) && VP_FAILED(vp_com_open(cfg->com, &cfg->socket, 0, &cfg->write))) + res = C_FAIL; + + if( VP_SUCCEEDED(res) ) + { + if(cfg->socket.type == VP_COM_SERVER) + { + res = vp_com_wait_connections(cfg->com, &cfg->socket, &cfg->socket_client, 1); + } + else + { + vp_os_memcpy(&cfg->socket_client, &cfg->socket, sizeof(vp_com_socket_t)); + } + + vp_com_sockopt(cfg->com, &cfg->socket_client, cfg->sockopt); + } + + // \todo test + return res; +} + + +C_RESULT +vp_stages_output_com_stage_transform(vp_stages_output_com_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + + if(out->status == VP_API_STATUS_INIT) + { + out->status = VP_API_STATUS_PROCESSING; + } + + // \todo test + if(out->status != VP_API_STATUS_ERROR) + { + out->size = in->size; + if(in->size > 0 && cfg->write != NULL) + { + cfg->write(&cfg->socket_client, &in->buffers[in->indexBuffer][0], &out->size); + } + + out->status = in->status; + } + // \todo test + + vp_os_mutex_unlock(&out->lock); + + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_com_stage_close(vp_stages_output_com_config_t *cfg) +{ + // \todo Faire ca dans le transform en detectant la fin d'une connection + vp_com_close(cfg->com, &cfg->socket_client); + + if(cfg->socket.type == VP_COM_SERVER) + vp_com_close(cfg->com, &cfg->socket); + + // \todo test + if(cfg->connection && cfg->connection->is_up) + vp_com_disconnect(cfg->com); + + vp_com_shutdown(cfg->com); + + return (VP_SUCCESS); +} diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.h new file mode 100644 index 0000000..7f87f68 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_com.h @@ -0,0 +1,141 @@ +/** + * \brief VP Stages. Com stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +#ifndef _VP_STAGES_IO_COM_H_ +#define _VP_STAGES_IO_COM_H_ + +/** + * @defgroup VP_SDK + * @{ */ + +/** + * @defgroup VP_Stages + * @{ */ + +/** + * @defgroup vp_stages_io_com input/output communcation stage + * @{ */ + + +#include +#include + +/////////////////////////////////////////////// +// TYPEDEFS + +typedef struct _vp_stages_input_com_config_ +{ + vp_com_t* com; + + vp_com_config_t* config; + vp_com_connection_t* connection; + + vp_com_socket_t socket; + VP_COM_SOCKET_OPTIONS sockopt; + + uint32_t buffer_size; + + // Private Datas + vp_com_socket_t socket_client; // Socket used for read / write + Read read; + +} vp_stages_input_com_config_t; + +typedef struct _vp_stages_output_com_config_ +{ + vp_com_t* com; + + vp_com_config_t* config; + vp_com_connection_t* connection; + + vp_com_socket_t socket; + VP_COM_SOCKET_OPTIONS sockopt; + + uint32_t buffer_size; + + // Private Datas + vp_com_socket_t socket_client; // Socket used for read / write + Write write; + +} vp_stages_output_com_config_t; + + +/////////////////////////////////////////////// +// FUNCTIONS + +/** + * @fn Open the input com stage + * @param vp_stages_input_com_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_com_stage_open(vp_stages_input_com_config_t *cfg); + + +/** + * @fn Transform the input com stage + * @param vp_stages_input_com_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_com_stage_transform(vp_stages_input_com_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Close the input com stage + * @param vp_stages_input_com_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_com_stage_close(vp_stages_input_com_config_t *cfg); + + +/** + * @fn Open the output com stage + * @param vp_stages_output_com_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_com_stage_open(vp_stages_output_com_config_t *cfg); + +/** + * @fn Transform the output com stage + * @param vp_stages_output_com_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_com_stage_transform(vp_stages_output_com_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Close the output com stage + * @param vp_stages_output_com_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_com_stage_close(vp_stages_output_com_config_t *cfg); + +// vp_stages_io_com +/** @} */ +// VP_Stages +/** @} */ +// VP_SDK +/** @} */ + + +#endif // ! _VP_STAGES_IO_COM_H_ diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.c new file mode 100644 index 0000000..6d64580 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.c @@ -0,0 +1,49 @@ +/** + * \brief VP Stages. Console stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include + + +C_RESULT +vp_stages_output_console_stage_open(void *cfg) +{ + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_console_stage_transform(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + out->buffers = in->buffers; + out->size = in->size; + if(in->status == VP_API_STATUS_PROCESSING) + { + int i; + + for(i = 0;i < out->size;i++) + PRINT("%c",in->buffers[in->indexBuffer][i]); + } + + out->status = in->status; + + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_console_stage_close(void *cfg) +{ + return (VP_SUCCESS); +} diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.h new file mode 100644 index 0000000..99ee2c0 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_console.h @@ -0,0 +1,79 @@ +/** + * \brief VP Stages. Console stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#ifndef _VP_STAGES_IO_CONSOLE_H_ +#define _VP_STAGES_IO_CONSOLE_H_ + +/** + * @defgroup VP_SDK + * @{ */ + +/** + * @defgroup VP_Stages + * @{ */ + +/** + * @defgroup vp_stages_io_console input/output console stage + * @{ */ + + +/////////////////////////////////////////////// +// INCLUDE + +#include + + +/////////////////////////////////////////////// +// FUNCTIONS + + + +/** + * @fn Open the output console stage + * @brief Nothing to do + * @param void *cfg + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_console_stage_open(void *cfg); + + +/** + * @fn Open the output console stage + * @brief Nothing to do + * @param void *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_console_stage_transform(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Close the output console stage + * @brief Nothing to do + * @param void *cfg + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_console_stage_close(void *cfg); + +// vp_stages_io_console +/** @} */ +// VP_Stages +/** @} */ +// VP_SDK +/** @} */ + +#endif // _VP_STAGES_IO_CONSOLE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.c new file mode 100644 index 0000000..65aa18a --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.c @@ -0,0 +1,136 @@ +/** + * \brief VP Stages. File stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include +#include +#include + +C_RESULT +vp_stages_input_file_stage_open(vp_stages_input_file_config_t *cfg) +{ + cfg->f = fopen(cfg->name, "rb"); + + if(cfg->f == NULL) + { + PRINT("Missing input file\n"); + return (VP_FAILURE); + } + return (VP_SUCCESS); +} + +C_RESULT +vp_stages_input_file_stage_transform(vp_stages_input_file_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + vp_os_mutex_lock(&out->lock); + uint32_t UI32_i=0; + char c; + uint32_t y_size, c_size; + if( out->status == VP_API_STATUS_INIT ) + { + out->numBuffers = 1; + out->size = cfg->buffer_size; + out->buffers = (int8_t **) vp_os_malloc (sizeof(int8_t *)+out->size*sizeof(int8_t)); + out->buffers[0] = (int8_t *)(out->buffers+1); + out->indexBuffer = 0; + // out->lineSize not used + out->status = VP_API_STATUS_PROCESSING; + } + + // work and update status + if(out->size < (int32_t)cfg->buffer_size || feof(cfg->f)) + { + if (cfg->loop) + { + rewind(cfg->f); + } + else + { + //vp_os_free(out->buffers); + out->status = VP_API_STATUS_ENDED; + } + } + else + { + if(out->status == VP_API_STATUS_PROCESSING) + out->size = fread(out->buffers[0], sizeof(int8_t), cfg->buffer_size*sizeof(int8_t), cfg->f); + + if(out->size <= 0) + { + if (cfg->loop) + { + rewind(cfg->f); + out->size = fread(out->buffers[0], sizeof(int8_t), cfg->buffer_size*sizeof(int8_t), cfg->f); + } + else + { + vp_os_free(out->buffers); + out->status = VP_API_STATUS_ENDED; + } + } + + if(ferror(cfg->f)) + { + PRINT("ferror\n"); + out->status = VP_API_STATUS_ERROR; + } + } + + vp_os_mutex_unlock(&out->lock); + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_input_file_stage_close(vp_stages_input_file_config_t *cfg) +{ + fclose(cfg->f); + return (VP_SUCCESS); +} + +C_RESULT +vp_stages_output_file_stage_open(vp_stages_output_file_config_t *cfg) +{ + VP_OS_ASSERT(cfg->flush_every_nb >= 0); + cfg->f = fopen(cfg->name, "wb"); + return (VP_SUCCESS); +} + +#define RATIO 1 + +C_RESULT +vp_stages_output_file_stage_transform(vp_stages_output_file_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + static int total_size = 0; + + vp_os_mutex_lock(&out->lock); + + if(in->status == VP_API_STATUS_PROCESSING && in->size > 0) + fwrite(in->buffers[in->indexBuffer], sizeof(int8_t), in->size*sizeof(int8_t), cfg->f); + + fflush(cfg->f); + total_size += in->size; + out->status = in->status; + vp_os_mutex_unlock(&out->lock); + + return (VP_SUCCESS); +} + +C_RESULT +vp_stages_output_file_stage_close(vp_stages_output_file_config_t *cfg) +{ + fclose(cfg->f); + return (VP_SUCCESS); +} diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.h new file mode 100644 index 0000000..2cb6128 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_io_file.h @@ -0,0 +1,122 @@ +/** + * \brief VP Stages. File stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +/////////////////////////////////////////////// +// INCLUDES + +#ifndef _VP_STAGES_IO_FILE_H_ +#define _VP_STAGES_IO_FILE_H_ + + +/** + * @defgroup VP_SDK + * @{ */ + +/** + * @defgroup VP_Stages + * @{ */ + +/** + * @defgroup vp_stages_io_file input/output file stage + * @{ */ + +#include +#include + +/////////////////////////////////////////////// +// TYEPDEFS + +typedef struct _vp_stages_input_file_config_ +{ + char *name; + FILE *f; + uint32_t buffer_size; + bool_t loop; +} vp_stages_input_file_config_t; + +typedef struct _vp_stages_output_file_config_ +{ + char *name; + FILE *f; + uint32_t flush_every_nb; + +} vp_stages_output_file_config_t; + + +/////////////////////////////////////////////// +// FUNCTIONS + +/** + * @fn Open the input file stage + * @param vp_stages_input_file_config_t *cfg + * @todo A COMMENTER + Verification de l'open + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_file_stage_open(vp_stages_input_file_config_t *cfg); + +/** + * @fn Transform the input file stage + * @param vp_stages_input_file_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_file_stage_transform(vp_stages_input_file_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Close the input file stage + * @param vp_stages_input_file_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_input_file_stage_close(vp_stages_input_file_config_t *cfg); + + +/** + * @fn Open the output file stage + * @param vp_stages_output_file_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_file_stage_open(vp_stages_output_file_config_t *cfg); + +/** + * @fn Open the output file stage + * @param vp_stages_output_file_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_file_stage_transform(vp_stages_output_file_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Open the output file stage + * @param vp_stages_output_file_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS + */ +C_RESULT +vp_stages_output_file_stage_close(vp_stages_output_file_config_t *cfg); + +// vp_stages_io_file +/** @} */ +// VP_Stages +/** @} */ +// VP_SDK +/** @} */ + +#endif // ! _VP_STAGES_IO_FILE_H_ diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.c new file mode 100644 index 0000000..897e6b0 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.c @@ -0,0 +1,378 @@ +/** + * \brief VP Stages. Output SDL stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +#if !defined(__NDS__) + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include +#include +#include +#include +#include + + +static int pipeline_opened = 0; +static vp_os_mutex_t xlib_mutex; + +#if defined(_CK4215_) && defined(WIN32) +static void * main_windows; +static void * child_windows; +static BOOL exit_pipeline; + +#ifdef _TEST_CK4215_ +static BOOL show_hide; +#endif + +void +vp_stages_init_display(void * handle) +{ + main_windows = handle; +} + +void * +vp_stages_get_child_window( void ) +{ + return child_windows; +} + +void manage_events(void) +{ + SDL_Event event; + static uint16_t x =0, y = 0; + RECT rect; + + if(SDL_PollEvent(&event)) + { + switch(event.type) + { +#if defined(_CK4215_) && defined(WIN32) + +#ifdef _TEST_CK4215_ + case SDL_MOUSEMOTION: + if(show_hide) + ShowWindow((HWND)child_windows,SW_HIDE); + else + ShowWindow((HWND)child_windows,SW_SHOW); + break; + +#endif + + case SDL_QUIT: + //exit(1); + //ExitThread(0); + if(!exit_pipeline) + { + exit_pipeline = TRUE; + } + break; +#endif + case SDL_KEYDOWN: + case SDL_KEYUP: + { + SDL_KeyboardEvent *kb_event = (SDL_KeyboardEvent *)&event; + switch(kb_event->keysym.sym) + { + case SDLK_ESCAPE: + exit(1); + break; + default: + break; + } + } + default: + break; + } + } + +} + +#endif + +PROTO_THREAD_ROUTINE(escaper,nomParams) +{ + SDL_Event event; + + while(!pipeline_opened) + { + vp_os_delay(100); + } + + while(pipeline_opened) + { + vp_os_mutex_lock(&xlib_mutex); + if(SDL_PollEvent(&event)) + { + vp_os_mutex_unlock(&xlib_mutex); + switch(event.type) + { + case SDL_KEYDOWN: + case SDL_KEYUP: + { + SDL_KeyboardEvent *kb_event = (SDL_KeyboardEvent *)&event; + switch(kb_event->keysym.sym) + { + case SDLK_ESCAPE: + exit(1); + break; + default: + break; + } + } + default: + break; + } + } + else + { + vp_os_mutex_unlock(&xlib_mutex); + } + } + return (THREAD_RET)0; +} + + +static void +vp_stages_buffer_to_overlay(SDL_Overlay *overlay, vp_stages_output_sdl_config_t *cfg, vp_api_picture_t *picture) +{ + uint8_t *dst0, *dst1, *dst2, *dst3; + uint8_t *src0, *src1, *src2, *src3; + int s0, s1, s2; + int d0, d1, d2; + int i; + + SDL_LockYUVOverlay(overlay); + + dst0 = overlay->pixels[0]; + src0 = picture->y_buf; + dst1 = overlay->pixels[1]; + src1 = picture->cr_buf; + dst2 = overlay->pixels[2]; + src2 = picture->cb_buf; + + d0 = overlay->pitches[0]; + d1 = overlay->pitches[1]; + d2 = overlay->pitches[2]; + + s0 = picture->y_line_size; + s1 = picture->cb_line_size; + s2 = picture->cr_line_size; + + dst3 = dst0 + d0 * cfg->pic_height/2; + src3 = src0 + s0 * picture->height/2; + + if(!cfg->c_size) + { + vp_os_memset(dst1, 0x80, ((cfg->pic_width/2+d1)*cfg->pic_height/2)/2); + vp_os_memset(dst2, 0x80, ((cfg->pic_width/2+d2)*cfg->pic_height/2)/2); + } + + for(i = 0 ; i < (int32_t)cfg->pic_height/2 ; i++) + { + memcpy(dst0, src0, cfg->pic_width*sizeof(char)); + dst0 += d0; + src0 += s0; + + if(cfg->c_size) + { + memcpy(dst1, src1, cfg->pic_width/2*sizeof(char)); + dst1 += d1; + src1 += s1; + + memcpy(dst2, src2, cfg->pic_width/2*sizeof(char)); + dst2 += d2; + src2 += s2; + } + + memcpy(dst3, src3, cfg->pic_width*sizeof(char)); + dst3 += d0; + src3 += s0; + } + + SDL_UnlockYUVOverlay(overlay); +} + + +static int +vp_stages_display_frame(vp_stages_output_sdl_config_t *cfg, vp_api_picture_t *picture) +{ + SDL_Rect dstrect; + + if( picture ) + { + dstrect.x = (cfg->window_width-cfg->width)/2; + dstrect.y = (cfg->window_height-cfg->height)/2; + dstrect.w = cfg->width; + dstrect.h = cfg->height; + + vp_os_mutex_lock(&xlib_mutex); + + vp_stages_buffer_to_overlay(cfg->overlay, cfg, picture); + SDL_DisplayYUVOverlay(cfg->overlay, &dstrect); + + vp_os_mutex_unlock(&xlib_mutex); + } + + return 0; +} + + +C_RESULT +vp_stages_output_sdl_stage_open(vp_stages_output_sdl_config_t *cfg) +{ + vp_os_mutex_init(&xlib_mutex); + + if(SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO)) + { + PRINT("Error initializing SDL\n"); + return (VP_FAILURE); + } +#if defined(_CK4215_) && defined(WIN32) + child_windows = NULL; + exit_pipeline = FALSE; + +#ifdef _TEST_CK4215_ + show_hide = TRUE;//show +#endif + +#endif + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_sdl_stage_transform(vp_stages_output_sdl_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ +#if defined(_CK4215_) && defined(WIN32) + struct SDL_SysWMinfo wmInfo; +#endif + + vp_os_mutex_lock(&out->lock); + +#if defined(_CK4215_) && defined(WIN32) + if( exit_pipeline == TRUE ) + { + /* It let the VPSDK handles the closing of the SDL */ + out->status = VP_API_STATUS_ENDED; + return (VP_FAILURE); + } +#endif + + if(out->status == VP_API_STATUS_INIT) + { + out->numBuffers = 1; + out->size = cfg->y_size + 2*cfg->c_size; + out->buffers = (int8_t**)vp_os_malloc(sizeof(uint8_t*)+out->size*sizeof(uint8_t)); + out->buffers[0] = (int8_t*)(out->buffers+1); + out->indexBuffer = 0; + +#if defined(_CK4215_) && defined(WIN32) + + if( main_windows ) + cfg->surface = SDL_SetVideoMode(cfg->width, cfg->height, cfg->bpp, SDL_NOFRAME); + else + cfg->surface = SDL_SetVideoMode(cfg->width, cfg->height, cfg->bpp, SDL_HWSURFACE); + +#else + cfg->surface = SDL_SetVideoMode(cfg->width, cfg->height, cfg->bpp, SDL_HWSURFACE); +#endif + SDL_ShowCursor(SDL_DISABLE); + cfg->overlay = SDL_CreateYUVOverlay(cfg->pic_width, cfg->pic_height, SDL_YV12_OVERLAY, cfg->surface); + +#if defined(_CK4215_) && defined(WIN32) + SDL_VERSION(&wmInfo.version); + + if(-1 == SDL_GetWMInfo(&wmInfo)) + { + OutputDebugString(SDL_GetError()); + return -1; + } + + child_windows = (void *) wmInfo.window; + + //Attach to parent windows + if( main_windows ) + SetParent((HWND)child_windows,(HWND) main_windows); + + if( main_windows ) + { + //Put the child windows at the good position + //MoveWindow((HWND)child_windows, 0,0,/*g_x, g_y,*/ cfg->width, cfg->height, FALSE); + MoveWindow((HWND)child_windows, cfg->window_pos_x, cfg->window_pos_y, cfg->width, cfg->height, FALSE); + } + else + { + SetWindowPos( + (HWND)child_windows, + HWND_TOPMOST, + cfg->window_pos_x, //0, // X + cfg->window_pos_y,//0, // Y + cfg->width, // cx + cfg->height, // cy + SWP_SHOWWINDOW//SWP_NOREPOSITION//SWP_NOREDRAW //uFlags + ); + } + +#endif + } + + out->status = (in->status == VP_API_STATUS_STILL_RUNNING ? VP_API_STATUS_PROCESSING : in->status); + + pipeline_opened = 1; + + if((out->status == VP_API_STATUS_PROCESSING || out->status == VP_API_STATUS_STILL_RUNNING) && in->size > 0) + { + vp_stages_display_frame(cfg, (vp_api_picture_t*)in->buffers); +#if defined(_CK4215_) && defined(WIN32) + manage_events(); +#endif + vp_os_memcpy(out->buffers[0], ((vp_api_picture_t*)in->buffers)->y_buf, cfg->y_size); + if(cfg->c_size) + { + vp_os_memcpy(out->buffers[0]+cfg->y_size, ((vp_api_picture_t*)in->buffers)->cb_buf, cfg->c_size); + vp_os_memcpy(out->buffers[0]+cfg->y_size+cfg->c_size, ((vp_api_picture_t*)in->buffers)->cr_buf, cfg->c_size); + } + } + + // not managed + if(in->status == VP_API_STATUS_ENDED) + { + pipeline_opened = 0; + vp_os_free(out->buffers); + } + + vp_os_mutex_unlock(&out->lock); + + return (VP_SUCCESS); +} + + +C_RESULT +vp_stages_output_sdl_stage_close(vp_stages_output_sdl_config_t *cfg) +{ + vp_os_mutex_lock(&xlib_mutex); + + SDL_ShowCursor(SDL_ENABLE); + SDL_FreeYUVOverlay(cfg->overlay); + SDL_FreeSurface(cfg->surface); + + SDL_Quit(); + + vp_os_mutex_unlock(&xlib_mutex); + + return (VP_SUCCESS); +} + + +#endif // ! __NDS__ diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.h new file mode 100644 index 0000000..67ac5d5 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_o_sdl.h @@ -0,0 +1,156 @@ +/** + * \brief VP Stages. Output SDL stage declaration + * \author Sylvain Gaeremynck + * \author Aurelien Morelle + * \author Thomas Landais + * \version 2.0 + * \date first release 16/03/2007 + * \date modification 19/03/2007 + */ + +#ifndef _VP_STAGES_O_SDL_H_ +#define _VP_STAGES_O_SDL_H_ + +/** + * @defgroup VP_SDK + * @{ */ + +/** + * @defgroup VP_Stages + * @{ */ + +/** + * @defgroup vp_stages_o_sdl output sdl stage + * @{ */ + +#if !defined(__NDS__) + +/////////////////////////////////////////////// +// INCLUDES + +#include + +#include + +#if defined(_CK4215_) && defined(WIN32) +#include +#endif + +/////////////////////////////////////////////// +// TYEPDEFS + +typedef struct _vp_stages_output_sdl_config_ +{ + uint32_t width; // in + uint32_t height; // in + uint32_t bpp; // in + +#if defined(_CK4215_) && defined(WIN32) + uint32_t window_pos_x; // in + uint32_t window_pos_y; // in +#endif + + uint32_t window_width; // in + uint32_t window_height; // in + + uint32_t pic_width; // in + uint32_t pic_height; // in + + uint32_t y_size; // in + uint32_t c_size; // in + + // private + + SDL_Surface *surface; + SDL_Overlay *overlay; + + uint32_t received; + +} vp_stages_output_sdl_config_t; + + +/////////////////////////////////////////////// +// FUNCTIONS + + +/** + * @fn vp_stages_buffer_to_overlay + * @param SDL_Overlay *overlay + * @param output_sdl_config_t *cfg + * @param vp_api_io_data_t *data + * @todo A COMMENTER + * @return VOID + */ +/* +void +vp_stages_buffer_to_overlay(SDL_Overlay *overlay, vp_stages_output_sdl_config_t *cfg, vp_api_io_data_t *data); +*/ +/** + * @fn vp_stages_display_frame + * @param output_sdl_config_t *cfg + * @param vp_api_io_data_t *dat + * @todo A COMMENTER + * @return 0 + */ +/* +int +vp_stages_display_frame(vp_stages_output_sdl_config_t *cfg, vp_api_io_data_t *data); +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#if defined(_CK4215_) && defined(WIN32) +void +vp_stages_init_display(void * handle); + +void * +vp_stages_get_child_window( void ); + +#endif +/** + * @fn Open the output sdl stage + * @param vp_stages_output_sdl_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_stages_output_sdl_stage_open(vp_stages_output_sdl_config_t *cfg); + +/** + * @fn Open the output sdl stage + * @param vp_stages_output_sdl_config_t *cfg + * @param vp_api_io_data_t *in + * @param vp_api_io_data_t *out + * @todo A COMMENTER + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_stages_output_sdl_stage_transform(vp_stages_output_sdl_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + +/** + * @fn Open the output sdl stage + * @param vp_stages_output_sdl_config_t *cfg + * @todo A COMMENTER + * @return VP_SUCCESS or VP_FAILURE + */ +C_RESULT +vp_stages_output_sdl_stage_close(vp_stages_output_sdl_config_t *cfg); + + +#endif // ! __NDS__ + +// vp_stages_o_sdl +/** @} */ +// VP_Stages +/** @} */ +// VP_SDK +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif // _VP_STAGES_O_SDL_H_ diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.c b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.c new file mode 100644 index 0000000..8173274 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.c @@ -0,0 +1,1055 @@ +/** + * @file vp_stages_yuv2rgb.c + * @brief VP Stages. YUV to RGB converter stage declaration +*/ + +#ifdef _INCLUDED_FOR_DOXYGEN_ +#else // ! _INCLUDED_FOR_DOXYGEN_ + +/////////////////////////////////////////////// +// INCLUDES + +#include +#include +#include +#include +#include +#include + +#endif // < _INCLUDED_FOR_DOXYGEN_ + + +#ifdef USE_YUV2RGB_STRETCH + +static C_RESULT vp_stages_yuv2rgb_open(vp_stages_yuv2rgb_config_t *cfg); +static C_RESULT vp_stages_yuv2rgb_close(vp_stages_yuv2rgb_config_t *cfg); +static void vp_stages_yuv2rgb_hresample(uint32_t sample0, uint32_t sample1, int8_t cov, int8_t* frac, uint32_t* line0, uint32_t* line1, int* dx); +static void vp_stages_yuv2rgb_hstretch(uint8_t* y_base, int32_t y_rbytes, uint8_t* cb_base, uint8_t* cr_base, uint32_t* line0, uint32_t* line1); +static void vp_stages_yuv2rgb_vstretch(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes, int8_t cov, int8_t* frac, uint32_t* line, int* dy); +static void vp_stages_yuv2rgb_flushline_565(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes, int y); + + +#define SRC_WIDTH 176 +#define SRC_HEIGHT 144 +#define DST_WIDTH 320 +#define DST_HEIGHT 240 + +/******************************************************************************/ +/* */ +/* 176*144 (YCbCr, 4:2:0) -> 320*240 (RGB-16bits, 5:6:5) */ +/* */ +/******************************************************************************/ + +static int8_t htable[SRC_WIDTH] = +{ + 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F, 0x0F, 0x0E,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0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, + 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, + 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, + 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, + 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, + 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, + 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, + 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, + 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E, 0x0D, 0x0D, 0x0E +}; + +/******************************************************************************/ + +#endif // < USE_YUV2RGB_STRETCH + + +/** + * @def VP_STAGES_YUV2RGB_LIMIT(x) + * @brief Macro used for ARGB32 saturation + * + * Moves x in a limited range of values (between 0 and 0xff). + */ +//#define VP_STAGES_YUV2ARGB_LIMIT(x) ( (x) > 0xffff ? 0xff : ( (x) <= 0xff ? 0 : ( (x) >> 8 ) ) ) +#define VP_STAGES_YUV2ARGB_LIMIT(dst, x) \ + dst = x; \ + dst = (dst > 0 ? ( ((dst) >> 8) > 0xff ? 0xff : ((dst) >> 8) ) : 0); + +/** + * @def VP_STAGES_YUV2RGB_SAT5U(a) + * @brief 5 bits saturation + */ +#define VP_STAGES_YUV2RGB_SAT5U(a) \ + if((a) < 0) (a) = 0; \ + else if((a) > 0x1F) (a) = 0x1F; + +/** + * @def VP_STAGES_YUV2RGB_SAT6U(a) + * @brief 6 bits saturation + */ +#define VP_STAGES_YUV2RGB_SAT6U(a) \ + if((a) < 0) (a) = 0; \ + else if((a) > 0x3F) (a) = 0x3F; + +/** Pointer to a YUV to RGB conversion function + */ +static vp_stages_YUV_to_RGB_t vp_stages_YUV_to_RGB; + +#ifndef QCIF_TO_QVGA +/** YUV to RGB conversion functions + */ + static void vp_stages_YUV420P_to_RGB565(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); + static void vp_stages_YUV420P_to_RGB24(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); + static void vp_stages_YUV420P_to_ARGB32(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); +#else // ! QCIF_TO_QVGA +/** YUV to RGB conversion + resizing + */ +#ifdef USE_YUV2RGB_STRETCH + static void vp_stages_YUV420P_to_RGB565_QCIF_to_QVGA_stretch(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); +#else // ! USE_YUV2RGB_STRETCH + static void vp_stages_YUV420P_to_RGB565_QCIF_to_QVGA(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); + static void vp_stages_YUV420P_to_RGB24_QCIF_to_QVGA(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); + static void vp_stages_YUV420P_to_ARGB32_QCIF_to_QVGA(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); +#endif // < USE_YUV2RGB_STRETCH +#endif // < QCIF_TO_QVGA + + +#ifndef QCIF_TO_QVGA +static void vp_stages_YUV420P_to_RGB565(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes) +{ + uint32_t w, width; + uint32_t h, height; + + width = picture->width >> 1; + height = picture->height >> 1; + + for (h = 0; h < height; h++) + { + uint8_t* s0; + uint8_t* s1; + uint8_t* s2; + uint16_t* d0; + uint16_t* d1; + + s0 = picture->y_buf + (h * picture->y_line_size * 2); + s1 = picture->cb_buf + (h * picture->cb_line_size); + s2 = picture->cr_buf + (h * picture->cr_line_size); + d0 = (uint16_t*) (dst + (h * dst_rbytes * 2)); + d1 = (uint16_t*) (dst + (h * dst_rbytes * 2) + dst_rbytes); + + for (w = 0; w < width; w++) + { + int32_t y, cb, cr; + int32_t c_r, c_g, c_b; + int16_t r, g, b; + + cb = ((uint32_t) *(s1++)) - 0x80L; + cr = ((uint32_t) *(s2++)) - 0x80L; + c_r = cr * 359L; + c_g = (cb * -88L) + (cr * -183L); + c_b = cb * 454L; + + y = ((uint32_t) s0[0]) << 8; + r = (int16_t) ((y + c_r + 0x000) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x000) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x000) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d0[0] = (r << 11) | (g << 5) | (b << 0); + + y = ((uint32_t) s0[1]) << 8; + r = (int16_t) ((y + c_r + 0x400) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x200) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x400) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d0[1] = (r << 11) | (g << 5) | (b << 0); + + y = ((uint32_t) s0[picture->y_line_size + 0]) << 8; + r = (int16_t) ((y + c_r + 0x600) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x300) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x600) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d1[0] = (r << 11) | (g << 5) | (b << 0); + + y = ((uint32_t) s0[picture->y_line_size + 1]) << 8; + r = (int16_t) ((y + c_r + 0x200) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x100) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x200) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d1[1] = (r << 11) | (g << 5) | (b << 0); + + s0 += 2; + d0 += 2; + d1 += 2; + } + } +} +#endif // < QCIF_TO_QVGA + + +#ifndef QCIF_TO_QVGA +static void vp_stages_YUV420P_to_RGB24(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes) +{ + uint32_t width, height; + int32_t line, col, linewidth; + int32_t y, u, v, r, g, b; + int32_t vr, ug, vg, ub; + uint8_t *py, *pu, *pv; + + int32_t lineSz0 = picture->y_line_size; + int32_t lineSz1 = picture->cb_line_size; + int32_t lineSz2 = picture->cr_line_size; + + width = picture->width; + height = picture->height; + + linewidth = width - (width >> 1); + + if(cfg->mode == VP_STAGES_YUV2RGB_MODE_UPSIDE_DOWN) + { + py = picture->y_buf+lineSz0*(height-1)+width-1; + pu = picture->cb_buf+lineSz1*((height>>1)-1)+((width>>1)-1); + pv = picture->cr_buf+lineSz2*((height>>1)-1)+((width>>1)-1); + + for (line = height-1; line >= 0; line--) { + for (col = width-1; col >= 0; col--) { + y = *py; + y = y << 8; + u = *pu - 128; + ug = 88 * u; + ub = 454 * u; + v = *pv - 128; + vg = 183 * v; + vr = 359 * v; + + VP_STAGES_YUV2ARGB_LIMIT(r, y + vr); + VP_STAGES_YUV2ARGB_LIMIT(g, y - ug - vg); + VP_STAGES_YUV2ARGB_LIMIT(b, y + ub ); + + *dst = r; + dst++; + *dst = g; + dst++; + *dst = b; + dst++; + + py--; + + if (col & 1) + { + pu--; + pv--; + } // No else + } + + pu += linewidth; + pv += linewidth; + + if (line & 1) + { + pu -= lineSz1; + pv -= lineSz2; + } // No else + py -= lineSz0 - width; + } + } + else + { + py = picture->y_buf; + pu = picture->cb_buf; + pv = picture->cr_buf; + + for (line = 0; line < (int32_t)height; line++) { + for (col = 0; col < (int32_t)width; col++) { + y = *py; + y = y << 8; + u = *pu - 128; + ug = 88 * u; + ub = 454 * u; + v = *pv - 128; + vg = 183 * v; + vr = 359 * v; + + VP_STAGES_YUV2ARGB_LIMIT(r, y + vr); + VP_STAGES_YUV2ARGB_LIMIT(g, y - ug - vg); + VP_STAGES_YUV2ARGB_LIMIT(b, y + ub ); + + *dst = r; + dst++; + *dst = g; + dst++; + *dst = b; + dst++; + + py++; + + if (col & 1) + { + pu++; + pv++; + } // No else + } + + pu -= linewidth; + pv -= linewidth; + + if (line & 1) + { + pu += lineSz1; + pv += lineSz2; + } // No else + py += lineSz0 - width; + } + } +} +#endif // < QCIF_TO_QVGA + + +#ifndef QCIF_TO_QVGA +static void vp_stages_YUV420P_to_ARGB32(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes) +{ + uint32_t width, height; + int32_t line, col, linewidth; + int32_t y, u, v, r, g, b; + int32_t vr, ug, vg, ub; + uint8_t *py, *pu, *pv; + + int32_t lineSz0 = picture->y_line_size; + int32_t lineSz1 = picture->cb_line_size; + int32_t lineSz2 = picture->cr_line_size; + + width = picture->width; + height = picture->height; + + linewidth = width - (width >> 1); + + py = picture->y_buf; + pu = picture->cb_buf; + pv = picture->cr_buf; + + for (line = 0; line < (int32_t)height; line++) { + for (col = 0; col < (int32_t)width; col++) { + y = *py; + y = y << 8; + u = *pu - 128; + ug = 88 * u; + ub = 454 * u; + v = *pv - 128; + vg = 183 * v; + vr = 359 * v; + + VP_STAGES_YUV2ARGB_LIMIT(r, y + vr); + VP_STAGES_YUV2ARGB_LIMIT(g, y - ug - vg); + VP_STAGES_YUV2ARGB_LIMIT(b, y + ub); + + *dst = b; + dst++; + *dst = g; + dst++; + *dst = r; + dst+=2; //skip Alpha value + + py++; + + if (col & 1) + { + pu++; + pv++; + } // No else + } + + pu -= linewidth; + pv -= linewidth; + + if (line & 1) + { + pu += lineSz1; + pv += lineSz2; + } // No else + py += lineSz0 - width; + } +} +#endif // < QCIF_TO_QVGA + + +#ifdef QCIF_TO_QVGA +#ifdef USE_YUV2RGB_STRETCH +static void vp_stages_YUV420P_to_RGB565_QCIF_to_QVGA_stretch(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes) +{ + int h; + uint8_t* y; + uint8_t* cb; + uint8_t* cr; + int dy; + int8_t vfrac; + + vp_os_memset(cfg->vline, 0, dst_rbytes); + + y = picture->y_buf; + cb = picture->cb_buf; + cr = picture->cr_buf; + vfrac = 8; + dy = 0; + for (h = 0; h < SRC_HEIGHT; h += 2) + { + vp_stages_yuv2rgb_hstretch(y, picture->y_line_size, cb, cr, cfg->hline0, cfg->hline1); + vp_stages_yuv2rgb_vstretch(cfg, picture, dst, dst_rbytes, vtable[h + 0], &vfrac, cfg->hline0, &dy); + vp_stages_yuv2rgb_vstretch(cfg, picture, dst, dst_rbytes, vtable[h + 1], &vfrac, cfg->hline1, &dy); + y += (picture->y_line_size * 2); + cb += picture->cb_line_size; + cr += picture->cr_line_size; + } +} +#endif // < USE_YUV2RGB_STRETCH +#endif // < QCIF_TO_QVGA + + +#ifdef QCIF_TO_QVGA +#ifndef USE_YUV2RGB_STRETCH +static void vp_stages_YUV420P_to_RGB565_QCIF_to_QVGA(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes) +{ + uint32_t w, width; + uint32_t h, height; + uint8_t* s0; + uint8_t* s1; + uint8_t* s2; + uint16_t* d0; + uint16_t* d1; + int32_t y, cb, cr; + int32_t c_r, c_g, c_b; + int16_t r, g, b; + + width = QVGA_WIDTH >> 2; + height = QVGA_HEIGHT >> 2; + + for (h = 0; h < height; h++) + { + s0 = picture->y_buf + ((h * picture->y_line_size)<<1); + s1 = picture->cb_buf + (h * picture->cb_line_size); + s2 = picture->cr_buf + (h * picture->cr_line_size); + d0 = (uint16_t*) (dst + ((h * QVGA_WIDTH) << 3)); + d1 = (uint16_t*) (dst + ((h * QVGA_WIDTH) << 3) + (QVGA_WIDTH << 2)); + + for (w = 0; w < width; w++) + { + cb = ((uint32_t) *(s1++)) - 0x80L; + cr = ((uint32_t) *(s2++)) - 0x80L; + c_r = cr * 359L; + c_g = (cb * -88L) + (cr * -183L); + c_b = cb * 454L; + + y = ((uint32_t) s0[0]) << 8; + r = (int16_t) ((y + c_r + 0x000) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x000) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x000) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d0[0] = (r << 11) | (g << 5) | (b << 0); + d0[1] = d0[0]; + + y = ((uint32_t) s0[1]) << 8; + r = (int16_t) ((y + c_r + 0x400) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x200) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x400) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d0[2] = (r << 11) | (g << 5) | (b << 0); + d0[3] = d0[2]; + + y = ((uint32_t) s0[picture->y_line_size + 0]) << 8; + r = (int16_t) ((y + c_r + 0x600) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x300) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x600) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d1[0] = (r << 11) | (g << 5) | (b << 0); + d1[1] = d1[0]; + + y = ((uint32_t) s0[picture->y_line_size + 1]) << 8; + r = (int16_t) ((y + c_r + 0x200) >> 11); VP_STAGES_YUV2RGB_SAT5U(r); + g = (int16_t) ((y + c_g + 0x100) >> 10); VP_STAGES_YUV2RGB_SAT6U(g); + b = (int16_t) ((y + c_b + 0x200) >> 11); VP_STAGES_YUV2RGB_SAT5U(b); + d1[2] = (r << 11) | (g << 5) | (b << 0); + d1[3] = d1[2]; + + s0 += 2; + d0 += 4; + d1 += 4; + } + vp_os_memcpy(dst + ((h * QVGA_WIDTH) << 3) + (QVGA_WIDTH<<1), dst + ((h * QVGA_WIDTH) << 3), QVGA_WIDTH<<1); + vp_os_memcpy(dst + ((h * QVGA_WIDTH) << 3) + (QVGA_WIDTH<<1)*3, dst + ((h * QVGA_WIDTH) << 3) + (QVGA_WIDTH<<2), QVGA_WIDTH<<1); + } +} +#endif // < USE_YUV2RGB_STRETCH +#endif // < QCIF_TO_QVGA + + +#ifdef QCIF_TO_QVGA +#ifndef USE_YUV2RGB_STRETCH +static void vp_stages_YUV420P_to_RGB24_QCIF_to_QVGA(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes) +{ +} +#endif // < USE_YUV2RGB_STRETCH +#endif // < QCIF_TO_QVGA + + +#ifdef QCIF_TO_QVGA +#ifndef USE_YUV2RGB_STRETCH +static void vp_stages_YUV420P_to_ARGB32_QCIF_to_QVGA(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes) +{ + uint32_t width, height; + int32_t line, col, linewidth; + int32_t y, u, v, r, g, b; + int32_t vr, ug, vg, ub; + uint8_t *py, *pu, *pv; + + int32_t lineSz0 = picture->y_line_size; + int32_t lineSz1 = picture->cb_line_size; + int32_t lineSz2 = picture->cr_line_size; + + width = picture->width; + height = picture->height; + + linewidth = width - (width >> 1); + + py = picture->y_buf; + pu = picture->cb_buf; + pv = picture->cr_buf; + + for (line = 0; line < (QVGA_HEIGHT >> 1); line++) { + for (col = 0; col < (QVGA_WIDTH >> 1); col++) { + y = *py; + y = y << 8; + u = *pu - 128; + ug = 88 * u; + ub = 454 * u; + v = *pv - 128; + vg = 183 * v; + vr = 359 * v; + + VP_STAGES_YUV2ARGB_LIMIT(r, y + vr); + VP_STAGES_YUV2ARGB_LIMIT(g, y - ug - vg); + VP_STAGES_YUV2ARGB_LIMIT(b, y + ub); + + *dst = b; + dst++; + *dst = g; + dst++; + *dst = r; + dst+=2; //skip Alpha value + *dst = b; + dst++; + *dst = g; + dst++; + *dst = r; + dst+=2; + + py++; + + if (col & 1) + { + pu++; + pv++; + } // No else + } + + pu -= (QVGA_WIDTH >> 2); + pv -= (QVGA_WIDTH >> 2); + + if (line & 1) + { + pu += lineSz1; + pv += lineSz2; + } // No else + py += lineSz0 - (QVGA_WIDTH >> 1); + + vp_os_memcpy(dst, dst - (QVGA_WIDTH<<2), QVGA_WIDTH<<2); + dst += (QVGA_WIDTH<<2); + } +} +#endif // < USE_YUV2RGB_STRETCH +#endif // < QCIF_TO_QVGA + + +/******************************************************************************/ + +#ifdef USE_YUV2RGB_STRETCH +static C_RESULT vp_stages_yuv2rgb_open(vp_stages_yuv2rgb_config_t *cfg) +{ + C_RESULT res = VP_SUCCESS; + + cfg->hline0 = (uint32_t*) vp_os_malloc(DST_WIDTH * sizeof(uint32_t)); + cfg->hline1 = (uint32_t*) vp_os_malloc(DST_WIDTH * sizeof(uint32_t)); + cfg->vline = (uint32_t*) vp_os_malloc(DST_WIDTH * sizeof(uint32_t)); + if (cfg->hline0 && cfg->hline1 && cfg->vline) + { +// vfrac = 8; + } + else + { + vp_stages_yuv2rgb_close(cfg); + res = VP_FAILURE; + } + + return res; +} + +/******************************************************************************/ + +static C_RESULT vp_stages_yuv2rgb_close(vp_stages_yuv2rgb_config_t *cfg) +{ + if (cfg->hline0) + { + vp_os_free(cfg->hline0); + cfg->hline0 = NULL; + } + if (cfg->hline1) + { + vp_os_free(cfg->hline1); + cfg->hline1 = NULL; + } + if (cfg->vline) + { + vp_os_free(cfg->vline); + cfg->vline = NULL; + } + return(VP_SUCCESS); +} + +/******************************************************************************/ + +static void vp_stages_yuv2rgb_hresample(uint32_t sample0, uint32_t sample1, int8_t cov, int8_t* frac, uint32_t* line0, uint32_t* line1, int* dx) +{ + int8_t f; + int i; + + f = *frac; + i = *dx; + do + { + int8_t c; + + if (f < cov) + { + c = f; + } + else + { + c = cov; + } + cov -= c; + f -= c; + switch (c) + { + case 0: + assert(0); + break; + + case 1: + line0[i] += (sample0 >> 3) & 0x1F1F1F1FUL; + line1[i] += (sample1 >> 3) & 0x1F1F1F1FUL; + break; + + case 2: + line0[i] += (sample0 >> 2) & 0x3F3F3F3FUL; + line1[i] += (sample1 >> 2) & 0x3F3F3F3FUL; + break; + + case 3: + line0[i] += ((sample0 >> 1) & 0x7F7F7F7FUL) - ((sample0 >> 3) & 0x1F1F1F1FUL); + line1[i] += ((sample1 >> 1) & 0x7F7F7F7FUL) - ((sample1 >> 3) & 0x1F1F1F1FUL); + break; + + case 4: + line0[i] += (sample0 >> 1) & 0x7F7F7F7FUL; + line1[i] += (sample1 >> 1) & 0x7F7F7F7FUL; + break; + + case 5: + line0[i] += ((sample0 >> 1) & 0x7F7F7F7FUL) + ((sample0 >> 3) & 0x1F1F1F1FUL); + line1[i] += ((sample1 >> 1) & 0x7F7F7F7FUL) + ((sample1 >> 3) & 0x1F1F1F1FUL); + break; + + case 6: + line0[i] += sample0 - ((sample0 >> 2) & 0x3F3F3F3FUL); + line1[i] += sample1 - ((sample1 >> 2) & 0x3F3F3F3FUL); + break; + + case 7: + line0[i] += sample0 - ((sample0 >> 3) & 0x1F1F1F1FUL); + line1[i] += sample1 - ((sample1 >> 3) & 0x1F1F1F1FUL); + break; + + case 8: + line0[i] += sample0; + line1[i] += sample1; + break; + } + + if (f == 0) + { + f = 8; + i++; + if (i < DST_WIDTH) + { + line0[i] = 0UL; + line1[i] = 0UL; + } + } + } while (cov); + *dx = i; + *frac = f; +} + +/*----------------------------------------------------------------------------*/ + +static void vp_stages_yuv2rgb_hstretch(uint8_t* y_base, int32_t y_rbytes, uint8_t* cb_base, uint8_t* cr_base, uint32_t* line0, uint32_t* line1) +{ + int sx, dx; + int8_t frac; + uint8_t* s0; + uint8_t* s1; + uint8_t* s2; + + frac = 8; + dx = 0; + line0[0] = 0UL; + line1[0] = 0UL; + s0 = y_base; + s1 = cb_base; + s2 = cr_base; + for (sx = 0; sx < 176; sx += 2) + { + int32_t cb, cr; + uint32_t cr_cg_cb, smp0, smp1; + + cb = (int32_t) ((uint32_t) *(s1++)); + cr = (int32_t) ((uint32_t) *(s2++)); + cr_cg_cb = ((cr * 180L) << 8) & 0xFF0000UL; + cr_cg_cb |= ((cb * 44L) + (cr * 91L)) & 0xFF00UL; + cr_cg_cb |= ((cb * 227L) >> 8) & 0xFFUL; + + smp0 = cr_cg_cb | (((uint32_t) s0[0]) << 24); + smp1 = cr_cg_cb | (((uint32_t) s0[y_rbytes + 0]) << 24); + vp_stages_yuv2rgb_hresample(smp0, smp1, htable[sx], &frac, line0, line1, &dx); + + smp0 = cr_cg_cb | (((uint32_t) s0[1]) << 24); + smp1 = cr_cg_cb | (((uint32_t) s0[y_rbytes + 1]) << 24); + vp_stages_yuv2rgb_hresample(smp0, smp1, htable[sx], &frac, line0, line1, &dx); + s0 += 2; + } +} + +/*----------------------------------------------------------------------------*/ + +static void vp_stages_yuv2rgb_vstretch(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst_base, uint32_t dst_rbytes, int8_t cov, int8_t* frac, uint32_t* line, int* dy) +{ + int8_t f; + uint32_t* src; + uint32_t* dst; + int y; + + f = *frac; + y = *dy; + do + { + int8_t c; + + if (f < cov) + { + c = f; + } + else + { + c = cov; + } + cov -= c; + f -= c; + src = line; + dst = cfg->vline; + switch (c) + { + int dx; + + case 8: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] = ycc; + } + break; + + case 7: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] += (ycc) - ((ycc >> 3) & 0x1F1F1F1FUL); + } + break; + + case 6: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] += (ycc) - ((ycc >> 2) & 0x3F3F3F3FUL); + } + break; + + case 5: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] += ((ycc >> 1) & 0x7F7F7F7FUL) + ((ycc >> 3) & 0x1F1F1F1FUL); + } + break; + + case 4: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] += ((ycc >> 1) & 0x7F7F7F7FUL); + } + break; + + case 3: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] += ((ycc >> 1) & 0x7F7F7F7FUL) - ((ycc >> 3) & 0x1F1F1F1FUL); + } + break; + + case 2: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] += ((ycc >> 2) & 0x3F3F3F3FUL); + } + break; + + case 1: + for (dx = 0; dx < DST_WIDTH; dx++) + { + uint32_t ycc; + + ycc = src[dx]; + dst[dx] += ((ycc >> 3) & 0x1F1F1F1FUL); + } + break; + + case 0: + assert(0); + break; + } + + if (f == 0) + { + vp_stages_yuv2rgb_flushline_565(cfg, picture, dst_base, dst_rbytes, y++); + f = 8; + } + } while (cov); + + *dy = y; + *frac = f; +} + +/*----------------------------------------------------------------------------*/ + +static void vp_stages_yuv2rgb_flushline_565(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes, int y) +{ +#ifdef __linux__ + uint32_t* s; + uint16_t* d; + int i, even, odd; + + s = cfg->vline; + d = (uint16_t*) (dst + (dst_rbytes * y)); + even = 0; + odd = 4; + if (y & 1) + { + even ^= 6; + odd ^= 6; + } + for (i = 0; i < DST_WIDTH; i += 2) + { + int32_t ycc; + int32_t y; + int32_t r, g, b; + int32_t c_r, c_g, c_b; + + ycc = s[0]; + y = ((uint32_t) ycc) >> 24; + c_r = ycc << 8; c_r = ((uint32_t) c_r) >> 23; c_r -= 180; + c_g = ycc << 16; c_g = ((uint32_t) c_g) >> 23; c_g -= 135; + c_b = ycc << 24; c_b = ((uint32_t) c_b) >> 23; c_b -= 227; + r = (even + y + c_r) >> 3; VP_STAGES_YUV2RGB_SAT5U(r); + g = ((even >> 1) + y - c_g) >> 2; VP_STAGES_YUV2RGB_SAT6U(g); + b = (even + y + c_b) >> 3; VP_STAGES_YUV2RGB_SAT5U(b); + d[0] = (r << 11) | (g << 5) | (b << 0); + + ycc = s[1]; + y = ((uint32_t) ycc) >> 24; + c_r = ycc << 8; c_r = ((uint32_t) c_r) >> 23; c_r -= 180; + c_g = ycc << 16; c_g = ((uint32_t) c_g) >> 23; c_g -= 135; + c_b = ycc << 24; c_b = ((uint32_t) c_b) >> 23; c_b -= 227; + r = (odd + y + c_r) >> 3; VP_STAGES_YUV2RGB_SAT5U(r); + g = ((odd >> 1) + y - c_g) >> 2; VP_STAGES_YUV2RGB_SAT6U(g); + b = (odd + y + c_b) >> 3; VP_STAGES_YUV2RGB_SAT5U(b); + d[1] = (r << 11) | (g << 5) | (b << 0); + + s[0] = 0U; + s[1] = 0U; + s += 2; + d += 2; + } +#else + asm_yuvrgb565(dst, dst_rbytes, cfg->vline, y); +//static void flushline_565(uint16_t* dst, int32_t dst_rbytes, uint32_t* src, int y); +#endif +} + +/******************************************************************************/ +#endif // < USE_YUV2RGB_STRETCH + + +C_RESULT vp_stages_yuv2rgb_stage_open(vp_stages_yuv2rgb_config_t *cfg) +{ + C_RESULT res = VP_SUCCESS; + +#ifdef USE_YUV2RGB_STRETCH + if(VP_FAILED(vp_stages_yuv2rgb_open(cfg))) { + res = VP_FAILURE; + } +#endif // < USE_YUV2RGB_STRETCH + + return res; +} + + +C_RESULT vp_stages_yuv2rgb_stage_transform(vp_stages_yuv2rgb_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + uint32_t width, height; + static uint32_t bytesPerPixel = 0; + uint8_t *dst; + vp_api_picture_t *picture; + + vp_os_mutex_lock(&out->lock); + + if( in->size > 0 ) + { + picture = (vp_api_picture_t *) in->buffers; //&in->buffers[in->indexBuffer]; + +#ifndef QCIF_TO_QVGA + width = picture->width; + height = picture->height; +#else // QCIF_TO_QVGA + width = QVGA_WIDTH; + height = QVGA_HEIGHT; +#endif // < QCIF_TO_QVGA + + if(out->status == VP_API_STATUS_INIT) + { + switch(cfg->rgb_format) + { + case VP_STAGES_RGB_FORMAT_RGB565: + bytesPerPixel = 2; +#ifndef QCIF_TO_QVGA + vp_stages_YUV_to_RGB = vp_stages_YUV420P_to_RGB565; +#else // QCIF_TO_QVGA +# ifndef USE_YUV2RGB_STRETCH + vp_stages_YUV_to_RGB = vp_stages_YUV420P_to_RGB565_QCIF_to_QVGA; +# else // USE_YUV2RGB_STRETCH + vp_stages_YUV_to_RGB = vp_stages_YUV420P_to_RGB565_QCIF_to_QVGA_stretch; +# endif // < USE_YUV2RGB_STRETCH +#endif // < QCIF_TO_QVGA + break; + + case VP_STAGES_RGB_FORMAT_RGB24: + bytesPerPixel = 3; +#ifndef QCIF_TO_QVGA + vp_stages_YUV_to_RGB = vp_stages_YUV420P_to_RGB24; +#else // QCIF_TO_QVGA + vp_stages_YUV_to_RGB = vp_stages_YUV420P_to_RGB24_QCIF_to_QVGA; +#endif // < QCIF_TO_QVGA + break; + + case VP_STAGES_RGB_FORMAT_ARGB32: + bytesPerPixel = 4; +#ifndef QCIF_TO_QVGA + vp_stages_YUV_to_RGB = vp_stages_YUV420P_to_ARGB32; +#else // QCIF_TO_QVGA + vp_stages_YUV_to_RGB = vp_stages_YUV420P_to_ARGB32_QCIF_to_QVGA; +#endif // < QCIF_TO_QVGA + break; + + default : + vp_stages_YUV_to_RGB = NULL; + break; + } + + VP_OS_ASSERT(vp_stages_YUV_to_RGB != NULL); + VP_OS_ASSERT(bytesPerPixel != 0); + + out->numBuffers = 1; + out->indexBuffer = 0; + out->size = width * height * bytesPerPixel; + out->buffers = (int8_t **) vp_os_malloc(sizeof(int8_t *)+out->size*sizeof(int8_t)); + out->buffers[out->indexBuffer] = (int8_t *)(out->buffers+1); + out->lineSize = (int32_t *) vp_os_malloc(out->numBuffers * sizeof(int32_t *)); + out->lineSize[out->indexBuffer] = width*bytesPerPixel; + vp_os_memset(out->buffers[out->indexBuffer], 0, out->size); + + out->status = VP_API_STATUS_PROCESSING; + } // No else + + if( out->status == VP_API_STATUS_PROCESSING ) + { + dst = (uint8_t*)out->buffers[out->indexBuffer]; + + vp_stages_YUV_to_RGB(cfg, picture, dst, width * bytesPerPixel); + out->size = width * height * bytesPerPixel; + } // No else + } + else + { + out->size = 0; + } + + if(in->status == VP_API_STATUS_STILL_RUNNING) { + out->status = VP_API_STATUS_PROCESSING; + } + else { + out->status = in->status; + } + + vp_os_mutex_unlock(&out->lock); + + return (VP_SUCCESS); +} + + +C_RESULT vp_stages_yuv2rgb_stage_close(vp_stages_yuv2rgb_config_t *cfg) +{ + C_RESULT res = VP_SUCCESS; + +#ifdef USE_YUV2RGB_STRETCH + if(VP_FAILED(vp_stages_yuv2rgb_close(cfg))) { + res = VP_FAILURE; + } +#endif // < USE_YUV2RGB_STRETCH + + return res; +} diff --git a/ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.h b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.h new file mode 100644 index 0000000..3015e47 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/vp_stages_yuv2rgb.h @@ -0,0 +1,121 @@ +/** + * @file vp_stages_yuv2rgb.h + * @brief VP Stages. YUV to RGB converter stage declaration + */ + +/////////////////////////////////////////////// +// INCLUDES + +#ifndef _VP_STAGES_YUV2RGB_INCLUDE_ +#define _VP_STAGES_YUV2RGB_INCLUDE_ + +/** + * @addtogroup VP_Stages + * @{ */ + +/** + * @defgroup vp_stages_yuv2rgb YUV-4:2:0p to RGB converter stage + * + * \section Brief + * \code + Gets in input a frame which type is vp_api_picture_t and format is planar YUV-4:2:0. + Converts it into RGB format : RGB-565 (16 bits), RGB24 or Alpha-RGB (32 bits) + Stores the result frame into the output buffer. + * \endcode + * + * \section History + * + * @{ */ + +#include +#include + +/////////////////////////////////////////////// +// TYPEDEFS + +/** Select RGB format + */ +typedef enum _VP_STAGES_RGB_FORMAT +{ + VP_STAGES_RGB_FORMAT_MARKER_BEGIN = -1, + VP_STAGES_RGB_FORMAT_RGB565 = 0, + VP_STAGES_RGB_FORMAT_RGB24, + VP_STAGES_RGB_FORMAT_ARGB32, + VP_STAGES_RGB_FORMAT_MARKER_END +} VP_STAGES_RGB_FORMAT; + +typedef enum _VP_STAGES_YUV2RGB_CONVERSION_MODE +{ + VP_STAGES_YUV2RGB_MODE_NORMAL = 0, + VP_STAGES_YUV2RGB_MODE_UPSIDE_DOWN, +} VP_STAGES_YUV2RGB_CONVERSION_MODE; + + +/** + * @brief Configuration structure for the YUV-4:2:0p to RGB-Alpha converter stage + */ +typedef struct _vp_stages_yuv2rgb_config_ +{ + VP_STAGES_RGB_FORMAT rgb_format; //!< Select RGB format + +#ifdef USE_YUV2RGB_STRETCH + uint32_t* hline0; + uint32_t* hline1; + uint32_t* vline; +#endif // < USE_YUV2RGB_STRETCH + + VP_STAGES_YUV2RGB_CONVERSION_MODE mode; + +} vp_stages_yuv2rgb_config_t; + + +/** + * @var vp_stages_YUV_to_RGB_t + * @brief Define pointer type to a YUV to RGB conversion function + */ +typedef void (*vp_stages_YUV_to_RGB_t)(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes); + +/////////////////////////////////////////////// +// FUNCTIONS + +void asm_yuvrgb565(uint8_t* dst, int32_t dst_rbytes, uint32_t* src, int y); + +/** + * @fn vp_stages_yuv2rgb_stage_open(vp_stages_yuv2rgb_config_t *) + * @brief Open the YUV to RGB converter stage. + * @param cfg Stage configuration + * @return C_RESULT : VP_SUCCESS + */ +C_RESULT vp_stages_yuv2rgb_stage_open(vp_stages_yuv2rgb_config_t *cfg); + + +/** + * @fn vp_stages_yuv2rgb_stage_transform(vp_stages_yuv2rgb_config_t *, vp_api_io_data_t *, vp_api_io_data_t *) + * @brief Apply a transform over the YUV to RGB converter stage. + * + * Gets in input a vp_api_picture_t frame which contains the Y, U, and V arrays.\n + * Calls internal generic function vp_stages_YUV_to_RGB. + * @param cfg Stage configuration + * @param in Input buffer : contains a vp_api_picture_t * + * @param out Output buffer + * @return C_RESULT : VP_SUCCESS + * @author Julien Floret + * @date Last modification 30/04/2007 + */ +C_RESULT vp_stages_yuv2rgb_stage_transform(vp_stages_yuv2rgb_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out); + + +/** + * @fn vp_stages_yuv2rgb_stage_close(vp_stages_yuv2rgb_config_t *) + * @brief Close the YUV to RGB converter stage. + * @param cfg Stage configuration + * @return C_RESULT : VP_SUCCESS + */ +C_RESULT vp_stages_yuv2rgb_stage_close(vp_stages_yuv2rgb_config_t *cfg); + +// vp_stages_yuv2rgb +/** @} */ +// VP_Stages +/** @} */ + +#endif // ! _VP_STAGES_YUV2RGB_INCLUDE_ diff --git a/ARDroneLib/VP_SDK/VP_Stages/yuv2rgb.S b/ARDroneLib/VP_SDK/VP_Stages/yuv2rgb.S new file mode 100644 index 0000000..22027f1 --- /dev/null +++ b/ARDroneLib/VP_SDK/VP_Stages/yuv2rgb.S @@ -0,0 +1,66 @@ + +#define ycc r0 +#define y r1 +#define r r2 +#define g r3 +#define b r4 +#define s r5 +#define d r6 +#define err r7 +#define count r8 +#define _1fe_ r9 +#define _0_ r10 + + .global asm_yuvrgb565 + +//static void flushline_565(uint16_t* dst, int32_t dst_rbytes, uint32_t* src, int y); +asm_yuvrgb565: + stmdb sp!, {r4-r10, lr} + mov s, r2 + mov d, r0 + mla d, r1, r3, d + mov _1fe_, #0xFF + tst r3, #1 + mov err, #4 + eorne err, err, #0x60000 + eorne err, err, #0x6 + add _1fe_, _1fe_, _1fe_ + mov _0_, #0 + + mov count, #320 +.loop: + ldr ycc, [s] + mov y, ycc, lsr #24 + str _0_, [s], #4 + and r, _1fe_, ycc, lsr #15 + and g, _1fe_, ycc, lsr #7 + and b, _1fe_, ycc, lsl #1 + sub r, r, #180 + sub g, g, #135 + sub b, b, #227 + add r, r, y + sub g, y, g + add b, b, y + adds r, r, err, lsr #16 + movmi r, _0_ + cmp r, #0xF8 + movgt r, #0xF8 + and r, r, #0xF8 + adds g, g, err, lsr #17 + movmi g, _0_ + cmp g, #0xFC + movgt g, #0xFC + and g, g, #0xFC + adds b, b, err, lsr #16 + movmi b, _0_ + cmp b, #0xF8 + movgt b, #0xF8 + mov r, r, lsl #8 + add r, r, g, lsl #3 + add r, r, b, lsr #3 + strh r, [d], #2 + mov err, err, ror #16 + subs count, count, #1 + bne .loop + + ldmia sp!, {r4-r10, pc} diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..1dad521 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.4.6) +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) + +# Set the build type. Options are: +# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage +# Debug : w/ debug symbols, w/o optimization +# Release : w/o debug symbols, w/ optimization +# RelWithDebInfo : w/ debug symbols, w/ optimization +# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries +#set(ROS_BUILD_TYPE RelWithDebInfo) + +rosbuild_init() + +#set the default path for built executables to the "bin" directory +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) +#set the default path for built libraries to the "lib" directory +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) + +#uncomment if you have defined messages +rosbuild_genmsg() +#uncomment if you have defined services +#rosbuild_gensrv() + +#common commands for building c++ executables and libraries +#rosbuild_add_library(${PROJECT_NAME} src/example.cpp) +#target_link_libraries(${PROJECT_NAME} another_library) +#rosbuild_add_boost_directories() +#rosbuild_link_boost(${PROJECT_NAME} thread) +#target_link_libraries(example ${PROJECT_NAME}) + +set(SDK ARDroneLib/) +link_directories(${PROJECT_SOURCE_DIR}/lib/) +include_directories(${SDK} ${SDK}/Soft/Common ${SDK}/Soft/Lib ${SDK}/VP_SDK ${SDK}/VP_SDK/VP_Os/linux) +rosbuild_add_executable(ardrone_driver src/ardrone_driver.cpp src/video.cpp src/ardrone_sdk.cpp src/teleop_twist.cpp) +target_link_libraries(ardrone_driver vlib pc_ardrone SDL sdk) diff --git a/ParrotCopyrightAndDisclaimer.txt b/ParrotCopyrightAndDisclaimer.txt new file mode 100644 index 0000000..bf6f9df --- /dev/null +++ b/ParrotCopyrightAndDisclaimer.txt @@ -0,0 +1,4 @@ +Copyright (C) 2007-2011, PARROT SA, all rights reserved. + +DISCLAIMER +The APIs is provided by PARROT and contributors "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall PARROT and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/ParrotLicense.txt b/ParrotLicense.txt new file mode 100644 index 0000000..b2ced38 --- /dev/null +++ b/ParrotLicense.txt @@ -0,0 +1,230 @@ +IMPORTANT: INSTRUCTION TO USE AND TO APPLY THE TERMS OF THE LICENSE TO ANY NEW PROGRAM + +READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING + + +Copyright (C) 2007-2011, PARROT SA, all rights reserved. + + +You may use, copy, modify the PARROT AR.Drone SDK and APIs or any portion of it, and thus form a work based on Parrot SDK and APIs, and copy and redistribute in source code and binary forms, with or without modification, provided that you comply with following conditions: + +• Redistribution in source code, with or without modification, must retain Parrot copyright notice, the following disclaimer and the license to develop and use in a text file named “Parrot License”. + +• Redistribution in binary form must reproduce Parrot copyright notice, the following disclaimer in the product documentation or legal notice. + +• The name of Parrot may not be used to endorse or promote products derived from the APIs without specific prior written permission. + + +DISCLAIMER +The APIs is provided by PARROT and contributors "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall PARROT and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. + + +DEVELOPMENT LICENSE OF THE PARROT AR.DRONE SDK and APIs V2.0 +(Creation of games for the Parrot AR.DRONE) + + + + +Article 1: Purpose +The purpose of the present Development License is to define the terms and conditions under which the Developer is authorized to use the source codes of the PARROT SDK and APIs to create under its own responsibility a Game for the AR.Drone and to market it for free or against payment. + +Article 2: Definitions +The terms defined hereunder, used in singular or plural, shall have the following meaning: + +- «PARROT SDK and APIs »: means the AR.Drone software development kit and AR.Drone APIs and associated documentation, allowing to pilot the PARROT AR.Drone, from a mobile phone, a console game, a computer or any other electronic device, and which source codes are provided for free to the Developer; +- « Developer » means a physical person, of age, having the capacity to accept the terms of the present License or a person, representing a company and having all powers to that effect to bind the company; +- “PARROT AR.Drone” or “PARROT AR.Drone” or « PARROT Drone» means the augmented reality drone developed by PARROT, without pilot, remote-controlled by a mobile phone, a console game, a computer or any other electronic device; +- « Interoperability »: means the ability of an application to exchange information with the Parrot AR.Drone or any it’s accessories; +- “ Game for AR.Drone” : means a software or a video game, created by the Developer from the PARROT SDK and APIs or any modified version, and which functionalities shall exclusively be dedicated to the use of the PARROT AR.Drone for entertaining, game, leisure or training purpose or any other purpose compatible with the terms of the present license; +- « License » means the present license of development and use of the API’s; +- « User Account» means the information relating to the identification of a Developer, such as first name, surname, email address, login, password, company, title; +- « User »: means any physical person using the PARROT Drone or a Game for AR.Drone. + +ARTICLE 3 – Identification +3.1 The downloading of the API’s is subject to the Identification of the Developer by filling in the online registration form and accept the terms of the License by clicking the acceptance box on https://projects.ardrone.org . +3.2 The Developer commits to provide accurate information and to update the information, if necessary. + +3.3 The User Account is personal and confidential; it cannot be assigned to a third party. + +3.4 The Developer commits to inform PARROT immediately of any disclosure, non authorized use by a third party of the login and/or password of its User Account. In such case, PARROT shall be entitled to invalid the login and the password. + + +ARTICLE 4 – Conditions of Use +Notwithstanding the limitation and restrictions mentioned in article 5, PARROT grants to the Developer, who accepts, a personal, non-assignable, non-exclusive, worldwide, free license of development of the PARROT SDK and APIs authorizing the Developer to: +• reproduce, without number limitation, the API’s on any device under its responsibility, and necessary to create the Game for AR.Drone; +• translate, adapt, arrange, modify the API’s in order to create a Game for AR.Drone in the software and hardware environment chosen by the Developer; +• to market, for free or against fees, copies of the Game for AR.Drone created ; +• to grant licenses of the Game for AR.Drone to the Users of the PARROT Drone. + + +ARTICLE 5 – Restrictions to the license +5.1 The License of development and use of the API’s is subject to the acceptance and to the respect by the Developer without any reserves of all restrictions and limitations listed hereafter: + +Consequently, PARROT expressly forbids the Developer: +(i) To access or use of the PARROT SDK and APIs from a technology or means others than those provided with the API’s; +(ii) To market copies of the API’s, for free or against fees, and to distribute, sub-license, rent, sell, transfer, commercialize, publish or generally put the API’s to a third party disposal; +(iii) To do reverse engineering, decompile or attempt to extract the Source Codes of the PARROT Drone; under special legal conditions, necessary information for interoperability purpose might be requested from PARROT ; +(iv) To destroy, or alter any warning and copyrights notices; +(v) To use the PARROT SDK and APIs to develop an application other than a Game for AR.Drone. The Game for AR.Drone, shall have for sole purpose to be used by a User for entertaining, game, leisure or training. The creation of applications for the use of the PARROT Drone for professional use or use such as but not limited to military, and, without limitation, security, watching, spying, defence, cartography, is strictly forbidden. +(vi) To use the PARROT SDK and APIs or to create a Game for AR.Drone breaching the terms of: +(1) The License; +(2) Third party rights; +(3) Applicable laws and regulations; +(4) Any instruction provided by PARROT. + +5.2 Therefore, and without limitation, the Developer commits when using the API’s or when creating a Game for AR.Drone: +a) not to infringe any applicable laws and regulation which the Developer shall determine whatever the country where he intends to develop and/or market the Game for AR.Drone ; +b) not to reproduce, represent, put contents which infringe copyrights, patents, trademarks, design, model, know-how, commercial secret and any intellectual property rights belonging to PARROT or to third parties ; +c) not to falsify or remove copyrights, trademarks notices of any other proprietary rights of PARROT figuring in the Application; +d) not to display a Game for AR.Drone which falsely or implied would suggest an endorsement or any approbation from PARROT ; +e) not to collect or treat, or store, with the Game for AR.Drone, personal data from third, especially User of the Game for AR.Drone without having previously asked for their consent. Shall the Game for AR.Drone store personal data, it should be in compliance with the applicable law + +5.3 PARROT is sole judge of the compliance of the Game for AR.Drone with the terms and conditions of the present License. + +5.4 PARROT reserves the right to correct or modify the PARROT SDK and APIs during the License duration. + +ARTICLE 6 – Duration of the License + +The License of the PARROT SDK and APIs is granted for the duration of the intellectual property rights of the Game for AR.Drone. It enters into force upon acceptance by the Developers by clicking the acceptance box or using a modified release of the PARROT SDK and APIs. + + +ARTICLE 7 – Termination of the License + +7.1 PARROT reserves the right to terminate the present License, without notice, in following cases: + +i. The Developer has created a Game for AR.Drone in violation of the present License terms, any applicable law and regulation or PARROT has objective reasons to believe that the Game for AR.Drone is infringing the License or any applicable law and regulation ; +ii. The Developer has created a Game for AR.Drone in violation of PARROT’s intellectual property rights or PARROT has objective reasons to believe that the Game for AR.Drone is infringing it’s rights ; +iii. The Developer has created a Game for AR.Drone in violation of a third party’s intellectual property rights or PARROT has objective reasons to believe that the Game for AR.Drone is infringing a third party’s rights ; +iv. The Developer has created a Game for AR.Drone containing bugs, viruses, worms, defects, Trojan horses, or any items of a destructive nature or PARROT has objective reasons to believe that the Game for AR.Drone contains of this item; + +7.2 Termination of the License shall be notified by email to any user breaching the terms of the License. + +7.3 In case of closing of a User Account or termination of the License, for whatever reason, articles which by their nature shall survive shall continue to be applicable, in particular articles 11.RIGHTS OF PARROT; 12.DISCLAIMER; 13.LIMITATION OF RESPONSIBILITY; 14.INDEMNITY; 17.GENERALS PROVISIONS. + +ARTICLE 8 – Specific Development + +Upon request of a video game editor, PARROT may perform specific development of the PARROT SDK and APIs, in order to enable the creation of a Game for AR.Drone for commercial purpose by such editor. The development services provide by PARROT shall be subject to a separate agreement between PARROT and the editor. PARROT and the editor shall share the revenues gained from the sale of games created thanks to the specific development for an amount to be determined by agreement between the parties. + + +ARTICLE 9 – Upgrade of the API’s +9.1 Due to technological innovations and for quality and/ or security reasons, the Developer acknowledges and agrees that PARROT may at any time modify the API’s, namely by adjunction, removal, improvement of functionalities, or that PARROT may temporarily or definitely suspend the access to the API’s, at its sole discretion and without notice. PARROT warrants – as far as possible and with no result obligation, the ascendant compatibility of the API’s. + +9.2 PARROT shall notify any modification by publication on https://projects.ardrone.org, or per email, or by any other appropriate mean in PARROT judgment. From the notification, the use of the API’s by the Developer to create new Game for AR.Drone shall be deemed as the acceptance by the Developer of the modified License of the PARROT SDK and APIs. + + + + +ARTICLE 10 – License granted to Parrot by the Developper +10.1 The Developer is owner of all copyrights and other intellectual property rights on the Game for AR.Drone that he creates. If the Developer is posting his Game for AR.Drone on https://projects.ardrone.org , he grants PARROT a perpetual, irrevocable, worldwide, free and non-exclusive license to reproduce, represent, adapt, arrange , modify, translate, publish, operate and display the Game for AR.Drone by any means of communication, numerical, analogical, electronic..to the public and namely by any network(internet, intranet), wireless or not, by mobile phone, email, by satellite, par optical fibre, par television and on any media. + +10.2 This license shall be granted in order to allow PARROT to display, promote, and distribute the PARROT SDK and APIs and/or the PARROT AR.Drone. + +10.3 This license includes the right for PARROT to make the Game for AR.Drone available – totally or partially – to any Users of the AR.DRONE PARROT or to any person with who PARROT is in relationship, and to use the Game for AR.Drone for information or advertisement purpose. + +10.4 The Developer agrees that PARROT for technical or for improvement purpose, may (a) transmit or communicate the Game for AR.Drone on public network others than internet (wireless or not, namely mobile telephony) and various media (graphic, magnetic, optical, numerical, analogical); and (b) make any modification necessary to adapt and make the Game for AR.Drone compliant to technical specifications so to make it interoperable with networks or devices. + +10.5 The Developer warrants PARROT that he has the rights to grant the license. + + +ARTICLE 11: Parrot Rights +11.1 Intellectual and industrial property rights. +PARROT is and remains the owner of all rights and interests on the PARROT SDK and APIs and on the PARROT AR.Drone, including without limitation all rights of intellectual and industrial property (copyrights, database rights, patents, trademark, design and model, semi-conductor topography) and/or any rights on the know-how, schemes, plans, algorythme, technologies, ideas, concepts. + +It is expressly specified that PARROT is owner of patents on the PARROT AR.Drone and that a right to use such patent is granted within the frame of the present License. No other rights on the patents are granted to the Developer who commits no to use the technologies issued from those patents for purpose not in the scope of the present License. + +11.2 Trademarks and logos. +11.2.1 PARROT is owner of the intellectual property rights on its commercial trade name, trademarks, logos, domain names and any others brand features. PARROT grants the Developer a non-exclusive, non assignable, non transferable, non sub-licensable, free license to use PARROT trademarks and logos for the sole purpose of mentioning that he uses the PARROT SDK and APIs. + +11.2.2 When using PARROT’s trademarks and logos, the Developer undertakes: +i. Not to display a trademark or a logo in any manner that implies a relationship or affiliation with, sponsorship, or endorsement by PARROT or that can be reasonably interpreted to suggest editorial content has been authored by, or represents the views or opinions of PARROT; +ii. Not to use PARROT brand features to disparage PARROT or its products; +iii. Not to display a trademark or a logo on its website if it contains or displays adult content or promotes illegal activities, gambling, or the sale of tobacco or alcohol to persons under eighteen (18) years of age; +iv. Not to display the PARROT trademark and logo as the most prominent element in any part of the Game for AR.Drone created by the Developer or its packaging; +v. Not to display the PARROT logo as the most prominent logo in the Game for AR.Drone ; +vi. Not to display PARROT trademark or logo in a manner that is misleading, defamatory, infringing, libelous, disparaging, obscene or otherwise objectionable to PARROT; +vii. Not to display a PARROT trademark or logo on a site that violates any law or regulation ; +viii. Not to remove, distort or alter any element of a PARROT brand feature (including squeezing, stretching, inverting, discoloring, etc.). + +11.3 The Developer undertakes during the term of the License and after its expiration, not to register or attempt to register any trademark, logo, domain name similar to or confusing with PARROT trademark or logo, in any manner (phonetic, intellectual, visual). PARROT reserves the right to sue for counterfeiting and unfair competition, any Developer who would not respect this commitment and use the trademarks and/or domain name PARROT AR.DRONE OU AR.DRONE in breach of the License. + +11.4 The Developer undertakes to immediately remedy to any breach notified by PARROT per email or any other mean concerning any infringement to PARROT intellectual property rights. + +11.5 The Developer, company or physical person, is owner, as applicable, on the intellectual property rights on his name, commercial name, trademarks, logos and any other brand features. He expressly grants PARROT a non exclusive, worldwide and free license to mention his name, commercial name, trademarks, logos, as applicable, to mention that he uses the PARROT SDK and APIs and/or that he has created a Game for AR.Drone. + + +ARTICLE 12: DISCLAIMER +12.1 THE PARROT SDK AND APIs IS PROVIDED «AS IS ». IN PARTICULAR, PARROT, IT’S SUBSIDIARIES, LICENSORS AND THEIR SUPPLIERS, DO NOT REPRESENT OR WARRANT THE DEVELOPER THAT: +1. ITS USE OF THE API’s WILL MEET ITS REQUIREMENTS; +2. ITS USE OF THE API’s WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR OR WILL OFFER CONSTANT PERFORMANCE; +3. THAT DEFECTS OR ERRORS WILL BE CORRECTED OR THAT THE API’s WILL BE UPGRADE, PARROT HAVING NO OBLIGATION TO PROVIDE CURATIVE OR EVOLUTIVE SUPPORT; +4. THE API’s IS COMPLIANT TO ANY SPECIFICATIONS; +5. ANY UPGRADE OF THE PARROT SDK AND APIs WILL BE COMPATIBLE WITH PREVIOUS RELEASE. + +12.2 PARROT, ITS SUBSIDIARIES, LICENSORS AND THEIR SUPPLIERS, DO NOT REPRESENT OR WARRANT THE DEVELOPER THAT ITS USER ACCOUNT WILL BE AVAILABLE WITHOUT INTERRUPTION. + +12.3 NO ADVICE OR INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED BY THE DEVELOPER FROM PARROT, ITS SUBSIDIARERIES, OR THROUGH THE API’s, SHALL BE CONSTRUED A WARRANTY PROVIDED BY PARROT. + +12.4 PARROT, IT’S SUBSIDIARIES, ITS LICENSORS DO NOT WARRANT, ANY RESULT, EXPRESS OR IMPLIED, OF ANY NATURE (TECHNICAL, COMMERCIAL, FINANCIAL OR OTHER) FROM THE USE OF THE APPLICATION. + +12.5 PARROT DECLARES THAT TO THE BEST OF ITS KNOWLEDGE THE PARROT SDK AND APIs DOES NOT INFRINGE ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHTS. + + +ARTICLE 13: LIMITATION OF RESPONSABILITY +13.1 THE PROVISION EXCLUSING OR LIMITING PARROT’S LIABILITY SHALL ONLY BE APPLICABLE IN COUNTRIES WHERE SUCH PROVISIONS ARE LEGAL. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR CERTAIN TYPES OF LOSS OR DAMAGES. ACCORDINGLY, PARROT’S LIABILITY WILL BE LIMITED TO THE MAXIMUM EXTENT PERMITTED BY LAW. + +13.2 THE DEVELOPER EXPRESSLY ACKNOWLEDGES AND AGREES THAT THE USE HE DOES OF ITS USER ACCOUNT, THE API’s, THE GAME FOR AR.DRONE THAT HE CREATES, ARE AT ITS SOLE RISK AND RESPONSABILITY. IN PARTICULAR, THE DEVELOPER SHALL BE SOLELY RESPONSIBLE FOR ANY DAMAGE TO ITS COMPUTER SYSTEM OR OTHER DEVICE, LOSS OF DATA, OR ANY OTHER DAMAGE OR INJURY THAT RESULTS FROM THE DOWNLOAD OR USE OF THE API’s. + +13.3 THE DEVELOPER EXPRESSLY ACKNOWLEDGES AND AGREES THAT HE SHALL BE SOLELY RESPONSIBLE FOR ALL COSTS, EXPENSES INCURRING FOR THE USE OF ITEMS MENTIONED ABOVE AS WELL AS ANY DEVELOPMENT AND PRODUCTION COSTS ASSOCIATED TO THE GAME OF AR.DRONE THAT HE IS CREATING. + +13.4 PARROT, ITS SUPPLIERS, LICENSORS, AFFILIATES, ARE NOT RESPONSIBLE FOR ANY DIRECTS OR INDIRECTS, MATERIALS OR IMMATERIALS, CONSECUTIVES OR NON CONSECUTIVES DAMAGES, INCLUDING, BUT NOT BE LIMITED TO, ANY LOSS OF PROFIT (WHETHER INCURRED DIRECTLY OR INDIRECTLY), ANY LOSS OF GOODWILL OR BUSINESS REPUTATION, ANY LOSS OF DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR OTHER INTANGIBLE LOSS, THAT DEVELOPER OR A THIRD PARTY MAY INCURR FROM: + +1- THE USE BY THE DEVELOPER OF ITS USER ACCOUNT, THE PARROT SDK AND APIs, THE GAME FOR AR.DRONE THAT HE CREATES; +2- THE MARKETING OF THE GAME FOR AR.DRONE FOR FREE OR AGAINST FEES; +3- THE MODIFICATION OF THE API’s BY PARROT; +4- THE CLOSING OF THE USER ACCOUNT, THE MODIFICATION OR THE EXPIRATION OR TERMINATION OF THE LICENSE; +5- ANY NON ACCURATE OR NON UPDATED INFORMATION PROVIDED BY PARROT, + + + +ARTICLE 14: INDEMNITY +The Developer warrants and hereby agrees to indemnify, defend and hold PARROT harmless from and against any claim or liability arising out of: (a) the use of the API’s in breach of the License and/or any instruction provided by PARROT; (b) the Game for AR.Drone; (c) any use by Users of the Game for AR.Drone; (d) any claim that the Game for AR.Drone breaches laws or infringes third party rights; consequently, assume all costs and damages to which PARROT could be condemned by a jurisdiction on such a basis. The Developer shall cooperate as fully as reasonably required in the defence of any claim and PARROT reserves the right, at its own expense, to assume the exclusive defence and control of any matter subject to indemnification by the Developer. And if necessary, to seek equitable relief, including but not limited to preliminary injunction and injunction, in addition to all other remedies. + +ARTICLE 15: Hyperlinks +15.1. The https://project.ardrone.org ardrone.org website may include hyperlinks to other web sites or content or resources provided by third parties and companies. PARROT has no control or authority over any web sites, resources, third parties. The Developer acknowledges and agrees that PARROT is not responsible for the availability of any such external sites or resources, and does not endorse any advertising, products or other materials on or available from such web sites or resources. + +15.2. The Developer acknowledges and agrees that PARROT is not liable for any loss or damage that may be incurred by the Developer as a result of the availability of those external sites or resources, or as a result of any reliance placed by you on the completeness, accuracy or existence of any advertising, products, or other materials on, or available from, such web sites or resources. + + +ARTICLE 16: Language and interpretation +16.1 The English version of the License shall prevail over any translation, which might only be provided for convenience purpose. Therefore any translation might be provided only for convenience purpose. + +16.2 If there is any contradiction between the English language version of the License and a translation of the License, the English language version will take precedence. + +16.3 Titles are provided for convenience purpose only; the content of an article shall have precedence on the title. + +ARTICLE 17: General provisions +17.1 The License constitutes the entire legal agreement between Parrot and the Developer and completely replace and supersede any prior agreements between PARROT and the Developer. + +17.2 The waiver by PARROT to prevail itself from a provision of the License shall not be construed as a waiver to prevail itself of any right obligation under the License in the future. + +17.3 If any court of law having jurisdiction rules that any provision of this License is invalid, then that provision will be removed from the License without affecting the rest of the License. The remaining provisions of the License will continue to be valid and enforceable. + +17.4 Any notice sent by PARROT to the Developer or exchange between the Parties will be validly delivered per email at the address provided by the Developer in its User Account and at legal@ardrone.org for PARROT. + +ARTICLE 18: Applicable law and jurisdiction +The License is governed by French Law, without regard to its conflict of Laws provisions. Any dispute arising out of its interpretation, execution or termination shall be submitted to the exclusive jurisdiction of the relevant court of Paris, even for urgency proceedings or plurality of defendants. Notwithstanding this, PARROT shall be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction + + +ARTICLE 19 - Privacy +19.1 All information about our privacy policy are provided on www.parrot.com . This policy explains how PARROT treats any personal data which are disclosed to her and protect your privacy. + +19.2 The Developer agrees that PARROT may use its personal data in compliance with its privacy policy. + + +ARTICLE 20 – Acceptance of the license +By clicking the acceptance box, downloading or using the PARROT SDK and APIs or an adapted or modified release of the PARROT SDK and APIs, the Developer or any user accepts without reserve all terms and conditions of the License concluded between him and PARROT SA – registered under N° 394 149 496 and located 174 quai de Jemmapes FRANCE - which he commits to respect. + + + +Last update: November 2010 +Document revision V2.0 diff --git a/build_sdk.sh b/build_sdk.sh new file mode 100755 index 0000000..6b4fa3d --- /dev/null +++ b/build_sdk.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd ARDroneLib/Soft/Build && make clean && make && cp -f targets_versions/*/*.a ../../../lib/ +cd ../../../ diff --git a/mainpage.dox b/mainpage.dox new file mode 100644 index 0000000..75375c1 --- /dev/null +++ b/mainpage.dox @@ -0,0 +1,26 @@ +/** +\mainpage +\htmlinclude manifest.html + +\b ardrone_brown is ... + + + + +\section codeapi Code API + + + + +*/ diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..8b809a4 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,19 @@ + + + + A driver for the Parrot AR Drone developed by Brown University. It includes furll ROS support for both motion control and video. + + + Paul Kernfeld and Christopher Crick + pkernfel@cs.brown.edu chriscrick@cs.brown.edu + BSD + + http://ros.org/wiki/ardrone_brown + + + + + + + + diff --git a/msg/Navdata.msg b/msg/Navdata.msg new file mode 100644 index 0000000..f46b38e --- /dev/null +++ b/msg/Navdata.msg @@ -0,0 +1,29 @@ +Header header + +# 0 means no battery, 100 means full battery +float32 batteryPercent + +# left/right tilt in degrees (rotation about the X axis) +float32 rotX + +# forward/backward tilt in degrees (rotation about the Y axis) +float32 rotY + +# orientation in degrees (rotation about the Z axis) +float32 rotZ + +# estimated altitude (cm) +int32 altd + +# linear velocity (mm/sec) +float32 vx + +# linear velocity (mm/sec) +float32 vy + +# linear velocity (mm/sec) +float32 vz + +#time stamp +float32 tm + diff --git a/rosdep.yaml b/rosdep.yaml new file mode 100644 index 0000000..8440cc5 --- /dev/null +++ b/rosdep.yaml @@ -0,0 +1,2 @@ +libsdl-dev: + ubuntu: libsdl1.2-dev diff --git a/src/ardrone_driver.cpp b/src/ardrone_driver.cpp new file mode 100644 index 0000000..a461e2e --- /dev/null +++ b/src/ardrone_driver.cpp @@ -0,0 +1,134 @@ +#include "ardrone_driver.h" +#include "teleop_twist.h" +#include "video.h" + +//////////////////////////////////////////////////////////////////////////////// +// class ARDroneDriver +//////////////////////////////////////////////////////////////////////////////// + +ARDroneDriver::ARDroneDriver() + : image_transport(node_handle) +{ + cmd_vel_sub = node_handle.subscribe("/cmd_vel", 1, &cmdVelCallback); + takeoff_sub = node_handle.subscribe("/ardrone/takeoff", 1, &takeoffCallback); + reset_sub = node_handle.subscribe("/ardrone/reset", 1, &resetCallback); + land_sub = node_handle.subscribe("/ardrone/land", 1, &landCallback); + image_pub = image_transport.advertiseCamera("/ardrone/image_raw", 1); + navdata_pub = node_handle.advertise("/ardrone/navdata", 1); + //toggleCam_sub = node_handle.subscribe("/ardrone/togglecam", 10, &toggleCamCallback); + +#ifdef _USING_SDK_1_7_ + //Ensure that the horizontal camera is running + int cam_state = 0; // horizontal + int set_navdata_demo_value = 0; + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (video_channel, &cam_state, NULL); + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (navdata_demo, &set_navdata_demo_value, NULL); +#else + //Ensure that the horizontal camera is running + ardrone_at_set_toy_configuration("video:video_channel","0"); +#endif + + toggleCam_service = node_handle.advertiseService("/ardrone/togglecam", toggleCamCallback); + + +} + +ARDroneDriver::~ARDroneDriver() +{ +} + +void ARDroneDriver::run() +{ + ros::Rate loop_rate(40); + + while (node_handle.ok()) + { + if (current_frame_id != last_frame_id) + { + publish_video(); + publish_navdata(); + last_frame_id = current_frame_id; + } + + ardrone_tool_update(); + ros::spinOnce(); + loop_rate.sleep(); + } +} + +void ARDroneDriver::publish_video() +{ + sensor_msgs::Image image_msg; + sensor_msgs::CameraInfo cinfo_msg; + + image_msg.width = STREAM_WIDTH; + image_msg.height = STREAM_HEIGHT; + image_msg.encoding = "rgb8"; + image_msg.is_bigendian = false; + image_msg.step = STREAM_WIDTH*3; + image_msg.data.resize(STREAM_WIDTH*STREAM_HEIGHT*3); + std::copy(buffer, buffer+(STREAM_WIDTH*STREAM_HEIGHT*3), image_msg.data.begin()); + + // We only put the width and height in here. + cinfo_msg.width = STREAM_WIDTH; + cinfo_msg.height = STREAM_HEIGHT; + + image_pub.publish(image_msg, cinfo_msg); +} + +void ARDroneDriver::publish_navdata() +{ + ardrone_brown::Navdata msg; + + msg.batteryPercent = navdata.vbat_flying_percentage; + + // positive means counterclockwise rotation around axis + msg.rotX = navdata.phi / 1000.0; // tilt left/right + msg.rotY = -navdata.theta / 1000.0; // tilt forward/backward + msg.rotZ = -navdata.psi / 1000.0; // orientation + + msg.altd = navdata.altitude; // cm + msg.vx = navdata.vx; // mm/sec + msg.vy = -navdata.vy; // mm/sec + msg.vz = -navdata.vz; // mm/sec + + msg.tm = arnavtime.time; + + // TODO: Ideally we would be able to figure out whether we are in an emergency state + // using the navdata.ctrl_state bitfield with the ARDRONE_EMERGENCY_MASK flag, but + // it seems to always be 0. The emergency state seems to be correlated with the + // inverse of the ARDRONE_TIMER_ELAPSED flag, but that just makes so little sense + // that I don't want to use it because it's probably wrong. So we'll just use a + // manual reset for now. + + navdata_pub.publish(msg); +} + +//////////////////////////////////////////////////////////////////////////////// +// custom_main +//////////////////////////////////////////////////////////////////////////////// + +extern "C" int custom_main(int argc, char** argv) +{ + int res = ardrone_tool_setup_com( NULL ); + + if( FAILED(res) ) + { + printf("Wifi initialization failed. It means either:\n"); + printf("\t* you're not root (it's mandatory because you can set up wifi connection only as root)\n"); + printf("\t* wifi device is not present (on your pc or on your card)\n"); + printf("\t* you set the wrong name for wifi interface (for example rausb0 instead of wlan0) \n"); + printf("\t* ap is not up (reboot card or remove wifi usb dongle)\n"); + printf("\t* wifi device has no antenna\n"); + } + else + { + ardrone_tool_init(argc, argv); + ros::init(argc, argv, "ardrone_driver"); + + ARDroneDriver().run(); + } + + return 0; +} + diff --git a/src/ardrone_driver.h b/src/ardrone_driver.h new file mode 100644 index 0000000..1ccd498 --- /dev/null +++ b/src/ardrone_driver.h @@ -0,0 +1,39 @@ +#ifndef _ARDRONE_DRIVER_H_ +#define _ARDRONE_DRIVER_H_ + +#include +#include +#include +#include +#include "ardrone_sdk.h" + +class ARDroneDriver +{ +public: + ARDroneDriver(); + ~ARDroneDriver(); + + void run(); + +private: + void publish_video(); + void publish_navdata(); + + ros::NodeHandle node_handle; + ros::Subscriber cmd_vel_sub; + ros::Subscriber takeoff_sub; + ros::Subscriber reset_sub; + ros::Subscriber land_sub; + image_transport::ImageTransport image_transport; + image_transport::CameraPublisher image_pub; + ros::Publisher navdata_pub; + + //ros::Subscriber toggleCam_sub; + ros::ServiceServer toggleCam_service; + + int last_frame_id; + int flying_state; + +}; + +#endif diff --git a/src/ardrone_sdk.cpp b/src/ardrone_sdk.cpp new file mode 100644 index 0000000..017dc51 --- /dev/null +++ b/src/ardrone_sdk.cpp @@ -0,0 +1,48 @@ +#include "ardrone_sdk.h" +#include "teleop_twist.h" +#include "video.h" + +navdata_demo_t navdata; +navdata_time_t arnavtime; + +extern "C" { + C_RESULT ardrone_tool_init_custom(int argc, char **argv) + { + ardrone_tool_input_add( &teleop ); + START_THREAD( video_update_thread, 0 ); + return C_OK; + } + + C_RESULT navdata_custom_init( void * ) + { + return C_OK; + } + + C_RESULT navdata_custom_process( const navdata_unpacked_t* const pnd ) + { + navdata = pnd->navdata_demo; + arnavtime = pnd->navdata_time; + return C_OK; + } + + C_RESULT navdata_custom_release() + { + return C_OK; + } + + BEGIN_THREAD_TABLE + THREAD_TABLE_ENTRY( video_update_thread, 20 ) + THREAD_TABLE_ENTRY( navdata_update, 20 ) + THREAD_TABLE_ENTRY( ATcodec_Commands_Client, 20 ) + THREAD_TABLE_ENTRY( ardrone_control, 20 ) + END_THREAD_TABLE + + BEGIN_NAVDATA_HANDLER_TABLE + NAVDATA_HANDLER_TABLE_ENTRY( + navdata_custom_init, + navdata_custom_process, + navdata_custom_release, + NULL) + END_NAVDATA_HANDLER_TABLE +} + diff --git a/src/ardrone_sdk.h b/src/ardrone_sdk.h new file mode 100644 index 0000000..bcfc38a --- /dev/null +++ b/src/ardrone_sdk.h @@ -0,0 +1,42 @@ +#ifndef _ARDRONE_SDK_H_ +#define _ARDRONE_SDK_H_ + +extern "C" { +#include +#include +#include +#include +#include +#ifdef USE_ELINUX +#include +#else +#include +#endif + +#include +#include +#include +#include +#include + +#include + +#ifdef JPEG_CAPTURE +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +} + +extern navdata_demo_t navdata; +extern navdata_time_t arnavtime; + +#endif diff --git a/src/teleop_twist.cpp b/src/teleop_twist.cpp new file mode 100644 index 0000000..82c8cc5 --- /dev/null +++ b/src/teleop_twist.cpp @@ -0,0 +1,124 @@ +#include "teleop_twist.h" + +inline float max(float a, float b) { return a > b ? a : b; } +inline float min(float a, float b) { return a < b ? a : b; } + +bool is_flying = false; +bool needs_reset = false; +geometry_msgs::Twist cmd_vel; + +int cam_state=0; // 0 for forward and 1 for vertical, change to enum later + +// ros service callback function for toggling Cam +bool toggleCamCallback(std_srvs::Empty::Request& request, std_srvs::Empty::Response& response) +{ + if (cam_state == 0) // toggle to 1, the vertical camera + { + cam_state = 1; + +#ifdef _USING_SDK_1_7_ + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (video_channel, &cam_state, NULL); +#else + ardrone_at_set_toy_configuration("video:video_channel","1"); +#endif + + fprintf(stderr, "\nToggling from frontal camera to vertical camera.\n"); + } + else if (cam_state == 1) // toggle to the forward camera + { + cam_state = 0; + +#ifdef _USING_SDK_1_7_ + ARDRONE_TOOL_CONFIGURATION_ADDEVENT (video_channel, &cam_state, NULL); +#else + ardrone_at_set_toy_configuration("video:video_channel","0"); +#endif + + fprintf(stderr, "\nToggling from vertical camera to frontal camera.\n"); + } + return true; +} + + +/* +// Older rostopic callback function for toggling Cam +void toggleCamCallback(const std_msgs::Empty &msg) +{ + if (cam_state == 0) // toggle to 1, the vertical camera + { + cam_state = 1; + ardrone_at_set_toy_configuration("video:video_channel","1"); + fprintf(stderr, "\nToggling from frontal camera to vertical camera.\n"); + } + else if (cam_state == 1) // toggle to the forward camera + { + cam_state = 0; + ardrone_at_set_toy_configuration("video:video_channel","0"); + fprintf(stderr, "\nToggling from vertical camera to frontal camera.\n"); + } +} +*/ + +void cmdVelCallback(const geometry_msgs::TwistConstPtr &msg) +{ + const float maxHorizontalSpeed = 1; // use 0.1f for testing and 1 for the real thing + cmd_vel.linear.x = max(min(-msg->linear.x, maxHorizontalSpeed), -maxHorizontalSpeed); + cmd_vel.linear.y = max(min(-msg->linear.y, maxHorizontalSpeed), -maxHorizontalSpeed); + cmd_vel.linear.z = max(min(msg->linear.z, 1), -1); + cmd_vel.angular.x = 0; + cmd_vel.angular.y = 0; + cmd_vel.angular.z = max(min(-msg->angular.z, 1), -1); +} + +void landCallback(const std_msgs::Empty &msg) +{ + is_flying = false; +} + +void resetCallback(const std_msgs::Empty &msg) +{ + needs_reset = true; +} + +void takeoffCallback(const std_msgs::Empty &msg) +{ + is_flying = true; +} + +C_RESULT open_teleop(void) +{ + return C_OK; +} + +C_RESULT update_teleop(void) +{ + // This function *toggles* the emergency state, so we only want to toggle the emergency + // state when we are in the emergency state (because we want to get out of it). + ardrone_tool_set_ui_pad_select(needs_reset); + needs_reset = false; + + // This function sets whether or not the robot should be flying. If it is flying and you + // send 0, the robot will slow down the motors and slowly descend to the floor. + ardrone_tool_set_ui_pad_start(is_flying); + + float left_right = cmd_vel.linear.y; + float front_back = cmd_vel.linear.x; + float up_down = cmd_vel.linear.z; + float turn = cmd_vel.angular.z; + + ardrone_at_set_progress_cmd(1, left_right, front_back, up_down, turn); + return C_OK; +} + +C_RESULT close_teleop(void) +{ + return C_OK; +} + +input_device_t teleop = { + "Teleop", + open_teleop, + update_teleop, + close_teleop +}; + diff --git a/src/teleop_twist.h b/src/teleop_twist.h new file mode 100644 index 0000000..3d19652 --- /dev/null +++ b/src/teleop_twist.h @@ -0,0 +1,21 @@ +#ifndef _TELEOP_TWIST_H_ +#define _TELEOP_TWIST_H_ + +#include "ardrone_sdk.h" +#include +#include +#include + +#define _USING_SDK_1_7_ + +extern input_device_t teleop; + +void cmdVelCallback(const geometry_msgs::TwistConstPtr &msg); +void landCallback(const std_msgs::Empty &msg); +void resetCallback(const std_msgs::Empty &msg); +void takeoffCallback(const std_msgs::Empty &msg); + +//void toggleCamCallback(const std_msgs::Empty &msg); +bool toggleCamCallback(std_srvs::Empty::Request& request, std_srvs::Empty::Response& response); +#endif + diff --git a/src/video.cpp b/src/video.cpp new file mode 100644 index 0000000..5dcfdf8 --- /dev/null +++ b/src/video.cpp @@ -0,0 +1,125 @@ +#include "video.h" + +#define NB_STAGES 10 +#define CAMIF_H_CAMERA_USED CAMIF_CAMERA_OVTRULY + +unsigned char buffer[STREAM_WIDTH * STREAM_HEIGHT * 3]; +int current_frame_id = 0; + +extern "C" C_RESULT export_stage_open( void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + return (SUCCESS); +} + +extern "C" C_RESULT export_stage_transform( void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + memcpy(buffer, in->buffers[0], STREAM_WIDTH * STREAM_HEIGHT * 3); + current_frame_id++; + return (SUCCESS); +} + +extern "C" C_RESULT export_stage_close( void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out) +{ + return (SUCCESS); +} + +const vp_api_stage_funcs_t vp_stages_export_funcs = +{ + NULL, + (vp_api_stage_open_t)export_stage_open, + (vp_api_stage_transform_t)export_stage_transform, + (vp_api_stage_close_t)export_stage_close +}; + +DEFINE_THREAD_ROUTINE(video_update_thread, data) +{ + C_RESULT res; + + vp_api_io_pipeline_t pipeline; + vp_api_io_data_t out; + vp_api_io_stage_t stages[NB_STAGES]; + + vp_api_picture_t picture; + + video_com_config_t icc; + vlib_stage_decoding_config_t vec; + vp_stages_yuv2rgb_config_t yuv2rgbconf; + + /// Picture configuration + picture.format = PIX_FMT_YUV420P; + picture.width = STREAM_WIDTH; + picture.height = STREAM_HEIGHT; + picture.framerate = 30; + + picture.y_buf = (uint8_t *)vp_os_malloc( STREAM_WIDTH * STREAM_HEIGHT ); + picture.cr_buf = (uint8_t *)vp_os_malloc( STREAM_WIDTH * STREAM_HEIGHT / 4 ); + picture.cb_buf = (uint8_t *)vp_os_malloc( STREAM_WIDTH * STREAM_HEIGHT / 4 ); + + picture.y_line_size = STREAM_WIDTH; + picture.cb_line_size = STREAM_WIDTH / 2; + picture.cr_line_size = STREAM_WIDTH / 2; + + vp_os_memset(&icc, 0, sizeof( icc )); + vp_os_memset(&vec, 0, sizeof( vec )); + vp_os_memset(&yuv2rgbconf, 0, sizeof( yuv2rgbconf )); + + icc.com = COM_VIDEO(); + icc.buffer_size = 100000; + icc.protocol = VP_COM_UDP; + COM_CONFIG_SOCKET_VIDEO(&icc.socket, VP_COM_CLIENT, VIDEO_PORT, wifi_ardrone_ip); + + vec.width = STREAM_WIDTH; + vec.height = STREAM_HEIGHT; + vec.picture = &picture; +#ifdef USE_VIDEO_YUV + vec.luma_only = FALSE; +#else + vec.luma_only = TRUE; +#endif // USE_VIDEO_YUV + vec.block_mode_enable = TRUE; + + vec.luma_only = FALSE; + yuv2rgbconf.rgb_format = VP_STAGES_RGB_FORMAT_RGB24; + if( CAMIF_H_CAMERA_USED == CAMIF_CAMERA_OVTRULY_UPSIDE_DOWN_ONE_BLOCKLINE_LESS ) + yuv2rgbconf.mode = VP_STAGES_YUV2RGB_MODE_UPSIDE_DOWN; + + pipeline.nb_stages = 0; + + stages[pipeline.nb_stages].type = VP_API_INPUT_SOCKET; + stages[pipeline.nb_stages].cfg = (void *)&icc; + stages[pipeline.nb_stages].funcs = video_com_funcs; + + pipeline.nb_stages++; + + stages[pipeline.nb_stages].type = VP_API_FILTER_DECODER; + stages[pipeline.nb_stages].cfg = (void*)&vec; + stages[pipeline.nb_stages].funcs = vlib_decoding_funcs; + + pipeline.nb_stages++; + + stages[pipeline.nb_stages].type = VP_API_FILTER_YUV2RGB; + stages[pipeline.nb_stages].cfg = (void*)&yuv2rgbconf; + stages[pipeline.nb_stages].funcs = vp_stages_yuv2rgb_funcs; + + pipeline.nb_stages++; + + stages[pipeline.nb_stages].type = VP_API_OUTPUT_SDL; + stages[pipeline.nb_stages].cfg = (void *)&vec; + stages[pipeline.nb_stages].funcs = vp_stages_export_funcs; + + pipeline.nb_stages++; + + pipeline.stages = &stages[0]; + PIPELINE_HANDLE pipeline_handle; + res = vp_api_open(&pipeline, &pipeline_handle); + + if( SUCCEED(res) ) { + while( SUCCEED(vp_api_run(&pipeline, &out)) ) { + } + + vp_api_close(&pipeline, &pipeline_handle); + } + + return (THREAD_RET)0; +} + diff --git a/src/video.h b/src/video.h new file mode 100644 index 0000000..d577d05 --- /dev/null +++ b/src/video.h @@ -0,0 +1,16 @@ +#ifndef _VIDEO_H_ +#define _VIDEO_H_ + +#include "ardrone_sdk.h" + +#define STREAM_WIDTH QVGA_WIDTH +#define STREAM_HEIGHT QVGA_HEIGHT + +extern const vp_api_stage_funcs_t vp_stages_export_funcs; +extern unsigned char buffer[]; // size STREAM_WIDTH * STREAM_HEIGHT * 3 +extern int current_frame_id; // this will be incremented for every frame + +PROTO_THREAD_ROUTINE(video_update_thread, data); + +#endif +