Debian Codegraph @

src/tsbuffer.h

raw
1 /*
2 * libiec61883 - Linux IEEE 1394 streaming media library.
3 * Copyright (C) 2004 Kristian Hogsberg, Dan Dennedy, and Dan Maas.
4 * This file orginially written in C++ by Dan Maas; ported to C by Dan Dennedy.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef _TSBUFFER_H
22 #define _TSBUFFER_H
23
24 #include "iec61883.h"
25
26 struct tsbuffer;
27 typedef struct tsbuffer* tsbuffer_t;
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 tsbuffer_t
34 tsbuffer_init (iec61883_mpeg2_xmit_t read_cb, void *callback_data, int pid);
35
36 void
37 tsbuffer_close (tsbuffer_t self);
38
39 void
40 tsbuffer_set_pid (tsbuffer_t self, int pid);
41
42 // read one MPEG-2 TS packet from the input fd
43 // and stick it on the end of ts_queue
44 int
45 tsbuffer_read_ts (tsbuffer_t self);
46
47 // read packets into ts_queue until we find one with a PCR
48 int
49 tsbuffer_read_to_next_pcr (tsbuffer_t self);
50
51 // refill the queue and update timestamper state
52 int
53 tsbuffer_refill (tsbuffer_t self);
54
55 // output one ISO cycle's worth of packets
56 // returns the total length of the ISO data
57 unsigned int tsbuffer_send_iso_cycle (tsbuffer_t self, void *data,
58 unsigned int iso_cycle, unsigned char src_node_id, unsigned int dropped);
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64 #endif /* _TSBUFFER_H */