osmo_ortp.c: Fix warning: check ortp API in rtp_session_signal_connect

Since ortp commit 5ab29c50adc7948b11449e3aeee66010379ff7dc preceeding
ortp 0.24, the API is fixed and requests a pointer instead of an
unsigned long.

As we now require at least ortp 0.22 since libosmo-abis
15d9b7929d, we need to support both old
and new version of the API to continue having support for 0.22 but still
supporting new versions of the library.

Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb
This commit is contained in:
Pau Espin 2017-06-21 07:37:45 +02:00
parent b0c3a4a30f
commit 05df2d65a7
2 changed files with 21 additions and 4 deletions

View File

@ -72,6 +72,20 @@ AC_COMPILE_IFELSE(
[ortp_set_log_level_mask has no domain parameter])])
CFLAGS=$_cflags_save
_cflags_save=$CFLAGS
CFLAGS="$CFLAGS $ORTP_CFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <ortp/ortp.h>]],
[[void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; } rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]]
)],
[AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(void*)(arg)],
[rtp_session_signal_connect requires pointer parameter])],
[AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(unsigned long)(arg)],
[rtp_session_signal_connect requires ulong parameter])])
CFLAGS=$_cflags_save
AC_OUTPUT(
libosmoabis.pc
libosmotrau.pc

View File

@ -350,16 +350,19 @@ struct osmo_rtp_socket *osmo_rtp_socket_create(void *talloc_ctx, unsigned int fl
rtp_session_signal_connect(rs->sess, "ssrc_changed",
(RtpCallback) ortp_sig_cb_ssrc,
(unsigned long) rs);
RTP_SIGNAL_PTR_CAST(rs));
rtp_session_signal_connect(rs->sess, "payload_type_changed",
(RtpCallback) ortp_sig_cb_pt,
(unsigned long) rs);
RTP_SIGNAL_PTR_CAST(rs));
rtp_session_signal_connect(rs->sess, "network_error",
(RtpCallback) ortp_sig_cb_net,
(unsigned long) rs);
RTP_SIGNAL_PTR_CAST(rs));
rtp_session_signal_connect(rs->sess, "timestamp_jump",
(RtpCallback) ortp_sig_cb_ts,
(unsigned long) rs);
RTP_SIGNAL_PTR_CAST(rs));
/* initialize according to the RFC */
rtp_session_set_seq_number(rs->sess, random());