1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-mpeg-pes.c */
4 /* ../../tools/asn2wrs.py -p mpeg-pes -c ./mpeg-pes.cnf -s ./packet-mpeg-pes-template -D . -O ../../epan/dissectors mpeg-pes.asn */
6 /* Input file: packet-mpeg-pes-template.c */
8 #line 1 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c"
9 /* MPEG Packetized Elementary Stream (PES) packet decoder.
10 * Written by Shaun Jackman <sjackman@gmail.com>.
11 * Copyright 2007 Shaun Jackman
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
38 #include <epan/packet.h>
39 #include <epan/asn1.h>
41 #include "packet-per.h"
44 /*--- Included file: packet-mpeg-pes-hf.c ---*/
45 #line 1 "../../asn1/mpeg-pes/packet-mpeg-pes-hf.c"
46 static int hf_mpeg_pes_prefix = -1; /* OCTET_STRING_SIZE_3 */
47 static int hf_mpeg_pes_stream = -1; /* T_stream */
48 static int hf_mpeg_pes_length = -1; /* INTEGER_0_65535 */
49 static int hf_mpeg_pes_must_be_one = -1; /* BOOLEAN */
50 static int hf_mpeg_pes_must_be_zero = -1; /* BOOLEAN */
51 static int hf_mpeg_pes_scrambling_control = -1; /* T_scrambling_control */
52 static int hf_mpeg_pes_priority = -1; /* BOOLEAN */
53 static int hf_mpeg_pes_data_alignment = -1; /* BOOLEAN */
54 static int hf_mpeg_pes_copyright = -1; /* BOOLEAN */
55 static int hf_mpeg_pes_original = -1; /* BOOLEAN */
56 static int hf_mpeg_pes_pts_flag = -1; /* BOOLEAN */
57 static int hf_mpeg_pes_dts_flag = -1; /* BOOLEAN */
58 static int hf_mpeg_pes_escr_flag = -1; /* BOOLEAN */
59 static int hf_mpeg_pes_es_rate_flag = -1; /* BOOLEAN */
60 static int hf_mpeg_pes_dsm_trick_mode_flag = -1; /* BOOLEAN */
61 static int hf_mpeg_pes_additional_copy_info_flag = -1; /* BOOLEAN */
62 static int hf_mpeg_pes_crc_flag = -1; /* BOOLEAN */
63 static int hf_mpeg_pes_extension_flag = -1; /* BOOLEAN */
64 static int hf_mpeg_pes_header_data_length = -1; /* INTEGER_0_255 */
65 static int hf_mpeg_pes_horizontal_size = -1; /* BIT_STRING_SIZE_12 */
66 static int hf_mpeg_pes_vertical_size = -1; /* BIT_STRING_SIZE_12 */
67 static int hf_mpeg_pes_aspect_ratio = -1; /* T_aspect_ratio */
68 static int hf_mpeg_pes_frame_rate = -1; /* T_frame_rate */
69 static int hf_mpeg_pes_bit_rate = -1; /* BIT_STRING_SIZE_18 */
70 static int hf_mpeg_pes_vbv_buffer_size = -1; /* BIT_STRING_SIZE_10 */
71 static int hf_mpeg_pes_constrained_parameters_flag = -1; /* BOOLEAN */
72 static int hf_mpeg_pes_load_intra_quantiser_matrix = -1; /* BOOLEAN */
73 static int hf_mpeg_pes_load_non_intra_quantiser_matrix = -1; /* BOOLEAN */
74 static int hf_mpeg_pes_must_be_0001 = -1; /* BIT_STRING_SIZE_4 */
75 static int hf_mpeg_pes_profile_and_level = -1; /* INTEGER_0_255 */
76 static int hf_mpeg_pes_progressive_sequence = -1; /* BOOLEAN */
77 static int hf_mpeg_pes_chroma_format = -1; /* INTEGER_0_3 */
78 static int hf_mpeg_pes_horizontal_size_extension = -1; /* INTEGER_0_3 */
79 static int hf_mpeg_pes_vertical_size_extension = -1; /* INTEGER_0_3 */
80 static int hf_mpeg_pes_bit_rate_extension = -1; /* BIT_STRING_SIZE_12 */
81 static int hf_mpeg_pes_vbv_buffer_size_extension = -1; /* INTEGER_0_255 */
82 static int hf_mpeg_pes_low_delay = -1; /* BOOLEAN */
83 static int hf_mpeg_pes_frame_rate_extension_n = -1; /* INTEGER_0_3 */
84 static int hf_mpeg_pes_frame_rate_extension_d = -1; /* INTEGER_0_3 */
85 static int hf_mpeg_pes_drop_frame_flag = -1; /* BOOLEAN */
86 static int hf_mpeg_pes_hour = -1; /* INTEGER_0_32 */
87 static int hf_mpeg_pes_minute = -1; /* INTEGER_0_64 */
88 static int hf_mpeg_pes_second = -1; /* INTEGER_0_64 */
89 static int hf_mpeg_pes_frame = -1; /* INTEGER_0_64 */
90 static int hf_mpeg_pes_closed_gop = -1; /* BOOLEAN */
91 static int hf_mpeg_pes_broken_gop = -1; /* BOOLEAN */
92 static int hf_mpeg_pes_must_be_zero_01 = -1; /* BIT_STRING_SIZE_5 */
93 static int hf_mpeg_pes_temporal_sequence_number = -1; /* BIT_STRING_SIZE_10 */
94 static int hf_mpeg_pes_frame_type = -1; /* T_frame_type */
95 static int hf_mpeg_pes_vbv_delay = -1; /* BIT_STRING_SIZE_16 */
97 /*--- End of included file: packet-mpeg-pes-hf.c ---*/
98 #line 36 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c"
100 /*--- Included file: packet-mpeg-pes-ett.c ---*/
101 #line 1 "../../asn1/mpeg-pes/packet-mpeg-pes-ett.c"
102 static gint ett_mpeg_pes_PES = -1;
103 static gint ett_mpeg_pes_Stream = -1;
104 static gint ett_mpeg_pes_Sequence_header = -1;
105 static gint ett_mpeg_pes_Sequence_extension = -1;
106 static gint ett_mpeg_pes_Group_of_pictures = -1;
107 static gint ett_mpeg_pes_Picture = -1;
109 /*--- End of included file: packet-mpeg-pes-ett.c ---*/
110 #line 37 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c"
112 /*--- Included file: packet-mpeg-pes-fn.c ---*/
113 #line 1 "../../asn1/mpeg-pes/packet-mpeg-pes-fn.c"
117 dissect_mpeg_pes_OCTET_STRING_SIZE_3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
118 offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
125 static const value_string mpeg_pes_T_stream_vals[] = {
127 { 179, "sequence-header" },
128 { 181, "sequence-header-extension" },
129 { 184, "group-of-pictures" },
130 { 185, "program-end" },
131 { 186, "pack-header" },
132 { 187, "system-header" },
133 { 188, "program-stream-map" },
134 { 189, "private-stream-1" },
135 { 190, "padding-stream" },
136 { 191, "private-stream-2" },
137 { 192, "audio-stream" },
138 { 224, "video-stream" },
144 dissect_mpeg_pes_T_stream(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
145 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
146 0U, 255U, NULL, FALSE);
152 static const per_sequence_t PES_sequence[] = {
153 { &hf_mpeg_pes_prefix , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_OCTET_STRING_SIZE_3 },
154 { &hf_mpeg_pes_stream , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_T_stream },
159 dissect_mpeg_pes_PES(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
160 offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
161 ett_mpeg_pes_PES, PES_sequence);
169 dissect_mpeg_pes_INTEGER_0_65535(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
170 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
171 0U, 65535U, NULL, FALSE);
179 dissect_mpeg_pes_BOOLEAN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
180 offset = dissect_per_boolean(tvb, offset, actx, tree, hf_index, NULL);
186 static const value_string mpeg_pes_T_scrambling_control_vals[] = {
187 { 0, "not-scrambled" },
193 dissect_mpeg_pes_T_scrambling_control(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
194 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
195 0U, 3U, NULL, FALSE);
203 dissect_mpeg_pes_INTEGER_0_255(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
204 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
205 0U, 255U, NULL, FALSE);
211 static const per_sequence_t Stream_sequence[] = {
212 { &hf_mpeg_pes_length , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_65535 },
213 { &hf_mpeg_pes_must_be_one, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
214 { &hf_mpeg_pes_must_be_zero, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
215 { &hf_mpeg_pes_scrambling_control, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_T_scrambling_control },
216 { &hf_mpeg_pes_priority , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
217 { &hf_mpeg_pes_data_alignment, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
218 { &hf_mpeg_pes_copyright , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
219 { &hf_mpeg_pes_original , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
220 { &hf_mpeg_pes_pts_flag , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
221 { &hf_mpeg_pes_dts_flag , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
222 { &hf_mpeg_pes_escr_flag , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
223 { &hf_mpeg_pes_es_rate_flag, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
224 { &hf_mpeg_pes_dsm_trick_mode_flag, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
225 { &hf_mpeg_pes_additional_copy_info_flag, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
226 { &hf_mpeg_pes_crc_flag , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
227 { &hf_mpeg_pes_extension_flag, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
228 { &hf_mpeg_pes_header_data_length, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_255 },
233 dissect_mpeg_pes_Stream(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
234 offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
235 ett_mpeg_pes_Stream, Stream_sequence);
243 dissect_mpeg_pes_BIT_STRING_SIZE_12(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
244 offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
245 12, 12, FALSE, NULL);
251 static const value_string mpeg_pes_T_aspect_ratio_vals[] = {
252 { 1, "aspect-1to1" },
253 { 2, "aspect-4to3" },
254 { 3, "aspect-16to9" },
255 { 4, "aspect-2-21to1" },
261 dissect_mpeg_pes_T_aspect_ratio(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
262 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
263 0U, 15U, NULL, FALSE);
269 static const value_string mpeg_pes_T_frame_rate_vals[] = {
282 static guint32 T_frame_rate_value_map[9+0] = {0, 23976, 24000, 25000, 29970, 30000, 50000, 59940, 60000};
285 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_) {
286 offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
287 9, NULL, FALSE, 0, T_frame_rate_value_map);
295 dissect_mpeg_pes_BIT_STRING_SIZE_18(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
296 offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
297 18, 18, FALSE, NULL);
305 dissect_mpeg_pes_BIT_STRING_SIZE_10(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
306 offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
307 10, 10, FALSE, NULL);
313 static const per_sequence_t Sequence_header_sequence[] = {
314 { &hf_mpeg_pes_horizontal_size, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_12 },
315 { &hf_mpeg_pes_vertical_size, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_12 },
316 { &hf_mpeg_pes_aspect_ratio, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_T_aspect_ratio },
317 { &hf_mpeg_pes_frame_rate , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_T_frame_rate },
318 { &hf_mpeg_pes_bit_rate , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_18 },
319 { &hf_mpeg_pes_must_be_one, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
320 { &hf_mpeg_pes_vbv_buffer_size, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_10 },
321 { &hf_mpeg_pes_constrained_parameters_flag, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
322 { &hf_mpeg_pes_load_intra_quantiser_matrix, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
323 { &hf_mpeg_pes_load_non_intra_quantiser_matrix, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
328 dissect_mpeg_pes_Sequence_header(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
329 offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
330 ett_mpeg_pes_Sequence_header, Sequence_header_sequence);
338 dissect_mpeg_pes_BIT_STRING_SIZE_4(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
339 offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
348 dissect_mpeg_pes_INTEGER_0_3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
349 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
350 0U, 3U, NULL, FALSE);
356 static const per_sequence_t Sequence_extension_sequence[] = {
357 { &hf_mpeg_pes_must_be_0001, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_4 },
358 { &hf_mpeg_pes_profile_and_level, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_255 },
359 { &hf_mpeg_pes_progressive_sequence, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
360 { &hf_mpeg_pes_chroma_format, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_3 },
361 { &hf_mpeg_pes_horizontal_size_extension, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_3 },
362 { &hf_mpeg_pes_vertical_size_extension, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_3 },
363 { &hf_mpeg_pes_bit_rate_extension, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_12 },
364 { &hf_mpeg_pes_must_be_one, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
365 { &hf_mpeg_pes_vbv_buffer_size_extension, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_255 },
366 { &hf_mpeg_pes_low_delay , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
367 { &hf_mpeg_pes_frame_rate_extension_n, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_3 },
368 { &hf_mpeg_pes_frame_rate_extension_d, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_3 },
373 dissect_mpeg_pes_Sequence_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
374 offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
375 ett_mpeg_pes_Sequence_extension, Sequence_extension_sequence);
383 dissect_mpeg_pes_INTEGER_0_32(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
384 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
385 0U, 32U, NULL, FALSE);
393 dissect_mpeg_pes_INTEGER_0_64(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
394 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
395 0U, 64U, NULL, FALSE);
403 dissect_mpeg_pes_BIT_STRING_SIZE_5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
404 offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
411 static const per_sequence_t Group_of_pictures_sequence[] = {
412 { &hf_mpeg_pes_drop_frame_flag, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
413 { &hf_mpeg_pes_hour , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_32 },
414 { &hf_mpeg_pes_minute , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_64 },
415 { &hf_mpeg_pes_must_be_one, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
416 { &hf_mpeg_pes_second , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_64 },
417 { &hf_mpeg_pes_frame , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_INTEGER_0_64 },
418 { &hf_mpeg_pes_closed_gop , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
419 { &hf_mpeg_pes_broken_gop , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BOOLEAN },
420 { &hf_mpeg_pes_must_be_zero_01, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_5 },
425 dissect_mpeg_pes_Group_of_pictures(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
426 offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
427 ett_mpeg_pes_Group_of_pictures, Group_of_pictures_sequence);
433 static const value_string mpeg_pes_T_frame_type_vals[] = {
443 dissect_mpeg_pes_T_frame_type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
444 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
445 0U, 7U, NULL, FALSE);
453 dissect_mpeg_pes_BIT_STRING_SIZE_16(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
454 offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
455 16, 16, FALSE, NULL);
461 static const per_sequence_t Picture_sequence[] = {
462 { &hf_mpeg_pes_temporal_sequence_number, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_10 },
463 { &hf_mpeg_pes_frame_type , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_T_frame_type },
464 { &hf_mpeg_pes_vbv_delay , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_mpeg_pes_BIT_STRING_SIZE_16 },
469 dissect_mpeg_pes_Picture(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
470 offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
471 ett_mpeg_pes_Picture, Picture_sequence);
477 /*--- End of included file: packet-mpeg-pes-fn.c ---*/
478 #line 38 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c"
480 static int proto_mpeg = -1;
481 static int proto_mpeg_pes = -1;
483 static int ett_mpeg_pes_pack_header = -1;
484 static int ett_mpeg_pes_header_data = -1;
485 static int ett_mpeg_pes_trick_mode = -1;
487 static int hf_mpeg_pes_pack_header = -1;
488 static int hf_mpeg_pes_scr = -1;
489 static int hf_mpeg_pes_program_mux_rate = -1;
490 static int hf_mpeg_pes_stuffing_length = -1;
491 static int hf_mpeg_pes_stuffing = -1;
492 static int hf_mpeg_pes_extension = -1;
493 static int hf_mpeg_pes_header_data = -1;
494 static int hf_mpeg_pes_pts = -1;
495 static int hf_mpeg_pes_dts = -1;
496 static int hf_mpeg_pes_escr = -1;
497 static int hf_mpeg_pes_es_rate = -1;
498 static int hf_mpeg_pes_dsm_trick_mode = -1;
499 static int hf_mpeg_pes_dsm_trick_mode_control = -1;
500 static int hf_mpeg_pes_dsm_trick_mode_field_id = -1;
501 static int hf_mpeg_pes_dsm_trick_mode_intra_slice_refresh = -1;
502 static int hf_mpeg_pes_dsm_trick_mode_frequency_truncation = -1;
503 static int hf_mpeg_pes_dsm_trick_mode_rep_cntrl = -1;
504 static int hf_mpeg_pes_copy_info = -1;
505 static int hf_mpeg_pes_crc = -1;
506 static int hf_mpeg_pes_extension_flags = -1;
507 static int hf_mpeg_pes_private_data = -1;
508 static int hf_mpeg_pes_pack_length = -1;
509 static int hf_mpeg_pes_sequence = -1;
510 static int hf_mpeg_pes_pstd_buffer = -1;
511 static int hf_mpeg_pes_extension2 = -1;
512 static int hf_mpeg_pes_padding = -1;
513 static int hf_mpeg_pes_data = -1;
515 static int hf_mpeg_video_sequence_header = -1;
516 static int hf_mpeg_video_sequence_extension = -1;
517 static int hf_mpeg_video_group_of_pictures = -1;
518 static int hf_mpeg_video_picture = -1;
519 static int hf_mpeg_video_quantization_matrix = -1;
520 static int hf_mpeg_video_data = -1;
522 enum { PES_PREFIX = 1 };
525 STREAM_PICTURE = 0x00,
526 STREAM_SEQUENCE = 0xb3,
527 STREAM_SEQUENCE_EXTENSION = 0xb5,
531 STREAM_SYSTEM = 0xbb,
532 STREAM_PROGRAM = 0xbc,
533 STREAM_PRIVATE1 = 0xbd,
534 STREAM_PADDING = 0xbe,
535 STREAM_PRIVATE2 = 0xbf,
545 DSM_TRICK_MODE_FLAG = 0x08,
546 COPY_INFO_FLAG = 0x04,
548 EXTENSION_FLAG = 0x01
552 PRIVATE_DATA_FLAG = 0x80,
553 PACK_LENGTH_FLAG = 0x40,
554 SEQUENCE_FLAG = 0x20,
555 PSTD_BUFFER_FLAG = 0x10,
557 EXTENSION_FLAG2 = 0x01
561 FAST_FORWARD_CONTROL = 0x00,
562 SLOW_MOTION_CONTROL = 0x01,
563 FREEZE_FRAME_CONTROL = 0x02,
564 FAST_REVERSE_CONTROL = 0x03,
565 SLOW_REVERSE_CONTROL = 0x04
568 static const value_string mpeg_pes_TrickModeControl_vals[] = {
569 { FAST_FORWARD_CONTROL, "fast-forward" },
570 { SLOW_MOTION_CONTROL, "slow-motion" },
571 { FREEZE_FRAME_CONTROL, "freeze-frame" },
572 { FAST_REVERSE_CONTROL, "fast-reverse" },
573 { SLOW_REVERSE_CONTROL, "slow-reverse" },
580 static const value_string mpeg_pes_TrickModeFieldId_vals[] = {
581 { 0, "display-from-top-field-only" },
582 { 1, "display-from-bottom-field-only" },
583 { 2, "display-complete-frame" },
588 static const value_string mpeg_pes_TrickModeIntraSliceRefresh_vals[] = {
589 { 0, "macroblocks-may-not-be-missing" },
590 { 1, "macroblocks-may-be-missing" },
594 static const value_string mpeg_pes_TrickModeFrequencyTruncation_vals[] = {
595 { 0, "only-DC-coefficients-are-non-zero" },
596 { 1, "only-the-first-three-coefficients-are-non-zero" },
597 { 2, "only-the-first-six-coefficients-are-non-zero" },
598 { 3, "all-coefficients-may-be-non-zero" },
604 static guint64 decode_time_stamp(tvbuff_t *tvb, gint offset, nstime_t *nst)
606 guint64 bytes = tvb_get_ntoh40(tvb, offset);
608 (bytes >> 33 & 0x0007) << 30 |
609 (bytes >> 17 & 0x7fff) << 15 |
610 (bytes >> 1 & 0x7fff) << 0;
611 unsigned rem = (unsigned)(ts % TSHZ);
612 nst->secs = (time_t)(ts / TSHZ);
613 nst->nsecs = (int)(G_GINT64_CONSTANT(1000000000) * rem / TSHZ);
617 #define SCRHZ 27000000
619 static guint64 decode_clock_reference(tvbuff_t *tvb, gint offset,
622 guint64 bytes = tvb_get_ntoh48(tvb, offset);
624 (bytes >> 43 & 0x0007) << 30 |
625 (bytes >> 27 & 0x7fff) << 15 |
626 (bytes >> 11 & 0x7fff) << 0;
627 unsigned ext = (unsigned)((bytes >> 1) & 0x1ff);
628 guint64 cr = 300 * ts + ext;
629 unsigned rem = (unsigned)(cr % SCRHZ);
630 nst->secs = (time_t)(cr / SCRHZ);
631 nst->nsecs = (int)(G_GINT64_CONSTANT(1000000000) * rem / SCRHZ);
636 dissect_mpeg_pes_header_data(tvbuff_t *tvb, packet_info *pinfo,
637 proto_tree *root, unsigned flags)
639 proto_item *item = proto_tree_add_item(root, hf_mpeg_pes_header_data, tvb,
641 proto_tree *tree = proto_item_add_subtree(item, ett_mpeg_pes_header_data);
644 if (flags & PTS_FLAG) {
646 decode_time_stamp(tvb, offset, &nst);
647 proto_tree_add_time(tree, hf_mpeg_pes_pts, tvb,
651 if (check_col(pinfo->cinfo, COL_DEF_DST)) {
652 SET_ADDRESS(&pinfo->dst, AT_NONE, 0, NULL);
653 col_add_fstr(pinfo->cinfo, COL_DEF_DST,
655 (long) nst.secs, nst.nsecs);
658 if (flags & DTS_FLAG) {
660 decode_time_stamp(tvb, offset, &nst);
661 proto_tree_add_time(tree, hf_mpeg_pes_dts, tvb,
665 if (check_col(pinfo->cinfo, COL_DEF_SRC)) {
666 SET_ADDRESS(&pinfo->src, AT_NONE, 0, NULL);
667 col_add_fstr(pinfo->cinfo, COL_DEF_SRC,
669 (long) nst.secs, nst.nsecs);
672 if (flags & ESCR_FLAG) {
674 decode_clock_reference(tvb, offset, &nst);
675 proto_tree_add_time(tree, hf_mpeg_pes_escr, tvb,
679 if (flags & ES_RATE_FLAG) {
680 unsigned es_rate = (tvb_get_ntohs(tvb, offset) >> 1 & 0x3fff) * 50;
681 proto_tree_add_uint(tree, hf_mpeg_pes_es_rate, tvb,
685 if (flags & DSM_TRICK_MODE_FLAG)
687 guint8 value = tvb_get_guint8(tvb, offset);
689 proto_tree *trick_tree;
690 proto_item *trick_item;
692 trick_item = proto_tree_add_item(item,
693 hf_mpeg_pes_dsm_trick_mode, tvb,
696 trick_tree = proto_item_add_subtree(trick_item,
697 ett_mpeg_pes_trick_mode);
699 control = (value >> 5);
700 proto_tree_add_uint(trick_tree,
701 hf_mpeg_pes_dsm_trick_mode_control, tvb,
705 if (control == FAST_FORWARD_CONTROL
706 || control == FAST_REVERSE_CONTROL)
708 proto_tree_add_uint(trick_tree,
709 hf_mpeg_pes_dsm_trick_mode_field_id, tvb,
711 (value & 0x18) >> 3);
713 proto_tree_add_uint(trick_tree,
714 hf_mpeg_pes_dsm_trick_mode_intra_slice_refresh, tvb,
716 (value & 0x04) >> 2);
718 proto_tree_add_uint(trick_tree,
719 hf_mpeg_pes_dsm_trick_mode_frequency_truncation, tvb,
723 else if (control == SLOW_MOTION_CONTROL
724 || control == SLOW_REVERSE_CONTROL)
726 proto_tree_add_uint(trick_tree,
727 hf_mpeg_pes_dsm_trick_mode_rep_cntrl, tvb,
731 else if (control == FREEZE_FRAME_CONTROL)
733 proto_tree_add_uint(trick_tree,
734 hf_mpeg_pes_dsm_trick_mode_field_id, tvb,
736 (value & 0x18) >> 3);
741 if (flags & COPY_INFO_FLAG) {
742 proto_tree_add_item(tree, hf_mpeg_pes_copy_info, tvb,
743 offset, 1, ENC_BIG_ENDIAN);
746 if (flags & CRC_FLAG) {
747 proto_tree_add_item(tree, hf_mpeg_pes_crc, tvb,
748 offset, 2, ENC_BIG_ENDIAN);
752 if (flags & EXTENSION_FLAG) {
753 int flags2 = tvb_get_guint8(tvb, offset);
754 proto_tree_add_item(tree, hf_mpeg_pes_extension_flags, tvb,
755 offset, 1, ENC_BIG_ENDIAN);
758 if (flags2 & PRIVATE_DATA_FLAG) {
759 proto_tree_add_item(tree, hf_mpeg_pes_private_data, tvb,
760 offset, 2, ENC_BIG_ENDIAN);
763 if (flags2 & PACK_LENGTH_FLAG) {
764 proto_tree_add_item(tree, hf_mpeg_pes_pack_length, tvb,
765 offset, 1, ENC_BIG_ENDIAN);
768 if (flags2 & SEQUENCE_FLAG) {
769 proto_tree_add_item(tree, hf_mpeg_pes_sequence, tvb,
770 offset, 2, ENC_BIG_ENDIAN);
773 if (flags2 & PSTD_BUFFER_FLAG) {
774 unsigned pstd = tvb_get_ntohs(tvb, offset);
775 proto_tree_add_uint(tree, hf_mpeg_pes_pstd_buffer, tvb,
776 offset, 2, (pstd & 0x2000 ? 1024 : 128) * (pstd & 0x1ff));
779 if (flags2 & EXTENSION_FLAG2) {
780 proto_tree_add_item(tree, hf_mpeg_pes_extension2, tvb,
781 offset, 2, ENC_BIG_ENDIAN);
789 dissect_mpeg_pes_pack_header(tvbuff_t *tvb, gint offset,
790 packet_info *pinfo, proto_tree *root)
792 unsigned program_mux_rate, stuffing_length;
794 proto_item *item = proto_tree_add_item(root, hf_mpeg_pes_pack_header, tvb,
795 offset / 8, 10, ENC_NA);
796 proto_tree *tree = proto_item_add_subtree(item, ett_mpeg_pes_pack_header);
799 decode_clock_reference(tvb, offset / 8, &nst);
800 proto_tree_add_time(tree, hf_mpeg_pes_scr, tvb, offset / 8, 6, &nst);
803 program_mux_rate = (tvb_get_ntoh24(tvb, offset / 8) >> 2) * 50;
804 proto_tree_add_uint(tree, hf_mpeg_pes_program_mux_rate, tvb, offset / 8, 3,
808 if (check_col(pinfo->cinfo, COL_DEF_SRC)) {
809 SET_ADDRESS(&pinfo->src, AT_NONE, 0, NULL);
810 col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "%u B/s", program_mux_rate);
813 stuffing_length = tvb_get_guint8(tvb, offset / 8) & 0x07;
814 proto_tree_add_item(tree, hf_mpeg_pes_stuffing_length, tvb,
815 offset / 8, 1, ENC_BIG_ENDIAN);
818 if (stuffing_length > 0) {
819 proto_tree_add_item(tree, hf_mpeg_pes_stuffing, tvb,
820 offset / 8, stuffing_length, ENC_NA);
821 offset += stuffing_length * 8;
828 dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
831 dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
838 if (!tvb_bytes_exist(tvb, 0, 3))
839 return FALSE; /* not enough bytes for a PES prefix */
841 prefix = tvb_get_ntoh24(tvb, 0);
842 if (prefix != PES_PREFIX)
844 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG PES");
845 col_clear(pinfo->cinfo, COL_INFO);
847 stream = tvb_get_guint8(tvb, 3);
848 if (check_col(pinfo->cinfo, COL_INFO)) {
849 const char *s = match_strval(stream, mpeg_pes_T_stream_vals);
851 col_set_str(pinfo->cinfo, COL_INFO, s);
858 asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
859 offset = dissect_mpeg_pes_PES(tvb, offset, &asn1_ctx,
860 tree, proto_mpeg_pes);
862 if (stream == STREAM_PICTURE) {
865 frame_type = tvb_get_guint8(tvb, 5) >> 3 & 0x07;
866 if (check_col(pinfo->cinfo, COL_INFO)) {
867 const char *s = match_strval(frame_type,
868 mpeg_pes_T_frame_type_vals);
870 col_set_str(pinfo->cinfo, COL_INFO, s);
873 offset = dissect_mpeg_pes_Picture(tvb, offset, &asn1_ctx,
874 tree, hf_mpeg_video_picture);
875 proto_tree_add_item(tree, hf_mpeg_video_data, tvb,
876 offset / 8, -1, ENC_NA);
877 } else if (stream == STREAM_SEQUENCE) {
880 offset = dissect_mpeg_pes_Sequence_header(tvb, offset, &asn1_ctx,
881 tree, hf_mpeg_video_sequence_header);
883 proto_tree_add_item(tree, hf_mpeg_video_quantization_matrix, tvb,
884 offset / 8, 64, ENC_NA);
887 es = tvb_new_subset_remaining(tvb, offset / 8);
888 dissect_mpeg_pes(es, pinfo, tree, NULL);
889 } else if (stream == STREAM_SEQUENCE_EXTENSION) {
892 offset = dissect_mpeg_pes_Sequence_extension(tvb, offset, &asn1_ctx,
893 tree, hf_mpeg_video_sequence_extension);
895 es = tvb_new_subset_remaining(tvb, offset / 8);
896 dissect_mpeg_pes(es, pinfo, tree, NULL);
897 } else if (stream == STREAM_GOP) {
900 offset = dissect_mpeg_pes_Group_of_pictures(tvb, offset, &asn1_ctx,
901 tree, hf_mpeg_video_group_of_pictures);
903 es = tvb_new_subset_remaining(tvb, offset / 8);
904 dissect_mpeg_pes(es, pinfo, tree, NULL);
905 } else if (stream == STREAM_PACK) {
906 if (tvb_get_guint8(tvb, offset / 8) >> 6 == 1) {
907 dissect_mpeg_pes_pack_header(tvb, offset, pinfo, tree);
909 proto_tree_add_item(tree, hf_mpeg_pes_data, tvb,
910 offset / 8, 8, ENC_NA);
912 } else if (stream == STREAM_SYSTEM || stream == STREAM_PRIVATE2) {
913 unsigned data_length = tvb_get_ntohs(tvb, offset / 8);
914 proto_tree_add_item(tree, hf_mpeg_pes_length, tvb,
915 offset / 8, 2, ENC_BIG_ENDIAN);
918 proto_tree_add_item(tree, hf_mpeg_pes_data, tvb,
919 offset / 8, data_length, ENC_NA);
920 } else if (stream == STREAM_PADDING) {
921 unsigned padding_length = tvb_get_ntohs(tvb, offset / 8);
922 proto_tree_add_item(tree, hf_mpeg_pes_length, tvb,
923 offset / 8, 2, ENC_BIG_ENDIAN);
926 proto_tree_add_item(tree, hf_mpeg_pes_padding, tvb,
927 offset / 8, padding_length, ENC_NA);
928 } else if (stream == STREAM_PRIVATE1
929 || stream >= STREAM_AUDIO) {
930 int length = tvb_get_ntohs(tvb, 4);
932 if ((tvb_get_guint8(tvb, 6) & 0xc0) == 0x80) {
936 offset = dissect_mpeg_pes_Stream(tvb, offset, &asn1_ctx,
937 tree, hf_mpeg_pes_extension);
938 /* https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2229
939 * A value of 0 indicates that the PES packet length is neither specified nor
940 * bounded and is allowed only in PES packets whose payload is a video elementary
941 * stream contained in Transport Stream packets.
942 * XXX Some one with access to the spec should check this
944 if(length !=0 && stream != STREAM_VIDEO){
948 header_length = tvb_get_guint8(tvb, 8);
949 if (header_length > 0) {
950 int flags = tvb_get_guint8(tvb, 7);
951 tvbuff_t *header_data = tvb_new_subset(tvb, offset / 8,
952 header_length, header_length);
953 dissect_mpeg_pes_header_data(header_data, pinfo, tree, flags);
954 offset += header_length * 8;
955 /* length may be zero for Video stream */
956 if(length !=0 && stream != STREAM_VIDEO){
957 length -= header_length * 8;
961 /* length may be zero for Video stream */
963 proto_tree_add_item(tree, hf_mpeg_pes_data, tvb, (offset>>3),-1, ENC_NA);
967 es = tvb_new_subset(tvb, offset / 8, -1, length / 8);
968 if (tvb_get_ntoh24(es, 0) == PES_PREFIX)
969 dissect_mpeg_pes(es, pinfo, tree, NULL);
970 else if (tvb_get_guint8(es, 0) == 0xff)
971 dissect_mpeg(es, pinfo, tree);
973 proto_tree_add_item(tree, hf_mpeg_pes_data, es,
976 unsigned data_length = tvb_get_ntohs(tvb, offset / 8);
977 proto_tree_add_item(tree, hf_mpeg_pes_length, tvb,
978 offset / 8, 2, ENC_BIG_ENDIAN);
981 proto_tree_add_item(tree, hf_mpeg_pes_data, tvb,
982 offset / 8, data_length, ENC_NA);
985 proto_tree_add_item(tree, hf_mpeg_pes_data, tvb,
986 offset / 8, -1, ENC_NA);
991 static heur_dissector_list_t heur_subdissector_list;
994 dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
996 if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, NULL)) {
997 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG");
998 col_clear(pinfo->cinfo, COL_INFO);
1000 proto_tree_add_item(tree, proto_mpeg, tvb, 0, -1, ENC_NA);
1005 proto_register_mpeg_pes(void)
1007 static hf_register_info hf[] = {
1009 /*--- Included file: packet-mpeg-pes-hfarr.c ---*/
1010 #line 1 "../../asn1/mpeg-pes/packet-mpeg-pes-hfarr.c"
1011 { &hf_mpeg_pes_prefix,
1012 { "prefix", "mpeg-pes.prefix",
1013 FT_BYTES, BASE_NONE, NULL, 0,
1014 "OCTET_STRING_SIZE_3", HFILL }},
1015 { &hf_mpeg_pes_stream,
1016 { "stream", "mpeg-pes.stream",
1017 FT_UINT8, BASE_HEX, VALS(mpeg_pes_T_stream_vals), 0,
1019 { &hf_mpeg_pes_length,
1020 { "length", "mpeg-pes.length",
1021 FT_UINT16, BASE_DEC, NULL, 0,
1022 "INTEGER_0_65535", HFILL }},
1023 { &hf_mpeg_pes_must_be_one,
1024 { "must-be-one", "mpeg-pes.must_be_one",
1025 FT_BOOLEAN, BASE_NONE, NULL, 0,
1026 "BOOLEAN", HFILL }},
1027 { &hf_mpeg_pes_must_be_zero,
1028 { "must-be-zero", "mpeg-pes.must_be_zero",
1029 FT_BOOLEAN, BASE_NONE, NULL, 0,
1030 "BOOLEAN", HFILL }},
1031 { &hf_mpeg_pes_scrambling_control,
1032 { "scrambling-control", "mpeg-pes.scrambling_control",
1033 FT_UINT32, BASE_DEC, VALS(mpeg_pes_T_scrambling_control_vals), 0,
1035 { &hf_mpeg_pes_priority,
1036 { "priority", "mpeg-pes.priority",
1037 FT_BOOLEAN, BASE_NONE, NULL, 0,
1038 "BOOLEAN", HFILL }},
1039 { &hf_mpeg_pes_data_alignment,
1040 { "data-alignment", "mpeg-pes.data_alignment",
1041 FT_BOOLEAN, BASE_NONE, NULL, 0,
1042 "BOOLEAN", HFILL }},
1043 { &hf_mpeg_pes_copyright,
1044 { "copyright", "mpeg-pes.copyright",
1045 FT_BOOLEAN, BASE_NONE, NULL, 0,
1046 "BOOLEAN", HFILL }},
1047 { &hf_mpeg_pes_original,
1048 { "original", "mpeg-pes.original",
1049 FT_BOOLEAN, BASE_NONE, NULL, 0,
1050 "BOOLEAN", HFILL }},
1051 { &hf_mpeg_pes_pts_flag,
1052 { "pts-flag", "mpeg-pes.pts_flag",
1053 FT_BOOLEAN, BASE_NONE, NULL, 0,
1054 "BOOLEAN", HFILL }},
1055 { &hf_mpeg_pes_dts_flag,
1056 { "dts-flag", "mpeg-pes.dts_flag",
1057 FT_BOOLEAN, BASE_NONE, NULL, 0,
1058 "BOOLEAN", HFILL }},
1059 { &hf_mpeg_pes_escr_flag,
1060 { "escr-flag", "mpeg-pes.escr_flag",
1061 FT_BOOLEAN, BASE_NONE, NULL, 0,
1062 "BOOLEAN", HFILL }},
1063 { &hf_mpeg_pes_es_rate_flag,
1064 { "es-rate-flag", "mpeg-pes.es_rate_flag",
1065 FT_BOOLEAN, BASE_NONE, NULL, 0,
1066 "BOOLEAN", HFILL }},
1067 { &hf_mpeg_pes_dsm_trick_mode_flag,
1068 { "dsm-trick-mode-flag", "mpeg-pes.dsm_trick_mode_flag",
1069 FT_BOOLEAN, BASE_NONE, NULL, 0,
1070 "BOOLEAN", HFILL }},
1071 { &hf_mpeg_pes_additional_copy_info_flag,
1072 { "additional-copy-info-flag", "mpeg-pes.additional_copy_info_flag",
1073 FT_BOOLEAN, BASE_NONE, NULL, 0,
1074 "BOOLEAN", HFILL }},
1075 { &hf_mpeg_pes_crc_flag,
1076 { "crc-flag", "mpeg-pes.crc_flag",
1077 FT_BOOLEAN, BASE_NONE, NULL, 0,
1078 "BOOLEAN", HFILL }},
1079 { &hf_mpeg_pes_extension_flag,
1080 { "extension-flag", "mpeg-pes.extension_flag",
1081 FT_BOOLEAN, BASE_NONE, NULL, 0,
1082 "BOOLEAN", HFILL }},
1083 { &hf_mpeg_pes_header_data_length,
1084 { "header-data-length", "mpeg-pes.header_data_length",
1085 FT_UINT32, BASE_DEC, NULL, 0,
1086 "INTEGER_0_255", HFILL }},
1087 { &hf_mpeg_pes_horizontal_size,
1088 { "horizontal-size", "mpeg-pes.horizontal_size",
1089 FT_BYTES, BASE_NONE, NULL, 0,
1090 "BIT_STRING_SIZE_12", HFILL }},
1091 { &hf_mpeg_pes_vertical_size,
1092 { "vertical-size", "mpeg-pes.vertical_size",
1093 FT_BYTES, BASE_NONE, NULL, 0,
1094 "BIT_STRING_SIZE_12", HFILL }},
1095 { &hf_mpeg_pes_aspect_ratio,
1096 { "aspect-ratio", "mpeg-pes.aspect_ratio",
1097 FT_UINT32, BASE_DEC, VALS(mpeg_pes_T_aspect_ratio_vals), 0,
1098 "T_aspect_ratio", HFILL }},
1099 { &hf_mpeg_pes_frame_rate,
1100 { "frame-rate", "mpeg-pes.frame_rate",
1101 FT_UINT32, BASE_DEC, VALS(mpeg_pes_T_frame_rate_vals), 0,
1103 { &hf_mpeg_pes_bit_rate,
1104 { "bit-rate", "mpeg-pes.bit_rate",
1105 FT_BYTES, BASE_NONE, NULL, 0,
1106 "BIT_STRING_SIZE_18", HFILL }},
1107 { &hf_mpeg_pes_vbv_buffer_size,
1108 { "vbv-buffer-size", "mpeg-pes.vbv_buffer_size",
1109 FT_BYTES, BASE_NONE, NULL, 0,
1110 "BIT_STRING_SIZE_10", HFILL }},
1111 { &hf_mpeg_pes_constrained_parameters_flag,
1112 { "constrained-parameters-flag", "mpeg-pes.constrained_parameters_flag",
1113 FT_BOOLEAN, BASE_NONE, NULL, 0,
1114 "BOOLEAN", HFILL }},
1115 { &hf_mpeg_pes_load_intra_quantiser_matrix,
1116 { "load-intra-quantiser-matrix", "mpeg-pes.load_intra_quantiser_matrix",
1117 FT_BOOLEAN, BASE_NONE, NULL, 0,
1118 "BOOLEAN", HFILL }},
1119 { &hf_mpeg_pes_load_non_intra_quantiser_matrix,
1120 { "load-non-intra-quantiser-matrix", "mpeg-pes.load_non_intra_quantiser_matrix",
1121 FT_BOOLEAN, BASE_NONE, NULL, 0,
1122 "BOOLEAN", HFILL }},
1123 { &hf_mpeg_pes_must_be_0001,
1124 { "must-be-0001", "mpeg-pes.must_be_0001",
1125 FT_BYTES, BASE_NONE, NULL, 0,
1126 "BIT_STRING_SIZE_4", HFILL }},
1127 { &hf_mpeg_pes_profile_and_level,
1128 { "profile-and-level", "mpeg-pes.profile_and_level",
1129 FT_UINT32, BASE_DEC, NULL, 0,
1130 "INTEGER_0_255", HFILL }},
1131 { &hf_mpeg_pes_progressive_sequence,
1132 { "progressive-sequence", "mpeg-pes.progressive_sequence",
1133 FT_BOOLEAN, BASE_NONE, NULL, 0,
1134 "BOOLEAN", HFILL }},
1135 { &hf_mpeg_pes_chroma_format,
1136 { "chroma-format", "mpeg-pes.chroma_format",
1137 FT_UINT32, BASE_DEC, NULL, 0,
1138 "INTEGER_0_3", HFILL }},
1139 { &hf_mpeg_pes_horizontal_size_extension,
1140 { "horizontal-size-extension", "mpeg-pes.horizontal_size_extension",
1141 FT_UINT32, BASE_DEC, NULL, 0,
1142 "INTEGER_0_3", HFILL }},
1143 { &hf_mpeg_pes_vertical_size_extension,
1144 { "vertical-size-extension", "mpeg-pes.vertical_size_extension",
1145 FT_UINT32, BASE_DEC, NULL, 0,
1146 "INTEGER_0_3", HFILL }},
1147 { &hf_mpeg_pes_bit_rate_extension,
1148 { "bit-rate-extension", "mpeg-pes.bit_rate_extension",
1149 FT_BYTES, BASE_NONE, NULL, 0,
1150 "BIT_STRING_SIZE_12", HFILL }},
1151 { &hf_mpeg_pes_vbv_buffer_size_extension,
1152 { "vbv-buffer-size-extension", "mpeg-pes.vbv_buffer_size_extension",
1153 FT_UINT32, BASE_DEC, NULL, 0,
1154 "INTEGER_0_255", HFILL }},
1155 { &hf_mpeg_pes_low_delay,
1156 { "low-delay", "mpeg-pes.low_delay",
1157 FT_BOOLEAN, BASE_NONE, NULL, 0,
1158 "BOOLEAN", HFILL }},
1159 { &hf_mpeg_pes_frame_rate_extension_n,
1160 { "frame-rate-extension-n", "mpeg-pes.frame_rate_extension_n",
1161 FT_UINT32, BASE_DEC, NULL, 0,
1162 "INTEGER_0_3", HFILL }},
1163 { &hf_mpeg_pes_frame_rate_extension_d,
1164 { "frame-rate-extension-d", "mpeg-pes.frame_rate_extension_d",
1165 FT_UINT32, BASE_DEC, NULL, 0,
1166 "INTEGER_0_3", HFILL }},
1167 { &hf_mpeg_pes_drop_frame_flag,
1168 { "drop-frame-flag", "mpeg-pes.drop_frame_flag",
1169 FT_BOOLEAN, BASE_NONE, NULL, 0,
1170 "BOOLEAN", HFILL }},
1171 { &hf_mpeg_pes_hour,
1172 { "hour", "mpeg-pes.hour",
1173 FT_UINT32, BASE_DEC, NULL, 0,
1174 "INTEGER_0_32", HFILL }},
1175 { &hf_mpeg_pes_minute,
1176 { "minute", "mpeg-pes.minute",
1177 FT_UINT32, BASE_DEC, NULL, 0,
1178 "INTEGER_0_64", HFILL }},
1179 { &hf_mpeg_pes_second,
1180 { "second", "mpeg-pes.second",
1181 FT_UINT32, BASE_DEC, NULL, 0,
1182 "INTEGER_0_64", HFILL }},
1183 { &hf_mpeg_pes_frame,
1184 { "frame", "mpeg-pes.frame",
1185 FT_UINT32, BASE_DEC, NULL, 0,
1186 "INTEGER_0_64", HFILL }},
1187 { &hf_mpeg_pes_closed_gop,
1188 { "closed-gop", "mpeg-pes.closed_gop",
1189 FT_BOOLEAN, BASE_NONE, NULL, 0,
1190 "BOOLEAN", HFILL }},
1191 { &hf_mpeg_pes_broken_gop,
1192 { "broken-gop", "mpeg-pes.broken_gop",
1193 FT_BOOLEAN, BASE_NONE, NULL, 0,
1194 "BOOLEAN", HFILL }},
1195 { &hf_mpeg_pes_must_be_zero_01,
1196 { "must-be-zero", "mpeg-pes.must_be_zero",
1197 FT_BYTES, BASE_NONE, NULL, 0,
1198 "BIT_STRING_SIZE_5", HFILL }},
1199 { &hf_mpeg_pes_temporal_sequence_number,
1200 { "temporal-sequence-number", "mpeg-pes.temporal_sequence_number",
1201 FT_BYTES, BASE_NONE, NULL, 0,
1202 "BIT_STRING_SIZE_10", HFILL }},
1203 { &hf_mpeg_pes_frame_type,
1204 { "frame-type", "mpeg-pes.frame_type",
1205 FT_UINT32, BASE_DEC, VALS(mpeg_pes_T_frame_type_vals), 0,
1207 { &hf_mpeg_pes_vbv_delay,
1208 { "vbv-delay", "mpeg-pes.vbv_delay",
1209 FT_BYTES, BASE_NONE, NULL, 0,
1210 "BIT_STRING_SIZE_16", HFILL }},
1212 /*--- End of included file: packet-mpeg-pes-hfarr.c ---*/
1213 #line 568 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c"
1214 { &hf_mpeg_pes_pack_header,
1215 { "Pack header", "mpeg-pes.pack",
1216 FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1218 { "system clock reference (SCR)", "mpeg-pes.scr",
1219 FT_RELATIVE_TIME, BASE_NONE, NULL, 0, NULL, HFILL }},
1220 { &hf_mpeg_pes_program_mux_rate,
1221 { "PES program mux rate", "mpeg-pes.program-mux-rate",
1222 FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
1223 { &hf_mpeg_pes_stuffing_length,
1224 { "PES stuffing length", "mpeg-pes.stuffing-length",
1225 FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
1226 { &hf_mpeg_pes_stuffing,
1227 { "PES stuffing bytes", "mpeg-pes.stuffing",
1228 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1229 { &hf_mpeg_pes_extension,
1230 { "PES extension", "mpeg-pes.extension",
1231 FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1232 { &hf_mpeg_pes_header_data,
1233 { "PES header data", "mpeg-pes.header-data",
1234 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1236 { "presentation time stamp (PTS)", "mpeg-pes.pts",
1237 FT_RELATIVE_TIME, BASE_NONE, NULL, 0, NULL, HFILL }},
1239 { "decode time stamp (DTS)", "mpeg-pes.dts",
1240 FT_RELATIVE_TIME, BASE_NONE, NULL, 0, NULL, HFILL }},
1241 { &hf_mpeg_pes_escr,
1242 { "elementary stream clock reference (ESCR)", "mpeg-pes.escr",
1243 FT_RELATIVE_TIME, BASE_NONE, NULL, 0, NULL, HFILL }},
1244 { &hf_mpeg_pes_es_rate,
1245 { "elementary stream rate", "mpeg-pes.es-rate",
1246 FT_UINT24, BASE_DEC, NULL, 0x7ffe, NULL, HFILL }},
1247 { &hf_mpeg_pes_dsm_trick_mode,
1248 { "Trick mode", "mpeg-pes.trick-mode",
1249 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1250 { &hf_mpeg_pes_dsm_trick_mode_control,
1251 { "control", "mpeg-pes.trick-mode-control",
1252 FT_UINT8, BASE_HEX, VALS(mpeg_pes_TrickModeControl_vals), 0,
1253 "mpeg_pes trick mode control", HFILL }},
1254 { &hf_mpeg_pes_dsm_trick_mode_field_id,
1255 { "field id", "mpeg-pes.trick-mode-field-id",
1256 FT_UINT8, BASE_HEX, VALS(mpeg_pes_TrickModeFieldId_vals), 0,
1257 "mpeg_pes trick mode field id", HFILL }},
1258 { &hf_mpeg_pes_dsm_trick_mode_intra_slice_refresh,
1259 { "intra slice refresh", "mpeg-pes.trick-mode-intra-slice-refresh",
1260 FT_UINT8, BASE_HEX, VALS(mpeg_pes_TrickModeIntraSliceRefresh_vals), 0,
1261 "mpeg_pes trick mode intra slice refresh", HFILL }},
1262 { &hf_mpeg_pes_dsm_trick_mode_frequency_truncation,
1263 { "frequency truncation", "mpeg-pes.trick-mode-frequeny-truncation",
1264 FT_UINT8, BASE_HEX, VALS(mpeg_pes_TrickModeFrequencyTruncation_vals), 0,
1265 "mpeg_pes trick mode frequency truncation", HFILL }},
1266 { &hf_mpeg_pes_dsm_trick_mode_rep_cntrl,
1267 { "rep cntrl", "mpeg-pes.trick-mode-rep-cntrl",
1268 FT_UINT8, BASE_HEX, NULL, 0, "mpeg_pes trick mode rep cntrl", HFILL }},
1269 { &hf_mpeg_pes_copy_info,
1270 { "copy info", "mpeg-pes.copy-info",
1271 FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
1273 { "CRC", "mpeg-pes.crc",
1274 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1275 { &hf_mpeg_pes_extension_flags,
1276 { "extension flags", "mpeg-pes.extension-flags",
1277 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1278 { &hf_mpeg_pes_private_data,
1279 { "private data", "mpeg-pes.private-data",
1280 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1281 { &hf_mpeg_pes_pack_length,
1282 { "pack length", "mpeg-pes.pack-length",
1283 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1284 { &hf_mpeg_pes_sequence,
1285 { "sequence", "mpeg-pes.sequence",
1286 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1287 { &hf_mpeg_pes_pstd_buffer,
1288 { "P-STD buffer size", "mpeg-pes.pstd-buffer",
1289 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1290 { &hf_mpeg_pes_extension2,
1291 { "extension2", "mpeg-pes.extension2",
1292 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1293 { &hf_mpeg_pes_padding,
1294 { "PES padding", "mpeg-pes.padding",
1295 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1296 { &hf_mpeg_pes_data,
1297 { "PES data", "mpeg-pes.data",
1298 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1299 { &hf_mpeg_video_sequence_header,
1300 { "MPEG sequence header", "mpeg-video.sequence",
1301 FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1302 { &hf_mpeg_video_sequence_extension,
1303 { "MPEG sequence extension", "mpeg-video.sequence-ext",
1304 FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1305 { &hf_mpeg_video_group_of_pictures,
1306 { "MPEG group of pictures", "mpeg-video.gop",
1307 FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1308 { &hf_mpeg_video_picture,
1309 { "MPEG picture", "mpeg-video.picture",
1310 FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1311 { &hf_mpeg_video_quantization_matrix,
1312 { "MPEG quantization matrix", "mpeg-video.quant",
1313 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1314 { &hf_mpeg_video_data,
1315 { "MPEG picture data", "mpeg-video.data",
1316 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1319 static gint *ett[] = {
1321 /*--- Included file: packet-mpeg-pes-ettarr.c ---*/
1322 #line 1 "../../asn1/mpeg-pes/packet-mpeg-pes-ettarr.c"
1324 &ett_mpeg_pes_Stream,
1325 &ett_mpeg_pes_Sequence_header,
1326 &ett_mpeg_pes_Sequence_extension,
1327 &ett_mpeg_pes_Group_of_pictures,
1328 &ett_mpeg_pes_Picture,
1330 /*--- End of included file: packet-mpeg-pes-ettarr.c ---*/
1331 #line 675 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c"
1332 &ett_mpeg_pes_pack_header,
1333 &ett_mpeg_pes_header_data,
1334 &ett_mpeg_pes_trick_mode
1337 proto_mpeg = proto_register_protocol(
1338 "Moving Picture Experts Group", "MPEG", "mpeg");
1339 register_dissector("mpeg", dissect_mpeg, proto_mpeg);
1340 register_heur_dissector_list("mpeg", &heur_subdissector_list);
1342 proto_mpeg_pes = proto_register_protocol(
1343 "Packetized Elementary Stream", "MPEG PES", "mpeg-pes");
1344 proto_register_field_array(proto_mpeg_pes, hf, array_length(hf));
1345 proto_register_subtree_array(ett, array_length(ett));
1346 new_register_dissector("mpeg-pes", dissect_mpeg_pes, proto_mpeg_pes);
1350 proto_reg_handoff_mpeg_pes(void)
1352 dissector_handle_t mpeg_handle = find_dissector("mpeg");
1354 dissector_add_uint("wtap_encap", WTAP_ENCAP_MPEG, mpeg_handle);
1355 heur_dissector_add("mpeg", dissect_mpeg_pes, proto_mpeg_pes);