From 4fc9120b359882087fa85cd9f0dab194fab8af4c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 27 Jan 2020 20:24:11 +0100 Subject: [PATCH] WIP call app --- CMakeLists.txt | 7 ++++++- src/call.c | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/call.c diff --git a/CMakeLists.txt b/CMakeLists.txt index aac5bdc..29121db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,9 +49,11 @@ add_executable(torecho ${CSOURCES} src/tor_echo.c) add_executable(capdiff ${CSOURCES} src/capdiff.c) add_executable(capreplay ${CSOURCES} src/capreplay.c) add_executable(donar_unit_test ${CSOURCES} src/test.c) +add_executable(dcall src/call.c) find_package(PkgConfig REQUIRED) pkg_search_module(GLIB REQUIRED glib-2.0) +pkg_check_modules(GST REQUIRED gstreamer-1.0>=1.16) target_include_directories(donar PRIVATE ${GLIB_INCLUDE_DIRS}) target_link_libraries(donar ${GLIB_LDFLAGS}) @@ -74,6 +76,9 @@ target_link_libraries(capreplay ${GLIB_LDFLAGS}) target_include_directories(donar_unit_test PRIVATE ${GLIB_INCLUDE_DIRS}) target_link_libraries(donar_unit_test ${GLIB_LDFLAGS}) -install(TARGETS donar measlat udpecho torecho capdiff capreplay donar_unit_test +target_include_directories(dcall PRIVATE ${GST_INCLUDE_DIRS}) +target_link_libraries(dcall ${GST_LDFLAGS}) + +install(TARGETS donar measlat udpecho torecho capdiff capreplay donar_unit_test dcall RUNTIME DESTINATION bin LIBRARY DESTINATION lib) diff --git a/src/call.c b/src/call.c new file mode 100644 index 0000000..695ee62 --- /dev/null +++ b/src/call.c @@ -0,0 +1,20 @@ +#include + +int main (int argc, char *argv[]) { + GMainLoop *loop; + GstElement *pipeline; + GstElement *rx_tap, *rx_jitter_buffer, *rx_opus_depay, *rx_opus_dec, *rx_audio_resample, *rx_sink; + + gst_init (&argc, &argv); + loop = g_main_loop_new (NULL, FALSE); + + + pipeline = gst_pipeline_new ("output-sound"); + rx_tap = gst_element_factory_make ("udpsrc", "rx-tap"); + rx_jitter_buffer = gst_element_factory_make ("rtpjitterbuffer", "rx-jitter-buffer"); + rx_opus_depay = gst_element_factory_make("rtpopusdepay", "rx-opus-depay"); + rx_opus_dec = gst_element_factory_make ("opusdec", "rx-opus-dec"); + rx_audio_resample = gst_element_factory_make ("audioresample", "rx-audio-resample"); + rx_sink = gst_element_factory_make ("autoaudiosink", "rx-sink"); + +}