void upnp_renderer_dump_control_scpd(void) { char *buf; buf = upnp_get_scpd(upnp_control_get_service()); assert(buf != NULL); fputs(buf, stdout); }
void upnp_control_init(struct upnp_device *device) { upnp_control_get_service(); // Set initial volume. float volume_fraction = 0; if (output_get_volume(&volume_fraction) == 0) { Log_info("control", "Output inital volume is %f; setting " "control variables accordingly.", volume_fraction); change_volume_decibel(20 * log(volume_fraction) / log(10)); } assert(control_service_.last_change == NULL); control_service_.last_change = UPnPLastChangeCollector_new(state_variables_, CONTROL_EVENT_XML_NS, device, CONTROL_SERVICE_ID); // According to UPnP-av-RenderingControl-v3-Service-20101231.pdf, 2.3.1 // page 51, the A_ARG_TYPE* variables are not evented. UPnPLastChangeCollector_add_ignore(control_service_.last_change, CONTROL_VAR_AAT_CHANNEL); UPnPLastChangeCollector_add_ignore(control_service_.last_change, CONTROL_VAR_AAT_INSTANCE_ID); UPnPLastChangeCollector_add_ignore(control_service_.last_change, CONTROL_VAR_AAT_PRESET_NAME); }
void upnp_control_init(void) { upnp_control_get_service(); // This doesn't seem to work: asking gmstreamer initially will always // return 1.0. float volume_fraction = 0; if (output_get_volume(&volume_fraction) == 0) { fprintf(stderr, "Got fraction %f\n", volume_fraction); change_volume_decibel(NULL, 20 * log(volume_fraction) / log(10)); } }
static int upnp_renderer_init(void) { static struct service *upnp_services[4]; upnp_services[0] = upnp_transport_get_service(); upnp_services[1] = upnp_connmgr_get_service(); upnp_services[2] = upnp_control_get_service(); upnp_services[3] = NULL; render_device.services = upnp_services; return connmgr_init(); }