MythTV master
mpg_common.h
Go to the documentation of this file.
1/*
2 * mpg_common.h
3 *
4 *
5 * Copyright (C) 2003 Marcus Metzler <mocm@metzlerbros.de>
6 * Metzler Brothers Systementwicklung GbR
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * General Public License for more details.
18 *
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
24 *
25 */
26
27#ifndef MPG_COMMON_H
28#define MPG_COMMON_H
29
30#include <cstdint>
31#include "ringbuffer.h"
32
33
34
35struct index_unit {
36 uint8_t active;
37 uint32_t length;
38 uint32_t start;
39 uint64_t pts;
40 uint64_t dts;
41 uint8_t seq_header;
42 uint8_t seq_end;
43 uint8_t gop;
44 uint8_t end_seq;
45 uint8_t frame;
46 uint8_t gop_off;
47 uint8_t frame_off;
48 uint8_t frame_start;
49 uint8_t err;
50 uint32_t framesize;
51 uint64_t ptsrate;
52};
53
54struct extdata_t {
56 uint64_t pts;
57 uint64_t pts_off;
58 int type;
61 char language[4];
63};
64
65
66#define NO_ERR 0
67#define FRAME_ERR 1
68
69
70void show_buf(uint8_t *buf, int length);
71int find_mpg_header(uint8_t head, const uint8_t *buf, int length);
72int find_any_header(uint8_t *head, const uint8_t *buf, int length);
73uint64_t trans_pts_dts(const uint8_t *pts);
74int mring_peek( ringbuffer *rbuf, uint8_t *buf, unsigned int l, uint32_t off);
75int mring_peek( ringbuffer *rbuf, peek_poke_vec &buf, unsigned int l, uint32_t off);
76int ring_find_mpg_header(ringbuffer *rbuf, uint8_t head, int off, int le);
77int ring_find_any_header(ringbuffer *rbuf, uint8_t *head, int off, int le);
78
79#endif /* MPG_COMMON_H */
void show_buf(uint8_t *buf, int length)
Definition: mpg_common.cpp:37
int mring_peek(ringbuffer *rbuf, uint8_t *buf, unsigned int l, uint32_t off)
Definition: mpg_common.cpp:159
int ring_find_any_header(ringbuffer *rbuf, uint8_t *head, int off, int le)
Definition: mpg_common.cpp:216
int find_any_header(uint8_t *head, const uint8_t *buf, int length)
Definition: mpg_common.cpp:107
int ring_find_mpg_header(ringbuffer *rbuf, uint8_t head, int off, int le)
Definition: mpg_common.cpp:177
uint64_t trans_pts_dts(const uint8_t *pts)
Definition: mpg_common.cpp:143
int find_mpg_header(uint8_t head, const uint8_t *buf, int length)
Definition: mpg_common.cpp:71
std::chrono::duration< CHRONO_TYPE, std::ratio< 1, 90000 > > pts
Definition: mythchrono.h:55
std::vector< uint8_t > peek_poke_vec
Definition: ringbuffer.h:35
int type
Definition: mpg_common.h:58
uint64_t pts_off
Definition: mpg_common.h:57
int strmnum
Definition: mpg_common.h:59
int frmperpkt
Definition: mpg_common.h:60
dummy_buffer dbuf
Definition: mpg_common.h:62
uint64_t pts
Definition: mpg_common.h:56
index_unit iu
Definition: mpg_common.h:55
char language[4]
Definition: mpg_common.h:61
uint64_t ptsrate
Definition: mpg_common.h:51
uint32_t framesize
Definition: mpg_common.h:50
uint32_t start
Definition: mpg_common.h:38
uint8_t seq_header
Definition: mpg_common.h:41
uint64_t pts
Definition: mpg_common.h:39
uint8_t gop
Definition: mpg_common.h:43
uint8_t frame
Definition: mpg_common.h:45
uint8_t gop_off
Definition: mpg_common.h:46
uint8_t err
Definition: mpg_common.h:49
uint64_t dts
Definition: mpg_common.h:40
uint8_t end_seq
Definition: mpg_common.h:44
uint8_t seq_end
Definition: mpg_common.h:42
uint8_t active
Definition: mpg_common.h:36
uint8_t frame_off
Definition: mpg_common.h:47
uint32_t length
Definition: mpg_common.h:37
uint8_t frame_start
Definition: mpg_common.h:48