summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2012-06-17 10:15:22 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2012-06-17 10:15:22 +0000
commit4e5e5f8f6a59be55b0eba83c8128011ef24ca8ff (patch)
treeaa3a7be68fb468b692baaf1f426840d139ebda30
parent96d4d223a6e2790e6269cd3b19b4944d99d61eb3 (diff)
download2012-violon-leds-4e5e5f8f6a59be55b0eba83c8128011ef24ca8ff.tar.gz
2012-violon-leds-4e5e5f8f6a59be55b0eba83c8128011ef24ca8ff.tar.bz2
2012-violon-leds-4e5e5f8f6a59be55b0eba83c8128011ef24ca8ff.zip
Tentatives pour capture que le micro et pas la sortie de mixer (mais j'ai pas tout compris encore...)
Tentative compilation -O2. Ca marche mais ça change un peu le comportement des buffers... git-svn-id: file:///var/svn/2012-violon-leds/trunk@22 6be1fa4d-33ac-4c33-becc-79fcb3794bb6
-rw-r--r--src/Makefile14
-rw-r--r--src/capture.c21
2 files changed, 31 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile
index 6b93d4c..f8b0aaf 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,12 +1,18 @@
CC=gcc
-CFLAGS=-W -Wall -Werror -Wno-error=unused-parameter -g
-LDFLAGS=-Werror -g
+# For debug
+#CFLAGS=-W -Wall -Werror -Wno-error=unused-parameter -g
+#LDFLAGS=-Werror -g
+
+# For release
+CFLAGS=-W -Wall -Werror -Wno-error=unused-parameter -O2
+LDFLAGS=-Werror
EXEC=music2light
CFLAGS+=$(shell pkg-config --cflags gtk+-2.0 gthread-2.0 libpulse)
-# Maths for FFT related code, libftdi is the driver for USB2DMX module, rt is for ftdi
+# Maths for FFT related code, libftdi is the driver for USB2DMX module
LDFLAGS+=-lm -lftdi
-# -lrt
+# -lrt for nanosleep but create many tiny buffers from PulseAudio
+#LDFLAGS+=-lm -lftdi -lrt
LDFLAGS+=$(shell pkg-config --libs gtk+-2.0 gthread-2.0 libpulse)
SRC= $(wildcard *.c)
diff --git a/src/capture.c b/src/capture.c
index 14e7abf..5a174d4 100644
--- a/src/capture.c
+++ b/src/capture.c
@@ -13,6 +13,7 @@ int capture_init(pa_mainloop **m, pa_context **c);
void context_state_callback(pa_context *c, void *userdata);
void context_get_server_info_callback(pa_context *c, const pa_server_info*si, void *userdata);
void context_get_source_info_callback(pa_context *c, const pa_source_info *si, int is_last, void *userdata);
+void context_get_source_info_list_callback(pa_context *c, const pa_source_info *si, int is_last, void *userdata);
pa_stream * create_stream(pa_context *c, const pa_source_info *si);
void stream_state_callback(pa_stream *s, void *userdata);
void stream_read_callback(pa_stream *s, size_t nbytes, void *userdata);
@@ -100,10 +101,30 @@ void context_get_server_info_callback(pa_context *c, const pa_server_info*si, vo
return;
}
+ //Temp :
+ pa_operation_unref(pa_context_get_source_info_list(c,context_get_source_info_list_callback,NULL));
+
+
pa_operation_unref(pa_context_get_source_info_by_name(c, si->default_source_name, context_get_source_info_callback, NULL));
}
+//Temp
+void context_get_source_info_list_callback(pa_context *c, const pa_source_info *si, int is_last, void *userdata) {
+ if (is_last < 0) {
+ printf("Failed to get sink information\n");
+ return;
+ }
+
+ if (!si) {
+ return;
+ }
+
+ printf("%i : '%s' (%s)\n", si->index, si->name, si->description);
+
+}
+
+
void context_get_source_info_callback(pa_context *c, const pa_source_info *si, int is_last, void *userdata) {
if (is_last < 0) {