I’m using the webrtc library provided for the Jestson Nano and passing video frame data from gstreamer to the rtc::AdaptedVideoTrackSource::onFrame. This will work but crash after a few times of re-connecting the peer and restarting the video stream. I’m using the CreateNvVideoEncoderFactory when creating the peer connection factory. This crash does not occur if I use the BuiltinVideoEncoderFactory. The following is the stack trace of the crash
Thread 73 "EncoderQueue" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f99b24000 (LWP 17612)]
0x00000000008b7038 in rtc::CopyOnWriteBuffer::SetSize(unsigned long) ()
Current language: auto
The current source language is "auto; currently c".
(gdb)
Reading in symbols for pthread_create.c...done.
Reading in symbols for ../sysdeps/unix/sysv/linux/aarch64/clone.S...done.
#0 0x00000000008b7038 in rtc::CopyOnWriteBuffer::SetSize(unsigned long) ()
#1 0x0000000000c3ffac in webrtc::NvVideoEncoder::InitEncode(webrtc::VideoCodec const*, int, unsigned long) ()
#2 0x0000000000da67b8 in webrtc::VideoStreamEncoder::ReconfigureEncoder() ()
#3 0x0000000000da7da0 in webrtc::VideoStreamEncoder::MaybeEncodeVideoFrame(webrtc::VideoFrame const&, long) ()
#4 0x0000000000dabe68 in webrtc::webrtc_new_closure_impl::ClosureTask<webrtc::VideoStreamEncoder::OnFrame(webrtc::VideoFrame const&)::$_8>::Run() ()
#5 0x0000000000a14dac in webrtc::(anonymous namespace)::TaskQueueLibevent::OnWakeup(int, short, void*) ()
#6 0x0000000000a16404 in event_base_loop ()
#7 0x0000000000a14c84 in webrtc::(anonymous namespace)::TaskQueueLibevent::ThreadMain(void*) ()
#8 0x00000000008be584 in rtc::PlatformThread::StartThread(void*) ()
#9 0x0000007fb6180088 in start_thread (arg=0x7f6e4e838f) at pthread_create.c:463
pd = 0x7f6e4e838f
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {548039442432, 547311485912, 547311485838, 547311485839, 25, 4096, 547311485912, 548516003840, 548039442432, 547810135880, 548039440384, 5799331034265429954, 0, 5799331033721610142, 0, 0, 0, 0, 0, 0, 0, 0}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#10 0x0000007fb5e7effc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
I am still learning gstreamer and webrtc, so any help is appreciated.