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