libdvbv5 1.26.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 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{
173
178extern const char *dvb_mpeg_es_frame_names[5];
179
180struct dvb_v5_fe_parms;
181
182#ifdef __cplusplus
183extern "C" {
184#endif
185
200int 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
229int 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
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.
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.
const char * dvb_mpeg_es_frame_names[5]
Vector that translates from enum dvb_mpeg_es_frame_t to string.
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.
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.
dvb_mpeg_es_frame_t
Definition mpeg_es.h:166
@ DVB_MPEG_ES_FRAME_D
D frame.
Definition mpeg_es.h:171
@ DVB_MPEG_ES_FRAME_I
I frame.
Definition mpeg_es.h:168
@ DVB_MPEG_ES_FRAME_UNKNOWN
Unknown frame.
Definition mpeg_es.h:167
@ DVB_MPEG_ES_FRAME_B
B frame.
Definition mpeg_es.h:170
@ DVB_MPEG_ES_FRAME_P
P frame.
Definition mpeg_es.h:169
MPEG ES Picture start header.
Definition mpeg_es.h:130
uint32_t temporal_ref
Definition mpeg_es.h:144
MPEG ES Sequence header.
Definition mpeg_es.h:88
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117