diff options
Diffstat (limited to 'src/talker.c')
-rw-r--r-- | src/talker.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/talker.c b/src/talker.c index bfea616..e7271ad 100644 --- a/src/talker.c +++ b/src/talker.c @@ -15,25 +15,22 @@ camera_handle cam_handle; -void on_send(char *buf, int *bytes) +void on_send(message *m) { - audio_record(buf); + audio_record(m->audio); - int image_sz = X_RES*Y_RES*3; - buf[REC_CAP+0] = (unsigned char)X_RES; - buf[REC_CAP+1] = (unsigned char)Y_RES; + m->WIDTH = X_RES; + m->HEIGHT = Y_RES; - *bytes = REC_CAP + 2 + image_sz; - - memcpy(&(buf[REC_CAP+2]), camera_get_image(&cam_handle), image_sz); + memcpy(m->video, camera_get_image(&cam_handle), X_RES * Y_RES * 3); } int main(void) { camera_params params = {0}; params.device = CAM; - params.x_res = 160; - params.y_res = 120; + params.x_res = X_RES; + params.y_res = Y_RES; camera_init(&cam_handle, params); |