/** Generate RTSP transport port range */ static apt_bool_t rtsp_port_range_generate(rtsp_transport_attrib_e attrib, const rtsp_port_range_t *port_range, apt_text_stream_t *text_stream) { const apt_str_t *str; str = apt_string_table_str_get(rtsp_transport_attrib_string_table,RTSP_TRANSPORT_ATTRIB_COUNT,attrib); if(!str) { return FALSE; } apt_string_value_generate(str,text_stream); apt_text_char_insert(text_stream,'='); apt_size_value_generate(port_range->min,text_stream); if(port_range->max > port_range->min) { apt_text_char_insert(text_stream,'-'); apt_size_value_generate(port_range->max,text_stream); } return TRUE; }
static void mpf_mixer_trace(mpf_object_t *object) { mpf_mixer_t *mixer = (mpf_mixer_t*) object; apr_size_t i; mpf_audio_stream_t *source; char buf[2048]; apr_size_t offset; apt_text_stream_t output; apt_text_stream_init(&output,buf,sizeof(buf)-1); for(i=0; i<mixer->source_count; i++) { source = mixer->source_arr[i]; if(source) { mpf_audio_stream_trace(source,STREAM_DIRECTION_RECEIVE,&output); apt_text_char_insert(&output,';'); } } offset = output.pos - output.text.buf; output.pos += apr_snprintf(output.pos, output.text.length - offset, "->Mixer->"); mpf_audio_stream_trace(mixer->sink,STREAM_DIRECTION_SEND,&output); *output.pos = '\0'; apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Media Path %s %s", object->name, output.text.buf); }
/** Generate RTSP transport */ static apt_bool_t rtsp_transport_generate(rtsp_transport_t *transport, apt_text_stream_t *text_stream) { const apt_str_t *protocol = apt_string_table_str_get(rtsp_transport_string_table,RTSP_TRANSPORT_COUNT,transport->protocol); const apt_str_t *profile = apt_string_table_str_get(rtsp_profile_string_table,RTSP_PROFILE_COUNT,transport->profile); if(!protocol || !profile) { return FALSE; } apt_string_value_generate(protocol,text_stream); apt_text_char_insert(text_stream,'/'); apt_string_value_generate(profile,text_stream); if(transport->delivery != RTSP_DELIVERY_NONE) { const apt_str_t *delivery = NULL; rtsp_transport_attrib_e attrib = RTSP_TRANSPORT_ATTRIB_NONE; if(transport->delivery == RTSP_DELIVERY_UNICAST) { attrib = RTSP_TRANSPORT_ATTRIB_UNICAST; } else if(transport->delivery == RTSP_DELIVERY_MULTICAST) { attrib = RTSP_TRANSPORT_ATTRIB_MULTICAST; } delivery = apt_string_table_str_get(rtsp_transport_attrib_string_table,RTSP_TRANSPORT_ATTRIB_COUNT,attrib); if(!delivery) { return FALSE; } apt_text_char_insert(text_stream,';'); apt_string_value_generate(delivery,text_stream); } if(rtsp_port_range_is_valid(&transport->client_port_range) == TRUE) { apt_text_char_insert(text_stream,';'); rtsp_port_range_generate(RTSP_TRANSPORT_ATTRIB_CLIENT_PORT,&transport->client_port_range,text_stream); } if(rtsp_port_range_is_valid(&transport->server_port_range) == TRUE) { apt_text_char_insert(text_stream,';'); rtsp_port_range_generate(RTSP_TRANSPORT_ATTRIB_SERVER_PORT,&transport->server_port_range,text_stream); } if(transport->mode.length) { const apt_str_t *str; str = apt_string_table_str_get(rtsp_transport_attrib_string_table,RTSP_TRANSPORT_ATTRIB_COUNT,RTSP_TRANSPORT_ATTRIB_MODE); if(str) { apt_text_char_insert(text_stream,';'); apt_string_value_generate(str,text_stream); apt_text_char_insert(text_stream,'='); apt_string_value_generate(&transport->mode,text_stream); } } return TRUE; }