#include "upnp_xml.h"#include "server.h"#include "cds_resource_manager.h"#include "common.h"#include "config_manager.h"#include "metadata_handler.h"Go to the source code of this file.
Functions | |
| Ref< Element > | UpnpXML_CreateResponse (String actionName, String serviceType) |
| Renders XML for the action response header. | |
| Ref< Element > | UpnpXML_DIDLRenderObject (Ref< CdsObject > obj, bool renderActions, int stringLimit) |
| Renders the DIDL-Lite representation of an object in the content directory. | |
| void | UpnpXML_DIDLUpdateObject (Ref< CdsObject > obj, String text) |
| Ref< Element > | UpnpXML_CreateEventPropertySet () |
| Renders XML for the event property set. | |
| Ref< Element > | UpnpXML_RenderDeviceDescription (String presentationURL) |
| Renders the device description XML. | |
| Ref< Element > | UpnpXML_DIDLRenderResource (String URL, Ref< Dictionary > attributes) |
| Renders a resource tag (part of DIDL-Lite XML). | |
Definition in file upnp_xml.cc.
Renders XML for the event property set.
Definition at line 186 of file upnp_xml.cc.
References _.
Referenced by ConnectionManagerService::process_subscription_request(), ContentDirectoryService::process_subscription_request(), ConnectionManagerService::subscription_update(), and ContentDirectoryService::subscription_update().
| Ref<Element> UpnpXML_CreateResponse | ( | zmm::String | actionName, | |
| zmm::String | serviceType | |||
| ) |
Renders XML for the action response header.
| actionName | Name of the action. | |
| serviceType | Type of service. |
Basically it renders an XML that looks like the following: <u:actionNameResponse xmlns:u="serviceType"/> Further response information (various parameters, DIDL-Lite or whatever can then be adapted to it.
Definition at line 46 of file upnp_xml.cc.
References _.
Referenced by ContentDirectoryService::upnp_action_Browse(), ConnectionManagerService::upnp_action_GetCurrentConnectionIDs(), ConnectionManagerService::upnp_action_GetProtocolInfo(), ContentDirectoryService::upnp_action_GetSearchCapabilities(), ContentDirectoryService::upnp_action_GetSortCapabilities(), and ContentDirectoryService::upnp_action_GetSystemUpdateID().
| Ref<Element> UpnpXML_DIDLRenderObject | ( | zmm::Ref< CdsObject > | obj, | |
| bool | renderActions = false, |
|||
| int | stringLimit = -1 | |||
| ) |
Renders the DIDL-Lite representation of an object in the content directory.
| obj | Object to be rendered as XML. | |
| renderActions | If true, also render special elements of an active item. |
This function looks at the object, and renders the DIDL-Lite representation of it - either a container or an item. The renderActions parameter tells us whether to also show the special fields of an active item in the XML. This is currently used when providing the XML representation of an active item to a trigger/toggle script.
Definition at line 55 of file upnp_xml.cc.
References _, CdsResourceManager::addResources(), MetadataHandler::getMetaFieldName(), getValidUTF8CutPosition(), IS_CDS_ACTIVE_ITEM, IS_CDS_CONTAINER, IS_CDS_ITEM, zmm::String::length(), M_DESCRIPTION, M_TITLE, M_TRACKNUMBER, RefCast, zmm::String::substring(), and UPNP_DEFAULT_CLASS_MUSIC_TRACK.
Referenced by FileRequestHandler::open(), and ContentDirectoryService::upnp_action_Browse().
| Ref<Element> UpnpXML_DIDLRenderResource | ( | zmm::String | URL, | |
| zmm::Ref< Dictionary > | attributes | |||
| ) |
Renders a resource tag (part of DIDL-Lite XML).
| URL | download location of the item (will be child element of the <res> tag) | |
| attributes | Dictionary containing the <res> tag attributes (like resolution, etc.) |
Definition at line 364 of file upnp_xml.cc.
References _.
Referenced by CdsResourceManager::addResources().
| void UpnpXML_DIDLUpdateObject | ( | zmm::Ref< CdsObject > | obj, | |
| zmm::String | text | |||
| ) |
Definition at line 145 of file upnp_xml.cc.
References _, MetadataHandler::getMetaFieldName(), IS_CDS_ACTIVE_ITEM, M_DESCRIPTION, nil, and RefCast.
Referenced by FileRequestHandler::open().
| Ref<Element> UpnpXML_RenderDeviceDescription | ( | zmm::String | presentationUTL = nil |
) |
Renders the device description XML.
Some elements are statically defined in common.h, others are loaded from the config with the help of the ConfigManager.
Definition at line 197 of file upnp_xml.cc.
References _, CFG_SERVER_MANUFACTURER_URL, CFG_SERVER_MODEL_DESCRIPTION, CFG_SERVER_MODEL_NAME, CFG_SERVER_MODEL_NUMBER, CFG_SERVER_NAME, CFG_SERVER_SERIAL_NUMBER, CFG_SERVER_UDN, DESC_CDS_CONTROL_URL, DESC_CDS_EVENT_URL, DESC_CDS_SCPD_URL, DESC_CDS_SERVICE_ID, DESC_CDS_SERVICE_TYPE, DESC_CM_CONTROL_URL, DESC_CM_EVENT_URL, DESC_CM_SCPD_URL, DESC_CM_SERVICE_ID, DESC_CM_SERVICE_TYPE, DESC_DEVICE_NAMESPACE, DESC_DEVICE_TYPE, DESC_ICON120_BMP, DESC_ICON120_JPG, DESC_ICON120_PNG, DESC_ICON32_BMP, DESC_ICON32_JPG, DESC_ICON32_PNG, DESC_ICON48_BMP, DESC_ICON48_JPG, DESC_ICON48_PNG, DESC_ICON_BMP_MIMETYPE, DESC_ICON_JPG_MIMETYPE, DESC_ICON_PNG_MIMETYPE, DESC_MANUFACTURER, DESC_SPEC_VERSION_MAJOR, DESC_SPEC_VERSION_MINOR, Singleton< ConfigManager >::getInstance(), log_debug, and string_ok().
Referenced by Server::upnp_init().
1.6.1