Add a pointer to the start frame of each gop in the gog's tree
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 18 Feb 2005 20:02:40 +0000 (20:02 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 18 Feb 2005 20:02:40 +0000 (20:02 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13423 f5534014-38df-0310-8fa8-9805f1628bb7

plugins/mate/mate.h
plugins/mate/mate_setup.c
plugins/mate/packet-mate.c

index 27bf3478ab11f10aee600a6fd58556911148c74a..8540e15145d1702c50aaae167a38ee72e72c736b 100644 (file)
@@ -210,6 +210,8 @@ typedef struct _mate_cfg_item {
        LoAL* keys;
        int hfid_gog_num_of_gops;
        int hfid_gog_gop;
+       int hfid_gog_gopstart;
+       gint ett_gog_gop;
        
 } mate_cfg_item;
 
index 4b8ad3504ae7f67f38008b1119d8ad2557ae1725..08e34e14069106e499b9aa0a5f86482682bd90a3 100644 (file)
@@ -159,7 +159,9 @@ static mate_cfg_item* new_mate_cfg_item(guint8* name) {
        new->lifetime = -1.0;
        new->hfid_gop_pdu = -1;
        new->hfid_gop_num_pdus = -1;
-
+       new->ett_gog_gop = -1;
+       new->hfid_gog_gopstart = -1;
+       
        new->gop_index = NULL;
        new->gog_index = NULL;
 
@@ -1406,6 +1408,15 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p _U_) {
        
        g_array_append_val(matecfg->hfrs,hfri);
        
+       hfri.p_id = &(cfg->hfid_gog_gopstart);
+       hfri.hfinfo.name = "GopStart frame";
+       hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.GopStart",cfg->name);
+       hfri.hfinfo.type = FT_FRAMENUM;
+       hfri.hfinfo.display = BASE_DEC;
+       hfri.hfinfo.blurb = g_strdup("The start frame of a GOP");
+       
+       g_array_append_val(matecfg->hfrs,hfri);
+       
        hfri.p_id = &(cfg->hfid_start_time);
        hfri.hfinfo.name = g_strdup_printf("%s start time",cfg->name);
        hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.StartTime",cfg->name);
@@ -1467,6 +1478,9 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p _U_) {
        ett = &cfg->ett_times;
        g_array_append_val(matecfg->ett,ett);
        
+       ett = &cfg->ett_gog_gop;        
+       g_array_append_val(matecfg->ett,ett);
+       
 }
 
 static void analyze_config(void) {
index 9956738da8c5fe164591752409f6dd33a4e5ba81..1745f8d487b587723eb6a949276fb1391337719d 100644 (file)
@@ -70,9 +70,12 @@ void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_gop* gop
        proto_tree *gog_tree;
        proto_item *gog_time_item;
        proto_tree *gog_time_tree;
+       proto_item *gog_gops_item;
+       proto_tree *gog_gops_tree;
+       mate_gop* gog_gops;
        proto_item *gog_gop_item;
        proto_tree *gog_gop_tree;
-       mate_gop* gog_gops;
+
 #ifdef _MATE_DEBUGGING
        proto_item* gog_key_item;
        proto_tree* gog_key_tree;
@@ -92,21 +95,32 @@ void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_gop* gop
                proto_tree_add_float(gog_time_tree, gog->cfg->hfid_last_time, tvb, 0, 0, gog->last_time - gog->start_time); 
        }
        
-       gog_gop_item = proto_tree_add_uint(gog_tree, gog->cfg->hfid_gog_num_of_gops,
+       gog_gops_item = proto_tree_add_uint(gog_tree, gog->cfg->hfid_gog_num_of_gops,
                                                                           tvb, 0, 0, gog->num_of_gops);
        
-       gog_gop_tree = proto_item_add_subtree(gog_gop_item, gog->cfg->ett_children);
+       gog_gops_tree = proto_item_add_subtree(gog_gops_item, gog->cfg->ett_children);
        
        for (gog_gops = gog->gops; gog_gops; gog_gops = gog_gops->next) {
                
                if (gop != gog_gops) {
                        if (gog->cfg->gop_as_subtree) {
-                               mate_gop_tree(gog_gop_tree, tvb, gog_gops);
+                               mate_gop_tree(gog_gops_tree, tvb, gog_gops);
+                               gog_gop_item = NULL;
                        } else {
-                               proto_tree_add_uint(gog_gop_tree,gog_gops->cfg->hfid,tvb,0,0,gog_gops->id);
+                               gog_gop_item = proto_tree_add_uint(gog_gops_tree,gog_gops->cfg->hfid,tvb,0,0,gog_gops->id);
+                               
+                               if (gop->pdus && gop->cfg->show_pdu_tree == mc->frame_tree) {
+                                       gog_gop_tree = proto_item_add_subtree(gog_gop_item, gog->cfg->ett_gog_gop);
+                                       proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstart,tvb,0,0,gog_gops->pdus->frame);
+                               }
+                               
                        }
                } else {
-                        proto_tree_add_uint_format(gog_gop_tree,gop->cfg->hfid,tvb,0,0,gop->id,"%s of current frame: %d",gop->cfg->name,gop->id);
+                        gog_gop_item = proto_tree_add_uint_format(gog_gops_tree,gop->cfg->hfid,tvb,0,0,gop->id,"%s of current frame: %d",gop->cfg->name,gop->id);
+               }
+               
+               if (gog_gop_item) {
+
                }
        }
 }