I'm trying to get a simple native client to stream audio and video through the webrtc protocol using openwebrtc on a linux machine.
I've followed the build instructions here. https://github.com/EricssonResearch/openwebrtc/wiki/Building-OpenWebRTC
There is no linux sample code so I've been trying to copy the OSX code bit by bit until I have something working. https://github.com/EricssonResearch/openwebrtc-examples/blob/master/osx/Camera%20Test/Camera%20Test/AppDelegate.m
#include <stdio.h>
#include <owr/owr.h>
#include <owr/owr_media_source.h>
#include <owr/owr_types.h>
#include <owr/owr_video_renderer.h>
#define SELF_VIEW_TAG "self-view"
static void got_sources(GList *sources, gpointer user_data) {
g_assert(sources);
// haven't actually gotten to showing video yet
// the above line does not compile =(
}
int main(void) {
printf("starting owr\n");
owr_init(NULL);
owr_run_in_background();
owr_get_capture_sources(OWR_MEDIA_TYPE_VIDEO, got_sources, NULL);
printf("exiting owr\n");
owr_quit();
return 0;
}
The problem is I have compile errors with glib functions like g_assert or g_object_get.
> make
gcc webrtc-client.c -o webrtc-client -lopenwebrtc
/usr/bin/ld: /tmp/ccd4VTU9.o: undefined reference to symbol 'g_object_get'
/opt/openwebrtc-0.3/lib/libgobject-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:23: recipe for target 'webrtc-client' failed
These are the env variables I set in my Makefile
export PATH:=/opt/openwebrtc-0.3/bin:$(PATH)
export LD_LIBRARY_PATH:=/opt/openwebrtc-0.3/lib:$(LD_LIBRARY_PATH)
export GST_PLUGIN_PATH_1_0:=/opt/openwebrtc-0.3/lib/gstreamer-1.0/:$(GST_PLUGIN_PATH_1_0)
export PKG_CONFIG_PATH:=/opt/openwebrtc-0.3/lib/pkgconfig:$(PKG_CONFIG_PATH)
export CPATH:=/opt/openwebrtc-0.3/include:/opt/openwebrtc-0.3/include/glib-2.0:/opt/openwebrtc-0.3/lib/glib-2.0/include:$(CPATH)
export LIBRARY_PATH:=/opt/openwebrtc-0.3/lib:$(LIBRARY_PATH)
As part of the openwebrtc instalation cerbero installed glib under /opt/openwebrtc-0.3/lib/
. I've also tried installing the apt package libglib2.0-dev
and commenting out my PKG_CONFIG_PATH which did not work.
How do I get my build process to properly incorporate glib?