Developing UPnP AV Framework Control Points (Windows Embedded CE 6.0)
1/6/2010
Using the UPnP AV Framework to develop a UPnP AV control point involves finding MediaRenderer and MediaServer devices and then invoking actions and receiving state variable change notifications.
The AV Control Point sample contains code for all of these steps. For more information about this sample, see Windows Embedded CE topic UPnP AV Control Point Sample.
UPnP AV control point applications that use the UPnP AV Framework typically perform the operations in the following list.
Locate UPnP AV MediaRenderer and/or MediaServer devices.
The UPnP AV Framework provides no special-purpose functionality for locating devices. Instead, you use the standard UPnP Control Point API.
To find MediaRenderer devices, use this search target string:urn:schemas-upnp-org:device:MediaRenderer:1
To find MediaServer devices, use this search target string:
urn:schemas-upnp-org:device:MediaServer:1
For more information about locating UPnP devices using the UPnP Control Point API, see Device Location.
Use the IUPnPDevice pointers you obtained in Step 1 to create instances of the MediaRendererDevice and/or MediaServerDevice classes. The constructors for these classes take IUPnPDevice pointers.
Use MediaRendererDevice::GetConnectionManager, MediaServerDevice::GetConnectionManager, and MediaServerDevice::GetContentDirectory to obtain pointers to IConnectionManager (on both devices) and IContentDirectory (on the MediaServer device) implementations.
Use the appropriate methods of the IConnectionManager and IContentDirectory implementations to perform all control point tasks.
For example, to browse the content made available by a ContentDirectory service, use IContentDirectory::BrowseMetadata or IContentDirectory::BrowseChildren. Then use the DIDL-Lite XML returned by these methods with the parser (UPnP AV) class to enumerate and examine all object properties.
Or, to start a media stream from a MediaServer to a MediaRenderer, use IConnectionManager::PrepareForConnection. PrepareForConnection returns IAVTransport and IRenderingControl implementations you use to initiate and control the display properties of the transferred media.
For information about the control flow and action invocations required when working with ConnectionManager, AVTransport, RenderingControl, and ContentDirectory services, see UPnP AV DCP Documentation.
See Also
Concepts
Using the UPnP Control Point API