Contents
Korva - a DLNA push service
Korva is a small, DBus-activateable daemon which does the device discovery and the push work.
Repository
https://github.com/phako/korva
Interfaces
org.jensge.Korva.Controller1
org.jensge.Korva.Controller1
The Controller1 interface has four methods:
aa{sv} org.jensge.Korva.Controller1.GetDevices () a{sv} org.jensge.Korva.Controller1.GetDeviceInfo (IN s uid) s org.jensge.Korva.Controller1.Push (IN a{sv} source, IN s uid) b org.jensge.Korva.Controller1.Unshare (IN s tag)
Methods
org.jensge.Korva.Controller1.GetDevices
Returns a list of dictionaries containing information about the current known devices. The mandatory properties are:
Type |
Key |
Description |
s |
UID |
Unique (per protocol) device identifier. For UPnP this is the UDN of the device |
s |
DisplayName |
Name of the device for display in an UI. Guaranteed to be UTF-8 |
s |
IconURI |
Local URI to an icon for the device. May be provided by the device or a generic icon |
s |
Protocol |
Currently fixed to "UPnP". Might be "AirPlay" or different in the future |
u |
Type |
Whether the device is a server or a client. Used for Upload |
org.jensge.Korva.Controller1.GetDeviceInfo
Return information about a single device. For description of the parameters and return values see GetDevices.
Type |
Parameter |
Description |
s |
uid |
A unique identifier of the device as returned by GetDevices |
org.jensge.Korva.Controller1.Push
Push a media file to a remote device.
Type |
Parameter |
Description |
a{sv} |
source |
A dictionary with meta-data about the file to be pushed. The only mandatory key is "URI". See MetaData for possible keys and their meaning |
s |
uid |
A unique identifier of the device as returned by GetDevices |
If the device associated with the UID is a server and it has the proper capabilities (UPnP CreateObject support, proper DLNA OCM flags), Push will try to upload the file to the device.
'Push' returns a tag that can be used with 'Unshare' to explicitly stop sharing of the file. This tag is unique for the combination of device and file.
MetaData
Type |
Key |
Description |
Mandatory |
s |
URI |
(Local) uri of the media file to push to the remote device |
✓ |
t |
Size |
Size of the media file |
✗ |
s |
Title |
A title for the media file |
✗ |
s |
Content type of the file |
✗ |
Errors
org.jensge.Korva.Error.NoSuchDevice org.jensge.Korva.Error.Timeout org.jensge.Korva.Error.FileNotFound org.jensge.Korva.Error.NotCompatible org.jensge.Korva.Error.InvalidArgs org.jensge.Korva.Error.NoSuchTransfer org.jensge.Korva.Error.NotAccessible
Signals
org.jensge.Korva.Controller1.DeviceAvailable(IN a{sv} device) org.jensge.Korva.Controller1.DeviceUnavailable(IN s UID)
Comments
After our discussion on #gnome-os (-- BastienNocera 2011-12-07 17:57:54):
- Push() should return a more meaningful error message
-> Proposed some errors -- JensGeorg 2012-02-24 18:14:00
- An explicit Unshare() should probably be added, as well as unsharing when a new URL is pushed (per-device, obviously), or when the controlling server goes away (Totem crashes, video isn't shared any more)
-> How to know that the controlling server went away? -- JensGeorg 2012-02-24 18:14:00
-> g_bus_watch_name() on the client's D-Bus name. -> Needs a bit more fine-grained control for one-shot tools like korva-control or the Harmattan sharing plugin
The code itself should be extensible to allow showing AirPlay devices in the same way
-> removed all UPnP"isms" from the D-Bus interface. -- JensGeorg 2012-02-24 18:14:00
- Push() should return a more meaningful error message
dLeyna Renderer
The dLeyna framework offers a component which is similar in spirit to Korva, dLeyna Renderer. The DBus API uses multiple interfaces:
- com.intel.dLeynaRenderer.Manager
- enumerates the discovered DMRs on the network and notififies applications when they appear/disappear
- com.intel.dLeynaRenderer.RendererDevice
- export useful info about the remote device itself
- org.mpris.MediaPlayer2.Player
- is used to control the status of the DMR
- com.intel.dLeynaRenderer.PushHost
- helps applications to implement the "2 box push" use case, where there's no DMS involved and it's the application itself that exports the media contents
A more complete description of the DBus API can be found at https://github.com/01org/dleyna-renderer/blob/master/doc/server/dbus/API.txt