From 0c2bb6e388da201ffc4abf1fa50fcb39ffaaa630 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Mon, 12 Sep 2011 19:32:49 +0000 Subject: Store a pointer to frame_data which holds the timing and frame number info rather than making copies. svn path=/trunk/; revision=38981 --- gtk/voip_calls.c | 19 ++++++++----------- gtk/voip_calls.h | 9 +++------ 2 files changed, 11 insertions(+), 17 deletions(-) (limited to 'gtk') diff --git a/gtk/voip_calls.c b/gtk/voip_calls.c index 089578f294..0421a19af6 100644 --- a/gtk/voip_calls.c +++ b/gtk/voip_calls.c @@ -547,9 +547,7 @@ RTP_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void cons } if (!strinfo->pt_str) strinfo->pt_str = g_strdup(val_to_str_ext(strinfo->pt, &rtp_payload_type_short_vals_ext, "%u")); strinfo->npackets = 0; - strinfo->first_frame_num = pinfo->fd->num; - strinfo->start_abs = pinfo->fd->abs_ts; - strinfo->start_rel = pinfo->fd->rel_ts; + strinfo->start_fd = pinfo->fd; strinfo->setup_frame_number = pi->info_setup_frame_num; strinfo->rtp_event = -1; tapinfo->list = g_list_append(tapinfo->list, strinfo); @@ -558,8 +556,7 @@ RTP_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void cons if (strinfo!=NULL){ /* Add the info to the existing RTP stream */ strinfo->npackets++; - strinfo->stop_abs = pinfo->fd->abs_ts; - strinfo->stop_rel = pinfo->fd->rel_ts; + strinfo->stop_fd = pinfo->fd; /* process RTP Event */ if (rtp_evt_frame_num == pinfo->fd->num) { @@ -609,8 +606,8 @@ static void RTP_packet_draw(void *prs _U_) while(voip_calls_graph_list){ gai = voip_calls_graph_list->data; /* if RTP was already in the Graph, just update the comment information */ - if (rtp_listinfo->first_frame_num == gai->frame_num){ - duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_rel) - nstime_to_msec(&rtp_listinfo->start_rel)); + if (rtp_listinfo->start_fd->num == gai->frame_num){ + duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts)); g_free(gai->comment); gai->comment = g_strdup_printf("%s Num packets:%u Duration:%u.%03us SSRC:0x%X", (rtp_listinfo->is_srtp)?"SRTP":"RTP", rtp_listinfo->npackets, @@ -623,15 +620,15 @@ static void RTP_packet_draw(void *prs _U_) if (!voip_calls_graph_list) item++; /* add the RTP item to the graph if was not there*/ - if (rtp_listinfo->first_frame_numframe_num || !voip_calls_graph_list){ + if (rtp_listinfo->start_fd->numframe_num || !voip_calls_graph_list){ new_gai = g_malloc(sizeof(graph_analysis_item_t)); - new_gai->frame_num = rtp_listinfo->first_frame_num; - new_gai->time = nstime_to_sec(&rtp_listinfo->start_rel); + new_gai->frame_num = rtp_listinfo->start_fd->num; + new_gai->time = nstime_to_sec(&rtp_listinfo->start_fd->rel_ts); COPY_ADDRESS(&(new_gai->src_addr),&(rtp_listinfo->src_addr)); COPY_ADDRESS(&(new_gai->dst_addr),&(rtp_listinfo->dest_addr)); new_gai->port_src = rtp_listinfo->src_port; new_gai->port_dst = rtp_listinfo->dest_port; - duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_rel) - nstime_to_msec(&rtp_listinfo->start_rel)); + duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts)); new_gai->frame_label = g_strdup_printf("%s (%s) %s", (rtp_listinfo->is_srtp)?"SRTP":"RTP", rtp_listinfo->pt_str, diff --git a/gtk/voip_calls.h b/gtk/voip_calls.h index 804ca5f039..6cc8c576b9 100644 --- a/gtk/voip_calls.h +++ b/gtk/voip_calls.h @@ -207,13 +207,10 @@ typedef struct _voip_rtp_stream_info { guint32 npackets; gboolean end_stream; - guint32 first_frame_num; /* frame number of first frame */ guint32 setup_frame_number; /* frame number of setup message */ - /* start of recording (GMT) of this stream */ - nstime_t start_abs; - nstime_t stop_abs; - nstime_t start_rel; - nstime_t stop_rel; + /* The frame_data struct holds the frame number and timing information needed. */ + frame_data *start_fd; + frame_data *stop_fd; gint32 rtp_event; } voip_rtp_stream_info_t; -- cgit v1.2.3