void analyse_vectors(MMAL_BUFFER_HEADER_T *buffer) { if(!cfg_val[c_motion_external]) { if (cfg_val[c_motion_detection]) { if (cfg_val[c_motion_noise] < 1000) { analyse_vectors1(buffer); } else { analyse_vectors2(buffer); } } if (cfg_val[c_motion_file]) save_vectors(buffer); } }
int search_bro_direction(t_client *clientondemand, t_client *tmpclient, t_srv *server) { t_listadvvector *vectors; t_advvector *clienttotmp; char **map; int finaldirection; vectors = NULL; if ((map = make_broadcast_map(server)) == NULL) return (FAILURE); if ((vectors = save_vectors(vectors, server, clientondemand, tmpclient, map)) == NULL) return (FAILURE); clienttotmp = calcul_smallest_vector(vectors); finaldirection = make_broadcast_angle(clienttotmp, tmpclient); free_broadcast_vectorlist(vectors); free_broadcast_map(map); return (finaldirection); }