Cling AVTransport:违反UPnP规范

时间:2015-08-31 16:37:23

标签: java upnp

所以实际上我正在尝试将MP3文件发送到电视上。但由于电视只是给你一个内部服务器错误,我创建了一个MediaRenderer,就像在Cling样本中一样。通过监控它我有一个奇怪的错误信息。 但首先是我的代码:

    ActionCallback setAVTransportURIAction = new SetAVTransportURI(service,uri,metadata) {
        @Override
        public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) {
            System.out.println(defaultMsg);
        }
    };

uri是本地http服务器的字符串:http://127.0.0.1/file.mp3 我用DIDL Parser创建的元数据

DIDLContent didl = new DIDLContent();       
ProtocolInfo info = new ProtocolInfo("http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01500000000000000000000000000000");
MusicTrack track =new MusicTrack("0","0",title,creator,album, artist, new Res(info, size, uri));
didl.addItem(track);
DIDLParser parser = new DIDLParser();       
String metadata="";
try {
    metadata = parser.generate(didl);
} catch (Exception e) {
    e.printStackTrace();
}

与手册中的示例一样,我通过upnpservice发送它:

upnpService.getControlPoint().execute(setAVTransportURIAction);

我知道自从我路由到localhost后电视无法获取文件。 但我用于调试的“假”MediaRenderer吐出了这条消息:

[cling-10        ] WARNING - 18:31:08,478 - A10ServiceDescriptorBinderImpl#generateActionArgument: UPnP specification violation: Not producing <retval> element to be compatible with WMP12: (ActionArgument, OUT) Actions http://127.0.0.1/file.mp3
[cling-35        ] INFO   - 18:31:09,447 - DA10DeviceDescriptorBinderImpl#hydrateDevice: Invalid X_DLNADOC value, ignoring value: SST-1.0
[cling-10        ] INFO   - 18:31:11,701 - DA10DeviceDescriptorBinderImpl#hydrateDevice: Invalid X_DLNADOC value, ignoring value: SST-1.0
[cling-35        ] INFO   - 18:31:11,702 - DA10DeviceDescriptorBinderImpl#hydrateDevice: Invalid X_DLNADOC value, ignoring value: SST-1.0

伪造的MediaRenderer客户端不在Cling的支持示例中,我没有太多改变

有什么问题?

1 个答案:

答案 0 :(得分:0)

看看实际的实现,我可以看到:

if (actionArgument.isReturnValue()) {
    // TODO: UPNP VIOLATION: WMP12 will discard RenderingControl service if it contains <retval> tags
    log.warning("UPnP specification violation: Not producing <retval> element to be compatible with WMP12: " + actionArgument);
    // appendNewElement(descriptor, actionArgumentElement, ELEMENT.retval);
}

看来Action Argument不是'返回值'。我有同样的问题,所以当我进一步弄清楚这意味着什么......会更多地回答这个问题!