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 <stdint.h>
31 #include "ringbuffer.h"
32 
33 
34 
35 typedef struct index_unit_s{
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 } index_unit;
53 
54 typedef struct extdata_s{
56  uint64_t pts;
57  uint64_t pts_off;
58  int type;
59  int strmnum;
60  int frmperpkt;
61  char language[4];
63 } extdata_t;
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_*/
uint64_t pts_off
Definition: mpg_common.h:57
uint32_t length
Definition: mpg_common.h:37
uint64_t dts
Definition: mpg_common.h:40
uint8_t gop_off
Definition: mpg_common.h:46
int mring_peek(ringbuffer *rbuf, uint8_t *buf, unsigned int l, uint32_t off)
Definition: mpg_common.c:170
int find_any_header(uint8_t *head, const uint8_t *buf, int length)
Definition: mpg_common.c:116
uint64_t ptsrate
Definition: mpg_common.h:51
int type
Definition: mpg_common.h:58
uint8_t end_seq
Definition: mpg_common.h:44
uint64_t pts
Definition: mpg_common.h:39
struct extdata_s extdata_t
int find_mpg_header(uint8_t head, const uint8_t *buf, int length)
Definition: mpg_common.c:80
uint32_t start
Definition: mpg_common.h:38
struct index_unit_s index_unit
uint8_t seq_header
Definition: mpg_common.h:41
int ring_find_any_header(ringbuffer *rbuf, uint8_t *head, int off, int le)
Definition: mpg_common.c:222
uint64_t pts
Definition: mpg_common.h:56
void show_buf(uint8_t *buf, int length)
Definition: mpg_common.c:37
uint8_t frame_start
Definition: mpg_common.h:48
uint8_t frame
Definition: mpg_common.h:45
uint8_t seq_end
Definition: mpg_common.h:42
uint8_t gop
Definition: mpg_common.h:43
char language[4]
Definition: mpg_common.h:61
int frmperpkt
Definition: mpg_common.h:60
int strmnum
Definition: mpg_common.h:59
index_unit iu
Definition: mpg_common.h:55
int ring_find_mpg_header(ringbuffer *rbuf, uint8_t head, int off, int le)
Definition: mpg_common.c:183
uint8_t active
Definition: mpg_common.h:36
uint64_t trans_pts_dts(const uint8_t *pts)
Definition: mpg_common.c:152
uint32_t framesize
Definition: mpg_common.h:50
uint8_t err
Definition: mpg_common.h:49
uint8_t frame_off
Definition: mpg_common.h:47
dummy_buffer dbuf
Definition: mpg_common.h:62