/** @internal @This sets the input flow definition. * * @param upipe description structure of the pipe * @param flow_def flow definition packet * @return an error code */ static int upipe_fsink_set_flow_def(struct upipe *upipe, struct uref *flow_def) { if (flow_def == NULL) return UBASE_ERR_INVALID; UBASE_RETURN(uref_flow_match_def(flow_def, UPIPE_FSINK_EXPECTED_FLOW_DEF)) flow_def = uref_dup(flow_def); UBASE_ALLOC_RETURN(flow_def) upipe_input(upipe, flow_def, NULL); return UBASE_ERR_NONE; }
/** @internal @This sets the input flow definition. * * @param upipe description structure of the pipe * @param flow_def flow definition packet * @return an error code */ static int upipe_dveo_asi_sink_set_flow_def(struct upipe *upipe, struct uref *flow_def) { if (flow_def == NULL) return UBASE_ERR_INVALID; UBASE_RETURN(uref_flow_match_def(flow_def, "block.mpegts.")) flow_def = uref_dup(flow_def); UBASE_ALLOC_RETURN(flow_def) upipe_input(upipe, flow_def, NULL); return UBASE_ERR_NONE; }
/** @internal @This sets the input flow definition. * * @param upipe description structure of the pipe * @param flow_def flow definition packet * @return an error code */ static int upipe_filter_blend_set_flow_def(struct upipe *upipe, struct uref *flow_def) { if (flow_def == NULL) return UBASE_ERR_INVALID; UBASE_RETURN(uref_flow_match_def(flow_def, "pic.")) struct uref *flow_def_dup; if (unlikely((flow_def_dup = uref_dup(flow_def)) == NULL)) { upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); return UBASE_ERR_ALLOC; } UBASE_RETURN(uref_pic_set_progressive(flow_def_dup)) upipe_input(upipe, flow_def_dup, NULL); return UBASE_ERR_NONE; }
/** @internal @This sets the input flow definition. * * @param upipe description structure of the pipe * @param flow_def flow definition packet * @return an error code */ static int upipe_audiobar_set_flow_def(struct upipe *upipe, struct uref *flow_def) { if (flow_def == NULL) return UBASE_ERR_INVALID; uref_dump(flow_def, upipe->uprobe); UBASE_RETURN(uref_flow_match_def(flow_def, INPUT_FLOW_DEF)) uint8_t channels; UBASE_RETURN(uref_sound_flow_get_channels(flow_def, &channels)) struct uref *flow_def_dup; if (unlikely((flow_def_dup = uref_dup(flow_def)) == NULL)) return UBASE_ERR_ALLOC; upipe_input(upipe, flow_def_dup, NULL); return UBASE_ERR_NONE; }
/** @internal @This sets the input flow definition. * * @param upipe description structure of the pipe * @param flow_def flow definition packet * @return an error code */ static int upipe_tblk_set_flow_def(struct upipe *upipe, struct uref *flow_def) { if (flow_def == NULL) return UBASE_ERR_INVALID; const char *def; if (unlikely(!ubase_check(uref_flow_get_def(flow_def, &def)) || (ubase_ncmp(def, "block.") && ubase_ncmp(def, "pic.") && ubase_ncmp(def, "sound.")))) return UBASE_ERR_INVALID; struct uref *flow_def_dup; if ((flow_def_dup = uref_dup(flow_def)) == NULL) return UBASE_ERR_ALLOC; upipe_input(upipe, flow_def_dup, NULL); return UBASE_ERR_NONE; }
/** @internal @This sets the input flow definition. * * @param upipe description structure of the pipe * @param flow_def flow definition packet * @return an error code */ static int upipe_ts_pese_set_flow_def(struct upipe *upipe, struct uref *flow_def) { if (flow_def == NULL) return UBASE_ERR_INVALID; const char *def; uint8_t pes_id; UBASE_RETURN(uref_flow_get_def(flow_def, &def)) if (ubase_ncmp(def, EXPECTED_FLOW_DEF) || !ubase_check(uref_ts_flow_get_pes_id(flow_def, &pes_id))) return UBASE_ERR_INVALID; struct uref *flow_def_dup; if (unlikely((flow_def_dup = uref_dup(flow_def)) == NULL)) { upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); return UBASE_ERR_ALLOC; } if (unlikely(!ubase_check(uref_flow_set_def_va(flow_def_dup, "block.mpegtspes.%s", def + strlen(EXPECTED_FLOW_DEF))))) upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); upipe_input(upipe, flow_def_dup, NULL); return UBASE_ERR_NONE; }