Exemplo n.º 1
0
int graphics_processor_decode_ts(GRAPHICS_PROCESSOR *p,
                                 PG_DISPLAY_SET **s,
                                 uint16_t pid, uint8_t *unit, unsigned num_units,
                                 int64_t stc)
{
    unsigned ii;

    if (pid != p->pid) {
        m2ts_demux_free(&p->demux);
        pes_buffer_free(&p->queue);
    }
    if (!p->demux) {
        p->demux = m2ts_demux_init(pid);
        p->pid   = pid;
    }

    for (ii = 0; ii < num_units; ii++) {
        pes_buffer_append(&p->queue, m2ts_demux(p->demux, unit));
        unit += 6144;
    }

    if (p->queue) {
        return graphics_processor_decode_pes(s, &p->queue, stc);
    }

    return 0;
}
Exemplo n.º 2
0
void graphics_processor_free(GRAPHICS_PROCESSOR **p)
{
    if (p && *p) {
        m2ts_demux_free(&(*p)->demux);
        pes_buffer_free(&(*p)->queue);

        X_FREE(*p);
    }
}