コード例 #1
0
/** @This is called when there is no external reference to the pipe anymore.
 *
 * @param upipe description structure of the pipe
 */
static void upipe_fdec_no_ref(struct upipe *upipe)
{
    struct upipe_fdec *upipe_fdec = upipe_fdec_from_upipe(upipe);
    upipe_fdec_clean_bin_input(upipe);
    upipe_fdec_clean_bin_output(upipe);
    urefcount_release(upipe_fdec_to_urefcount_real(upipe_fdec));
}
コード例 #2
0
/** @internal @This allocates a fdec pipe.
 *
 * @param mgr common management structure
 * @param uprobe structure used to raise events
 * @param signature signature of the pipe allocator
 * @param args optional arguments
 * @return pointer to upipe or NULL in case of allocation error
 */
static struct upipe *upipe_fdec_alloc(struct upipe_mgr *mgr,
                                      struct uprobe *uprobe,
                                      uint32_t signature, va_list args)
{
    struct upipe *upipe = upipe_fdec_alloc_void(mgr, uprobe, signature, args);
    if (unlikely(upipe == NULL))
        return NULL;
    struct upipe_fdec *upipe_fdec = upipe_fdec_from_upipe(upipe);
    upipe_fdec_init_urefcount(upipe);
    urefcount_init(upipe_fdec_to_urefcount_real(upipe_fdec),
                   upipe_fdec_free);
    upipe_fdec_init_uref_mgr(upipe);
    upipe_fdec_init_bin_input(upipe);
    upipe_fdec_init_bin_output(upipe, upipe_fdec_to_urefcount_real(upipe_fdec));
    upipe_fdec->options = NULL;
    upipe_throw_ready(upipe);
    upipe_fdec_demand_uref_mgr(upipe);
    return upipe;
}