static int32_t rtp_sinker_set_config(network_sinker *sinker, void *in, void *data) { rtp_sinker *rs = (rtp_sinker*)sinker; int32_t stm_i = *((int32_t*)in); rtp_port_conf *rpc = (rtp_port_conf*)data; proto_watch *pw; if (!VALID_STM_TYPE(stm_i) || sinker->stms[stm_i].stm_type == ST_NONE) return -EINVAL; if (!rpc->rtsp_client) return -EINVAL; rs->trans_mode = rpc->trans; pw = sinker->stms[stm_i].stm_watch; if (!pw) { if (rpc->trans != RTP_OVER_RTSP) return -EINVAL; if (!rs->interleaved) { rs->interleaved = (rtsp_client*)client_ref((client*)rpc->rtsp_client); } return 0; } if (!proto_watch_attach(pw, ((client*)rpc->rtsp_client)->sched)) return proto_watch_set_dst(pw, rpc->host, rpc->ports.min_port); return -EINVAL; }
static __inline__ int32_t __network_client_attach(network_client *nc, void *loop) { int32_t err = -EINVAL; if (nc->proto_watch) { err = proto_watch_attach(nc->proto_watch, loop); } return err; }