cablelabs/rygel — pull request #4 by craigpratt (2013-11-22 08:00:27+00:00)
Title: Merge/review for cpratt/container_playlist_retrofit

Playlist support is now re-enabled for MediaContainers.

Changed the MediaContainer implementation to publish the (two)
supported playlist resources using MediaResources. This allows the
playlist for of the URI, playlist handler, and a variety of special-
case logic to be removed.

Moved the create_stream_source_for_resource() method from MediaItem
to MediaObject so that MediaContainer can use it and it can be called
from the HTTMediaResourceHandler without a cast. Replaced "host_ip" as
a param with HTTPRequest since the PlaylistDataSource requires access
to the request's "hacks" parameter.

Moved serialize_resource_list() to MediaObject and made it usable
by MediaFileItem, OdidMediaItem, and MediaContainer.
get_protocol_for_uri() went along for the ride.

Uncovered an issue with the MediaResource copy constructor. The
ProtocolInfo wasn't being deep copied, resulting in some incorrect
behavior with the MediaContainer. Added code to deep-copy the PI.

Playlists uncovered an issue with the assumed HTTP transfer mode.
Per DLNA 7.5.4.3.2.33.2, the default transfer mode is "Streaming"
*only* for AV content (not items, but content). For all other content
forms, the default is supposed to be "Interactive". Added a
get_default_transfer_mode() to the HTTPGetHandler. The
HTTPMediaResourceHandler delegates to a newly-added MediaResource.
default_transfer_mode() which returns "Streaming" if the streaming
bit is set and "Interactive" otherwise. The base HTTPGetHandler
returns "Interactive".