~oah-dev/oah/gst-plugins-bad

« back to all changes in this revision

Viewing changes to ext/resindvd/gstmpegdefs.h

  • Committer: Haakon Sporsheim
  • Date: 2009-03-12 13:52:03 UTC
  • Revision ID: haakon.sporsheim@tandberg.com-20090312135203-i5k294hgkushb0mt
Initial import of git repository: git://anongit.freedesktop.org/gstreamer/gst-plugins-bad (tag: RELEASE-0_10_10)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * The contents of this file are subject to the Mozilla Public License
 
3
 * Version 1.1 (the "License"); you may not use this file except in
 
4
 * compliance with the License. You may obtain a copy of the License at
 
5
 * http://www.mozilla.org/MPL/.
 
6
 *
 
7
 * Software distributed under the License is distributed on an "AS IS"
 
8
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 
9
 * License for the specific language governing rights and limitations
 
10
 * under the License.
 
11
 *
 
12
 * The Original Code is Fluendo MPEG Demuxer plugin.
 
13
 *
 
14
 * The Initial Developer of the Original Code is Fluendo, S.L.
 
15
 * Portions created by Fluendo, S.L. are Copyright (C) 2005
 
16
 * Fluendo, S.L. All Rights Reserved.
 
17
 *
 
18
 * Contributor(s): Wim Taymans <wim@fluendo.com>
 
19
 *                 Jan Schmidt <thaytan@noraisin.net>
 
20
 */
 
21
 
 
22
#ifndef __GST_MPEG_DEFS_H__
 
23
#define __GST_MPEG_DEFS_H__
 
24
 
 
25
/*
 
26
 * 1011 1100                program_stream_map
 
27
 * 1011 1101                private_stream_1
 
28
 * 1011 1110                padding_stream
 
29
 * 1011 1111                private_stream_2
 
30
 * 110x xxxx                ISO/IEC 13818-3 or ISO/IEC 11172-3 audio stream number x xxxx
 
31
 * 1110 xxxx                ITU-T Rec. H.262 | ISO/IEC 13818-2 or ISO/IEC 11172-2 video stream number xxxx
 
32
 * 1111 0000                ECM_stream
 
33
 * 1111 0001                EMM_stream
 
34
 * 1111 0010                ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Annex A or ISO/IEC 13818-6_DSMCC_stream
 
35
 * 1111 0011                ISO/IEC_13522_stream
 
36
 * 1111 0100                ITU-T Rec. H.222.1 type A
 
37
 * 1111 0101                ITU-T Rec. H.222.1 type B
 
38
 * 1111 0110                ITU-T Rec. H.222.1 type C
 
39
 * 1111 0111                ITU-T Rec. H.222.1 type D
 
40
 * 1111 1000                ITU-T Rec. H.222.1 type E
 
41
 * 1111 1001                ancillary_stream
 
42
 * 1111 1010 E 1111 1110    reserved data stream
 
43
 * 1111 1111                program_stream_directory
 
44
 */
 
45
 
 
46
#define ID_PS_END_CODE                          0x000001B9
 
47
#define ID_PS_PACK_START_CODE                   0x000001BA
 
48
#define ID_PS_SYSTEM_HEADER_START_CODE          0x000001BB
 
49
#define ID_PS_PROGRAM_STREAM_MAP                0x000001BC
 
50
#define ID_PRIVATE_STREAM_1                     0x000001BD
 
51
#define ID_PADDING_STREAM                       0x000001BE
 
52
#define ID_PRIVATE_STREAM_2                     0x000001BF
 
53
#define ID_ISO_IEC_MPEG12_AUDIO_STREAM_0        0x000001C0
 
54
#define ID_ISO_IEC_MPEG12_AUDIO_STREAM_32       0x000001DF
 
55
#define ID_ISO_IEC_MPEG12_VIDEO_STREAM_0        0x000001E0
 
56
#define ID_ISO_IEC_MPEG12_VIDEO_STREAM_16       0x000001EF
 
57
#define ID_ECM_STREAM                           0x000001F0
 
58
#define ID_EMM_STREAM                           0x000001F1
 
59
#define ID_DSMCC_STREAM                         0x000001F2
 
60
#define ID_ISO_IEC_13522_STREAM                 0x000001F3
 
61
#define ID_ITU_TREC_H222_TYPE_A_STREAM          0x000001F4
 
62
#define ID_ITU_TREC_H222_TYPE_B_STREAM          0x000001F5
 
63
#define ID_ITU_TREC_H222_TYPE_C_STREAM          0x000001F6
 
64
#define ID_ITU_TREC_H222_TYPE_D_STREAM          0x000001F7
 
65
#define ID_ITU_TREC_H222_TYPE_E_STREAM          0x000001F8
 
66
#define ID_ANCILLARY_STREAM                     0x000001F9
 
67
#define ID_RESERVED_STREAM_1                    0x000001FA
 
68
#define ID_RESERVED_STREAM_2                    0x000001FB
 
69
#define ID_EXTENDED_METADATA                    0x000001FC
 
70
#define ID_EXTENDED_STREAM_ID                   0x000001FD
 
71
#define ID_RESERVED_STREAM_3                    0x000001FE
 
72
#define ID_PROGRAM_STREAM_DIRECTORY             0x000001FF
 
73
 
 
74
#define PACKET_VIDEO_START_CODE                 0x000001E0
 
75
#define PACKET_AUDIO_START_CODE                 0x000001C0
 
76
#define PICTURE_START_CODE                      0x00000100
 
77
#define USER_DATA_START_CODE                    0x000001B2
 
78
#define SEQUENCE_HEADER_CODE                    0x000001B3
 
79
#define SEQUENCE_ERROR_CODE                     0x000001B4
 
80
#define EXTENSION_START_CODE                    0x000001B5
 
81
#define SEQUENCE_END_CODE                       0x000001B7
 
82
#define GROUP_START_CODE                        0x000001B8
 
83
 
 
84
#define AC3_SYNC_WORD                           0x0b770000
 
85
 
 
86
#define MPEG_TS_SYNC_BYTE                       0x00000047
 
87
 
 
88
#define PID_PROGRAM_ASSOCIATION_TABLE          0x0000
 
89
#define PID_CONDITIONAL_ACCESS_TABLE           0x0001
 
90
#define PID_RESERVED_FIRST                     0x0002
 
91
#define PID_RESERVED_LAST                      0x0010
 
92
#define PID_NULL_PACKET                        0x1FFF
 
93
 
 
94
#define PID_TYPE_UNKNOWN                        0
 
95
#define PID_TYPE_RESERVED                       1
 
96
#define PID_TYPE_PROGRAM_ASSOCIATION            2
 
97
#define PID_TYPE_CONDITIONAL_ACCESS             3
 
98
#define PID_TYPE_PROGRAM_MAP                    4
 
99
#define PID_TYPE_ELEMENTARY                     5
 
100
#define PID_TYPE_NULL_PACKET                    6
 
101
#define PID_TYPE_PRIVATE_SECTION                7
 
102
 
 
103
/* Stream type assignments
 
104
 * 
 
105
 *   0x00    ITU-T | ISO/IEC Reserved
 
106
 *   0x01    ISO/IEC 11172 Video
 
107
 *   0x02    ITU-T Rec. H.262 | ISO/IEC 13818-2 Video or
 
108
 *           ISO/IEC 11172-2 constrained parameter video
 
109
 *           stream
 
110
 *   0x03    ISO/IEC 11172 Audio
 
111
 *   0x04    ISO/IEC 13818-3 Audio
 
112
 *   0x05    ITU-T Rec. H.222.0 | ISO/IEC 13818-1
 
113
 *           private_sections
 
114
 *   0x06    ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES
 
115
 *           packets containing private data
 
116
 *   0x07    ISO/IEC 13522 MHEG
 
117
 *   0x08    ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Annex A
 
118
 *           DSM CC
 
119
 *   0x09    ITU-T Rec. H.222.1
 
120
 *   0x0A    ISO/IEC 13818-6 type A
 
121
 *   0x0B    ISO/IEC 13818-6 type B
 
122
 *   0x0C    ISO/IEC 13818-6 type C
 
123
 *   0x0D    ISO/IEC 13818-6 type D
 
124
 *   0x0E    ISO/IEC 13818-1 auxiliary
 
125
 * 0x0F-0x7F ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved
 
126
 * 0x80-0xFF User Private
 
127
 */
 
128
#define ST_RESERVED                     0x00
 
129
#define ST_VIDEO_MPEG1                  0x01
 
130
#define ST_VIDEO_MPEG2                  0x02
 
131
#define ST_AUDIO_MPEG1                  0x03
 
132
#define ST_AUDIO_MPEG2                  0x04
 
133
#define ST_PRIVATE_SECTIONS             0x05
 
134
#define ST_PRIVATE_DATA                 0x06
 
135
#define ST_MHEG                         0x07
 
136
#define ST_DSMCC                        0x08
 
137
#define ST_H222_1                       0x09
 
138
 
 
139
/* later extensions */
 
140
#define ST_AUDIO_AAC                    0x0f
 
141
#define ST_VIDEO_MPEG4                  0x10
 
142
#define ST_VIDEO_H264                   0x1b
 
143
 
 
144
/* Un-official Dirac extension */
 
145
#define ST_VIDEO_DIRAC                  0xd1
 
146
 
 
147
/* private stream types */
 
148
#define ST_PS_AUDIO_AC3                 0x81
 
149
#define ST_PS_AUDIO_DTS                 0x8a
 
150
#define ST_PS_AUDIO_LPCM                0x8b
 
151
#define ST_PS_DVD_SUBPICTURE            0xff
 
152
 
 
153
/* Un-official time-code stream */
 
154
#define ST_PS_TIMECODE                  0xd2
 
155
 
 
156
/* Internal stream types >= 0x100 */
 
157
#define ST_GST_AUDIO_RAWA52             0x181
 
158
  /* Used when we don't yet know which stream type it will be in a PS stream */
 
159
#define ST_GST_VIDEO_MPEG1_OR_2         0x102
 
160
 
 
161
#define CLOCK_BASE 9LL
 
162
#define CLOCK_FREQ (CLOCK_BASE * 10000)
 
163
 
 
164
#define MPEGTIME_TO_GSTTIME(time) (gst_util_uint64_scale ((time), \
 
165
            GST_MSECOND/10, CLOCK_BASE))
 
166
#define GSTTIME_TO_MPEGTIME(time) (gst_util_uint64_scale ((time), \
 
167
            CLOCK_BASE, GST_MSECOND/10))
 
168
 
 
169
#define MPEG_MUX_RATE_MULT      50
 
170
 
 
171
/* some extra GstFlowReturn values used internally */
 
172
#define GST_FLOW_NEED_MORE_DATA         -100
 
173
#define GST_FLOW_LOST_SYNC              -101
 
174
 
 
175
#endif /* __GST_MPEG_DEFS_H__ */