Re: Building a Media Renderer



On Mon, Jan 25, 2016 at 6:58 AM, Jussi Kukkonen
<jussi kukkonen intel com> wrote:
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.

Ah, I see... if I were do #3, would I simply just call all of the
_action_set and _action_connect functions on startup in place of the
autoconnect call?

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).


Yes, will do. That Makefile was just quick & dirty for the sake of
compiling it without all the other baggage. Eventually this will be
folded into make files for a larger project.

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).

You were right, I did need to correct that, but then I still got
"Connection terminated unexpectedly" which turned out to be an issue
with autoconnect in the version Ubuntu uses of gupnp. Jens helped me
realize by building the code on his box where everything worked fine.
Thanks for you help.


HTH,
 Jussi


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