ffmpeg(9) mpegts_read_header

来源:互联网 发布:文明 太空 mac 中文 编辑:程序博客网 时间:2024/04/30 08:26

1.

mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1);

mpegts_open_section_filter(ts, PAT_PID, pat_cb, ts, 1);

注册section filters


PAT表的PID固定是0x0000, SDT表的PID固定是0x0011

这两条语句的作用就是在

mpegts_open_section_filter ---> mpegts_open_filter中向MpegTSContext的数据成员

    /** filters for various streams specified by PMT + for the PAT and PMT */
    MpegTSFilter *pids[NB_PID_MAX];

注册两个filters,在此处是section filter

ts->pids[pid] = filter;


2. 

handle_packets(ts, s->probesize / ts->raw_packet_size);

    /**
     * Maximum size of the data read from input for determining
     * the input container format.
     * Demuxing only, set by the caller before avformat_open_input().
     */

s->probesize


ts->raw_packet_size则是在这条语句之前通过

ts->raw_packet_size = get_packet_size(buf, len);

获取的;


        ret = read_packet(s, packet, ts->raw_packet_size, &data);
        if (ret != 0)
            break;














0 0
原创粉丝点击