annotate mpegts.h @ 261:5f27f90ed496 libavformat

Fix a very nasty problem with extra bytes appearing in TCP data streams. Whenever there was an EINTR/EAGAIN return, then a byte in the data stream would be duplicated!! This fix should allow ffserver to work again.
author philipjsg
date Mon, 29 Sep 2003 01:41:30 +0000
parents e4d2f704bf80
children 155ce13f1033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
152
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
1 /*
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
2 * MPEG2 transport stream defines
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
3 * Copyright (c) 2003 Fabrice Bellard.
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
4 *
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
9 *
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
13 * Lesser General Public License for more details.
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
14 *
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
18 */
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
19
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
20 #define TS_FEC_PACKET_SIZE 204
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
21 #define TS_PACKET_SIZE 188
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
22 #define NB_PID_MAX 8192
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
23 #define MAX_SECTION_SIZE 4096
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
24
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
25 /* pids */
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
26 #define PAT_PID 0x0000
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
27 #define SDT_PID 0x0011
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
28
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
29 /* table ids */
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
30 #define PAT_TID 0x00
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
31 #define PMT_TID 0x02
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
32 #define SDT_TID 0x42
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
33
160
9bde37b1a5ce try to filter _all_ PATs if no SDT could be found patch by (<gbazin at altern dot org>)
michaelni
parents: 152
diff changeset
34 #define STREAM_TYPE_VIDEO_MPEG1 0x01
9bde37b1a5ce try to filter _all_ PATs if no SDT could be found patch by (<gbazin at altern dot org>)
michaelni
parents: 152
diff changeset
35 #define STREAM_TYPE_VIDEO_MPEG2 0x02
9bde37b1a5ce try to filter _all_ PATs if no SDT could be found patch by (<gbazin at altern dot org>)
michaelni
parents: 152
diff changeset
36 #define STREAM_TYPE_AUDIO_MPEG1 0x03
9bde37b1a5ce try to filter _all_ PATs if no SDT could be found patch by (<gbazin at altern dot org>)
michaelni
parents: 152
diff changeset
37 #define STREAM_TYPE_AUDIO_MPEG2 0x04
152
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
38 #define STREAM_TYPE_PRIVATE_SECTION 0x05
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
39 #define STREAM_TYPE_PRIVATE_DATA 0x06
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
40
165
e4d2f704bf80 - Looks a tiny bit harder in mpegps_probe() for a valid start code. This is
michaelni
parents: 160
diff changeset
41 #define STREAM_TYPE_AUDIO_AC3 0x81
e4d2f704bf80 - Looks a tiny bit harder in mpegps_probe() for a valid start code. This is
michaelni
parents: 160
diff changeset
42
152
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
43 unsigned int mpegts_crc32(const uint8_t *data, int len);
cc03a75cbde4 mpeg ts demux uses DVB SI info and generates correct PTS info - added prototype mpeg ts mux
bellard
parents:
diff changeset
44 extern AVOutputFormat mpegts_mux;