diff options
Diffstat (limited to 'epan/dissectors/packet-mpeg-pes.c')
-rw-r--r-- | epan/dissectors/packet-mpeg-pes.c | 326 |
1 files changed, 172 insertions, 154 deletions
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c index e9eaecec05..fe2ebde7e5 100644 --- a/epan/dissectors/packet-mpeg-pes.c +++ b/epan/dissectors/packet-mpeg-pes.c @@ -1,11 +1,8 @@ /* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-mpeg-pes.c */ -/* asn2wrs.py -p mpeg-pes -c ./mpeg-pes.cnf -s ./packet-mpeg-pes-template -D . -O ../.. mpeg-pes.asn */ +/* asn2wrs.py -L -p mpeg-pes -c ./mpeg-pes.cnf -s ./packet-mpeg-pes-template -D . -O ../.. mpeg-pes.asn */ -/* Input file: packet-mpeg-pes-template.c */ - -#line 1 "./asn1/mpeg-pes/packet-mpeg-pes-template.c" /* MPEG Packetized Elementary Stream (PES) packet decoder. * Written by Shaun Jackman <sjackman@gmail.com>. * Copyright 2007 Shaun Jackman @@ -26,77 +23,62 @@ #include "packet-per.h" - -/*--- Included file: packet-mpeg-pes-hf.c ---*/ -#line 1 "./asn1/mpeg-pes/packet-mpeg-pes-hf.c" -static int hf_mpeg_pes_prefix = -1; /* OCTET_STRING_SIZE_3 */ -static int hf_mpeg_pes_stream = -1; /* T_stream */ -static int hf_mpeg_pes_length = -1; /* INTEGER_0_65535 */ -static int hf_mpeg_pes_must_be_one = -1; /* BOOLEAN */ -static int hf_mpeg_pes_stream_must_be_zero = -1; /* BOOLEAN */ -static int hf_mpeg_pes_scrambling_control = -1; /* T_scrambling_control */ -static int hf_mpeg_pes_priority = -1; /* BOOLEAN */ -static int hf_mpeg_pes_data_alignment = -1; /* BOOLEAN */ -static int hf_mpeg_pes_copyright = -1; /* BOOLEAN */ -static int hf_mpeg_pes_original = -1; /* BOOLEAN */ -static int hf_mpeg_pes_pts_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_dts_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_escr_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_es_rate_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_dsm_trick_mode_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_additional_copy_info_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_crc_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_extension_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_header_data_length = -1; /* INTEGER_0_255 */ -static int hf_mpeg_pes_horizontal_size = -1; /* BIT_STRING_SIZE_12 */ -static int hf_mpeg_pes_vertical_size = -1; /* BIT_STRING_SIZE_12 */ -static int hf_mpeg_pes_aspect_ratio = -1; /* T_aspect_ratio */ -static int hf_mpeg_pes_frame_rate = -1; /* T_frame_rate */ -static int hf_mpeg_pes_bit_rate = -1; /* BIT_STRING_SIZE_18 */ -static int hf_mpeg_pes_vbv_buffer_size = -1; /* BIT_STRING_SIZE_10 */ -static int hf_mpeg_pes_constrained_parameters_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_load_intra_quantiser_matrix = -1; /* BOOLEAN */ -static int hf_mpeg_pes_load_non_intra_quantiser_matrix = -1; /* BOOLEAN */ -static int hf_mpeg_pes_must_be_0001 = -1; /* BIT_STRING_SIZE_4 */ -static int hf_mpeg_pes_profile_and_level = -1; /* INTEGER_0_255 */ -static int hf_mpeg_pes_progressive_sequence = -1; /* BOOLEAN */ -static int hf_mpeg_pes_chroma_format = -1; /* INTEGER_0_3 */ -static int hf_mpeg_pes_horizontal_size_extension = -1; /* INTEGER_0_3 */ -static int hf_mpeg_pes_vertical_size_extension = -1; /* INTEGER_0_3 */ -static int hf_mpeg_pes_bit_rate_extension = -1; /* BIT_STRING_SIZE_12 */ -static int hf_mpeg_pes_vbv_buffer_size_extension = -1; /* INTEGER_0_255 */ -static int hf_mpeg_pes_low_delay = -1; /* BOOLEAN */ -static int hf_mpeg_pes_frame_rate_extension_n = -1; /* INTEGER_0_3 */ -static int hf_mpeg_pes_frame_rate_extension_d = -1; /* INTEGER_0_3 */ -static int hf_mpeg_pes_drop_frame_flag = -1; /* BOOLEAN */ -static int hf_mpeg_pes_hour = -1; /* INTEGER_0_32 */ -static int hf_mpeg_pes_minute = -1; /* INTEGER_0_64 */ -static int hf_mpeg_pes_second = -1; /* INTEGER_0_64 */ -static int hf_mpeg_pes_frame = -1; /* INTEGER_0_64 */ -static int hf_mpeg_pes_closed_gop = -1; /* BOOLEAN */ -static int hf_mpeg_pes_broken_gop = -1; /* BOOLEAN */ -static int hf_mpeg_pes_must_be_zero = -1; /* BIT_STRING_SIZE_5 */ -static int hf_mpeg_pes_temporal_sequence_number = -1; /* BIT_STRING_SIZE_10 */ -static int hf_mpeg_pes_frame_type = -1; /* T_frame_type */ -static int hf_mpeg_pes_vbv_delay = -1; /* BIT_STRING_SIZE_16 */ - -/*--- End of included file: packet-mpeg-pes-hf.c ---*/ -#line 22 "./asn1/mpeg-pes/packet-mpeg-pes-template.c" - -/*--- Included file: packet-mpeg-pes-ett.c ---*/ -#line 1 "./asn1/mpeg-pes/packet-mpeg-pes-ett.c" -static gint ett_mpeg_pes_PES = -1; -static gint ett_mpeg_pes_Stream = -1; -static gint ett_mpeg_pes_Sequence_header = -1; -static gint ett_mpeg_pes_Sequence_extension = -1; -static gint ett_mpeg_pes_Group_of_pictures = -1; -static gint ett_mpeg_pes_Picture = -1; - -/*--- End of included file: packet-mpeg-pes-ett.c ---*/ -#line 23 "./asn1/mpeg-pes/packet-mpeg-pes-template.c" - -/*--- Included file: packet-mpeg-pes-fn.c ---*/ -#line 1 "./asn1/mpeg-pes/packet-mpeg-pes-fn.c" +static int hf_mpeg_pes_prefix; /* OCTET_STRING_SIZE_3 */ +static int hf_mpeg_pes_stream; /* T_stream */ +static int hf_mpeg_pes_length; /* INTEGER_0_65535 */ +static int hf_mpeg_pes_must_be_one; /* BOOLEAN */ +static int hf_mpeg_pes_stream_must_be_zero; /* BOOLEAN */ +static int hf_mpeg_pes_scrambling_control; /* T_scrambling_control */ +static int hf_mpeg_pes_priority; /* BOOLEAN */ +static int hf_mpeg_pes_data_alignment; /* BOOLEAN */ +static int hf_mpeg_pes_copyright; /* BOOLEAN */ +static int hf_mpeg_pes_original; /* BOOLEAN */ +static int hf_mpeg_pes_pts_flag; /* BOOLEAN */ +static int hf_mpeg_pes_dts_flag; /* BOOLEAN */ +static int hf_mpeg_pes_escr_flag; /* BOOLEAN */ +static int hf_mpeg_pes_es_rate_flag; /* BOOLEAN */ +static int hf_mpeg_pes_dsm_trick_mode_flag; /* BOOLEAN */ +static int hf_mpeg_pes_additional_copy_info_flag; /* BOOLEAN */ +static int hf_mpeg_pes_crc_flag; /* BOOLEAN */ +static int hf_mpeg_pes_extension_flag; /* BOOLEAN */ +static int hf_mpeg_pes_header_data_length; /* INTEGER_0_255 */ +static int hf_mpeg_pes_horizontal_size; /* BIT_STRING_SIZE_12 */ +static int hf_mpeg_pes_vertical_size; /* BIT_STRING_SIZE_12 */ +static int hf_mpeg_pes_aspect_ratio; /* T_aspect_ratio */ +static int hf_mpeg_pes_frame_rate; /* T_frame_rate */ +static int hf_mpeg_pes_bit_rate; /* BIT_STRING_SIZE_18 */ +static int hf_mpeg_pes_vbv_buffer_size; /* BIT_STRING_SIZE_10 */ +static int hf_mpeg_pes_constrained_parameters_flag; /* BOOLEAN */ +static int hf_mpeg_pes_load_intra_quantiser_matrix; /* BOOLEAN */ +static int hf_mpeg_pes_load_non_intra_quantiser_matrix; /* BOOLEAN */ +static int hf_mpeg_pes_must_be_0001; /* BIT_STRING_SIZE_4 */ +static int hf_mpeg_pes_profile_and_level; /* INTEGER_0_255 */ +static int hf_mpeg_pes_progressive_sequence; /* BOOLEAN */ +static int hf_mpeg_pes_chroma_format; /* INTEGER_0_3 */ +static int hf_mpeg_pes_horizontal_size_extension; /* INTEGER_0_3 */ +static int hf_mpeg_pes_vertical_size_extension; /* INTEGER_0_3 */ +static int hf_mpeg_pes_bit_rate_extension; /* BIT_STRING_SIZE_12 */ +static int hf_mpeg_pes_vbv_buffer_size_extension; /* INTEGER_0_255 */ +static int hf_mpeg_pes_low_delay; /* BOOLEAN */ +static int hf_mpeg_pes_frame_rate_extension_n; /* INTEGER_0_3 */ +static int hf_mpeg_pes_frame_rate_extension_d; /* INTEGER_0_3 */ +static int hf_mpeg_pes_drop_frame_flag; /* BOOLEAN */ +static int hf_mpeg_pes_hour; /* INTEGER_0_32 */ +static int hf_mpeg_pes_minute; /* INTEGER_0_64 */ +static int hf_mpeg_pes_second; /* INTEGER_0_64 */ +static int hf_mpeg_pes_frame; /* INTEGER_0_64 */ +static int hf_mpeg_pes_closed_gop; /* BOOLEAN */ +static int hf_mpeg_pes_broken_gop; /* BOOLEAN */ +static int hf_mpeg_pes_must_be_zero; /* BIT_STRING_SIZE_5 */ +static int hf_mpeg_pes_temporal_sequence_number; /* BIT_STRING_SIZE_10 */ +static int hf_mpeg_pes_frame_type; /* T_frame_type */ +static int hf_mpeg_pes_vbv_delay; /* BIT_STRING_SIZE_16 */ +static gint ett_mpeg_pes_PES; +static gint ett_mpeg_pes_Stream; +static gint ett_mpeg_pes_Sequence_header; +static gint ett_mpeg_pes_Sequence_extension; +static gint ett_mpeg_pes_Group_of_pictures; +static gint ett_mpeg_pes_Picture; static int @@ -265,7 +247,7 @@ static const value_string mpeg_pes_T_frame_rate_vals[] = { { 0, NULL } }; -static guint32 T_frame_rate_value_map[9+0] = {0, 23976, 24000, 25000, 29970, 30000, 50000, 59940, 60000}; +static uint32_t T_frame_rate_value_map[9+0] = {0, 23976, 24000, 25000, 29970, 30000, 50000, 59940, 60000}; static int dissect_mpeg_pes_T_frame_rate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { @@ -460,61 +442,94 @@ dissect_mpeg_pes_Picture(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_ } -/*--- End of included file: packet-mpeg-pes-fn.c ---*/ -#line 24 "./asn1/mpeg-pes/packet-mpeg-pes-template.c" - void proto_register_mpeg_pes(void); void proto_reg_handoff_mpeg_pes(void); -static int proto_mpeg = -1; -static int proto_mpeg_pes = -1; - -static int ett_mpeg_pes_pack_header = -1; -static int ett_mpeg_pes_header_data = -1; -static int ett_mpeg_pes_trick_mode = -1; - -static int hf_mpeg_pes_pack_header = -1; -static int hf_mpeg_pes_scr = -1; -static int hf_mpeg_pes_program_mux_rate = -1; -static int hf_mpeg_pes_stuffing_length = -1; -static int hf_mpeg_pes_stuffing = -1; -static int hf_mpeg_pes_extension = -1; -static int hf_mpeg_pes_header_data = -1; -static int hf_mpeg_pes_pts = -1; -static int hf_mpeg_pes_dts = -1; -static int hf_mpeg_pes_escr = -1; -static int hf_mpeg_pes_es_rate = -1; -static int hf_mpeg_pes_dsm_trick_mode = -1; -static int hf_mpeg_pes_dsm_trick_mode_control = -1; -static int hf_mpeg_pes_dsm_trick_mode_field_id = -1; -static int hf_mpeg_pes_dsm_trick_mode_intra_slice_refresh = -1; -static int hf_mpeg_pes_dsm_trick_mode_frequency_truncation = -1; -static int hf_mpeg_pes_dsm_trick_mode_rep_cntrl = -1; -static int hf_mpeg_pes_copy_info = -1; -static int hf_mpeg_pes_crc = -1; -static int hf_mpeg_pes_extension_flags = -1; -static int hf_mpeg_pes_private_data = -1; -static int hf_mpeg_pes_pack_length = -1; -static int hf_mpeg_pes_sequence = -1; -static int hf_mpeg_pes_pstd_buffer = -1; -static int hf_mpeg_pes_extension2 = -1; -static int hf_mpeg_pes_padding = -1; -static int hf_mpeg_pes_data = -1; - -static int hf_mpeg_video_sequence_header = -1; -static int hf_mpeg_video_sequence_extension = -1; -static int hf_mpeg_video_group_of_pictures = -1; -static int hf_mpeg_video_picture = -1; -static int hf_mpeg_video_quantization_matrix = -1; -static int hf_mpeg_video_data = -1; +static int proto_mpeg; +static int proto_mpeg_pes; + +static int ett_mpeg_pes_pack_header; +static int ett_mpeg_pes_header_data; +static int ett_mpeg_pes_trick_mode; + +static int hf_mpeg_pes_pack_header; +static int hf_mpeg_pes_scr; +static int hf_mpeg_pes_program_mux_rate; +static int hf_mpeg_pes_stuffing_length; +static int hf_mpeg_pes_stuffing; +static int hf_mpeg_pes_extension; +static int hf_mpeg_pes_header_data; +static int hf_mpeg_pes_pts; +static int hf_mpeg_pes_dts; +static int hf_mpeg_pes_escr; +static int hf_mpeg_pes_es_rate; +static int hf_mpeg_pes_dsm_trick_mode; +static int hf_mpeg_pes_dsm_trick_mode_control; +static int hf_mpeg_pes_dsm_trick_mode_field_id; +static int hf_mpeg_pes_dsm_trick_mode_intra_slice_refresh; +static int hf_mpeg_pes_dsm_trick_mode_frequency_truncation; +static int hf_mpeg_pes_dsm_trick_mode_rep_cntrl; +static int hf_mpeg_pes_copy_info; +static int hf_mpeg_pes_crc; +static int hf_mpeg_pes_extension_flags; +static int hf_mpeg_pes_private_data; +static int hf_mpeg_pes_pack_length; +static int hf_mpeg_pes_sequence; +static int hf_mpeg_pes_pstd_buffer; +static int hf_mpeg_pes_extension2; +static int hf_mpeg_pes_padding; +static int hf_mpeg_pes_data; + +static int hf_mpeg_video_sequence_header; +static int hf_mpeg_video_sequence_extension; +static int hf_mpeg_video_group_of_pictures; +static int hf_mpeg_video_picture; +static int hf_mpeg_video_quantization_matrix; +static int hf_mpeg_video_data; static dissector_handle_t mpeg_handle; + +static dissector_table_t stream_type_table; + enum { PES_PREFIX = 1 }; /* - * XXX - some of these aren't documented in ISO/IEC 13818-1:2007; - * Table 2-22 "Stream_id assignments" starts with 0xbc, and also - * lists some types not given here. Where are the others described? + * MPEG uses 32-bit start codes that all begin with the three byte sequence + * 00 00 01 (the start code prefix) for bit and byte alignment, among other + * purposes. + * + * The values from 0xb9 through 0xff are "system start codes" and described in + * ISO/IEC 13818-1:2019 / ITU-T H.222.0. The bulk of them, 0xbc through 0xff, + * are stream_id values and documented in Table 2-22 "Stream_id assignments". + * The remaining three are used by Program Streams and found as follows: + * 0xb9, the MPEG_program_end_code, in 2.5.3.2 "Semantic definition of fields + * in program stream" + * 0xba, the pack_start_code, in 2.5.3.4 "Semantic definition of fields in + * program stream pack" + * 0xbb, the system_header_start_code, in 2.5.3.6 "Semantic definition of fields + * in system header" + * + * The remaining 185 values from 0x00 to 0xb8 are used by MPEG-2 video + * (backwards compatible with MPEG-1 video) and documented in ISO/IEC 13818-2 / + * ITU-T H.262 (2000), in Table 6-1 "Start code values". These are not stream + * id values and do not mark PES packets, but rather demarcate elements in the + * coded MPEG-1/2 video bitstream, at a different hierarchical level than the + * PES packets. The sets of values used for video start codes and for stream + * ids are disjoint to avoid any ambiguity when resynchronizing. Note the + * dissector currently conflates MPEG video with MPEG PES. + * + * Care is taken to ensure that the start code prefix 0x000001 does not occur + * elsewhere in the structure (avoiding "emulation of start codes"). + * + * The video can have other formats, given by the stream type, carried on + * TS in the PMT and in PS from the similar Program Stream Map. AVC/H.264 and + * HEVC/H.265 carried in PES also use the start code prefix, before each NAL, + * and escape the raw byte sequence with bytes that prevent internal start code + * prefixes. The byte following the prefix (the first byte of the NAL header) + * has high bit zero, so the values of the NAL header are in the range used by + * the MPEG-2 video bitstream, not the range used by stream ids, allowing for + * synchronization in the same way. See Annex B "Byte Stream Format" of H.264 + * and H.265. */ enum { STREAM_PICTURE = 0x00, @@ -804,12 +819,13 @@ static int dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data); static gboolean -dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { int prefix; int stream; asn1_ctx_t asn1_ctx; gint offset = 0; + guint8 stream_type; if (!tvb_bytes_exist(tvb, 0, 3)) return FALSE; /* not enough bytes for a PES prefix */ @@ -823,6 +839,13 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data stream = tvb_get_guint8(tvb, 3); col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(stream, mpeg_pes_T_stream_vals, "Unknown stream: %d")); + /* Were we called from MP2T providing a stream type from a PMT? */ + stream_type = GPOINTER_TO_UINT(data); + /* Luckily, stream_type 0 is reserved, so a null value is fine. + * XXX: Implement Program Stream Map for Program Stream (similar + * to PMT but maps stream_ids to stream_types instead of PIDs.) + */ + #if 0 if (tree == NULL) return TRUE; @@ -966,18 +989,22 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data /* length may be zero for Video stream */ if(length==0){ - proto_tree_add_item(tree, hf_mpeg_pes_data, tvb, (offset>>3),-1, ENC_NA); - return TRUE; + es = tvb_new_subset_remaining(tvb, offset / 8); + } else { + es = tvb_new_subset_length_caplen(tvb, offset / 8, -1, length); + } + if (!dissector_try_uint_new(stream_type_table, stream_type, es, pinfo, tree, TRUE, NULL)) { + /* If we didn't get a stream type, then assume + * MPEG-1/2 Audio or Video. + */ + if (tvb_get_ntoh24(es, 0) == PES_PREFIX) + dissect_mpeg_pes(es, pinfo, tree, NULL); + else if (tvb_get_guint8(es, 0) == 0xff) + dissect_mpeg(es, pinfo, tree, NULL); + else + proto_tree_add_item(tree, hf_mpeg_pes_data, es, + 0, -1, ENC_NA); } - - es = tvb_new_subset_length_caplen(tvb, offset / 8, -1, length); - if (tvb_get_ntoh24(es, 0) == PES_PREFIX) - dissect_mpeg_pes(es, pinfo, tree, NULL); - else if (tvb_get_guint8(es, 0) == 0xff) - dissect_mpeg(es, pinfo, tree, data); - else - proto_tree_add_item(tree, hf_mpeg_pes_data, es, - 0, -1, ENC_NA); } else { unsigned int data_length = tvb_get_ntohs(tvb, offset / 8); proto_tree_add_item(tree, hf_mpeg_pes_length, tvb, @@ -987,7 +1014,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data proto_tree_add_item(tree, hf_mpeg_pes_data, tvb, offset / 8, data_length, ENC_NA); } - } else { + } else if (stream != STREAM_END) { proto_tree_add_item(tree, hf_mpeg_pes_data, tvb, offset / 8, -1, ENC_NA); } @@ -1014,9 +1041,6 @@ void proto_register_mpeg_pes(void) { static hf_register_info hf[] = { - -/*--- Included file: packet-mpeg-pes-hfarr.c ---*/ -#line 1 "./asn1/mpeg-pes/packet-mpeg-pes-hfarr.c" { &hf_mpeg_pes_prefix, { "prefix", "mpeg-pes.prefix", FT_BYTES, BASE_NONE, NULL, 0, @@ -1039,7 +1063,7 @@ proto_register_mpeg_pes(void) "BOOLEAN", HFILL }}, { &hf_mpeg_pes_scrambling_control, { "scrambling-control", "mpeg-pes.scrambling_control", - FT_UINT32, BASE_DEC, VALS(mpeg_pes_T_scrambling_control_vals), 0, + FT_UINT8, BASE_DEC, VALS(mpeg_pes_T_scrambling_control_vals), 0x30, NULL, HFILL }}, { &hf_mpeg_pes_priority, { "priority", "mpeg-pes.priority", @@ -1217,9 +1241,6 @@ proto_register_mpeg_pes(void) { "vbv-delay", "mpeg-pes.vbv_delay", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_16", HFILL }}, - -/*--- End of included file: packet-mpeg-pes-hfarr.c ---*/ -#line 577 "./asn1/mpeg-pes/packet-mpeg-pes-template.c" { &hf_mpeg_pes_pack_header, { "Pack header", "mpeg-pes.pack", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, @@ -1326,33 +1347,27 @@ proto_register_mpeg_pes(void) }; static gint *ett[] = { - -/*--- Included file: packet-mpeg-pes-ettarr.c ---*/ -#line 1 "./asn1/mpeg-pes/packet-mpeg-pes-ettarr.c" &ett_mpeg_pes_PES, &ett_mpeg_pes_Stream, &ett_mpeg_pes_Sequence_header, &ett_mpeg_pes_Sequence_extension, &ett_mpeg_pes_Group_of_pictures, &ett_mpeg_pes_Picture, - -/*--- End of included file: packet-mpeg-pes-ettarr.c ---*/ -#line 684 "./asn1/mpeg-pes/packet-mpeg-pes-template.c" &ett_mpeg_pes_pack_header, &ett_mpeg_pes_header_data, &ett_mpeg_pes_trick_mode }; - proto_mpeg = proto_register_protocol( - "Moving Picture Experts Group", "MPEG", "mpeg"); + proto_mpeg = proto_register_protocol("Moving Picture Experts Group", "MPEG", "mpeg"); mpeg_handle = register_dissector("mpeg", dissect_mpeg, proto_mpeg); - heur_subdissector_list = register_heur_dissector_list("mpeg", proto_mpeg); + heur_subdissector_list = register_heur_dissector_list_with_description("mpeg", "MPEG payload", proto_mpeg); - proto_mpeg_pes = proto_register_protocol( - "Packetized Elementary Stream", "MPEG PES", "mpeg-pes"); + proto_mpeg_pes = proto_register_protocol("Packetized Elementary Stream", "MPEG PES", "mpeg-pes"); proto_register_field_array(proto_mpeg_pes, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("mpeg-pes", dissect_mpeg_pes, proto_mpeg_pes); + + stream_type_table = register_dissector_table("mpeg-pes.stream", "MPEG PES stream type", proto_mpeg_pes, FT_UINT8, BASE_HEX); } void @@ -1360,4 +1375,7 @@ proto_reg_handoff_mpeg_pes(void) { dissector_add_uint("wtap_encap", WTAP_ENCAP_MPEG, mpeg_handle); heur_dissector_add("mpeg", dissect_mpeg_pes, "MPEG PES", "mpeg_pes", proto_mpeg_pes, HEURISTIC_ENABLE); + + dissector_add_uint("mpeg-pes.stream", 0x1B, find_dissector_add_dependency("h264_bytestream", proto_mpeg_pes)); + dissector_add_uint("mpeg-pes.stream", 0x24, find_dissector_add_dependency("h265_bytestream", proto_mpeg_pes)); } |