aboutsummaryrefslogtreecommitdiff
path: root/src/listener.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/listener.c')
-rw-r--r--src/listener.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/listener.c b/src/listener.c
index b344b6e..f819383 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -10,7 +10,9 @@
#include "audio.h"
#include "typedef.h"
-char cam_data[BUF_CAP];
+char cam_data[BUF_CAP] = {0};
+unsigned int WIDTH = 1;
+unsigned int HEIGHT = 1;
void *display_thread(void *arg)
{
@@ -24,18 +26,17 @@ void *display_thread(void *arg)
exit(r);
}
-void on_recv(char *buf, int numbytes)
+void on_recv(message *m)
{
- (void)numbytes;
+ WIDTH = m->WIDTH;
+ HEIGHT = m->HEIGHT;
- memcpy(cam_data, &(buf[REC_CAP]), BUF_CAP-REC_CAP);
- audio_play(buf);
+ memcpy(cam_data, m->video, WIDTH * HEIGHT * 3);
+ audio_play(m->audio);
}
int main(void)
{
- memset(cam_data, 0, BUF_CAP);
-
pthread_t tid;
pthread_create(&tid, NULL, display_thread, NULL);