2007-08-09 15:42:01 +00:00
|
|
|
|
/*
|
2007-10-27 07:40:30 +00:00
|
|
|
|
* tvheadend, MPEG transport stream muxer
|
2009-11-12 23:07:02 +00:00
|
|
|
|
* Copyright (C) 2008 - 2009 Andreas <EFBFBD>man
|
2007-08-09 15:42:01 +00:00
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* 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 General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-10-27 07:40:30 +00:00
|
|
|
|
#ifndef TSMUX_H
|
|
|
|
|
#define TSMUX_H
|
2007-08-09 15:42:01 +00:00
|
|
|
|
|
2009-11-12 23:07:02 +00:00
|
|
|
|
void tsm_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
2008-01-26 12:15:34 +00:00
|
|
|
|
typedef void (ts_mux_output_t)(void *opaque, th_subscription_t *s,
|
2008-02-05 05:58:48 +00:00
|
|
|
|
uint8_t *pkt, int npackets, int64_t pcr_ref);
|
2008-01-26 12:15:34 +00:00
|
|
|
|
|
|
|
|
|
typedef struct ts_muxer {
|
|
|
|
|
th_subscription_t *ts_subscription;
|
|
|
|
|
int ts_flags;
|
|
|
|
|
#define TS_SEEK 0x1
|
|
|
|
|
#define TS_HTSCLIENT 0x2
|
|
|
|
|
|
2008-02-08 14:23:07 +00:00
|
|
|
|
enum {
|
|
|
|
|
TS_SRC_MUX,
|
|
|
|
|
TS_SRC_RAW_TS,
|
|
|
|
|
|
|
|
|
|
} ts_source;
|
|
|
|
|
|
2008-01-26 12:15:34 +00:00
|
|
|
|
th_muxer_t *ts_muxer;
|
|
|
|
|
ts_mux_output_t *ts_output;
|
|
|
|
|
void *ts_output_opaque;
|
|
|
|
|
|
|
|
|
|
int ts_pat_cc;
|
|
|
|
|
int ts_pmt_cc;
|
|
|
|
|
dtimer_t ts_patpmt_timer;
|
|
|
|
|
|
|
|
|
|
uint8_t *ts_packet;
|
|
|
|
|
int ts_block;
|
|
|
|
|
int ts_blocks_per_packet;
|
|
|
|
|
|
2008-02-05 05:58:48 +00:00
|
|
|
|
th_muxstream_t *ts_pcr_stream;
|
2008-01-26 12:15:34 +00:00
|
|
|
|
|
2008-02-05 05:58:48 +00:00
|
|
|
|
int64_t ts_pcr_start;
|
|
|
|
|
int64_t ts_pcr_ref; /* System clock when PCR was/is/will be 0 */
|
|
|
|
|
int64_t ts_pcr_last;
|
2008-01-26 12:15:34 +00:00
|
|
|
|
} ts_muxer_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ts_muxer_t *ts_muxer_init(th_subscription_t *s, ts_mux_output_t *output,
|
2008-02-05 11:27:57 +00:00
|
|
|
|
void *opaque, int flags, int corruption);
|
2007-08-09 15:42:01 +00:00
|
|
|
|
|
2008-01-26 12:15:34 +00:00
|
|
|
|
void ts_muxer_deinit(ts_muxer_t *ts, th_subscription_t *s);
|
2007-10-27 07:40:30 +00:00
|
|
|
|
|
2008-01-26 12:15:34 +00:00
|
|
|
|
void ts_muxer_play(ts_muxer_t *ts, int64_t toffset);
|
2007-10-27 07:40:30 +00:00
|
|
|
|
|
2008-01-26 12:15:34 +00:00
|
|
|
|
void ts_muxer_pause(ts_muxer_t *ts);
|
2009-11-12 23:07:02 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2007-10-27 07:40:30 +00:00
|
|
|
|
|
|
|
|
|
#endif /* TSMUX_H */
|