Improve building documentation

- Add apt-get install lines for Ubuntu 18.04
- add gstreamer-webrtc-1.0 and gstreamer-sdp-1.0 to CFLAGS
- make the CLAGS match LIBS in Makefile dependencies
This commit is contained in:
Jason Sun 2018-11-21 21:23:15 -08:00 committed by Matthew Waters
parent a63902e621
commit 92bce589d8
4 changed files with 36 additions and 6 deletions

View file

@ -18,6 +18,12 @@ One thing to note is that it's written in Python 2, so you may need to replace a
## Building GStreamer manually from source
Here are the commands for Ubuntu 18.04.
```
sudo apt-get install -y gstreamer1.0-tools gstreamer1.0-nice gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good libgstreamer1.0-dev git libglib2.0-dev libgstreamer-plugins-bad1.0-dev libsoup2.4-dev libjson-glib-dev
```
For hacking on the webrtc plugin, you may want to build manually using the git repositories:
- http://cgit.freedesktop.org/gstreamer/gstreamer
@ -61,7 +67,7 @@ http://blog.nirbheek.in/2018/02/gstreamer-webrtc.html
#### Running the C version
* Build the sources in the `gst/` directory on your machine
* Build the sources in the `gst/` directory on your machine. Use `make` or
```console
$ gcc webrtc-sendrecv.c $(pkg-config --cflags --libs gstreamer-webrtc-1.0 gstreamer-sdp-1.0 libsoup-2.4 json-glib-1.0) -o webrtc-sendrecv

View file

@ -428,6 +428,7 @@ start_pipeline (void)
return TRUE;
err:
g_print ("State change failure\n");
if (pipeline)
g_clear_object (&pipeline);
return FALSE;
@ -517,6 +518,7 @@ do_join_room (const gchar * text)
}
app_state = ROOM_JOINED;
g_print ("Room joined\n");
/* Start recording, but not transmitting */
if (!start_pipeline ()) {
cleanup_and_quit_loop ("ERROR: Failed to start pipeline",

View file

@ -1,6 +1,6 @@
CC := gcc
LIBS := $(shell pkg-config --libs --cflags gstreamer-webrtc-1.0 gstreamer-sdp-1.0 libsoup-2.4 json-glib-1.0)
CFLAGS := -O0 -ggdb -Wall -fno-omit-frame-pointer
CC := gcc
LIBS := $(shell pkg-config --libs --cflags glib-2.0 gstreamer-1.0 gstreamer-sdp-1.0 gstreamer-webrtc-1.0 json-glib-1.0 libsoup-2.4)
CFLAGS := -O0 -ggdb -Wall -fno-omit-frame-pointer \
$(shell pkg-config --cflags glib-2.0 gstreamer-1.0 gstreamer-sdp-1.0 gstreamer-webrtc-1.0 json-glib-1.0 libsoup-2.4)
webrtc-sendrecv: webrtc-sendrecv.c
"$(CC)" $(CFLAGS) $^ $(LIBS) -o $@
"$(CC)" $(CFLAGS) $^ $(LIBS) -o $@

View file

@ -16,6 +16,8 @@ $ ./generate_cert.sh
$ ./simple-server.py
```
### Session Based
```console
$ ./session-client.py
Our uid is 'ws-test-client-8f63b9'
@ -24,3 +26,23 @@ Our uid is 'ws-test-client-8f63b9'
```console
$ ./session-client.py --call ws-test-client-8f63b9
```
### Room Based
```console
$ ./room-client.py --room 123
Our uid is 'ws-test-client-bdb5b9'
Got ROOM_OK for room '123'
```
Another window
```console
$ ./room-client.py --room 123
Our uid is 'ws-test-client-78b59a'
Got ROOM_OK for room '123'
Sending offer to 'ws-test-client-bdb5b9'
Sent: ROOM_PEER_MSG ws-test-client-bdb5b9 {"sdp": "initial sdp"}
Got answer from 'ws-test-client-bdb5b9': {"sdp": "reply sdp"}
```
.. and similar output with more clients in the same room.