Commit 767f46b1 authored by Seungha Yang's avatar Seungha Yang 🐑

webrtc: sendonly: Add support for Windows

Add meson build script and use mfvideosrc element in case of Windows

Part-of: <!29>
parent 85aeda42
Pipeline #241873 waiting for manual action with stages
in 33 seconds
......@@ -17,6 +17,7 @@ endif
subdir('multiparty-sendrecv')
subdir('signalling')
subdir('sendonly')
subdir('sendrecv')
subdir('check')
executable('webrtc-recvonly-h264',
'webrtc-recvonly-h264.c',
dependencies : [gst_dep, gstsdp_dep, gstwebrtc_dep, libsoup_dep, json_glib_dep ])
executable('webrtc-unidirectional-h264',
'webrtc-unidirectional-h264.c',
dependencies : [gst_dep, gstsdp_dep, gstwebrtc_dep, libsoup_dep, json_glib_dep ])
......@@ -19,6 +19,12 @@
#define SOUP_HTTP_PORT 57778
#define STUN_SERVER "stun.l.google.com:19302"
#ifdef G_OS_WIN32
#define VIDEO_SRC "mfvideosrc"
#else
#define VIDEO_SRC "v4l2src"
#endif
gchar *video_priority = NULL;
gchar *audio_priority = NULL;
......@@ -232,11 +238,12 @@ create_receiver_entry (SoupWebsocketConnection * connection)
receiver_entry->pipeline =
gst_parse_launch ("webrtcbin name=webrtcbin stun-server=stun://"
STUN_SERVER " "
"v4l2src ! videorate ! videoscale ! video/x-raw,width=640,height=360,framerate=15/1 ! videoconvert ! queue max-size-buffers=1 ! x264enc bitrate=600 speed-preset=ultrafast tune=zerolatency key-int-max=15 ! video/x-h264,profile=constrained-baseline ! queue max-size-time=100000000 ! h264parse ! "
VIDEO_SRC
" ! videorate ! videoscale ! video/x-raw,width=640,height=360,framerate=15/1 ! videoconvert ! queue max-size-buffers=1 ! x264enc bitrate=600 speed-preset=ultrafast tune=zerolatency key-int-max=15 ! video/x-h264,profile=constrained-baseline ! queue max-size-time=100000000 ! h264parse ! "
"rtph264pay config-interval=-1 name=payloader aggregate-mode=zero-latency ! "
"application/x-rtp,media=video,encoding-name=H264,payload="
RTP_PAYLOAD_TYPE " ! webrtcbin. "
"autoaudiosrc is-live=1 ! queue max-size-buffers=1 leaky=downstream ! opusenc ! rtpopuspay pt="
"autoaudiosrc is-live=1 ! queue max-size-buffers=1 leaky=downstream ! audioconvert ! audioresample ! opusenc ! rtpopuspay pt="
RTP_AUDIO_PAYLOAD_TYPE " ! webrtcbin. ", &error);
if (error != NULL) {
g_error ("Could not create WebRTC pipeline: %s\n", error->message);
......
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