Commit 24adef14 authored by Kieran Kunhya's avatar Kieran Kunhya Committed by Michael Niedermayer

Export more transport stream information.

with minor addition to the comment by michael
parent fa12fb3b
...@@ -647,6 +647,9 @@ typedef struct AVProgram { ...@@ -647,6 +647,9 @@ typedef struct AVProgram {
unsigned int *stream_index; unsigned int *stream_index;
unsigned int nb_stream_indexes; unsigned int nb_stream_indexes;
AVMetadata *metadata; AVMetadata *metadata;
int program_num;
int pmt_pid;
} AVProgram; } AVProgram;
#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present #define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present
...@@ -844,6 +847,12 @@ typedef struct AVFormatContext { ...@@ -844,6 +847,12 @@ typedef struct AVFormatContext {
* decoding: number of frames used to probe fps * decoding: number of frames used to probe fps
*/ */
int fps_probe_size; int fps_probe_size;
/**
* Transport stream id.
* This will be moved into demuxer private options. Thus no API/ABI compatibility
*/
int ts_id;
} AVFormatContext; } AVFormatContext;
typedef struct AVPacketList { typedef struct AVPacketList {
......
...@@ -1137,6 +1137,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len ...@@ -1137,6 +1137,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
SectionHeader h1, *h = &h1; SectionHeader h1, *h = &h1;
const uint8_t *p, *p_end; const uint8_t *p, *p_end;
int sid, pmt_pid; int sid, pmt_pid;
AVProgram *program;
#ifdef DEBUG #ifdef DEBUG
av_dlog(ts->stream, "PAT:\n"); av_dlog(ts->stream, "PAT:\n");
...@@ -1149,6 +1150,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len ...@@ -1149,6 +1150,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (h->tid != PAT_TID) if (h->tid != PAT_TID)
return; return;
ts->stream->ts_id = h->id;
clear_programs(ts); clear_programs(ts);
for(;;) { for(;;) {
sid = get16(&p, p_end); sid = get16(&p, p_end);
...@@ -1163,7 +1166,9 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len ...@@ -1163,7 +1166,9 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (sid == 0x0000) { if (sid == 0x0000) {
/* NIT info */ /* NIT info */
} else { } else {
av_new_program(ts->stream, sid); program = av_new_program(ts->stream, sid);
program->program_num = sid;
program->pmt_pid = pmt_pid;
if (ts->pids[pmt_pid]) if (ts->pids[pmt_pid])
mpegts_close_filter(ts, ts->pids[pmt_pid]); mpegts_close_filter(ts, ts->pids[pmt_pid]);
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1); mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment