Ejemplo n.º 1
0
/** @hidden */
static int upipe_burst_throw_update(struct upipe *upipe, bool empty)
{
    struct upipe_burst *upipe_burst = upipe_burst_from_upipe(upipe);

    if (unlikely(upipe_burst->empty == empty))
        return UBASE_ERR_NONE;
    upipe_burst->empty = empty;

    upipe_dbg_va(upipe, "throw update %s", empty ? "empty" : "not empty");
    return upipe_throw(upipe, UPROBE_BURST_UPDATE, UPIPE_BURST_SIGNATURE,
                       empty);
}
Ejemplo n.º 2
0
/** @internal @This handles data.
 *
 * @param upipe description structure of the pipe
 * @param uref uref structure
 * @param upump pump that generated the buffer
 */
static void _upipe_multicat_probe_input(struct upipe *upipe, struct uref *uref,
                                       struct upump *upump)
{
    struct upipe_multicat_probe *upipe_multicat_probe = upipe_multicat_probe_from_upipe(upipe);
    uint64_t systime = 0;
    int64_t newidx;

    if (unlikely(!uref_clock_get_systime(uref, &systime))) {
        upipe_warn(upipe, "uref has no systime");
    }
    newidx = (systime/upipe_multicat_probe->rotate);
    if (upipe_multicat_probe->idx != newidx) {
        upipe_throw(upipe, UPROBE_MULTICAT_PROBE_ROTATE,
                    UPIPE_MULTICAT_PROBE_SIGNATURE, uref, newidx);
        upipe_multicat_probe->idx = newidx;
    }

    upipe_multicat_probe_output(upipe, uref, upump);
}