Design and implement a media service for Ubuntu

Registered by Jim Hodapp

Design and implement a media service for apps to call into to play video and audio on the Ubuntu platform.

Blueprint information

Status:
Not started
Approver:
Michael Frey
Priority:
High
Drafter:
Jim Hodapp
Direction:
Approved
Assignee:
Jim Hodapp
Definition:
Approved
Series goal:
Accepted for trusty
Implementation:
Not started
Milestone target:
milestone icon ubuntu-14.04

Related branches

Sprints

Whiteboard

vUDS Session Agenda:
---------------------------------
1. Brief overview of current music hub design and implementation
    - MPRIS spec: http://specifications.freedesktop.org/mpris-spec/latest/
2. Discuss what music hub needs to morph into (a general media service)
3. Discuss some of the specific implementation tasks
4. Assign work items
5. Discuss the merge request (MR) process

Things to do to create a general media service:
----------------------------------------------------------------
1) Change the general things that refer to music to media to accommodate both music and video
e.g. namespaces, class names, etc
2) Extend the GStreamer playbin implementation to setup a pipeline with both an audio and video sink

Things to discuss/figure out:
--------------------------------------
1) Does this get wired up to QtMultimedia or to a new Qt MediaPlayer set of classes like what qtubuntu-media was?
2) Do we implement the MediaPlayer2 interface for 14.04 or for 14.10? Do we just focus on video for 14.04 or on filling out the interface set?

Architectural diagram:
------------------------------
https://wiki.ubuntu.com/Touch/MediaArchitecture (scroll to the bottom)

MPRIS interface relevance analysis:
-------------------------------------------------
*Note: The design assumes for 14.04 for now, 14.10 is the target for the media service to be applied across all Ubuntu platforms

Methods:

MediaPlayer2 Interface:
--------------------------------
*Note - some of these may overlap with the URL handler for Ubuntu Touch; this needs to be resolved

raise() - Media player app or music player app are already opened but suspended in the background. This would bring the appropriate one to the foreground if the user presses a piece of media from the dash.

quit() - No obvious use case for Ubuntu Touch

Properties:

CanQuit - always returns false

Fullscreen - returns true if the app is truly fullscreen, otherwise false if the app is resized to show the parts of the shell

CanSetFullscreen - returns true

CanRaise - returns true

HasTrackList - returns true

Identity - returns the player's name from the corresponding .desktop file

DesktopEntry - returns the basename of the installed .desktop file

SupportedUriSchemes - returns an array of the protocol types that the player supports for playing media from

SupportedMimeTypes - returns an array of the mime types that the player supports

Player Interface:
----------------------
Methods:

Next() - already implemented, no changes needed

Previous() - already implemented, no changes needed

Pause() - already implemented, no changes needed

PlayPause() - already implemented, no changes needed

Stop() - already implemented, no changes needed

Play() - already implemented, no changes needed

Seek() - already implemented, no changes needed

SetPosition() - already implemented, no changes needed

OpenUri() - already implemented, no changes needed

Signals:

Seeked() - already implemented, no changes needed

Properties:

PlaybackStatus - already implemented, no changes needed

LoopStatus - already implemented, no changes needed

Rate - already implemented, no changes needed

Shuffle - already implemented, no changes needed

MetaData - already implemented, no changes needed

Volume - already implemented, no changes needed

Position - already implemented, no changes needed

MinimumRate - already implemented, no changes needed

MaximumRate - already implemented, no changes needed

CanGoNext - already implemented, no changes needed

CanGoPrevious - already implemented, no changes needed

CanPlay - already implemented, no changes needed

CanPause - already implemented, no changes needed

CanSeek - already implemented, no changes needed

CanControl - already implemented, no changes needed

Tracklist Interface:
-------------------------
Methods:

GetTracksMetadata() - already implemented, no changes needed

AddTrack() - already implemented, no changes needed

RemoveTrack() - already implemented, no changes needed

GoTo() - already implemented, no changes needed

Signals:

TrackListReplaced - already implemented, no changes needed

TrackAdded - already implemented, no changes needed

TrackRemoved - already implemented, no changes needed

TrackMetadataChanged - already implemented, no changes needed

Properties:

Tracks - already implemented, no changes needed

CanEditTracks - already implemented, no changes needed

Playlists Interface:
-------------------------
Currently not implemented and not going to implement for 14.04

Existing code reference:
---------------------------------
http://bazaar.launchpad.net/~thomas-voss/music-hub/add-backend-and-service-implementation/files

(?)

Work Items

Work items for ubuntu-13.11:
[jhodapp] Talk to the media scanner team about integrating thumbnailer into media-hub: DONE
[rsalveti] powerd integration for media-hub: DONE
[jhodapp] General porting of music-hub to be a more general media-hub: DONE
[jhodapp] Add video support to music-hub: DONE
[jhodapp] platform-api/QtMultimedia integration: DONE
[vthompson] Investigate and port music-app to use media-hub: INPROGRESS

Work items for ubuntu-14.04:
[jdstrand] Adjust the apparmor policy for music-hub: DONE

Dependency tree

* Blueprints in grey have been implemented.