Commit 2ce4104a authored by Ronan's avatar Ronan Committed by François Grisez

fix(mediastreamer2): disable new gcc 8 -Wcast-function-type warnings (FIXME in the future)

(cherry picked from commit 6f5ab274)
parent 646feb16
......@@ -202,7 +202,7 @@ static void audio_stream_configure_resampler(AudioStream *st, MSFilter *resample
ms_filter_call_method(resampler, MS_FILTER_SET_NCHANNELS, &from_channels);
ms_filter_call_method(resampler, MS_FILTER_SET_OUTPUT_NCHANNELS, &to_channels);
ms_message("configuring %s:%p-->%s:%p from rate [%i] to rate [%i] and from channel [%i] to channel [%i]",
from->desc->name, from, to->desc->name, to, from_rate, to_rate, from_channels, to_channels);
from->desc->name, from, to->desc->name, to, from_rate, to_rate, from_channels, to_channels);
}
static void audio_stream_process_rtcp(MediaStream *media_stream, mblk_t *m){
......@@ -263,7 +263,7 @@ void audio_stream_prepare_sound(AudioStream *stream, MSSndCard *playcard, MSSndC
} else {
stream->ms.voidsink=ms_factory_create_filter(stream->ms.factory, MS_VOID_SINK_ID);
ms_filter_link(stream->dummy,0,stream->ms.voidsink,0);
}
if (stream->ms.sessions.ticker == NULL) media_stream_start_ticker(&stream->ms);
ms_ticker_attach(stream->ms.sessions.ticker,stream->dummy);
......@@ -813,9 +813,20 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
stream->dtmfgen=ms_factory_create_filter(stream->ms.factory, MS_DTMF_GEN_ID);
else
stream->dtmfgen=NULL;
/* FIXME: Temporary workaround for -Wcast-function-type. */
#if __GNUC__ >= 8
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#endif // if __GNUC__ >= 8
rtp_session_signal_connect(rtps,"telephone-event",(RtpCallback)on_dtmf_received,stream);
rtp_session_signal_connect(rtps,"payload_type_changed",(RtpCallback)audio_stream_payload_type_changed,stream);
#if __GNUC__ >= 8
_Pragma("GCC diagnostic pop")
#endif // if __GNUC__ >= 8
if (stream->ms.state==MSStreamPreparing){
/*we were using the dummy preload graph, destroy it but keep sound filters unless no soundcard is given*/
_audio_stream_unprepare_sound(stream, io->input.type == MSResourceSoundcard);
......@@ -865,7 +876,7 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
if ((stream->features & AUDIO_STREAM_FEATURE_DTMF) != 0 && (tev_pt == -1)
&& ( strcasecmp(pt->mime_type,"pcmu")==0 || strcasecmp(pt->mime_type,"pcma")==0)){
/*if no telephone-event payload is usable and pcma or pcmu is used, we will generate
inband dtmf*/
inband dtmf*/
stream->dtmfgen_rtp=ms_factory_create_filter (stream->ms.factory, MS_DTMF_GEN_ID);
} else {
......@@ -878,7 +889,7 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
ms_error("Sample rate is unknown for RTP side !");
return -1;
}
if (stream->features == 0) {
MSPinFormat sndread_format = {0};
MSPinFormat rtpsend_format = {0};
......@@ -894,7 +905,7 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
}
do_ts_adjustments = !skip_encoder_and_decoder;
ms_filter_call_method(stream->ms.rtpsend, MS_RTP_SEND_ENABLE_TS_ADJUSTMENT, &do_ts_adjustments);
if (!skip_encoder_and_decoder) {
stream->ms.encoder=ms_factory_create_encoder(stream->ms.factory, pt->mime_type);
stream->ms.decoder=ms_factory_create_decoder(stream->ms.factory, pt->mime_type);
......@@ -1003,7 +1014,7 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
if (stream->write_resampler == NULL) stream->write_resampler = ms_factory_create_filter(stream->ms.factory, MS_RESAMPLE_ID);
resampler_missing = stream->write_resampler == NULL;
}
if (resampler_missing){
ms_fatal("AudioStream: no resampler implementation found, but resampler is required to perform the AudioStream. "
"Does mediastreamer2 was compiled with libspeex dependency ?");
......@@ -1078,7 +1089,7 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
/*configure equalizer if needed*/
MSDevicesInfo *devices = ms_factory_get_devices_info(stream->ms.factory);
SoundDeviceDescription *device = ms_devices_info_get_sound_device_description(devices);
audio_stream_set_mic_gain_db(stream, 0);
audio_stream_set_spk_gain_db(stream, 0);
if (device && device->hacks) {
......@@ -1165,7 +1176,7 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
if (ms_filter_call_method(stream->ms.decoder, MS_DECODER_ENABLE_PLC, &decoder_enable_plc) != 0) {
ms_warning(" MS_DECODER_ENABLE_PLC on stream %p function error ", stream);
}
}
stream->plc = NULL;
}
......@@ -1476,7 +1487,7 @@ AudioStream *audio_stream_new_with_sessions(MSFactory *factory, const MSMediaStr
stream->ms.type = MSAudio;
media_stream_init(&stream->ms,factory, sessions);
ms_factory_enable_statistics(factory, TRUE);
ms_factory_reset_statistics(factory);
......@@ -1780,10 +1791,23 @@ void audio_stream_stop(AudioStream * stream){
}
}
rtp_session_set_rtcp_xr_media_callbacks(stream->ms.sessions.rtp_session, NULL);
/* FIXME: Temporary workaround for -Wcast-function-type. */
#if __GNUC__ >= 8
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#endif // if __GNUC__ >= 8
rtp_session_signal_disconnect_by_callback(stream->ms.sessions.rtp_session,"telephone-event",(RtpCallback)on_dtmf_received);
rtp_session_signal_disconnect_by_callback(stream->ms.sessions.rtp_session,"payload_type_changed",(RtpCallback)audio_stream_payload_type_changed);
/*before destroying the filters, pump the event queue so that pending events have a chance to reach their listeners.
* When the filter are destroyed, all their pending events in the event queue will be cancelled*/
#if __GNUC__ >= 8
_Pragma("GCC diagnostic pop")
#endif // if __GNUC__ >= 8
// Before destroying the filters, pump the event queue so that pending events have a chance
// to reach their listeners. When the filter are destroyed, all their pending events in the
// event queue will be cancelled.
evq = ms_factory_get_event_queue(stream->ms.factory);
if (evq) ms_event_queue_pump(evq);
ms_factory_log_statistics(stream->ms.factory);
......@@ -1918,4 +1942,3 @@ void audio_stream_set_audio_route(AudioStream *stream, MSAudioRoute route) {
}
}
}
......@@ -1269,11 +1269,11 @@ static int ice_send_message_to_socket(RtpTransport * rtptp, char* buf, size_t le
mblk_t *m = rtp_session_create_packet_raw((const uint8_t *)buf, len);
int err;
struct addrinfo *v6ai = NULL;
memcpy(&m->net_addr, from, fromlen);
m->net_addrlen = fromlen;
if ((rtptp->session->rtp.gs.sockfamily == AF_INET6) && (to->sa_family == AF_INET)) {
char to_addr_str[64];
int to_port = 0;
memset(to_addr_str, 0, sizeof(to_addr_str));
......@@ -2396,7 +2396,7 @@ static bool_t ice_handle_received_turn_allocate_success_response(IceCheckList *c
candidate = ice_add_local_candidate(cl, "srflx", ms_stun_family_to_af(srflx_addr.family), srflx_addr_str, srflx_port, componentID, candidate);
ms_stun_address_to_printable_ip_address(&srflx_addr, srflx_addr_str, sizeof(srflx_addr_str));
ms_message("ice: Add candidate obtained by STUN/TURN: %s:srflx", srflx_addr_str);
if (cl->session->turn_enabled) {
request->turn_context->stats.nb_successful_allocate++;
ice_schedule_turn_allocation_refresh(cl, componentID, ms_stun_message_get_lifetime(msg));
......@@ -2706,7 +2706,7 @@ void ice_handle_stun_packet(IceCheckList *cl, RtpSession *rtp_session, const Ort
ms_warning("ice: Recv unknown STUN success response: %s <-- %s [%s]", recv_addr_str, source_addr_str, tr_id_str);
break;
}
} else if (ms_stun_message_is_error_response(msg)) {
ice_set_transaction_response_time(cl, &tr_id, evt_data->ts);
ms_message("ice: Recv error response: %s <-- %s [%s]", recv_addr_str, source_addr_str, tr_id_str);
......@@ -2912,7 +2912,7 @@ void ice_add_losing_pair(IceCheckList *cl, uint16_t componentID, int local_famil
elem = bctbx_list_find_custom(cl->local_candidates, (bctbx_compare_func)ice_find_candidate_from_transport_address, &taddr);
if (elem == NULL) {
/* Workaround to detect if the local candidate that has not been found has been added by the proxy server.
If that is the case, add it to the local candidates now. */
If that is the case, add it to the local candidates now. */
elem = bctbx_list_find_custom(cl->remote_candidates, (bctbx_compare_func)ice_find_candidate_from_ip_address, local_addr);
if (elem != NULL) {
tc.componentID = componentID;
......@@ -3451,7 +3451,7 @@ static void ice_conclude_waiting_frozen_and_inprogress_pairs(const IceValidCandi
bctbx_list_t *elem;
ice_remove_waiting_and_frozen_pairs_from_list(&cl->check_list, valid_pair->valid->local->componentID);
ice_remove_waiting_and_frozen_pairs_from_list(&cl->triggered_checks_queue, valid_pair->valid->local->componentID);
for (elem = cl->check_list ; elem != NULL; elem = elem->next){
IceCandidatePair *pair = (IceCandidatePair*) elem->data;
if ((pair->state == ICP_InProgress) && (pair->local->componentID == valid_pair->valid->local->componentID)
......@@ -3774,7 +3774,18 @@ static int ice_find_gathering_stun_server_request(const IceStunServerRequest *re
static void ice_remove_gathering_stun_server_requests(IceCheckList *cl) {
bctbx_list_t *elem = cl->stun_server_requests;
while (elem != NULL) {
/* FIXME: Temporary workaround for -Wcast-function-type. */
#if __GNUC__ >= 8
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#endif // if __GNUC__ >= 8
elem = bctbx_list_find_custom(cl->stun_server_requests, (bctbx_compare_func)ice_find_gathering_stun_server_request, NULL);
#if __GNUC__ >= 8
_Pragma("GCC diagnostic pop")
#endif // if __GNUC__ >= 8
if (elem != NULL) {
IceStunServerRequest *request = (IceStunServerRequest *)elem->data;
ice_stun_server_request_free(request);
......@@ -3893,8 +3904,19 @@ void ice_check_list_process(IceCheckList *cl, RtpSession *rtp_session)
/* Send STUN/TURN server requests (to gather candidates, create/refresh TURN permissions, refresh TURN allocations or bind TURN channels). */
bctbx_list_for_each2(cl->stun_server_requests, (void (*)(void*,void*))ice_send_stun_server_requests, cl);
/* FIXME: Temporary workaround for -Wcast-function-type. */
#if __GNUC__ >= 8
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#endif // if __GNUC__ >= 8
cl->stun_server_requests = bctbx_list_remove_custom(cl->stun_server_requests, (bctbx_compare_func)ice_compare_stun_server_requests_to_remove, NULL);
#if __GNUC__ >= 8
_Pragma("GCC diagnostic pop")
#endif // if __GNUC__ >= 8
/* Send event if needed. */
if ((cl->session->send_event == TRUE) && (ice_compare_time(curtime, cl->session->event_time) >= 0)) {
OrtpEvent *ev;
......
......@@ -137,8 +137,20 @@ RtpSession * ms_create_duplex_rtp_session(const char* local_ip, int loc_rtp_port
rtp_session_enable_adaptive_jitter_compensation(rtpr, TRUE);
rtp_session_set_symmetric_rtp(rtpr, TRUE);
rtp_session_set_local_addr(rtpr, local_ip, loc_rtp_port, loc_rtcp_port);
/* FIXME: Temporary workaround for -Wcast-function-type. */
#if __GNUC__ >= 8
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#endif // if __GNUC__ >= 8
rtp_session_signal_connect(rtpr, "timestamp_jump", (RtpCallback)rtp_session_resync, NULL);
rtp_session_signal_connect(rtpr, "ssrc_changed", (RtpCallback)rtp_session_resync, NULL);
#if __GNUC__ >= 8
_Pragma("GCC diagnostic pop")
#endif // if __GNUC__ >= 8
rtp_session_set_ssrc_changed_threshold(rtpr, 0);
rtp_session_set_rtcp_report_interval(rtpr, 2500); /* At the beginning of the session send more reports. */
rtp_session_set_multicast_loopback(rtpr,TRUE); /*very useful, specially for testing purposes*/
......@@ -646,7 +658,6 @@ static void apply_bitrate_limit(MediaStream *obj, int br_limit){
MSVideoConfiguration *vconf_list = NULL;
MSVideoSize vsize;
MSVideoConfiguration vconf1, vconf2;
ms_filter_call_method(obj->encoder, MS_VIDEO_ENCODER_GET_CONFIGURATION_LIST, &vconf_list);
ms_filter_call_method(obj->encoder, MS_FILTER_GET_VIDEO_SIZE, &vsize);
......
......@@ -899,9 +899,19 @@ static int video_stream_start_with_source_and_output(VideoStream *stream, RtpPro
rtp_session_set_jitter_compensation(rtps, jitt_comp);
}
/* FIXME: Temporary workaround for -Wcast-function-type. */
#if __GNUC__ >= 8
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#endif // if __GNUC__ >= 8
rtp_session_signal_connect(stream->ms.sessions.rtp_session,"payload_type_changed",
(RtpCallback)video_stream_payload_type_changed,&stream->ms);
#if __GNUC__ >= 8
_Pragma("GCC diagnostic pop")
#endif // if __GNUC__ >= 8
rtp_session_get_jitter_buffer_params(stream->ms.sessions.rtp_session,&jbp);
jbp.max_packets=1000;//needed for high resolution video
rtp_session_set_jitter_buffer_params(stream->ms.sessions.rtp_session,&jbp);
......@@ -1443,8 +1453,19 @@ static MSFilter* _video_stream_stop(VideoStream * stream, bool_t keep_source)
}
}
rtp_session_set_rtcp_xr_media_callbacks(stream->ms.sessions.rtp_session, NULL);
/* FIXME: Temporary workaround for -Wcast-function-type. */
#if __GNUC__ >= 8
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#endif // if __GNUC__ >= 8
rtp_session_signal_disconnect_by_callback(stream->ms.sessions.rtp_session,"payload_type_changed",(RtpCallback)video_stream_payload_type_changed);
#if __GNUC__ >= 8
_Pragma("GCC diagnostic pop")
#endif // if __GNUC__ >= 8
/*Automatically the video recorder if it was opened previously*/
if (stream->recorder_output && ms_filter_implements_interface(stream->recorder_output, MSFilterRecorderInterface)){
MSRecorderState state = MSRecorderClosed;
......
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