3 * Routines for RFC 2250 MPEG-1 dissection
6 * Francisco Javier Cabello Torres, <fjcabello@vtools.es>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
16 * This dissector tries to dissect the MPEG-1 video streams.
22 #include <epan/packet.h>
24 #include <epan/rtp_pt.h>
26 void proto_register_mpeg1(void);
27 void proto_reg_handoff_mpeg1(void);
29 static dissector_handle_t mpeg1_handle
;
31 /* MPEG1 header fields */
35 static int hf_rtp_mpg_mbz
;
36 static int hf_rtp_mpg_T
;
37 static int hf_rtp_mpg_tr
;
38 static int hf_rtp_mpg_an
;
39 static int hf_rtp_mpg_n
;
40 static int hf_rtp_mpg_s
;
41 static int hf_rtp_mpg_b
;
42 static int hf_rtp_mpg_e
;
43 static int hf_rtp_mpg_p
;
46 static int hf_rtp_mpg_fbv
;
47 static int hf_rtp_mpg_bfc
;
48 static int hf_rtp_mpg_ffv
;
49 static int hf_rtp_mpg_ffc
;
50 static int hf_rtp_mpg_data
;
53 /* MPEG-1 fields defining a sub tree */
56 static const value_string rtp_mpg_picture_types_vals
[] =
70 dissect_mpeg1( tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
74 unsigned int offset
= 0;
76 static int * const mpg_fields1
[] = {
82 static int * const mpg_fields2
[] = {
91 static int * const mpg_fields3
[] = {
99 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "MPEG-1");
100 col_set_str(pinfo
->cinfo
, COL_INFO
, "MPEG-1 message");
102 /* Get MPEG-1 fields */
104 ti
= proto_tree_add_item( tree
, proto_mpg
, tvb
, offset
, -1, ENC_NA
);
105 mpg_tree
= proto_item_add_subtree( ti
, ett_mpg
);
107 proto_tree_add_bitmask_list(mpg_tree
, tvb
, offset
, 2, mpg_fields1
, ENC_BIG_ENDIAN
);
110 proto_tree_add_bitmask_list(mpg_tree
, tvb
, offset
, 2, mpg_fields2
, ENC_BIG_ENDIAN
);
113 proto_tree_add_bitmask_list(mpg_tree
, tvb
, offset
, 1, mpg_fields3
, ENC_NA
);
116 /* The rest of the packet is the MPEG-1 stream */
117 proto_tree_add_item( mpg_tree
, hf_rtp_mpg_data
, tvb
, offset
, -1, ENC_NA
);
118 return tvb_captured_length(tvb
);
122 proto_register_mpeg1(void)
124 static hf_register_info hf
[] =
130 "rtp.payload_mpeg_mbz",
142 "rtp.payload_mpeg_T",
153 "Temporal Reference",
154 "rtp.payload_mpeg_tr",
166 "rtp.payload_mpeg_an",
178 "New Picture Header",
179 "rtp.payload_mpeg_n",
192 "rtp.payload_mpeg_s",
204 "Beginning-of-slice",
205 "rtp.payload_mpeg_b",
218 "rtp.payload_mpeg_e",
231 "rtp.payload_mpeg_p",
234 VALS(rtp_mpg_picture_types_vals
),
244 "rtp.payload_mpeg_fbv",
257 "rtp.payload_mpeg_bfc",
269 "rtp.payload_mpeg_ffv",
282 "rtp.payload_mpeg_ffc",
311 proto_mpg
= proto_register_protocol("RFC 2250 MPEG1","MPEG1","mpeg1");
312 mpeg1_handle
= register_dissector("mpeg1", dissect_mpeg1
, proto_mpg
);
313 proto_register_field_array(proto_mpg
, hf
, array_length(hf
));
314 proto_register_subtree_array(ett
, array_length(ett
));
318 proto_reg_handoff_mpeg1(void)
320 dissector_add_uint("rtp.pt", PT_MPV
, mpeg1_handle
);
324 * Editor modelines - https://www.wireshark.org/tools/modelines.html
329 * indent-tabs-mode: t
332 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
333 * :indentSize=8:tabSize=8:noTabs=false: