mpeg_es.h
Go to the documentation of this file.
/*
* Copyright (c) 2013-2014 - Andre Roth <neolynx@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation version 2.1 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
*/
#ifndef _MPEG_ES_H
#define _MPEG_ES_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#define DVB_MPEG_ES_PIC_START 0x00
#define DVB_MPEG_ES_USER_DATA 0xb2
#define DVB_MPEG_ES_SEQ_START 0xb3
#define DVB_MPEG_ES_SEQ_EXT 0xb5
#define DVB_MPEG_ES_GOP 0xb8
#define DVB_MPEG_ES_SLICES 0x01 ... 0xaf
struct dvb_mpeg_es_seq_start {
union {
uint32_t bitfield;
struct {
uint32_t type:8;
uint32_t sync:24;
} __attribute__((packed));
} __attribute__((packed));
union {
uint32_t bitfield2;
struct {
uint32_t framerate:4;
uint32_t aspect:4;
uint32_t height:12;
uint32_t width:12;
} __attribute__((packed));
} __attribute__((packed));
union {
uint32_t bitfield3;
struct {
uint32_t qm_nonintra:1;
uint32_t qm_intra:1;
uint32_t constrained:1;
uint32_t vbv:10; // Size of video buffer verifier = 16*1024*vbv buf size
uint32_t one:1;
uint32_t bitrate:18;
} __attribute__((packed));
} __attribute__((packed));
} __attribute__((packed));
struct dvb_mpeg_es_pic_start {
union {
uint32_t bitfield;
struct {
uint32_t type:8;
uint32_t sync:24;
} __attribute__((packed));
} __attribute__((packed));
union {
uint32_t bitfield2;
struct {
uint32_t dummy:3;
uint32_t vbv_delay:16;
uint32_t coding_type:3;
uint32_t temporal_ref:10;
} __attribute__((packed));
} __attribute__((packed));
} __attribute__((packed));
enum dvb_mpeg_es_frame_t
{
DVB_MPEG_ES_FRAME_UNKNOWN,
DVB_MPEG_ES_FRAME_I,
DVB_MPEG_ES_FRAME_P,
DVB_MPEG_ES_FRAME_B,
DVB_MPEG_ES_FRAME_D
};
extern const char *dvb_mpeg_es_frame_names[5];
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
int dvb_mpeg_es_seq_start_init (const uint8_t *buf, ssize_t buflen,
struct dvb_mpeg_es_seq_start *seq_start);
void dvb_mpeg_es_seq_start_print(struct dvb_v5_fe_parms *parms,
struct dvb_mpeg_es_seq_start *seq_start);
int dvb_mpeg_es_pic_start_init (const uint8_t *buf, ssize_t buflen,
struct dvb_mpeg_es_pic_start *pic_start);
void dvb_mpeg_es_pic_start_print(struct dvb_v5_fe_parms *parms,
struct dvb_mpeg_es_pic_start *pic_start);
#ifdef __cplusplus
}
#endif
#endif
dvb_mpeg_es_seq_start_print
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_seq_start_init
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.
dvb_mpeg_es_frame_t
dvb_mpeg_es_frame_t
MPEG frame types.
Definition mpeg_es.h:166
dvb_mpeg_es_frame_names
const char * dvb_mpeg_es_frame_names[5]
Vector that translates from enum dvb_mpeg_es_frame_t to string.
dvb_mpeg_es_pic_start_init
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.
dvb_mpeg_es_pic_start_print
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_P
@ DVB_MPEG_ES_FRAME_P
P frame.
Definition mpeg_es.h:169
DVB_MPEG_ES_FRAME_B
@ DVB_MPEG_ES_FRAME_B
B frame.
Definition mpeg_es.h:170
DVB_MPEG_ES_FRAME_UNKNOWN
@ DVB_MPEG_ES_FRAME_UNKNOWN
Unknown frame.
Definition mpeg_es.h:167
DVB_MPEG_ES_FRAME_I
@ DVB_MPEG_ES_FRAME_I
I frame.
Definition mpeg_es.h:168
DVB_MPEG_ES_FRAME_D
@ DVB_MPEG_ES_FRAME_D
D frame.
Definition mpeg_es.h:171
dvb_mpeg_es_pic_start
MPEG ES Picture start header.
Definition mpeg_es.h:130
dvb_mpeg_es_pic_start::temporal_ref
uint32_t temporal_ref
Definition mpeg_es.h:144
dvb_mpeg_es_pic_start::bitfield2
uint32_t bitfield2
Definition mpeg_es.h:139
dvb_mpeg_es_pic_start::sync
uint32_t sync
Definition mpeg_es.h:135
dvb_mpeg_es_pic_start::dummy
uint32_t dummy
Definition mpeg_es.h:141
dvb_mpeg_es_pic_start::type
uint32_t type
Definition mpeg_es.h:134
dvb_mpeg_es_pic_start::bitfield
uint32_t bitfield
Definition mpeg_es.h:132
dvb_mpeg_es_pic_start::vbv_delay
uint32_t vbv_delay
Definition mpeg_es.h:142
dvb_mpeg_es_pic_start::coding_type
uint32_t coding_type
Definition mpeg_es.h:143
dvb_mpeg_es_seq_start
MPEG ES Sequence header.
Definition mpeg_es.h:88
dvb_mpeg_es_seq_start::aspect
uint32_t aspect
Definition mpeg_es.h:100
dvb_mpeg_es_seq_start::qm_nonintra
uint32_t qm_nonintra
Definition mpeg_es.h:108
dvb_mpeg_es_seq_start::bitfield3
uint32_t bitfield3
Definition mpeg_es.h:106
dvb_mpeg_es_seq_start::height
uint32_t height
Definition mpeg_es.h:101
dvb_mpeg_es_seq_start::constrained
uint32_t constrained
Definition mpeg_es.h:110
dvb_mpeg_es_seq_start::framerate
uint32_t framerate
Definition mpeg_es.h:99
dvb_mpeg_es_seq_start::bitfield
uint32_t bitfield
Definition mpeg_es.h:90
dvb_mpeg_es_seq_start::one
uint32_t one
Definition mpeg_es.h:112
dvb_mpeg_es_seq_start::bitrate
uint32_t bitrate
Definition mpeg_es.h:113
dvb_mpeg_es_seq_start::width
uint32_t width
Definition mpeg_es.h:102
dvb_mpeg_es_seq_start::qm_intra
uint32_t qm_intra
Definition mpeg_es.h:109
dvb_mpeg_es_seq_start::bitfield2
uint32_t bitfield2
Definition mpeg_es.h:97
dvb_mpeg_es_seq_start::type
uint32_t type
Definition mpeg_es.h:92
dvb_mpeg_es_seq_start::vbv
uint32_t vbv
Definition mpeg_es.h:111
dvb_mpeg_es_seq_start::sync
uint32_t sync
Definition mpeg_es.h:93
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117