Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
ISO/IEC 29341-17-10 provides the complete specification for the ContentDirectory service, which is the core service of the UPnP MediaServer device defined in Part 17-1. While Part 17-1 defines the MediaServer device as a whole, Part 17-10 delves deep into the ContentDirectory service itself — its data model, metadata schema, browsing and search semantics, and the detailed action specifications that implementors must follow. This standard is essential reading for any engineer building a UPnP-compatible media server or control point that needs to navigate and query media collections.
The ContentDirectory service organizes media content using the DIDL-Lite (Digital Item Declaration Language Lite) schema, an XML-based metadata framework derived from the MPEG-21 digital item specification. The object model defines three primary class hierarchies: items (individual media resources), containers (collections of items and sub-containers), and descriptors (additional metadata attached to items or containers). Each class in the hierarchy inherits properties from its parent classes, creating a rich and extensible metadata structure.
Items are further specialized into audio items, video items, image items, playlist items, text items, and other media types. Each specialized type inherits the base item properties (title, creator, date, etc.) and adds type-specific properties (audioItem adds bitrate, sampleFrequency, channelCount; videoItem adds resolutionBitDepth, framerate, aspectRatio). Containers are similarly specialized into album containers, genre containers, person containers, playlist containers, and storage system containers, each with their own additional properties.
| Class | Base Type | Key Properties |
|---|---|---|
| audioItem.musicTrack | audioItem | artist, album, originalTrackNumber, duration, bitrate, sampleFrequency |
| videoItem.movie | videoItem | director, genre, longDescription, DVDRegionCode, scheduledStartTime |
| imageItem.photo | imageItem | album, dateTaken, exposureTime, fNumber, flash, pixelResolution |
| container.album.musicAlbum | container.album | artist, genre, producer, albumArtURI, storeArtURI |
| container.person.musicArtist | container.person | biography, birthDate, deathDate, discography, similarArtists |
The Browse action provides tree-traversal access to the content hierarchy. It supports two mutually exclusive browse flags: BrowseMetadata (returns the metadata of the specified object or container itself) and BrowseDirectChildren (returns the immediate children of a container). The results are filtered according to the Filter parameter, which specifies a comma-separated list of metadata properties that the control point is interested in. This filtering mechanism is crucial for performance — a control point browsing a photo album with hundreds of items may only need the title, thumbnail, and date, and can omit the full set of technical metadata.
The Search action provides query-based access using a search expression language defined in the standard. Search expressions are composed from comparisons of metadata properties against literal values, combined with logical AND, OR, and NOT operators. Properties that support search are advertised through the GetSearchCapabilities action. Importantly, the standard does not mandate that all properties be searchable — only those listed in SearchCaps are guaranteed to support search queries, and implementors can choose which properties to index for search based on their storage engine capabilities.
Implementing the ContentDirectory service efficiently requires sophisticated data engineering. The object hierarchy can be stored using several approaches: in-memory trees for small libraries (up to a few thousand items), SQL databases with materialized path or nested set encodings for medium libraries, and dedicated search engines (Elasticsearch, Apache Solr) for large libraries with hundreds of thousands of items. The choice of storage backend directly impacts browse response times, search latency, and the set of searchable properties.
The standard defines a resource abstraction that separates a media object from its underlying data resources. An item can have multiple resources (e.g., a movie in 480p, 720p, and 1080p resolutions, or with different audio tracks). Each resource is described by a protocolInfo string that encodes the transfer protocol, network format, and encoding parameters. The control point selects the appropriate resource based on its playback capabilities and network conditions. This abstraction enables adaptive streaming scenarios without requiring a dedicated streaming protocol.
Another important implementation consideration is the update mechanism. The ContentDirectory service supports two forms of change notification: the SystemUpdateID counter that increments on any change to the content tree, and the ContainerUpdateIDs state variable that tracks changes to specific containers. Control points use the former as a change-detection trigger and the latter to efficiently refresh only the parts of the tree that have actually changed. Engineers should ensure that ContainerUpdateIDs correctly reflects the scope of each content change to avoid unnecessary full-tree refreshes by control points.