Skip to content

Commit

Permalink
Debug meetecho#2
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrayevRamil committed Aug 7, 2023
1 parent 93ed1f5 commit b83dec1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ice.c
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,7 @@ static void janus_ice_cb_new_remote_candidate (NiceAgent *agent, NiceCandidate *
}

static void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint component_id, guint len, gchar *buf, gpointer ice) {
JANUS_LOG(LOG_WARN, "BEGINNING OF METHOD BLOCK\n");
janus_ice_peerconnection *pc = (janus_ice_peerconnection *)ice;
if(!pc) {
JANUS_LOG(LOG_ERR, "No component %d in stream %d??\n", component_id, stream_id);
Expand Down Expand Up @@ -2576,6 +2577,7 @@ static void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint comp
/* Not DTLS... RTP or RTCP? (http://tools.ietf.org/html/rfc5761#section-4) */
if(janus_is_rtp(buf, len)) {
/* This is RTP */
JANUS_LOG(LOG_WARN, "BEGINNING OF RTP BLOCK\n");
if(janus_is_webrtc_encryption_enabled() && (!pc->dtls || !pc->dtls->srtp_valid || !pc->dtls->srtp_in)) {
JANUS_LOG(LOG_WARN, "[%"SCNu64"] Missing valid SRTP session (packet arrived too early?), skipping...\n", handle->handle_id);
} else {
Expand Down Expand Up @@ -2701,6 +2703,7 @@ static void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint comp
JANUS_LOG(LOG_ERR, "[%"SCNu64"] SRTP unprotect error: %s (len=%d-->%d, ts=%"SCNu32", seq=%"SCNu16")\n", handle->handle_id, janus_srtp_error_str(res), len, buflen, timestamp, seq);
}
} else {
JANUS_LOG(LOG_WARN, "BEGINNING OF ELSE BLOCK\n");
if((!video && medium->ssrc_peer[0] == 0) || (vindex == 0 && medium->ssrc_peer[0] == 0)) {
medium->ssrc_peer[0] = ntohl(header->ssrc);
JANUS_LOG(LOG_VERB, "[%"SCNu64"] Peer #%d (%s) SSRC: %u\n",
Expand Down Expand Up @@ -2832,6 +2835,7 @@ static void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint comp
/* Prepare the data to pass to the responsible plugin */
janus_plugin_rtp rtp = { .mindex = medium->mindex, .video = video, .buffer = buf, .length = buflen };
janus_plugin_rtp_extensions_reset(&rtp.extensions);
JANUS_LOG(LOG_WARN, "PARSE RTP EXTENSIONS\n");
/* Parse RTP extensions before involving the plugin */
if(!video && pc->audiolevel_ext_id != -1) {
gboolean vad = FALSE;
Expand Down Expand Up @@ -2875,14 +2879,14 @@ static void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint comp
memcpy(rtp.extensions.dd_content, dd, len);
}
}
JANUS_LOG(LOG_WARN, "pc->abs_capture_time_ext_id: %d", pc->abs_capture_time_ext_id);
JANUS_LOG(LOG_WARN, "pc->abs_capture_time_ext_id: %d\n", pc->abs_capture_time_ext_id);
if(pc->abs_capture_time_ext_id != -1) {
uint64_t abs_ts = 0;
if(janus_rtp_header_extension_parse_abs_capture_time(buf, buflen,
pc->abs_capture_time_ext_id, &abs_ts) == 0) {
rtp.extensions.abs_capture_ts = abs_ts;
}
JANUS_LOG(LOG_WARN, "rtp.extensions.abs_capture_ts: %d", abs_ts);
JANUS_LOG(LOG_WARN, "rtp.extensions.abs_capture_ts: %d\n", abs_ts);
}
/* Pass the packet to the plugin */
janus_plugin *plugin = (janus_plugin *)handle->app;
Expand Down Expand Up @@ -4081,7 +4085,7 @@ static void janus_ice_rtp_extension_update(janus_ice_handle *handle, janus_ice_p
}
}
/* Check if we need to add the abs-capture-time extension */
JANUS_LOG(LOG_WARN, "extensions.abs_capture_ts: %d, handle->pc->abs_capture_time_ext_id: %d", packet->extensions.abs_capture_ts, handle->pc->abs_capture_time_ext_id);
JANUS_LOG(LOG_WARN, "extensions.abs_capture_ts: %d, handle->pc->abs_capture_time_ext_id: %d\n", packet->extensions.abs_capture_ts, handle->pc->abs_capture_time_ext_id);
if(packet->extensions.abs_capture_ts > 0 && handle->pc->abs_capture_time_ext_id > 0) {
uint64_t abs64 = htonll(packet->extensions.abs_capture_ts);
if(!use_2byte) {
Expand Down

0 comments on commit b83dec1

Please sign in to comment.