Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DLNA Controller in Java
10-07-2012, 07:49 PM
Post: #1
Question DLNA Controller in Java
Hi All,

I am setting out to build a DLNA controller for music and pictures and a renderer for pictures only in Java. I've gotten the ohnet stack and Java bindings built for my platform.

Would anyone have any recommendations for how to go about building the ohnet facing components for DLNA? Also, if anyone can point me to any relevant example code, that would be helpful as well.

Thanks!
Mark Wolfskehl
Find all posts by this user
11-07-2012, 11:13 AM
Post: #2
RE: DLNA Controller in Java
Welcome to the forum Mark.

By "ohnet facing components for DLNA", do you mean the classes that wrap particular UPnP services into Java classes? Source for these is available under OpenHome/Net/Bindings/Java/org/openhome/net. See controlpoint/proxies for your controller and device/providers for your renderer. These can be built using the CpProxyJavaClasses and DvDeviceJavaClasses make targets.

See OpenHome/Net/Bindings/Java/org/openhome/net/device/tests/TestDvDevice.java for some simple example code that uses both proxies and providers.

If the terms proxy & provider are unfamiliar, it'd also be worth having a scan through the Control Point and Device Stack docs at http://www.openhome.org/wiki/OhNet#Overview_docs.

Let us know if that doesn't cover your questions.

Simon
Find all posts by this user
11-07-2012, 02:33 PM
Post: #3
RE: DLNA Controller in Java
Well, I suppose my first question that I wasn't clear about is whether ohnet itself just implements UPnP itself or the whole DLNA logic. That is, is there anything I need to do on top of ohnet to support DLNA specifically, or is that all already baked in, so to speak?
Find all posts by this user
11-07-2012, 02:57 PM
Post: #4
RE: DLNA Controller in Java
(11-07-2012 02:33 PM)adaptiveal Wrote:  Well, I suppose my first question that I wasn't clear about is whether ohnet itself just implements UPnP itself or the whole DLNA logic. That is, is there anything I need to do on top of ohnet to support DLNA specifically, or is that all already baked in, so to speak?

ohNet is a UPnP stack, capable of publishing or consuming services over UPnP. My understanding of DLNA is that it is a set of rules governing the behaviour of product classes, including some that use UPnP. These rules are not open; you have to pay a substantial sum to access them. You don't require certification of DLNA compatibility to offer software providing or using a UPnP AV media renderer.

I suspect DLNA is irrelevant for you.

Your initial question suggested that you want to implement a UPnP AV media renderer for photos and want to control media renderers (both yours and external) for audio. The UPnP forum have defined a collection of services (effectively classes with methods and member variables) which describe the functionality a media renderer should provide. ohNet provides classes which represent these services plus code to identify and communicate with other providers or consumers of these services.

Another way of putting it is that ohNet provides everything you need to build your own media renderer. It does not however provide the full media renderer.
Find all posts by this user
11-07-2012, 07:08 PM
Post: #5
RE: DLNA Controller in Java
Thanks for the response. So, I think we're getting close to the crux of my question. My situation is that actually I have been given the assignment of building a media controller only. So, in terms of say a music player it would be that minus the renderer. The plan is that there will be a different device running the DLNA media server (serving the music assets) and yet another different device serving as the DLNA media/music renderer. I'm just the controller.

I don't have to get DLNA certification, that's not important. But I do have to build something that will actually work with a DLNA certified server and renderer.

Right now the first thing I need to do is to get an idea of the scope of the project - that is, does ohNet pretty much handle all the controller functionality? Or will I need to build a substantial amount of DLNA specific code on top of ohNet to get this to work? Will I need access to the DLNA specification (the company can in fact provide them to me)? Or is it a more straightforward process? I'm not sure what the difference between a plain UPnP media server/renderer/controller (if any) and DLNA versions are.

Mark

(11-07-2012 02:57 PM)simonc Wrote:  
(11-07-2012 02:33 PM)adaptiveal Wrote:  Well, I suppose my first question that I wasn't clear about is whether ohnet itself just implements UPnP itself or the whole DLNA logic. That is, is there anything I need to do on top of ohnet to support DLNA specifically, or is that all already baked in, so to speak?

ohNet is a UPnP stack, capable of publishing or consuming services over UPnP. My understanding of DLNA is that it is a set of rules governing the behaviour of product classes, including some that use UPnP. These rules are not open; you have to pay a substantial sum to access them. You don't require certification of DLNA compatibility to offer software providing or using a UPnP AV media renderer.

I suspect DLNA is irrelevant for you.

Your initial question suggested that you want to implement a UPnP AV media renderer for photos and want to control media renderers (both yours and external) for audio. The UPnP forum have defined a collection of services (effectively classes with methods and member variables) which describe the functionality a media renderer should provide. ohNet provides classes which represent these services plus code to identify and communicate with other providers or consumers of these services.

Another way of putting it is that ohNet provides everything you need to build your own media renderer. It does not however provide the full media renderer.
Find all posts by this user
11-07-2012, 07:49 PM
Post: #6
RE: DLNA Controller in Java
(11-07-2012 07:08 PM)adaptiveal Wrote:  Thanks for the response. So, I think we're getting close to the crux of my question. My situation is that actually I have been given the assignment of building a media controller only. So, in terms of say a music player it would be that minus the renderer. The plan is that there will be a different device running the DLNA media server (serving the music assets) and yet another different device serving as the DLNA media/music renderer. I'm just the controller.

I don't have to get DLNA certification, that's not important. But I do have to build something that will actually work with a DLNA certified server and renderer.

Right now the first thing I need to do is to get an idea of the scope of the project - that is, does ohNet pretty much handle all the controller functionality? Or will I need to build a substantial amount of DLNA specific code on top of ohNet to get this to work? Will I need access to the DLNA specification (the company can in fact provide them to me)? Or is it a more straightforward process? I'm not sure what the difference between a plain UPnP media server/renderer/controller (if any) and DLNA versions are.

Mark

I've implemented a UPnP media server in Java, and I haven't needed to do anything special for DLNA compatibility. I'm still waiting for the first user bug report that I can put down to the lack of DLNA compatibility. Smile My experience is that if you implement the UPnP AV specifications correctly, you'll be able to interoperate with other DLNA implementations.

ohNet handles all the communication aspects between your control point and the server and renderer. It doesn't include any code to help you build the internal logic of your control point.
Find all posts by this user
11-07-2012, 08:57 PM
Post: #7
RE: DLNA Controller in Java
Thanks. I'm building the ohnet libraries now for my arm platform. I think for getting familiar with the api i will probably start looking at the test code included in the source. Thanks for helping clear things up for me!

(11-07-2012 07:49 PM)simoncn Wrote:  
(11-07-2012 07:08 PM)adaptiveal Wrote:  Thanks for the response. So, I think we're getting close to the crux of my question. My situation is that actually I have been given the assignment of building a media controller only. So, in terms of say a music player it would be that minus the renderer. The plan is that there will be a different device running the DLNA media server (serving the music assets) and yet another different device serving as the DLNA media/music renderer. I'm just the controller.

I don't have to get DLNA certification, that's not important. But I do have to build something that will actually work with a DLNA certified server and renderer.

Right now the first thing I need to do is to get an idea of the scope of the project - that is, does ohNet pretty much handle all the controller functionality? Or will I need to build a substantial amount of DLNA specific code on top of ohNet to get this to work? Will I need access to the DLNA specification (the company can in fact provide them to me)? Or is it a more straightforward process? I'm not sure what the difference between a plain UPnP media server/renderer/controller (if any) and DLNA versions are.

Mark

I've implemented a UPnP media server in Java, and I haven't needed to do anything special for DLNA compatibility. I'm still waiting for the first user bug report that I can put down to the lack of DLNA compatibility. Smile My experience is that if you implement the UPnP AV specifications correctly, you'll be able to interoperate with other DLNA implementations.

ohNet handles all the communication aspects between your control point and the server and renderer. It doesn't include any code to help you build the internal logic of your control point.
Find all posts by this user
11-07-2012, 09:07 PM
Post: #8
RE: DLNA Controller in Java
ohNet handles all the protocol-specific functionality for you. You just need to consider the UI.

You can use the three classes in
  • CpProxyUpnpOrgAVTransport1.java
  • CpProxyUpnpOrgConnectionManager1.java
  • CpProxyUpnpOrgRenderingControl1.java
to access all functionality of a media renderer.

If you also want to access a media server, you can use
  • CpProxyUpnpOrgContentDirectory1.java
  • CpProxyUpnpOrgConnectionManager1.java
You might also need a X_MS_MediaReceiverRegistrar service which was defined by MicroSoft. If you do need this, you can generate a class like the ones above using the OhNetGen tool.

The UPnP forum contains a zip of protocol docs and service descriptions - see http://upnp.org/resources/upnpresources.zip.

You won't need anything else to work with a DLNA-certified server or renderer. It'd be worth reviewing the DLNA specs if they're available though - just in case they point to additional, optional but useful, functions.
Find all posts by this user
03-09-2013, 12:48 PM (This post was last modified: 03-09-2013 12:50 PM by rajareddy.)
Post: #9
RE: DLNA Controller in Java
Simonc, I have simple question
We have callback listener for deviceAdded(..) and deviceRemoved(..)
Let's take an Example, two devices added Device-A and Device-B
How to identify Device-A/B is of type DMS/DMR ?

--Raja
Find all posts by this user
03-09-2013, 01:23 PM
Post: #10
RE: DLNA Controller in Java
(03-09-2013 12:48 PM)rajareddy Wrote:  Simonc, I have simple question
We have callback listener for deviceAdded(..) and deviceRemoved(..)
Let's take an Example, two devices added Device-A and Device-B
How to identify Device-A/B is of type DMS/DMR ?

I've tried to answer your question below. If I haven't covered everything you'd like to know, it'd be great if you could post any follow-up questions to a new thread. Threads will become less useful to future readers if they start to cover multiple independent issues...

You have a couple of options to distinguish between different device types
  • You could avoid the problem by creating two device lists, one each for a service that is unique to only a server or renderer, setting their callbacks to point to different objects.
  • If you can't avoid having a single device list that includes both servers and renderers, you could call device.getAttribute("Upnp.DeviceXml") and check the value of the deviceType element
Find all posts by this user


Forum Jump: