Re: Building a Media Renderer



On 21 January 2016 at 22:23, Nick Deubert <ndeubert gmail com> wrote:
>
> Hey Everyone,
>
> I've been lingering on irc, but figured I would post here to get a
> broader audience. I am working on implementing a media renderer using
> GUPNP. I started by looking at the example code and followed the
> "Writing a UPnP Service" tutorial. I used the AVTransport3.xml
> RenderingControl3.xml and ConnectionManager3.xml files from upnp.org
> for my SCPDs and ran them through gupnp-binding-tool to create the
> action_get/set and signal_connect functions, though I don't see these
> equivalent functions in the example code so I wasn't sure if this was
> necessary?

In a couple of places GUPnP has multiple ways to do something -- this is one of them and the docs don't really make it clear how you're supposed to pick one. The main options are:
1. Write all the signal connection stuff by hand, e.g.:
    g_signal_connect (service, "action-invoked::GetProtocolInfo", cb, data);
2. Use gupnp_service_signals_autoconnect() and hope you got every function name correct
3. Use the gupnp-binding-tool to generate a service-specific API and use e.g.
    cm_get_protocol_info_action_connect (service, cb, data)
 
All have pros and cons but TL;DR is that if you use #2, there's no need for the gupnp-binding-tool generated files of #3.

> I then started by created _cb and query_cb functions for the
> ConnectionManager SCPD (since it was the shortest) and I believe I
> followed the proper syntax (given in gupnp-service.c), however my
> autoconnect call fails. I have attached a tarball of the code (with
> Makefile for Ubuntu 15.10) to this point. Any guidance would be
> greatly appreciated.

The code looks like it should work (although for everyones sanity, please use pkg-config in the Makefile even if you write it by hand).

Your Device description says "<SCPDURL>/ConnectionManager/scpd.xml</SCPDURL>" but you don't have a file like that. That should give you an error message but you did not mention that? The correct url is probably "<SCPDURL>/ConnectionManager3.xml</SCPDURL>" (meaning that file in the same directory as the device description).

HTH,
 Jussi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]