By the first article we have a general understanding of the basic concepts of DLNA and the relationship with UPnP, this article mainly introduces the basic components of the UPnP protocol and the AV architecture.
1. UPnP Protocol Composition
In the UPnP protocol, two main components are defined, one is device, and the other is control point. This is why the interface code of the SDK for many UPnP stacks is generally composed of device and control point. A device is an object that is visible in the network, and the control point is not visible in the network.
One UPnP device is a device that cannot access and control the other UPnP directly, and the access and control of the device must be done by means of control point. The control point of the device is mainly implemented by the "service" defined by the device.
Devices need to broadcast their own information to the network, provide a description of the device and a service, and send a device event message.
Control point is a search device that uses its provided services (service) to access and control devices while listening for device event messages.
2. Typical UPnP AV application architecture
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6B/E3/wKiom1U45h_x1rP4AAESqPv2zVk980.jpg "title=" Image.jpg "alt=" Wkiom1u45h_x1rp4aaesqpv2zvk980.jpg "/>
is a typical UPnP AV application architecture, it comes from "upnp-av-avarchitecture". In a typical UPnP application, there are three principals, one server (mediaserver), one player (Mediarender), and one control point.
The server (MediaServer) is primarily responsible for providing browsing and control of multimedia files.
The player (Mediarender) is primarily responsible for providing playback and rendering.
Control point controls the entire playback process.
The three of them can be physically the same device, and of course, it can be on different devices.
For UPnP protocol components, "MediaServer" and "Mediarnederer" belong to UPnP's device.
"Contentdirectory", "ConnectionManager", "Avtransport", "Renderingcontrol" are all services (service) provided by UPnP devices, and through these service descriptions, Control point knows how to access and control the device.
3. UPnP device description and service description
UPnP equipment (device) is a broadcast packet to notify the local area network control points of their own device information and services, and these device information and services must be written in accordance with the requirements of the UPnP Protocol XML document format, UPnP provides a standard template can refer to the specific document address:
http://upnp.org/sdcps-and-certification/standards/sdcps/
From these documents we can see that the UPnP website defines 12 devices for us, defines in detail how the device description XML is written in each device's documentation, defines what services each device needs to implement, and how XML documents for each service are written.
Here, we can actually see that the implementation of a UPnP AV application described above is not so scary, everything is rule-based, what we need to do is to read the protocol defined a series of documents.
4. How UPnP Works
There are many articles on the Internet that describe how the UPnP protocol works, such as:
"UPnP protocol Programming Practice"
http://www.ibm.com/developerworks/cn/linux/other/UPnP/part1/
http://www.ibm.com/developerworks/cn/linux/other/UPnP/part2/
Personal comparison is recommended to read the official documents of the agreement, in very detail:
"Upnp-arch-devicearchitecture-v2.0"
"Upnp-av-avarchitecture"
5. Summary
About the basic composition of the UPnP protocol and the AV architecture is introduced here, the following article will further explain how to develop applications for the UPnP protocol, have any questions welcome message or letter [email protected] exchange.
This article is from the "Shadow Three People" blog, please be sure to keep this source http://ticktick.blog.51cto.com/823160/1637727
DLNA&UPNP Development Notes (2)