Commit 2ee8fd61 authored by hark's avatar hark

ogg seems to work

parent 65d0af42
#!/bin/bash
#!/bin/bash
colorgcc -O0 -g gnunet-helper-audio-record-gst.c -o gnunet-helper-audio-record-gst -I ../include `pkg-config --cflags --libs gstreamer-app-1.0 gnunetutil gnunetconversation gnunetenv gstreamer-app-1.0 gstreamer-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` -O0 -march=native -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-conversion -Wformat -Wformat-security -fstack-protector -D_FORTIFY_SOURCE=2 -std=c99 -D_GNU_SOURCE
colorgcc -O0 -g gnunet-helper-audio-playback-gst.c -o gnunet-helper-audio-playback-gst -I ../include `pkg-config --cflags --libs gstreamer-app-1.0 gnunetutil gnunetconversation gnunetenv gstreamer-app-1.0 gstreamer-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` -O0 -march=native -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-conversion -Wformat -Wformat-security -fstack-protector -D_FORTIFY_SOURCE=2 -std=c99 -D_GNU_SOURCE
colorgcc -O0 -DIS_MIC -g gnunet_gst_test.c gnunet_gst.c -o gnunet-helper-audio-record-experimental `pkg-config --cflags --libs gstreamer-app-1.0 gnunetutil gnunetconversation gnunetenv gstreamer-app-1.0 gstreamer-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` -O0 -march=native -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-conversion -Wformat -Wformat-security -fstack-protector -D_FORTIFY_SOURCE=2 -std=c99 -D_GNU_SOURCE
colorgcc -O0 -DIS_SPEAKER -g gnunet_gst_test.c gnunet_gst.c -o gnunet-helper-audio-playback-experimental `pkg-config --cflags --libs gstreamer-app-1.0 gnunetutil gnunetconversation gnunetenv gstreamer-app-1.0 gstreamer-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` -O0 -march=native -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-conversion -Wformat -Wformat-security -fstack-protector -D_FORTIFY_SOURCE=2 -std=c99 -D_GNU_SOURCE
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.libs/
#echo $LD_LIBRARY_PATH
#colorgcc -g media_loopback.c -o media_loopback -I../include -L.libs\ -L/crypthome/hark/src/crypto/gnunet/gnunet/src/conversation/.libs/ -l libgnunetmicrophone -l libgnunetspeaker `pkg-config --cflags --libs gnunetutil gnunetconversation gnunetenv ` -O0 -march=native -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-conversion -Wformat -Wformat-security -fstack-protector -D_FORTIFY_SOURCE=2 -std=c99 -D_GNU_SOURCE
colorgcc -DIS_MIC -g gnunet_gst_test.c gnunet_gst.c -o gnunet-helper-audio-record-experimental `pkg-config --cflags --libs gstreamer-app-1.0 gnunetutil gnunetconversation gnunetenv gstreamer-app-1.0 gstreamer-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` -O0 -march=native -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-conversion -Wformat -Wformat-security -fstack-protector -D_FORTIFY_SOURCE=2 -std=c99 -D_GNU_SOURCE
colorgcc -DIS_SPEAKER -g gnunet_gst_test.c gnunet_gst.c -o gnunet-helper-audio-playback-experimental `pkg-config --cflags --libs gstreamer-app-1.0 gnunetutil gnunetconversation gnunetenv gstreamer-app-1.0 gstreamer-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` -O0 -march=native -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-conversion -Wformat -Wformat-security -fstack-protector -D_FORTIFY_SOURCE=2 -std=c99 -D_GNU_SOURCE
......
#!/bin/bash
dot -Tpng `ls -tr1 /tmp/*rec*.dot | tail -1` | display /dev/stdin &
#dot -Tpng `ls -tr1 /tmp/gnunet_gstreamer/*rec*.dot | tail -1` | display /dev/stdin
dot -Tpng `ls -tr1 /tmp/*play*.dot | tail -1` | display /dev/stdin &
dot -Tpng `ls -tr1 /tmp/gnunet_gstreamer/*play*.dot | tail -1` | display /dev/stdin &
This diff is collapsed.
......@@ -78,9 +78,6 @@ struct GNUNET_gstData {
char *jack_pp_out;
};
#define DEBUG_READ_PURE_OGG 1
#define DEBUG_RECORD_PURE_OGG 1
......@@ -88,7 +85,7 @@ struct GNUNET_gstData {
/**
* How much data to read in one go
*/
#define MAXLINE 4096
#define MAXLINE 94096
/**
* Max number of microseconds to buffer in audiosink.
......
#include "gnunet_gst_def.h"
#include "gnunet_gst.h"
int
int
main (int argc, char *argv[])
{
struct GNUNET_gstData *gst;
......@@ -9,37 +9,22 @@ main (int argc, char *argv[])
GstMessage *msg;
GstElement *gnunetsrc, *gnunetsink, *source, *sink, *encoder, *decoder;
// audio_message = GNUNET_malloc (UINT16_MAX);
//audio_message->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO);
//GstPipeline *pipeline;
gst = (GNUNET_gstData*)malloc(sizeof(struct GNUNET_gstData));
//gst->audio_message.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO);
gg_load_configuration(gst);
/*
gst->audiobackend = JACK;
gst->dropsilence = TRUE;
gst->usertp = FALSE;
*/
/* Initialize GStreamer */
gst_init (&argc, &argv);
gst->pipeline = GST_PIPELINE(gst_pipeline_new ("gnunet-media-helper"));
#ifdef IS_SPEAKER
int type = SPEAKER;
printf("this is the speaker \n");
fprintf(stderr,"this is the speaker \n");
#endif
#ifdef IS_MIC
int type = MICROPHONE;
printf("this is the microphone \n");
fprintf(stderr,"this is the microphone \n");
#endif
if ( type == SPEAKER)
......@@ -60,57 +45,40 @@ main (int argc, char *argv[])
encoder = GST_ELEMENT(get_coder(gst, ENCODER));
gnunetsink = GST_ELEMENT(get_app(gst, SINK));
gst_bin_add_many( GST_BIN(gst->pipeline), source, encoder, gnunetsink, NULL);
gst_element_link_many( source, encoder, gnunetsink , NULL);
}
/*
gst_bin_add_many( GST_BIN(gst->pipeline), appsource, appsink, source, encoder, decoder, sink, NULL);
gst_element_link_many( source, encoder, decoder, sink , NULL);
*/
pl_graph(gst->pipeline);
/* Start playing */
gst_element_set_state (GST_ELEMENT(gst->pipeline), GST_STATE_PLAYING);
//pl_graph(gst->pipeline);
/* Wait until error or EOS */
//bus = gst_element_get_bus (GST_ELEMENT(gst->pipeline));
//bus_watch_id = gst_bus_add_watch (bus, gnunet_gst_bus_call, pipeline);
gg_setup_gst_bus(gst);
// g_print ("Running...\n");
// start pushing buffers
if ( type == MICROPHONE )
{
if ( type == MICROPHONE )
{
GMainLoop *loop;
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
g_main_loop_run (loop);
/*
while ( 1 )
{
GstFlowReturn flow;
flow = on_appsink_new_sample (gst->appsink, gst);
}
*/
}
if ( type == SPEAKER )
{
while ( 1 )
{
// printf("read.. \n");
}
if ( type == SPEAKER )
{
while ( 1 )
{
gnunet_read(gst);
}
}
g_print ("Returned, stopping playback\n");
}
}
gst_object_unref (bus);
gst_element_set_state (GST_ELEMENT(gst->pipeline), GST_STATE_NULL);
......
[MEDIAHELPER]
AUDIOBACKEND = JACK
REMOVESILENCE = NO
REMOVESILENCE = YES
USERTP = NO
NO_GN_HEADERS = NO
JACK_PP_IN = mocp
......
#!/bin/bash
mkdir /tmp/gnunet_gstreamer/
mkfifo /tmp/gg_fifo
export GST_DEBUG_DUMP_DOT_DIR=/tmp/gnunet_gstreamer
export GST_DEBUG_FILE=/tmp/gnunet_gstreamer/gstreamer_gnunet_record.log
export GST_DEBUG=4
#./gnunet-helper-audio-record-experimental | GST_DEBUG_FILE=/tmp/gnunet_gstreamer/gstreamer_gnunet_playback.log ./gnunet-helper-audio-playback-experimental
./gnunet-helper-audio-record-experimental > /tmp/ggfifo 2> /tmp/gnunet_gstreamer/record_stderr.log &
REC_PID=$!
export GST_DEBUG_FILE=/tmp/gnunet_gstreamer/gstreamer_gnunet_playback.log
gdb --args ./gnunet-helper-audio-playback-experimental
export GST_DEBUG_DUMP_DOT_DIR=/tmp/
GST_DEBUG_DUMP_DOT_DIR=/tmp/ ./gnunet-helper-audio-record |GST_DEBUG_DUMP_DOT_DIR=/tmp/ ./gnunet-helper-audio-playback
kill -15 $REC_PID
kill -9 $REC_PID
pkill -P $$
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment