3

i'have a probleme using Upnp to send video file to xbox one with java/android.

I use cling api to discover and connect upnp device over network. The discover operation work well, the xbox one is detected. The problem is when i try to send video link to this device.

Here, it's the xbox response on upnp connect service:

<root xmlns="urn:schemas-upnp-org:device-1-0"
  xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation"
  xmlns:microsoft="urn:schemas-microsoft-com:WMPDMR-1-0"
  xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11">

<specVersion>
  <major>1</major>
  <minor>0</minor>
</specVersion>
<device>`
<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
<friendlyName>Xbox-SystemOS</friendlyName>
<modelName>Xbox One</modelName>
<modelDescription>Digital Media Renderer</modelDescription>
<manufacturer>Microsoft Corporation</manufacturer>
<manufacturerURL>http://www.microsoft.com</manufacturerURL>
<modelURL>http://xbox.com</modelURL>
<UDN>uuid:6e5e6c24-e450-4c6b-8987-89c6be33a1f7</UDN>
<df:X_containerId>{6E5E6C24-E450-4C6B-8987-89C6BE33A1F7}</df:X_containerId>
<dlna:X_DLNACAP xmlns:dlna="urn:schemas-dlna-org:device-1-0"/>
<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
<pnpx:X_deviceCategory>MediaDevices</pnpx:X_deviceCategory>
<pnpx:X_hardwareId>VEN_0125&DEV_0002&REV_0001 VEN_0125&DEV_0002</pnpx:X_hardwareId>
<iconList>
    <icon>
        <mimetype>image/jpeg</mimetype>
        <width>120</width>
        <height>120</height>
        <depth>24</depth>
        <url>/upnphost/udhisapi.dll?content=uuid:cde23e6c-d763-427d-b96b-c71a8cc5a3a5</url>
    </icon>
    <icon>
        <mimetype>image/jpeg</mimetype>
        <width>48</width>
        <height>48</height>
        <depth>24</depth>
        <url>/upnphost/udhisapi.dll?content=uuid:a89beb23-a099-4f65-8cd5-aad6e7210db0</url>
    </icon>
    <icon>
        <mimetype>image/png</mimetype>
        <width>120</width>
        <height>120</height>
        <depth>24</depth>
        <url>/upnphost/udhisapi.dll?content=uuid:d4eb98f9-e708-4faa-bcd4-591a9365d000</url>
    </icon>
    <icon>
        <mimetype>image/png</mimetype>
        <width>48</width>
        <height>48</height>
        <depth>24</depth>
        <url>/upnphost/udhisapi.dll?content=uuid:ba12866a-d6c8-4a19-94e7-7a2ed8f305b3</url>
    </icon> 
</iconList>
<serviceList>
    <service>
        <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
        <controlURL>/upnphost/udhisapi.dll?control=uuid:6e5e6c24-e450-4c6b-8987-89c6be33a1f7+urn:upnp-org:serviceId:RenderingControl</controlURL>
        <eventSubURL>/upnphost/udhisapi.dll?event=uuid:6e5e6c24-e450-4c6b-8987-89c6be33a1f7+urn:upnp-org:serviceId:RenderingControl</eventSubURL>
        <SCPDURL>/upnphost/udhisapi.dll?content=uuid:654eefc5-0e1b-4bfa-a72f-e02001be36e4</SCPDURL>
    </service>
    <service>
        <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
        <controlURL>/upnphost/udhisapi.dll?control=uuid:6e5e6c24-e450-4c6b-8987-89c6be33a1f7+urn:upnp-org:serviceId:AVTransport</controlURL>
        <eventSubURL>/upnphost/udhisapi.dll?event=uuid:6e5e6c24-e450-4c6b-8987-89c6be33a1f7+urn:upnp-org:serviceId:AVTransport</eventSubURL>
        <SCPDURL>/upnphost/udhisapi.dll?content=uuid:85466b84-2a4a-4514-b7a4-2bb7a4871da4</SCPDURL>
    </service>
    <service>
        <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
        <controlURL>/upnphost/udhisapi.dll?control=uuid:6e5e6c24-e450-4c6b-8987-89c6be33a1f7+urn:upnp-org:serviceId:ConnectionManager</controlURL>
        <eventSubURL>/upnphost/udhisapi.dll?event=uuid:6e5e6c24-e450-4c6b-8987-89c6be33a1f7+urn:upnp-org:serviceId:ConnectionManager</eventSubURL>
        <SCPDURL>/upnphost/udhisapi.dll?content=uuid:1de93088-6694-4d7c-a4a5-771ae3008378</SCPDURL>
    </service>
</serviceList>
</device>
</root>

As said in the api documentation, you have to send first an SetAVTransportURI action to the device wich provide the url of the video file:

4.2. Controlling a renderer
Cling Support provides several action callbacks that simplify creating a     control point for the AVTransport service. This is the client side of your     player, the remote control.

This is how you set an URI for playback:

ActionCallback setAVTransportURIAction = new SetAVTransportURI(service, "http://www.duorimes.siquiere.fr/wa_files/Il_20camino.flv", "NO METADATA") {
            @Override
            public void failure(ActionInvocation invocation, UpnpResponse     operation, String defaultMsg) {
                // Something was wrong
        }
    };
This is how you actually start playback:

ActionCallback playAction = new Play(service) {
            @Override
            public void failure(ActionInvocation invocation, UpnpResponse     operation, String defaultMsg) {
                // Something was wrong
            }
        };

In my case, the first action send me a 500 error code (Internal server error)

Did someone ever experience the same problem?

Thanks by advance for your help.

Simon Mardiné
  • 510
  • 2
  • 7
  • 23
  • 1
    Your metadata is malformed (unless "NO METADATA" is some weird special case in cling). an empty string might be accepted. Also, are you sure the renderer can play the video format - "flv" support is certainly not required by upnp specs? – Jussi Kukkonen Aug 05 '15 at 15:12

1 Answers1

2

For SetAVTransportURI, meta must be encoded in XML defined by DLNA spec.

In SetAVTransportURI(service, "http://www.duorimes.siquiere.fr/wa_files/Il_20camino.flv", "NO METADATA"), "NO METADATA" is illegal XML string.

Try to use empty String "" or generate your own meta XML may help.

yjzhang
  • 4,859
  • 3
  • 19
  • 21