From caf318d4999dff48937b8dece3c3e007ee8ee55b Mon Sep 17 00:00:00 2001 From: Dan Walters Date: Mon, 11 Mar 2019 19:02:52 -0500 Subject: [PATCH] dlna: add connection manager service description The UPnP MediaServer spec says that the ConnectionManager service is required, and adding it was enough to get dlna support working on my other TV (LG webOS 2.2.1). --- cmd/serve/dlna/cm-service-desc.go | 184 ++++++++++++++++++++++++++++++ cmd/serve/dlna/dlna.go | 8 ++ cmd/serve/dlna/dlna_test.go | 3 + 3 files changed, 195 insertions(+) create mode 100644 cmd/serve/dlna/cm-service-desc.go diff --git a/cmd/serve/dlna/cm-service-desc.go b/cmd/serve/dlna/cm-service-desc.go new file mode 100644 index 000000000..8147d0317 --- /dev/null +++ b/cmd/serve/dlna/cm-service-desc.go @@ -0,0 +1,184 @@ +package dlna + +const connectionManagerServiceDescription = ` + + + 1 + 0 + + + + GetProtocolInfo + + + Source + out + SourceProtocolInfo + + + Sink + out + SinkProtocolInfo + + + + + PrepareForConnection + + + RemoteProtocolInfo + in + A_ARG_TYPE_ProtocolInfo + + + PeerConnectionManager + in + A_ARG_TYPE_ConnectionManager + + + PeerConnectionID + in + A_ARG_TYPE_ConnectionID + + + Direction + in + A_ARG_TYPE_Direction + + + ConnectionID + out + A_ARG_TYPE_ConnectionID + + + AVTransportID + out + A_ARG_TYPE_AVTransportID + + + RcsID + out + A_ARG_TYPE_RcsID + + + + + ConnectionComplete + + + ConnectionID + in + A_ARG_TYPE_ConnectionID + + + + + GetCurrentConnectionIDs + + + ConnectionIDs + out + CurrentConnectionIDs + + + + + GetCurrentConnectionInfo + + + ConnectionID + in + A_ARG_TYPE_ConnectionID + + + RcsID + out + A_ARG_TYPE_RcsID + + + AVTransportID + out + A_ARG_TYPE_AVTransportID + + + ProtocolInfo + out + A_ARG_TYPE_ProtocolInfo + + + PeerConnectionManager + out + A_ARG_TYPE_ConnectionManager + + + PeerConnectionID + out + A_ARG_TYPE_ConnectionID + + + Direction + out + A_ARG_TYPE_Direction + + + Status + out + A_ARG_TYPE_ConnectionStatus + + + + + + + SourceProtocolInfo + string + + + SinkProtocolInfo + string + + + CurrentConnectionIDs + string + + + A_ARG_TYPE_ConnectionStatus + string + + OK + ContentFormatMismatch + InsufficientBandwidth + UnreliableChannel + Unknown + + + + A_ARG_TYPE_ConnectionManager + string + + + A_ARG_TYPE_Direction + string + + Input + Output + + + + A_ARG_TYPE_ProtocolInfo + string + + + A_ARG_TYPE_ConnectionID + i4 + + + A_ARG_TYPE_AVTransportID + i4 + + + A_ARG_TYPE_RcsID + i4 + + +` diff --git a/cmd/serve/dlna/dlna.go b/cmd/serve/dlna/dlna.go index b430634a4..df8dec1bd 100644 --- a/cmd/serve/dlna/dlna.go +++ b/cmd/serve/dlna/dlna.go @@ -84,6 +84,14 @@ var services = []*service{ }, SCPD: contentDirectoryServiceDescription, }, + { + Service: upnp.Service{ + ServiceType: "urn:schemas-upnp-org:service:ConnectionManager:1", + ServiceId: "urn:upnp-org:serviceId:ConnectionManager", + ControlURL: serviceControlURL, + }, + SCPD: connectionManagerServiceDescription, + }, } func init() { diff --git a/cmd/serve/dlna/dlna_test.go b/cmd/serve/dlna/dlna_test.go index a2ef03445..8c5492117 100644 --- a/cmd/serve/dlna/dlna_test.go +++ b/cmd/serve/dlna/dlna_test.go @@ -59,6 +59,9 @@ func TestRootSCPD(t *testing.T) { // Make sure that the SCPD contains a CDS service. require.Contains(t, string(body), "urn:schemas-upnp-org:service:ContentDirectory:1") + // Make sure that the SCPD contains a CM service. + require.Contains(t, string(body), + "urn:schemas-upnp-org:service:ConnectionManager:1") // Ensure that the SCPD url is configured. require.Regexp(t, "/.*", string(body)) }