Browse Source

Move PES structures at the end of tsdata.h

Georgi Chorbadzhiyski 9 years ago
parent
commit
9ac314c284
1 changed files with 140 additions and 140 deletions
  1. 140
    140
      tsdata.h

+ 140
- 140
tsdata.h View File

@@ -32,146 +32,6 @@ struct ts_header {
32 32
 	uint8_t		payload_offset;		// Payload offset inside the packet
33 33
 };
34 34
 
35
-struct mpeg_audio_header {
36
-	uint32_t	syncword		: 12,
37
-				ID				: 1,
38
-				layer			: 2,
39
-				protection_bit	: 1,
40
-				bitrate_index	: 4,
41
-				sampl_freq		: 2,
42
-				padding_bit		: 1,
43
-				private_bit		: 1,
44
-				mode			: 2,
45
-				mode_extension	: 2,
46
-				copyright		: 1,
47
-				org_home		: 1,
48
-				emphasis		: 2;
49
-
50
-	uint8_t		initialized;
51
-};
52
-
53
-struct ts_pes {
54
-	struct ts_header ts_header;
55
-
56
-	uint32_t	have_pts		: 1,		// Have PTS in the PES (init from PES header)
57
-				have_dts		: 1,		// Have DTS in the PES (init from PES header)
58
-				is_audio		: 1,		// PES carries audio (mpeg2 or AC3) (init from PES stream_id and PMT stream_type and descriptors)
59
-				is_audio_mpeg1	: 1,		// PES carries MP1 audio (init from PMT stream_id)
60
-				is_audio_mpeg1l1: 1,		// PES carries MP1 audio Layer I (init from PMT audio descriptor)
61
-				is_audio_mpeg1l2: 1,		// PES carries MP1 audio Layer II (init from PMT audio descriptor)
62
-				is_audio_mpeg1l3: 1,		// PES carries MP1 audio Layer III (init from PMT audio descriptor)
63
-				is_audio_mpeg2	: 1,		// PES carries MP2 audio (init from PMT stream_id)
64
-				is_audio_aac	: 1,		// PES carries AAC audio (init from PMT stream_id)
65
-				is_audio_ac3	: 1,		// PES carries AC3 audio (init from stream_id and PMT descriptors and elmentary stream)
66
-				is_audio_dts	: 1,		// PES carries DTS audio (init from stream_id and elementary stream)
67
-				is_video		: 1,		// PES carries video (mpeg2 or H.264) (init from PES stream_id)
68
-				is_video_mpeg1	: 1,		// PES carries mpeg1 video (init from PES stream_id)
69
-				is_video_mpeg2	: 1,		// PES carries mpeg2 video (init from PES stream_id)
70
-				is_video_mpeg4	: 1,		// PES carries mpeg4 part 2 video (init from PES stream_id)
71
-				is_video_h264	: 1,		// PES carries H.264 video (init from PES stream_id)
72
-				is_video_avs	: 1,		// PES carries AVS video (init from PES stream_id)
73
-				is_teletext		: 1,		// PES carries teletext (init from PMT descriptors)
74
-				is_subtitle		: 1;		// PES carries subtitles (init from PMT descriptors)
75
-
76
-	uint8_t		stream_id;					// If !0 then the PES has started initializing
77
-	uint16_t	pes_packet_len;				// Allowed to be 0 for video streams
78
-	int			real_pes_packet_len;		// if pes_packet_len is > 0 the this is eq to pes_packet_len
79
-											// if pes_packet_len is = 0 this is set to -1 until very last packet
80
-
81
-	uint8_t		flags_1;					// Bellow flags
82
-	uint8_t		reserved1			: 2,	// Always eq 2 (10 binary)
83
-				scrambling			: 2,
84
-				priority			: 1,
85
-				data_alignment		: 1,
86
-				copyright			: 1,
87
-				original_or_copy	: 1;
88
-
89
-	uint8_t		flags_2;					// Bellow flags
90
-	uint8_t		PTS_flag			: 1,
91
-				DTS_flag			: 1,
92
-				ESCR_flag			: 1,
93
-				ES_rate_flag		: 1,
94
-				trick_mode_flag		: 1,
95
-				add_copy_info_flag	: 1,
96
-				pes_crc_flag		: 1,
97
-				pes_extension_flag	: 1;
98
-
99
-	uint8_t		pes_header_len;
100
-
101
-	uint64_t	PTS;						// if (PTS_flag)
102
-	uint64_t	DTS;						// if (DTS_flag)
103
-	uint64_t	ESCR;						// if (ESCR_flag)
104
-	uint32_t	ES_rate;					// if (ES_rate_flag)
105
-
106
-	uint16_t	trick_mode_control	: 2,	// if (trick_mode_flag)
107
-				field_id			: 2,
108
-				intra_slice_refresh	: 1,
109
-				freq_truncation		: 2,
110
-				rep_ctrl			: 5,
111
-				tm_reserved			: 4;
112
-
113
-	uint8_t		reserved_add		: 1,	// if (add_copy_info_flag)
114
-				add_copy_info		: 7;
115
-
116
-	uint16_t	prev_pes_crc;				// if (pes_crc_flag)
117
-
118
-	// PES extension
119
-	uint8_t		flags_3;					// Bellow flags
120
-	uint8_t		pes_private_data_flag			: 1,
121
-				pack_header_field_flag			: 1,
122
-				program_packet_seq_counter_flag	: 1,
123
-				p_std_buffer_flag				: 1,
124
-				reserved2						: 3,
125
-				pes_extension2_flag				: 1;
126
-
127
-	uint64_t	pes_private_data_1;					// if (pes_private_data_flag)
128
-	uint64_t	pes_private_data_2;					// The whole field is 128 bits
129
-
130
-	uint8_t		pack_header_len;					// if (pack_header_field_flag)
131
-	uint8_t		*pack_header;						// Pointer into *pes_data
132
-
133
-	uint8_t		reserved3					: 1,	// if (program_packet_seq_counter_flag)
134
-				program_packet_seq_counter	: 7;
135
-
136
-	uint8_t		mpeg1_mpeg2_identifier		: 1,
137
-				original_stuff_length		: 6;
138
-
139
-	uint16_t	p_std_reserved				: 2,	// Always 1, if (p_std_buffer_flag)
140
-				p_std_buffer_scale			: 1,
141
-				p_std_buffer_size			: 13;
142
-
143
-	uint16_t	reserved4					: 1,	// if (pes_extension2_flag)
144
-				pes_extension_field_len		: 7;
145
-	uint8_t		*pes_extension2;					// Pointer into *pes_data
146
-
147
-	// Private data
148
-	uint8_t		*pes_data;				// Whole packet is stored here
149
-	uint32_t	pes_data_pos;			// How much data is filled in pes_data
150
-	uint32_t	pes_data_size;			// Total allocated for pes_data
151
-	uint8_t		pes_data_initialized;	// Set to 1 when all of the pes_data is in *pes_data and the parsing can start
152
-
153
-	// More private data
154
-	uint8_t		*es_data;				// Pointer to start of data after PES header, initialized when the packet is fully assembled
155
-	uint32_t	es_data_size;			// Full pes packet length (used for video streams, otherwise equal to pes_packet_len)
156
-	uint8_t		initialized;			// Set to 1 when the packet is fully assembled
157
-
158
-	// Extra data
159
-	struct mpeg_audio_header mpeg_audio_header;
160
-};
161
-
162
-struct pes_entry {
163
-	uint16_t		pid;
164
-	struct ts_pes	*pes;
165
-	struct ts_pes	*pes_next;
166
-};
167
-
168
-struct pes_array {
169
-	int max;
170
-	int cur;
171
-	struct pes_entry **entries;
172
-};
173
-
174
-
175 35
 struct ts_section_header {
176 36
 	uint8_t		pointer_field;
177 37
 
@@ -452,4 +312,144 @@ enum ts_stream_type {
452 312
 										       id == STREAM_ID_DSMCC_STREAM             || \
453 313
 										       id == STREAM_ID_H222_E_STREAM))
454 314
 
315
+
316
+struct mpeg_audio_header {
317
+	uint32_t	syncword		: 12,
318
+				ID				: 1,
319
+				layer			: 2,
320
+				protection_bit	: 1,
321
+				bitrate_index	: 4,
322
+				sampl_freq		: 2,
323
+				padding_bit		: 1,
324
+				private_bit		: 1,
325
+				mode			: 2,
326
+				mode_extension	: 2,
327
+				copyright		: 1,
328
+				org_home		: 1,
329
+				emphasis		: 2;
330
+
331
+	uint8_t		initialized;
332
+};
333
+
334
+struct ts_pes {
335
+	struct ts_header ts_header;
336
+
337
+	uint32_t	have_pts		: 1,		// Have PTS in the PES (init from PES header)
338
+				have_dts		: 1,		// Have DTS in the PES (init from PES header)
339
+				is_audio		: 1,		// PES carries audio (mpeg2 or AC3) (init from PES stream_id and PMT stream_type and descriptors)
340
+				is_audio_mpeg1	: 1,		// PES carries MP1 audio (init from PMT stream_id)
341
+				is_audio_mpeg1l1: 1,		// PES carries MP1 audio Layer I (init from PMT audio descriptor)
342
+				is_audio_mpeg1l2: 1,		// PES carries MP1 audio Layer II (init from PMT audio descriptor)
343
+				is_audio_mpeg1l3: 1,		// PES carries MP1 audio Layer III (init from PMT audio descriptor)
344
+				is_audio_mpeg2	: 1,		// PES carries MP2 audio (init from PMT stream_id)
345
+				is_audio_aac	: 1,		// PES carries AAC audio (init from PMT stream_id)
346
+				is_audio_ac3	: 1,		// PES carries AC3 audio (init from stream_id and PMT descriptors and elmentary stream)
347
+				is_audio_dts	: 1,		// PES carries DTS audio (init from stream_id and elementary stream)
348
+				is_video		: 1,		// PES carries video (mpeg2 or H.264) (init from PES stream_id)
349
+				is_video_mpeg1	: 1,		// PES carries mpeg1 video (init from PES stream_id)
350
+				is_video_mpeg2	: 1,		// PES carries mpeg2 video (init from PES stream_id)
351
+				is_video_mpeg4	: 1,		// PES carries mpeg4 part 2 video (init from PES stream_id)
352
+				is_video_h264	: 1,		// PES carries H.264 video (init from PES stream_id)
353
+				is_video_avs	: 1,		// PES carries AVS video (init from PES stream_id)
354
+				is_teletext		: 1,		// PES carries teletext (init from PMT descriptors)
355
+				is_subtitle		: 1;		// PES carries subtitles (init from PMT descriptors)
356
+
357
+	uint8_t		stream_id;					// If !0 then the PES has started initializing
358
+	uint16_t	pes_packet_len;				// Allowed to be 0 for video streams
359
+	int			real_pes_packet_len;		// if pes_packet_len is > 0 the this is eq to pes_packet_len
360
+											// if pes_packet_len is = 0 this is set to -1 until very last packet
361
+
362
+	uint8_t		flags_1;					// Bellow flags
363
+	uint8_t		reserved1			: 2,	// Always eq 2 (10 binary)
364
+				scrambling			: 2,
365
+				priority			: 1,
366
+				data_alignment		: 1,
367
+				copyright			: 1,
368
+				original_or_copy	: 1;
369
+
370
+	uint8_t		flags_2;					// Bellow flags
371
+	uint8_t		PTS_flag			: 1,
372
+				DTS_flag			: 1,
373
+				ESCR_flag			: 1,
374
+				ES_rate_flag		: 1,
375
+				trick_mode_flag		: 1,
376
+				add_copy_info_flag	: 1,
377
+				pes_crc_flag		: 1,
378
+				pes_extension_flag	: 1;
379
+
380
+	uint8_t		pes_header_len;
381
+
382
+	uint64_t	PTS;						// if (PTS_flag)
383
+	uint64_t	DTS;						// if (DTS_flag)
384
+	uint64_t	ESCR;						// if (ESCR_flag)
385
+	uint32_t	ES_rate;					// if (ES_rate_flag)
386
+
387
+	uint16_t	trick_mode_control	: 2,	// if (trick_mode_flag)
388
+				field_id			: 2,
389
+				intra_slice_refresh	: 1,
390
+				freq_truncation		: 2,
391
+				rep_ctrl			: 5,
392
+				tm_reserved			: 4;
393
+
394
+	uint8_t		reserved_add		: 1,	// if (add_copy_info_flag)
395
+				add_copy_info		: 7;
396
+
397
+	uint16_t	prev_pes_crc;				// if (pes_crc_flag)
398
+
399
+	// PES extension
400
+	uint8_t		flags_3;					// Bellow flags
401
+	uint8_t		pes_private_data_flag			: 1,
402
+				pack_header_field_flag			: 1,
403
+				program_packet_seq_counter_flag	: 1,
404
+				p_std_buffer_flag				: 1,
405
+				reserved2						: 3,
406
+				pes_extension2_flag				: 1;
407
+
408
+	uint64_t	pes_private_data_1;					// if (pes_private_data_flag)
409
+	uint64_t	pes_private_data_2;					// The whole field is 128 bits
410
+
411
+	uint8_t		pack_header_len;					// if (pack_header_field_flag)
412
+	uint8_t		*pack_header;						// Pointer into *pes_data
413
+
414
+	uint8_t		reserved3					: 1,	// if (program_packet_seq_counter_flag)
415
+				program_packet_seq_counter	: 7;
416
+
417
+	uint8_t		mpeg1_mpeg2_identifier		: 1,
418
+				original_stuff_length		: 6;
419
+
420
+	uint16_t	p_std_reserved				: 2,	// Always 1, if (p_std_buffer_flag)
421
+				p_std_buffer_scale			: 1,
422
+				p_std_buffer_size			: 13;
423
+
424
+	uint16_t	reserved4					: 1,	// if (pes_extension2_flag)
425
+				pes_extension_field_len		: 7;
426
+	uint8_t		*pes_extension2;					// Pointer into *pes_data
427
+
428
+	// Private data
429
+	uint8_t		*pes_data;				// Whole packet is stored here
430
+	uint32_t	pes_data_pos;			// How much data is filled in pes_data
431
+	uint32_t	pes_data_size;			// Total allocated for pes_data
432
+	uint8_t		pes_data_initialized;	// Set to 1 when all of the pes_data is in *pes_data and the parsing can start
433
+
434
+	// More private data
435
+	uint8_t		*es_data;				// Pointer to start of data after PES header, initialized when the packet is fully assembled
436
+	uint32_t	es_data_size;			// Full pes packet length (used for video streams, otherwise equal to pes_packet_len)
437
+	uint8_t		initialized;			// Set to 1 when the packet is fully assembled
438
+
439
+	// Extra data
440
+	struct mpeg_audio_header mpeg_audio_header;
441
+};
442
+
443
+struct pes_entry {
444
+	uint16_t		pid;
445
+	struct ts_pes	*pes;
446
+	struct ts_pes	*pes_next;
447
+};
448
+
449
+struct pes_array {
450
+	int max;
451
+	int cur;
452
+	struct pes_entry **entries;
453
+};
454
+
455 455
 #endif

Loading…
Cancel
Save