the gstreamer webrtc demo works fine.but all demo has a small problem: all webrtcbin that created offer must have some video/audio data to send. i want use webrtcbin create offer,and only receive video data from other webrtc peer.
all demo pipeline start from videotestsrc/audiotestsrc to make test data,so that webrtcbin can send data to remote peer. but i don't want send any data to remote,and i must create offer,not wait offer then answer.
i am try this pipeline:
pipeline = gst_parse_launch(
"webrtcbin name=recv stun-server=stun://localhost:19302 "
" ! rtpvp8depay ! vp8dec ! videoconvert ! queue ! fakevideosink ",
&error);
then connect signal:
g_signal_connect(webrtc, "on-negotiation-needed", G_CALLBACK(on_negotiation_needed), NULL);
g_signal_connect(webrtc, "on-ice-candidate", G_CALLBACK(send_ice_candidate_message), NULL);
g_signal_connect(webrtc, "pad-added", G_CALLBACK(on_incoming_stream), pipeline);
when i am run program,on_negotiation_needed is executed,and i call create-offer:
GstPromise* promise;
promise = gst_promise_new_with_change_func(on_offer_created, user_data, NULL);
g_signal_emit_by_name(webrtc, "create-offer", NULL, promise);
but it create very short sdp:
{"type":"offer","sdp":"v=0\r\no=- 7210256809476625085 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-options:trickle\r\n"}
this sdp do not have any media info.
and,after create-offer called,callback on-ice-candidate should be called.in my program,this callback never called.
so,my question is:if webrtcbin have no media source,how can i make webrtcbin create correct offer that tell remote peer send media to local peer?