libdvbv5  1.10.1
Library to work with Digital TV devices on Linux
mpeg_es.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 - Andre Roth <neolynx@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation version 2
7  * of the License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18  *
19  */
20 
21 #ifndef _MPEG_ES_H
22 #define _MPEG_ES_H
23 
41 #include <stdint.h>
42 #include <unistd.h> /* ssize_t */
43 
64 #define DVB_MPEG_ES_PIC_START 0x00
65 #define DVB_MPEG_ES_USER_DATA 0xb2
66 #define DVB_MPEG_ES_SEQ_START 0xb3
67 #define DVB_MPEG_ES_SEQ_EXT 0xb5
68 #define DVB_MPEG_ES_GOP 0xb8
69 #define DVB_MPEG_ES_SLICES 0x01 ... 0xaf
70 
90  union {
91  uint32_t bitfield;
92  struct {
93  uint32_t type:8;
94  uint32_t sync:24;
95  } __attribute__((packed));
96  } __attribute__((packed));
97  union {
98  uint32_t bitfield2;
99  struct {
100  uint32_t framerate:4;
101  uint32_t aspect:4;
102  uint32_t height:12;
103  uint32_t width:12;
104  } __attribute__((packed));
105  } __attribute__((packed));
106  union {
107  uint32_t bitfield3;
108  struct {
109  uint32_t qm_nonintra:1;
110  uint32_t qm_intra:1;
111  uint32_t constrained:1;
112  uint32_t vbv:10; // Size of video buffer verifier = 16*1024*vbv buf size
113  uint32_t one:1;
114  uint32_t bitrate:18;
115  } __attribute__((packed));
116  } __attribute__((packed));
117 } __attribute__((packed));
118 
132  union {
133  uint32_t bitfield;
134  struct {
135  uint32_t type:8;
136  uint32_t sync:24;
137  } __attribute__((packed));
138  } __attribute__((packed));
139  union {
140  uint32_t bitfield2;
141  struct {
142  uint32_t dummy:3;
143  uint32_t vbv_delay:16;
144  uint32_t coding_type:3;
145  uint32_t temporal_ref:10;
146  } __attribute__((packed));
147  } __attribute__((packed));
148 } __attribute__((packed));
149 
167 {
173 };
174 
179 extern const char *dvb_mpeg_es_frame_names[5];
180 
181 struct dvb_v5_fe_parms;
182 
183 #ifdef __cplusplus
184 extern "C" {
185 #endif
186 
201 int dvb_mpeg_es_seq_start_init (const uint8_t *buf, ssize_t buflen,
202  struct dvb_mpeg_es_seq_start *seq_start);
203 
214  struct dvb_mpeg_es_seq_start *seq_start);
215 
230 int dvb_mpeg_es_pic_start_init (const uint8_t *buf, ssize_t buflen,
231  struct dvb_mpeg_es_pic_start *pic_start);
232 
243  struct dvb_mpeg_es_pic_start *pic_start);
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
249 #endif
uint32_t bitfield2
Definition: mpeg_es.h:140
int dvb_mpeg_es_pic_start_init(const uint8_t *buf, ssize_t buflen, struct dvb_mpeg_es_pic_start *pic_start)
Initialize a struct dvb_mpeg_es_pic_start from buffer.
uint32_t bitfield
Definition: mpeg_es.h:91
uint32_t qm_nonintra
Definition: mpeg_es.h:109
uint32_t constrained
Definition: mpeg_es.h:111
int dvb_mpeg_es_seq_start_init(const uint8_t *buf, ssize_t buflen, struct dvb_mpeg_es_seq_start *seq_start)
Initialize a struct dvb_mpeg_es_seq_start from buffer.
MPEG ES Picture start header.
Definition: mpeg_es.h:131
uint32_t framerate
Definition: mpeg_es.h:100
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:118
Unknown frame.
Definition: mpeg_es.h:168
void dvb_mpeg_es_pic_start_print(struct dvb_v5_fe_parms *parms, struct dvb_mpeg_es_pic_start *pic_start)
Print details of struct dvb_mpeg_es_pic_start.
MPEG ES Sequence header.
Definition: mpeg_es.h:89
const char * dvb_mpeg_es_frame_names[5]
Vector that translates from enum dvb_mpeg_es_frame_t to string.
uint32_t bitfield3
Definition: mpeg_es.h:107
void dvb_mpeg_es_seq_start_print(struct dvb_v5_fe_parms *parms, struct dvb_mpeg_es_seq_start *seq_start)
Print details of struct dvb_mpeg_es_seq_start.
dvb_mpeg_es_frame_t
MPEG frame types.
Definition: mpeg_es.h:166
uint32_t bitfield2
Definition: mpeg_es.h:98