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 
35 struct 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 
54 struct extdata_t {
56  uint64_t pts;
57  uint64_t pts_off;
58  int type;
59  int strmnum;
60  int frmperpkt;
61  char language[4];
63 };
64 
65 
66 #define NO_ERR 0
67 #define FRAME_ERR 1
68 
69 
70 void show_buf(uint8_t *buf, int length);
71 int find_mpg_header(uint8_t head, const uint8_t *buf, int length);
72 int find_any_header(uint8_t *head, const uint8_t *buf, int length);
73 uint64_t trans_pts_dts(const uint8_t *pts);
74 int mring_peek( ringbuffer *rbuf, uint8_t *buf, unsigned int l, uint32_t off);
75 int ring_find_mpg_header(ringbuffer *rbuf, uint8_t head, int off, int le);
76 int ring_find_any_header(ringbuffer *rbuf, uint8_t *head, int off, int le);
77 
78 #endif /* MPG_COMMON_H */
uint8_t err
Definition: mpg_common.h:49
uint8_t end_seq
Definition: mpg_common.h:44
int mring_peek(ringbuffer *rbuf, uint8_t *buf, unsigned int l, uint32_t off)
Definition: mpg_common.cpp:168
int find_any_header(uint8_t *head, const uint8_t *buf, int length)
Definition: mpg_common.cpp:116
uint32_t framesize
Definition: mpg_common.h:50
int find_mpg_header(uint8_t head, const uint8_t *buf, int length)
Definition: mpg_common.cpp:80
int strmnum
Definition: mpg_common.h:59
uint8_t seq_header
Definition: mpg_common.h:41
index_unit iu
Definition: mpg_common.h:55
uint8_t gop_off
Definition: mpg_common.h:46
char language[4]
Definition: mpg_common.h:61
uint32_t start
Definition: mpg_common.h:38
int ring_find_any_header(ringbuffer *rbuf, uint8_t *head, int off, int le)
Definition: mpg_common.cpp:220
uint8_t frame
Definition: mpg_common.h:45
void show_buf(uint8_t *buf, int length)
Definition: mpg_common.cpp:37
int frmperpkt
Definition: mpg_common.h:60
uint64_t ptsrate
Definition: mpg_common.h:51
uint8_t active
Definition: mpg_common.h:36
uint8_t frame_start
Definition: mpg_common.h:48
dummy_buffer dbuf
Definition: mpg_common.h:62
int ring_find_mpg_header(ringbuffer *rbuf, uint8_t head, int off, int le)
Definition: mpg_common.cpp:181
uint64_t trans_pts_dts(const uint8_t *pts)
Definition: mpg_common.cpp:152
uint64_t pts
Definition: mpg_common.h:56
uint8_t frame_off
Definition: mpg_common.h:47
uint64_t dts
Definition: mpg_common.h:40
uint32_t length
Definition: mpg_common.h:37
uint64_t pts_off
Definition: mpg_common.h:57
uint8_t gop
Definition: mpg_common.h:43
uint8_t seq_end
Definition: mpg_common.h:42
uint64_t pts
Definition: mpg_common.h:39
int type
Definition: mpg_common.h:58