Go to the source code of this file.
Classes | |
| struct | dvb_caption_info_t |
| struct | pmt_entry_t |
| struct | MpegTSPESFilter |
| struct | MpegTSSectionFilter |
| struct | MpegTSFilter |
| struct | MpegTSService |
| struct | MpegTSContext |
| struct | PESContext |
| struct | SectionContext |
| struct | SectionHeader |
Typedefs | |
| typedef struct PESContext | PESContext |
| typedef struct SectionContext | SectionContext |
| typedef void | PESCallback (void *opaque, const uint8_t *buf, int len, int is_start, int64_t startpos) |
| typedef void | SectionCallback (void *opaque, const uint8_t *buf, int len) |
| typedef void | SetServiceCallback (void *opaque, int ret) |
Enumerations | |
| enum | MpegTSFilterType { MPEGTS_PES, MPEGTS_SECTION } |
| enum | MpegTSState { MPEGTS_HEADER = 0, MPEGTS_PESHEADER_FILL, MPEGTS_PAYLOAD, MPEGTS_SKIP } |
Functions | |
| static PESContext * | add_pes_stream (MpegTSContext *ts, int pid, int stream_type) |
| static AVStream * | new_pes_av_stream (PESContext *pes, uint32_t code) |
| static AVStream * | new_section_av_stream (SectionContext *sect, uint32_t code) |
| static SectionContext * | add_section_stream (MpegTSContext *ts, int pid, int stream_type) |
| static void | mpegts_cleanup_streams (MpegTSContext *ts) |
| static int | is_desired_stream (int type) |
| static int | find_in_list (const int *pids, int pid) |
| static int | mpegts_parse_desc (dvb_caption_info_t *dvbci, uint8_t **p, uint8_t *p_end, int *stream_type) |
| static int | is_pat_same (MpegTSContext *mpegts_ctx, int *pmt_pnums, int *pmts_pids, uint pmt_count) |
| static void | mpegts_add_stream (MpegTSContext *ts, pmt_entry_t *item) |
| static int | is_pmt_same (MpegTSContext *mpegts_ctx, pmt_entry_t *items, int item_cnt) |
| static void | mpegts_close_filter (MpegTSContext *ts, MpegTSFilter *filter) |
| static void | write_section_data (AVFormatContext *s, MpegTSFilter *tss1, const uint8_t *buf, int buf_size, int is_start) |
| Assembles PES packets out of TS packets, and then calls the "section_cb" function when they are complete. | |
| MpegTSFilter * | mpegts_open_section_filter (MpegTSContext *ts, unsigned int pid, SectionCallback *section_cb, void *opaque, int check_crc) |
| MpegTSFilter * | mpegts_open_pes_filter (MpegTSContext *ts, unsigned int pid, PESCallback *pes_cb, void *opaque) |
| static int | analyze (const uint8_t *buf, int size, int packet_size, int *index) |
| static int | get_packet_size (const uint8_t *buf, int size) |
| static int | get8 (const uint8_t **pp, const uint8_t *p_end) |
| static int | get16 (const uint8_t **pp, const uint8_t *p_end) |
| static char * | getstr8 (const uint8_t **pp, const uint8_t *p_end) |
| static int | parse_section_header (SectionHeader *h, const uint8_t **pp, const uint8_t *p_end) |
| static MpegTSService * | new_service (MpegTSContext *ts, int sid, int pid, char *provider_name, char *name) |
| static int | mpegts_parse_program_info_length (uint8_t **p, uint8_t *p_end) |
| static int | mpegts_parse_pcrpid (MpegTSContext *mpegts_ctx, uint8_t **p, uint8_t *p_end) |
| static void | pmt_cb (void *opaque, const uint8_t *section, int section_len) |
| void | mpegts_remove_stream (MpegTSContext *ts, int pid) |
| static void | pat_cb (void *opaque, const uint8_t *section, int section_len) |
| static void | pat_scan_cb (void *opaque, const uint8_t *section, int section_len) |
| static void | sdt_cb (void *opaque, const uint8_t *section, int section_len) |
| void | mpegts_scan_sdt (MpegTSContext *ts) |
| void | mpegts_scan_pat (MpegTSContext *ts) |
| static int64_t | get_pts (const uint8_t *p) |
| static void | init_stream (AVStream *st, int stream_type, int code) |
| static void | mpegts_push_data (void *opaque, const uint8_t *buf, int buf_size, int is_start, int64_t position) |
| static void | mpegts_push_section (void *opaque, const uint8_t *section, int section_len) |
| static void | handle_packet (MpegTSContext *ts, const uint8_t *packet, int64_t position) |
| static int | mpegts_resync (ByteIOContext *pb) |
| static int | read_packet (ByteIOContext *pb, uint8_t *buf, int raw_packet_size, int64_t *position) |
| static int | handle_packets (MpegTSContext *ts, int nb_packets) |
| static int | mpegts_probe (AVProbeData *p) |
| static void | set_service_cb (void *opaque, int ret) |
| static int | parse_pcr (int64_t *ppcr_high, int *ppcr_low, const uint8_t *packet) |
| static int | mpegts_read_header (AVFormatContext *s, AVFormatParameters *ap) |
| static int | mpegts_raw_read_packet (AVFormatContext *s, AVPacket *pkt) |
| static int | mpegts_read_packet (AVFormatContext *s, AVPacket *pkt) |
| static int | mpegts_read_close (AVFormatContext *s) |
| static int64_t | mpegts_get_pcr (AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit) |
| static int | read_seek (AVFormatContext *s, int stream_index, int64_t target_ts, int flags) |
| MpegTSContext * | mpegts_parse_open (AVFormatContext *s) |
| int | mpegts_parse_packet (MpegTSContext *ts, AVPacket *pkt, const uint8_t *buf, int len) |
| void | mpegts_parse_close (MpegTSContext *ts) |
Variables | |
| pthread_mutex_t | avcodeclock |
| AVInputFormat | mpegts_demuxer |
| typedef struct PESContext PESContext |
| typedef struct SectionContext SectionContext |
| typedef void PESCallback(void *opaque, const uint8_t *buf, int len, int is_start, int64_t startpos) |
| typedef void SectionCallback(void *opaque, const uint8_t *buf, int len) |
| typedef void SetServiceCallback(void *opaque, int ret) |
| enum MpegTSFilterType |
| enum MpegTSState |
| static PESContext * add_pes_stream | ( | MpegTSContext * | ts, | |
| int | pid, | |||
| int | stream_type | |||
| ) | [static] |
| static AVStream * new_pes_av_stream | ( | PESContext * | pes, | |
| uint32_t | code | |||
| ) | [static] |
Definition at line 1476 of file mpegts.c.
Referenced by mpegts_add_stream(), and mpegts_push_data().
| static AVStream * new_section_av_stream | ( | SectionContext * | sect, | |
| uint32_t | code | |||
| ) | [static] |
| static SectionContext * add_section_stream | ( | MpegTSContext * | ts, | |
| int | pid, | |||
| int | stream_type | |||
| ) | [static] |
| static void mpegts_cleanup_streams | ( | MpegTSContext * | ts | ) | [static] |
| static int is_desired_stream | ( | int | type | ) | [static] |
| static int find_in_list | ( | const int * | pids, | |
| int | pid | |||
| ) | [static] |
| static int mpegts_parse_desc | ( | dvb_caption_info_t * | dvbci, | |
| uint8_t ** | p, | |||
| uint8_t * | p_end, | |||
| int * | stream_type | |||
| ) | [static] |
| static int is_pat_same | ( | MpegTSContext * | mpegts_ctx, | |
| int * | pmt_pnums, | |||
| int * | pmts_pids, | |||
| uint | pmt_count | |||
| ) | [static] |
| static void mpegts_add_stream | ( | MpegTSContext * | ts, | |
| pmt_entry_t * | item | |||
| ) | [static] |
| static int is_pmt_same | ( | MpegTSContext * | mpegts_ctx, | |
| pmt_entry_t * | items, | |||
| int | item_cnt | |||
| ) | [static] |
| void mpegts_close_filter | ( | MpegTSContext * | ts, | |
| MpegTSFilter * | filter | |||
| ) | [static] |
Definition at line 363 of file mpegts.c.
Referenced by add_pes_stream(), add_section_stream(), mpegts_open_section_filter(), mpegts_read_close(), mpegts_remove_stream(), pat_cb(), pat_scan_cb(), and sdt_cb().
| write_section_data | ( | AVFormatContext * | s, | |
| MpegTSFilter * | tss1, | |||
| const uint8_t * | buf, | |||
| int | buf_size, | |||
| int | is_start | |||
| ) | [static] |
Assembles PES packets out of TS packets, and then calls the "section_cb" function when they are complete.
NOTE: "DVB Section" is DVB terminology for an MPEG PES packet.
Definition at line 253 of file mpegts.c.
Referenced by handle_packet().
| MpegTSFilter* mpegts_open_section_filter | ( | MpegTSContext * | ts, | |
| unsigned int | pid, | |||
| SectionCallback * | section_cb, | |||
| void * | opaque, | |||
| int | check_crc | |||
| ) |
Definition at line 301 of file mpegts.c.
Referenced by add_section_stream(), handle_packet(), mpegts_read_header(), mpegts_scan_pat(), mpegts_scan_sdt(), and pat_cb().
| MpegTSFilter* mpegts_open_pes_filter | ( | MpegTSContext * | ts, | |
| unsigned int | pid, | |||
| PESCallback * | pes_cb, | |||
| void * | opaque | |||
| ) |
| static int analyze | ( | const uint8_t * | buf, | |
| int | size, | |||
| int | packet_size, | |||
| int * | index | |||
| ) | [static] |
Definition at line 395 of file mpegts.c.
Referenced by get_packet_size(), main(), and mpegts_probe().
| static int get_packet_size | ( | const uint8_t * | buf, | |
| int | size | |||
| ) | [static] |
| static int get8 | ( | const uint8_t ** | pp, | |
| const uint8_t * | p_end | |||
| ) | [inline, static] |
Definition at line 447 of file mpegts.c.
Referenced by getstr8(), mpegts_parse_desc(), parse_section_header(), pmt_cb(), and sdt_cb().
| static int get16 | ( | const uint8_t ** | pp, | |
| const uint8_t * | p_end | |||
| ) | [inline, static] |
Definition at line 460 of file mpegts.c.
Referenced by mpegts_parse_desc(), mpegts_parse_pcrpid(), mpegts_parse_program_info_length(), parse_section_header(), pat_cb(), pat_scan_cb(), pmt_cb(), and sdt_cb().
| static char* getstr8 | ( | const uint8_t ** | pp, | |
| const uint8_t * | p_end | |||
| ) | [static] |
| static int parse_section_header | ( | SectionHeader * | h, | |
| const uint8_t ** | pp, | |||
| const uint8_t * | p_end | |||
| ) | [static] |
Definition at line 497 of file mpegts.c.
Referenced by mpegts_push_section(), pat_cb(), pat_scan_cb(), pmt_cb(), and sdt_cb().
| static MpegTSService* new_service | ( | MpegTSContext * | ts, | |
| int | sid, | |||
| int | pid, | |||
| char * | provider_name, | |||
| char * | name | |||
| ) | [static] |
| static int mpegts_parse_program_info_length | ( | uint8_t ** | p, | |
| uint8_t * | p_end | |||
| ) | [static] |
| static int mpegts_parse_pcrpid | ( | MpegTSContext * | mpegts_ctx, | |
| uint8_t ** | p, | |||
| uint8_t * | p_end | |||
| ) | [static] |
| static void pmt_cb | ( | void * | opaque, | |
| const uint8_t * | section, | |||
| int | section_len | |||
| ) | [static] |
| void mpegts_remove_stream | ( | MpegTSContext * | ts, | |
| int | pid | |||
| ) |
Definition at line 1076 of file mpegts.c.
Referenced by av_remove_stream(), and mpegts_cleanup_streams().
| static void pat_cb | ( | void * | opaque, | |
| const uint8_t * | section, | |||
| int | section_len | |||
| ) | [static] |
| static void pat_scan_cb | ( | void * | opaque, | |
| const uint8_t * | section, | |||
| int | section_len | |||
| ) | [static] |
| static void sdt_cb | ( | void * | opaque, | |
| const uint8_t * | section, | |||
| int | section_len | |||
| ) | [static] |
| void mpegts_scan_sdt | ( | MpegTSContext * | ts | ) |
| void mpegts_scan_pat | ( | MpegTSContext * | ts | ) |
| static void init_stream | ( | AVStream * | st, | |
| int | stream_type, | |||
| int | code | |||
| ) | [static] |
Definition at line 1407 of file mpegts.c.
Referenced by new_pes_av_stream(), and new_section_av_stream().
| static void mpegts_push_data | ( | void * | opaque, | |
| const uint8_t * | buf, | |||
| int | buf_size, | |||
| int | is_start, | |||
| int64_t | position | |||
| ) | [static] |
| static void mpegts_push_section | ( | void * | opaque, | |
| const uint8_t * | section, | |||
| int | section_len | |||
| ) | [static] |
| static void handle_packet | ( | MpegTSContext * | ts, | |
| const uint8_t * | packet, | |||
| int64_t | position | |||
| ) | [static] |
Definition at line 1745 of file mpegts.c.
Referenced by handle_packets(), and mpegts_parse_packet().
| static int mpegts_resync | ( | ByteIOContext * | pb | ) | [static] |
| static int read_packet | ( | ByteIOContext * | pb, | |
| uint8_t * | buf, | |||
| int | raw_packet_size, | |||
| int64_t * | position | |||
| ) | [static] |
| static int handle_packets | ( | MpegTSContext * | ts, | |
| int | nb_packets | |||
| ) | [static] |
Definition at line 1868 of file mpegts.c.
Referenced by mpegts_read_header(), and mpegts_read_packet().
| static int mpegts_probe | ( | AVProbeData * | p | ) | [static] |
| static void set_service_cb | ( | void * | opaque, | |
| int | ret | |||
| ) | [static] |
| static int parse_pcr | ( | int64_t * | ppcr_high, | |
| int * | ppcr_low, | |||
| const uint8_t * | packet | |||
| ) | [static] |
Definition at line 1937 of file mpegts.c.
Referenced by mpegts_get_pcr(), mpegts_raw_read_packet(), and mpegts_read_header().
| static int mpegts_read_header | ( | AVFormatContext * | s, | |
| AVFormatParameters * | ap | |||
| ) | [static] |
| static int mpegts_raw_read_packet | ( | AVFormatContext * | s, | |
| AVPacket * | pkt | |||
| ) | [static] |
| static int mpegts_read_packet | ( | AVFormatContext * | s, | |
| AVPacket * | pkt | |||
| ) | [static] |
| static int mpegts_read_close | ( | AVFormatContext * | s | ) | [static] |
| static int64_t mpegts_get_pcr | ( | AVFormatContext * | s, | |
| int | stream_index, | |||
| int64_t * | ppos, | |||
| int64_t | pos_limit | |||
| ) | [static] |
| static int read_seek | ( | AVFormatContext * | s, | |
| int | stream_index, | |||
| int64_t | target_ts, | |||
| int | flags | |||
| ) | [static] |
| MpegTSContext* mpegts_parse_open | ( | AVFormatContext * | s | ) |
| int mpegts_parse_packet | ( | MpegTSContext * | ts, | |
| AVPacket * | pkt, | |||
| const uint8_t * | buf, | |||
| int | len | |||
| ) |
| void mpegts_parse_close | ( | MpegTSContext * | ts | ) |
| pthread_mutex_t avcodeclock |
Referenced by IvtvDecoder::CanHandle(), AvFormatDecoder::CanHandle(), NuppelDecoder::CloseAVCodecAudio(), NuppelDecoder::CloseAVCodecVideo(), AvFormatDecoder::CloseCodecs(), NuppelDecoder::DecodeFrame(), NuppelDecoder::GetFrame(), AvFormatDecoder::GetFrame(), DecoderBase::GetTrackDesc(), DecoderBase::GetTrackInfo(), DecoderBase::GetTracks(), HandleStreamChange(), SignalMonitor::Init(), NuppelDecoder::InitAVCodecAudio(), NuppelDecoder::InitAVCodecVideo(), DecoderBase::InsertTrack(), NuppelDecoder::NuppelDecoder(), AvFormatDecoder::OpenFile(), AvFormatDecoder::ProcessDSMCCPacket(), RecorderBase::RecorderBase(), AvFormatDecoder::RemoveAudioStreams(), AvFormatDecoder::ScanStreams(), AvFormatDecoder::SetDisablePassThrough(), DecoderBase::SetTrack(), AvFormatDecoder::SetupAudioStreamSubIndexes(), NuppelVideoRecorder::SetupAVCodecVideo(), NuppelVideoRecorder::WriteVideo(), and NuppelVideoRecorder::~NuppelVideoRecorder().
Initial value:
{
"mpegts",
"MPEG2 transport stream format",
sizeof(MpegTSContext),
mpegts_probe,
mpegts_read_header,
mpegts_read_packet,
mpegts_read_close,
read_seek,
mpegts_get_pcr,
.flags = AVFMT_SHOW_IDS,
}
1.5.5