Git Product home page Git Product logo

jrtplib's People

Contributors

j0r1 avatar lbakman avatar linrock avatar matanshahar avatar wegylexy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jrtplib's Issues

Info about compatibility with mobile?

I'm evaluating lots of rtp libraries and therefore can't put effort reading the entire source by now. What would need to be done to make it work on iOS and Android?

Thank you!

Great Job

Great job, I like this code,do you have plan to add FEC to rtp over udp?

Please make a release

The last release was made 3 years ago, and systems that stick to official releases now have a very outdated version.

error, RTPTCPTransmitter

When I used the RTPTCPTransmitter class to receive RTP packets, I received a bunch of garble codes. Although I identified it as a Packet, the internal data was completely wrong.
May I ask if there is a more complete example for your reference? What I need is to receive and parse RTP packets on TCP after establishing a connection through RTSP.

RTPTCPTransmitter::PollSocket implementation problem

int RTPTCPTransmitter::PollSocket(SocketType sock, SocketData &sdata)
{
#ifdef RTP_SOCKETTYPE_WINSOCK
	unsigned long len;
#else 
	size_t len;
#endif // RTP_SOCKETTYPE_WINSOCK
	bool dataavailable;
	
	do
	{
		len = 0;
		RTPIOCTL(sock, FIONREAD, &len);

		if (len <= 0) 

RTPIOCTL() is a non-blocking method that will cause the cpu to idle ?

getloginrtest wont work

jrtplib_test_feature(getloginrtest RTP_SUPPORT_GETLOGINR FALSE "// Not using getlogin_r" "${TESTDEFS}")

fails

getloginrtest.cpp compiles on docker, but won't run on docker, because there's no user

I even tried setting an user, but it won't work

Support SRTP 2.1.0 and OpenSSL 1.1.0 (Build linker error JRTPLIB 3.1.1)

Hello.
I need help. I try to build JRTPLIB 3.1.1 with SRTP 2.1.0 and OpenSSL 1.1.0 but got linker error while try to make JRTPLIB,

Dependencies:
Debian 9 (also tried on Ubuntu 16.04 LTS)
JRTPLIB v.3_1_11(from git+changes)
JTHREAD v.1_3_3 (from git);
LIBSRTP v.2_1_0 (by tag) (https://github.com/cisco/libsrtp#installing-and-building-libsrtp)
LIBSSL v.1_1_0 Stable (by branch) (https://github.com/openssl/openssl/tree/OpenSSL_1_1_0-stable)
Source changes:
JRTPLIB v.3_1_11 (from git): changed srtp to srtp2; link to lib source archive: https://drive.google.com/drive/folders/0B_Q0HXvHrCzabVpsSUp0TXNka1U?usp=sharing
Cmake settings (image cmake_JRTPLIB.JPG): https://drive.google.com/drive/folders/0B_Q0HXvHrCzabVpsSUp0TXNka1U?usp=sharing

Build:

  1. OpenSSL:
    build from source and also tried on a Virtual Machine to install libssl1.1 and libssl-dev by sudo apt-get install libssl1.1 libssl-dev)
    2)libSRTP:
    $./configure --enable-debug-logging --enable-log-stdout --enable-openssl

3)JTHREAD:
build with cmake

4)JRTPLIB:
Cmake config - see image cmake_JRTPLIB.JPG

$make

Error log:

Scanning dependencies of target jrtplib-static
[ 1%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpapppacket.cpp.o
[ 2%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpbyepacket.cpp.o
[ 3%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpcompoundpacket.cpp.o
[ 4%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpcompoundpacketbuilder.cpp.o
[ 4%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcppacket.cpp.o
[ 5%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcppacketbuilder.cpp.o
[ 6%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcprrpacket.cpp.o
[ 7%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpscheduler.cpp.o
[ 8%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpsdesinfo.cpp.o
[ 8%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpsdespacket.cpp.o
[ 9%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtcpsrpacket.cpp.o
[ 10%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpcollisionlist.cpp.o
[ 11%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpdebug.cpp.o
[ 12%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtperrors.cpp.o
[ 12%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpinternalsourcedata.cpp.o
[ 13%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv4address.cpp.o
[ 14%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv6address.cpp.o
[ 15%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv4destination.cpp.o
[ 16%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpipv6destination.cpp.o
[ 16%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtplibraryversion.cpp.o
[ 17%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtppacket.cpp.o
[ 18%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtppacketbuilder.cpp.o
[ 19%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtppollthread.cpp.o
[ 20%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandom.cpp.o
[ 20%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandomrand48.cpp.o
[ 21%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandomrands.cpp.o
[ 22%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtprandomurandom.cpp.o
[ 23%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsession.cpp.o
[ 24%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsessionparams.cpp.o
[ 25%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsessionsources.cpp.o
[ 25%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsourcedata.cpp.o
[ 26%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsources.cpp.o
[ 27%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtptimeutilities.cpp.o
[ 28%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpudpv4transmitter.cpp.o
[ 29%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpudpv6transmitter.cpp.o
[ 29%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpbyteaddress.cpp.o
[ 30%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpexternaltransmitter.cpp.o
[ 31%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpsecuresession.cpp.o
[ 32%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtpabortdescriptors.cpp.o
[ 33%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtptcpaddress.cpp.o
[ 33%] Building CXX object src/CMakeFiles/jrtplib-static.dir/rtptcptransmitter.cpp.o
[ 34%] Building CXX object src/CMakeFiles/jrtplib-static.dir/extratransmitters/rtpfaketransmitter.cpp.o
[ 35%] Linking CXX static library libjrtp.a
[ 35%] Built target jrtplib-static
Scanning dependencies of target jrtplib-shared
[ 35%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpapppacket.cpp.o
[ 36%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpbyepacket.cpp.o
[ 37%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpcompoundpacket.cpp.o
[ 38%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpcompoundpacketbuilder.cpp.o
[ 39%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcppacket.cpp.o
[ 39%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcppacketbuilder.cpp.o
[ 40%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcprrpacket.cpp.o
[ 41%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpscheduler.cpp.o
[ 42%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpsdesinfo.cpp.o
[ 43%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpsdespacket.cpp.o
[ 44%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtcpsrpacket.cpp.o
[ 44%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpcollisionlist.cpp.o
[ 45%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpdebug.cpp.o
[ 46%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtperrors.cpp.o
[ 47%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpinternalsourcedata.cpp.o
[ 48%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv4address.cpp.o
[ 48%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv6address.cpp.o
[ 49%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv4destination.cpp.o
[ 50%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpipv6destination.cpp.o
[ 51%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtplibraryversion.cpp.o
[ 52%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtppacket.cpp.o
[ 52%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtppacketbuilder.cpp.o
[ 53%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtppollthread.cpp.o
[ 54%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandom.cpp.o
[ 55%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandomrand48.cpp.o
[ 56%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandomrands.cpp.o
[ 56%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtprandomurandom.cpp.o
[ 57%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsession.cpp.o
[ 58%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsessionparams.cpp.o
[ 59%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsessionsources.cpp.o
[ 60%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsourcedata.cpp.o
[ 60%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsources.cpp.o
[ 61%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtptimeutilities.cpp.o
[ 62%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpudpv4transmitter.cpp.o
[ 63%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpudpv6transmitter.cpp.o
[ 64%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpbyteaddress.cpp.o
[ 64%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpexternaltransmitter.cpp.o
[ 65%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpsecuresession.cpp.o
[ 66%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtpabortdescriptors.cpp.o
[ 67%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtptcpaddress.cpp.o
[ 68%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/rtptcptransmitter.cpp.o
[ 69%] Building CXX object src/CMakeFiles/jrtplib-shared.dir/extratransmitters/rtpfaketransmitter.cpp.o
[ 69%] Linking CXX shared library libjrtp.so
[ 69%] Built target jrtplib-shared
Scanning dependencies of target example4
[ 69%] Building CXX object examples/CMakeFiles/example4.dir/example4.cpp.o
[ 70%] Linking CXX executable example4
[ 70%] Built target example4
Scanning dependencies of target example2
[ 71%] Building CXX object examples/CMakeFiles/example2.dir/example2.cpp.o
[ 72%] Linking CXX executable example2
[ 72%] Built target example2
Scanning dependencies of target example5
[ 73%] Building CXX object examples/CMakeFiles/example5.dir/example5.cpp.o
[ 74%] Linking CXX executable example5
[ 74%] Built target example5
Scanning dependencies of target example8
[ 75%] Building CXX object examples/CMakeFiles/example8.dir/example8.cpp.o
[ 76%] Linking CXX executable example8
[ 76%] Built target example8
Scanning dependencies of target example1
[ 77%] Building CXX object examples/CMakeFiles/example1.dir/example1.cpp.o
[ 77%] Linking CXX executable example1
[ 77%] Built target example1
Scanning dependencies of target example6
[ 78%] Building CXX object examples/CMakeFiles/example6.dir/example6.cpp.o
[ 78%] Linking CXX executable example6
[ 78%] Built target example6
Scanning dependencies of target example7
[ 79%] Building CXX object examples/CMakeFiles/example7.dir/example7.cpp.o
[ 80%] Linking CXX executable example7
/usr/local/lib/libsrtp2.a(datatypes.o): In function octet_string_set_to_zero': datatypes.c:(.text+0x1d91): undefined reference to OPENSSL_cleanse'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_set_iv': aes_icm_ossl.c:(.text+0x77): undefined reference to EVP_EncryptInit_ex'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_encrypt': aes_icm_ossl.c:(.text+0xe8): undefined reference to EVP_EncryptUpdate'
aes_icm_ossl.c:(.text+0x113): undefined reference to EVP_EncryptFinal_ex' /usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_context_init':
aes_icm_ossl.c:(.text+0x1f9): undefined reference to EVP_aes_128_ctr' aes_icm_ossl.c:(.text+0x20d): undefined reference to EVP_EncryptInit_ex'
aes_icm_ossl.c:(.text+0x231): undefined reference to EVP_aes_256_ctr' aes_icm_ossl.c:(.text+0x241): undefined reference to EVP_aes_192_ctr'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_dealloc': aes_icm_ossl.c:(.text+0x26c): undefined reference to EVP_CIPHER_CTX_free'
/usr/local/lib/libsrtp2.a(aes_icm_ossl.o): In function srtp_aes_icm_openssl_alloc': aes_icm_ossl.c:(.text+0x36a): undefined reference to EVP_CIPHER_CTX_new'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_get_tag': aes_gcm_ossl.c:(.text+0x18): undefined reference to EVP_Cipher'
aes_gcm_ossl.c:(.text+0x2c): undefined reference to EVP_CIPHER_CTX_ctrl' /usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_set_aad':
aes_gcm_ossl.c:(.text+0x71): undefined reference to EVP_CIPHER_CTX_ctrl' aes_gcm_ossl.c:(.text+0x81): undefined reference to EVP_Cipher'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_context_init': aes_gcm_ossl.c:(.text+0xeb): undefined reference to EVP_aes_256_gcm'
aes_gcm_ossl.c:(.text+0x102): undefined reference to EVP_CipherInit_ex' aes_gcm_ossl.c:(.text+0x129): undefined reference to EVP_aes_128_gcm'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_dealloc': aes_gcm_ossl.c:(.text+0x147): undefined reference to EVP_CIPHER_CTX_free'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_encrypt': aes_gcm_ossl.c:(.text+0x19e): undefined reference to EVP_Cipher'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_decrypt': aes_gcm_ossl.c:(.text+0x1e3): undefined reference to EVP_CIPHER_CTX_ctrl'
aes_gcm_ossl.c:(.text+0x1f9): undefined reference to EVP_Cipher' aes_gcm_ossl.c:(.text+0x208): undefined reference to EVP_Cipher'
/usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_set_iv': aes_gcm_ossl.c:(.text+0x293): undefined reference to EVP_CipherInit_ex'
aes_gcm_ossl.c:(.text+0x2c1): undefined reference to EVP_CIPHER_CTX_ctrl' aes_gcm_ossl.c:(.text+0x2db): undefined reference to EVP_CIPHER_CTX_ctrl'
aes_gcm_ossl.c:(.text+0x2f2): undefined reference to EVP_CIPHER_CTX_ctrl' /usr/local/lib/libsrtp2.a(aes_gcm_ossl.o): In function srtp_aes_gcm_openssl_alloc':
aes_gcm_ossl.c:(.text+0x3cb): undefined reference to EVP_CIPHER_CTX_new' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_start':
hmac_ossl.c:(.text+0xe): undefined reference to HMAC_Init_ex' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_update':
hmac_ossl.c:(.text+0x61): undefined reference to HMAC_Update' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_init':
hmac_ossl.c:(.text+0x8e): undefined reference to EVP_sha1' hmac_ossl.c:(.text+0xa2): undefined reference to HMAC_Init_ex'
/usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_dealloc': hmac_ossl.c:(.text+0xc9): undefined reference to HMAC_CTX_free'
/usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_compute': hmac_ossl.c:(.text+0x129): undefined reference to HMAC_Update'
hmac_ossl.c:(.text+0x142): undefined reference to HMAC_Final' /usr/local/lib/libsrtp2.a(hmac_ossl.o): In function srtp_hmac_alloc':
hmac_ossl.c:(.text+0x21c): undefined reference to `HMAC_CTX_new'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/example7.dir/build.make:96: ошибка выполнения рецепта для цели «examples/example7»
make[2]: *** [examples/example7] Ошибка 1
CMakeFiles/Makefile2:415: ошибка выполнения рецепта для цели «examples/CMakeFiles/example7.dir/all»
make[1]: *** [examples/CMakeFiles/example7.dir/all] Ошибка 2
Makefile:127: ошибка выполнения рецепта для цели «all»
make: *** [all] Ошибка 2

pkg-config output is inconsistent with example5.cpp

$ c++ -o example5 example5.cpp `pkg-config --cflags --libs jrtplib`
example5.cpp:6:10: fatal error: 'rtpsession.h' file not found
#include "rtpsession.h"
         ^~~~~~~~~~~~~~

This is because rtpsession.h is installed into /usr/local/include/jrtplib3/rtpsession.h and pkg-config doesn't include this directory:

$ pkg-config --cflags --libs jrtplib
-I/usr/local/include -L/usr/local/lib -ljrtp 

Struggling on an h264 stream

Hey, so I finally got the library implemented into my system which uses an h264 stream. It seems to be struggling to receive that data when I play a move over the h264 stream. I set the max packet size to 60,000. But my average packet size is around 10,000 maxing out at about 20,000. My server seems to be sending these out at 60 frames a second but my receive end starts struggling at the beginning and towards the end it doesn't even receive any packets... Not sure what I should be looking for here.

How to handle RTCP using custom port?

Source use 45180 to send RTP packet and 40860 to send RTCP (sender report) packet。
My program use 50000 to receive RTP packet and 50001 to receive RTCP packet, but send RTCP (receiver report) to 45181 on source。
How can I add destination with custom RTCP port?

sendto system call return value ignored

In RTPUDPv4Transmitter::SendRTPData, I notice that the return value of sendto is simply ignored. There's a variety of issues that may show up with the call. At the very least, it would be good to check that sendto was successful, by checking that the return value is the same as the length of bytes written. If it's not successful, some sort of error should show up, even it's as simple as "sendto failed".

Cmake command to only build include files

I'm working on top of https://github.com/Ansersion/myRtspClient. It doesn't have cmake, I'm adding so it can work on Android. The problem is that in order for me to link it together with with JRTPLIB, I need to build with JRTPLIB source files. But for now, when I add_subdirectory the jrtplib in the myRtspClient's cmakelists file, it will build the headers but in the end it will also build the entire jrtplib, which is unnecesary.

Wouldn't it be great to have a way to build only the include files?

Link error: undefined reference to `jrtplib::RTPFakeTransmitter::AbortWait()'

On Linux, after compiling and installing, when I link against the library (-ljrtp), I get the following link error:

/usr/local/lib/libjrtp.so: undefined reference to 'jrtplib::RTPFakeTransmitter::AbortWait()'

To fix it, in src/extratransmitters/rtpfaketransmitter.cpp, underneath RTPFakeTransmitter::WaitForIncoingData(), I insert the following member function implementation:

int RTPFakeTransmitter::AbortWait() { return ERR_RTP_FAKETRANS_WAITNOTIMPLEMENTED; }

then I recompile and reinstall the library.

This eliminates the linker error, but is this the proper way to do this? Am I doing something else wrong to get the linker error in the first place?

Compile error

Hey, so I am incorporating your library into my program right now and I am receiving the following compile time error:

/usr/local/include/jrtplib3/rtptimeutilities.h:92:17: error: expected unqualified-id before numeric constant
static RTPTime CurrentTime();
^
/usr/local/include/jrtplib3/rtptimeutilities.h:268:25: error: expected unqualified-id before numeric constant
inline RTPTime RTPTime::CurrentTime()

I have been able to narrow down the issue just a little bit. It seems to only pop up when "rtpsession.h" is included in more than one file. Any help would be greatly appreciated!

RTPSession copy constructor is broken

RTPSession can be copied with the default copy constructor, which however does the wrong thing. It copies the pointer to RTPRandom instead of cloning the pointed-to object. When one of the copies is destroyed, it deletes the RTPRandom, which will result in access violation or double delete, depending on how the other copy is used.

Probably RTPSession is not meant to be copied, so I suggest you disable the copy constructor and copy assignment operator as described here.

jrtp not receiving packets on Linux/ARM when sending from a remote pc

Hi,

I included jrtplib into my project, and it is working fine on Windows. Sending RTP data over a network and receiving.
When using the same program built for Linux on ARM (Nvidia Jetson), I only receive packets when sending from the same machine as where the receiving program is run. It doesn't matter if I listen on 127.0.0.1, 0.0.0.0 or the network interface.
I already checked with strace, sockets are opened, it looks the same for both variations (sending from local and remote, data is read from the socket), yet when sending from a remote machine I do not get data from jrtp.

Here's the setup I use for the receiving side:

jrtplib::RTPUDPv4TransmissionParams transmission_params;
jrtplib::RTPSessionParams session_params;

session_params.SetOwnTimestampUnit(1.0 / 90000.0);
session_params.SetMaximumPacketSize(64000);
session_params.SetAcceptOwnPackets(false);

transmission_params.SetPortbase(24710);
transmission_params.SetRTPReceiveBuffer(1024*1024); // big enough for everything ...

jrtplib::RTPSession session;
auto status = session.Create(session_params, &transmission_params);

Does anyone have an idea or encountered a similar problem? Since data is coming from the remote machine (I can see it being read with strace), I am out of ideas here.

thanks for any help
Findus

SSL certificate expired for https://research.edm.uhasselt.be/jori/jrtplib

Josephs-MacBook-Pro:~ joe$ curl -ILvvv https://research.edm.uhasselt.be/jori/jrtplib
*   Trying 136.144.131.36...
* TCP_NODELAY set
* Connected to research.edm.uhasselt.be (136.144.131.36) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /usr/local/etc/openssl/cert.pem
  CApath: /usr/local/etc/openssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: certificate has expired
* Closing connection 0
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Josephs-MacBook-Pro:~ joe$ 

Add proper logging

Please add proper logging and tracing for all functions.

I'm trying to debug an RTP issue on a machine with no debugger (only printf debugging) and it's pretty much impossible to figure out where the problem lies with the lack of logging in JRTPLIB.

Support for libc++?

I'm trying to get JRTP to build (and more importantly link) with an application that is linked with libc++.

This is proving to be annoying simply because there's no ABI standard for C++ libraries, and therefore it's impossible to mix and match standard library implementations. (Which, thinking about it, is probably a good thing.) :)

Basically, I'm trying to get "-stdlib=libc++" to be added to the clang command line options from the cmake command line.

Do you have any suggestions as to how I can achieve this? (Or is this something you can add support for?)

FYI, the only function I appear to be having trouble with is jrtplib::RTPGetErrorString, which returns a string.

x64 not working

It seems that the .lib files created as per the video tutorial you provided are x86. Is there anyway to make them work within a x64 project?

Is this right?

I usually compile it like this in arm-linux platform. Although it can be done in this way, but it also seemed stupid. Is there any other perfect and simple way?


  • Step 1: compile jthread
  1. change workspace to compile directory of jthread.
    # tar -jxvf jthread-1.3.1.tar.bz2
    # mkdir jthread_tmp
    # cd jthread_tmp
  1. Add this following lines to front of the file ../CMakeLists.txt.
    set(CMAKE_SYSTEM_NAME Linux)
    set(CMAKE_C_COMPILER arm-none-linux-gnueabi-gcc)
    set(CMAKE_CXX_COMPILER arm-none-linux-gnueabi-g++)
    set(CMAKE_INSTALL_PREFIX /root/28181)
  1. And then.
    # cmake../
  1. After that, add this following lines to front of the file ./cmake/JThreadConfig.cmake, let the jrtp link static library of jthread.
    set(JTHREAD_LIBRARIES  "/root/28181/lib/libjthread.a" "-lpthread")
    # make install
  • Step 2: compile jrtp
  1. change workspace to compile directory of jrtp.
    # mkdir jrtplib_tmp
    # cd jrtplib_tmp
  1. Add this following lines to front of the file ../CMakeLists.txt.
    set(CMAKE_SYSTEM_NAME Linux)
    set(CMAKE_C_COMPILER arm-none-linux-gnueabi-gcc)
    set(CMAKE_CXX_COMPILER arm-none-linux-gnueabi-g++)
    set(CMAKE_INSTALL_PREFIX /root/28181)
    include(${CMAKE_INSTALL_PREFIX}/lib/cmake/JThread/JThreadConfig.cmake)
  1. Then follow this commands, jrtp will automatically detect the correct JThread.
    # cmake ../
    # make install

Support Runtime Libraries /MT and /MTd

The project in which I use is compiled with the /MT and /MTd runtime libraries. The default JRTP and JThread libraries assume /MD and /MDd. It would be nice if the default can be overridden with an option in CMake, or better yet: it would be nice if the Visual Studio solutions contain a configuration such as Debug_MT and Release_MT with the /MT options specified. You can work around the problem by manually making the configurations Debug_MT and Release_MT, but I'd have to re-do this every time you create a new release: a rather time consuming process.

The Create function block.求助!

jrtplib库版本:3.11.2
jthread库版本:1.3.3
使用场景:
1、收流-UDP 发流UDP
2、50路流轮询播放,9路流直播
3、SetNeedThreadSafety函数执行成功
现象:
1、Create函数偶现阻塞
求助!

Locking does not seem to work properly in Windows

I've previously ran a piece of code in Windows that does the following

sess.BeginDataAccess()
...
sess.SendPacket(...)
...
sess.EndDataAccess()

This worked fine. I then later tried to do this on a Mac and found that there was lock contention. From the jrtplib code, it looks like there should be. SOURCES_LOCK is grabbed on BeginDataAccess and also grabbed in SendPacket.

My takeaway is that Windows isn't properly locking SOURCES_LOCK, whereas Mac is

Note that in both environments jThread is running and working (I know this because OnPollThreadStep is being called)

I haven't confirmed in a minimal example environment that this is an issue, so please feel free to close this if this isn't a detailed enough bug report.

pkg-config shouldn't add libsrtp2.so to the link flags

$ pkg-config --libs jrtplib
-L/usr/local/lib -ljrtp /usr/local/lib/libsrtp2.so 

Only binaries that immediately use the library should be linked with it. So /usr/local/lib/libjrtp.so.3.11.1 should be linked with /usr/local/lib/libsrtp2.so, but binaries that use /usr/local/lib/libjrtp.so shouldn't be linked with it.

i get messy code from RTPGetErrorString

i read READMI and build a library for android.i get an error in session.Create,When I print the error message, I get the messy code:�L�U, i use ndk17, cmake3.13.4

Does JRTPLIB work with libstp2?

I have installed SRTP on Mac OS using Homebrew. It installed the pkg-config file under:

/usr/local//lib/pkgconfig/libsrtp2.pc

Name: libsrtp2
Version: 2.1.0
Description: Library for SRTP (Secure Realtime Transport Protocol)

The output of cmake is:

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'srtp'
--   No package 'srtp' found
-- Found LIBSRTP: LIBSRTP_LIBRARY_DIR-NOTFOUND LIBSRTP_INCLUDE_DIR-NOTFOUND

Does JRTPLIB currently only work with libstp v1?

Thanks,

nick.

Compilation error when building with -DCMAKE_BUILD_TYPE=Release

cmake -DCMAKE_BUILD_TYPE=Release .

Then I get

/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp: In member function ‘virtual uint8_t jrtplib::RTPRandomURandom::GetRandom8()’:
/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp:71:7: error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Werror=unused-result]
  fread(&value, sizeof(uint8_t), 1, device);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp: In member function ‘virtual uint16_t jrtplib::RTPRandomURandom::GetRandom16()’:
/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp:83:7: error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Werror=unused-result]
  fread(&value, sizeof(uint16_t), 1, device);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp: In member function ‘virtual uint32_t jrtplib::RTPRandomURandom::GetRandom32()’:
/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp:95:7: error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Werror=unused-result]
  fread(&value, sizeof(uint32_t), 1, device);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp: In member function ‘virtual double jrtplib::RTPRandomURandom::GetRandomDouble()’:
/home/lz/orwell/myRtspClient/third_party/JRTPLIB/src/rtprandomurandom.cpp:107:7: error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Werror=unused-result]
  fread(&value, sizeof(uint64_t), 1, device);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm confused, I've never compiled for Release, only Debug. I just accidentally turned Release on and got these errors. I understand what they mean but now I'm asking myself how it's possible that these errors have not been fixed? Haven't nobody ever compiled for Release?

rtp argument of RTPRawPacket complicates things

I use JRTPLIB to parse RTP / RTCP packages, and I was wondering if the rtp argument of the RTPRawPacket contructor makes any sense. Normally, this is how I would go about parsing a packet:

RTPRawPacket raw_packet(data);
RTPPacket rtp_packet(raw_packet);
if (rtp_packet.GetCreationError()) {
    RTCPCompoundPacket rtcp_packet(raw_packet);
    ...
} else {
    ...
}

However, this code fails when data represents an RTCP packet: in order to parse raw_packet as an RTPPacket, I have to instantiate it with rtp=true; but then the creation of rtcp_packet will fail by default. So effectively if rtp_packet could not be created, I need to create another raw packet, this time with rtp=false, and call the RTCPCompoundPacket constructor on that.

Not only is the process more cumbersome that it should be, with parsing in mind, the parameter doesn't make much sense, because it forces me to make a blind guess about the contents of the packet.

Building for C++11 fails due to naming conflict of bind in rtpudpv4transmitter.cpp

Building the library for C++11 on macOS (Apple Clang) fails due to a naming conflict in RTPUDPv4Transmitter, which declares "using namespace std;" which changes the meaning of all bind calls from a socket-bind to a functional-bind. This then fails to compile as the arguments do not match. Removing the using namespace and declaring std:: explicitly where needed fixes this, as does replacing the bind call with ::bind. Then the rest compiles nicely.

Memory access problem in rtpsources.cpp line 339

Hi Jori

I believe I have found a memory access problem in rtpsources.cpp line 339, if a session implementation overrides OnValidatedRTPPacket, sets ispackethandled to true and deletes the RTPPacket pointer.

In rtpsources.cpp line 232 srcdat->ProcessRTPPacket is called, which in turn calls OnValidatedRTPPacket. In example6 the override deletes the packet using DeletePacket(packet), but in rtpsources.cpp line 339, rtppack->GetCSRCCount() is called on a deleted object and in line rtppack->GetCSRC(i) may be called on the same deleted object.

I do not have a suggestion for a fix, but either the OnValidatedRTPPacket should not delete the packet, or it should be handled in some other way. If OnValidatedRTPPacket deletes the packet, the entire contributing source handling will be broken.

I can just avoid setting ispackethandled to true and delete the packet, but that means that the packets are stored in the packetlist and I am not sure why I would want that (I call Poll() from my own thread as in example8).

Regards
Lau Bakman

Typo in src/rtperrors.cpp

Hey, there appears to be a typo in src/rtperrors.cpp on line 72. Should be "would" and it is spelled "whould"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.