diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-07-24 12:12:31 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2014-07-24 19:59:34 +0000 |
commit | 476f49cd0f2be4c78cd58f672b72bdb015e72d9b (patch) | |
tree | 31cee3f120c07ac53bed9f31f72e7f54c01f8fc6 /epan/dissectors/file-mp4.c | |
parent | 2c1b67313de3e49e4d588db2fdcafb4b5e1fba5f (diff) |
dissect the MP4 hdlr box
Change-Id: I467bfae2db7d3a119b58505b43b3d9bb59615ee9
Reviewed-on: https://code.wireshark.org/review/3185
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/file-mp4.c')
-rw-r--r-- | epan/dissectors/file-mp4.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/epan/dissectors/file-mp4.c b/epan/dissectors/file-mp4.c index 60491e77a8..c6cbc1fa24 100644 --- a/epan/dissectors/file-mp4.c +++ b/epan/dissectors/file-mp4.c @@ -60,6 +60,8 @@ static int hf_mp4_tkhd_track_id = -1; static int hf_mp4_tkhd_duration = -1; static int hf_mp4_tkhd_width = -1; static int hf_mp4_tkhd_height = -1; +static int hf_mp4_hdlr_type = -1; +static int hf_mp4_hdlr_name = -1; static expert_field ei_mp4_box_too_large = EI_INIT; @@ -272,6 +274,40 @@ dissect_mp4_ftyp_body(tvbuff_t *tvb, gint offset, gint len, return offset - offset_start; } + +static gint +dissect_mp4_hdlr_body(tvbuff_t *tvb, gint offset, gint len _U_, + packet_info *pinfo _U_, proto_tree *tree) +{ + gint offset_start; + guint hdlr_name_len; + + offset_start = offset; + + proto_tree_add_item(tree, hf_mp4_full_box_ver, + tvb, offset, 1, ENC_BIG_ENDIAN); + /* XXX - put up an expert info if version!=0 */ + offset += 1; + offset += 3; /* flags in the full box header */ + + offset += 4; /* four reserved 0 bytes */ + + proto_tree_add_item(tree, hf_mp4_hdlr_type, + tvb, offset, 4, ENC_ASCII|ENC_NA); + offset += 4; + + offset += 12; /* 3x32bit reserved */ + + /* name is a 0-terminated UTF-8 string, len includes the final 0 */ + hdlr_name_len = tvb_strsize(tvb, offset); + proto_tree_add_item(tree, hf_mp4_hdlr_name, + tvb, offset, hdlr_name_len, ENC_UTF_8|ENC_NA); + offset += hdlr_name_len; + + return offset-offset_start; +} + + /* dissect a box, return its (standard or extended) length or 0 for error */ static gint dissect_mp4_box(guint32 parent_box_type _U_, @@ -347,6 +383,9 @@ dissect_mp4_box(guint32 parent_box_type _U_, case BOX_TYPE_TKHD: dissect_mp4_tkhd_body(tvb, offset, body_size, pinfo, box_tree); break; + case BOX_TYPE_HDLR: + dissect_mp4_hdlr_body(tvb, offset, body_size, pinfo, box_tree); + break; case BOX_TYPE_MOOV: case BOX_TYPE_MOOF: case BOX_TYPE_STBL: @@ -455,6 +494,12 @@ proto_register_mp4(void) BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_mp4_tkhd_height, { "Height", "mp4.tkhd.height", FT_DOUBLE, + BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_mp4_hdlr_type, + { "Handler type", "mp4.hdlr.type", FT_STRING, + BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_mp4_hdlr_name, + { "Handler name", "mp4.hdlr.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } } }; |