using coherence as a client

10 messages Options
Embed this post
Permalink
Alexandre LIBERT

using coherence as a client

Reply Threaded More More options
Print post
Permalink
hi,

I'm working on an Multimedia application in python witch give you the possibility to the manage your personal calendar, to watch your personal videos, to navigate on the Internet etc...

for the next step i had to put all user data in another device (server). So my application has to establish a connection between the client and the server to retrieve user data and let the possibility to manage and watch it.

for this i use this architecture:

server : windows xp wih TVersity installed

client: ubuntu with coherence

for now I'm in these situation but didn't now if coherence can easily answer my problem.

I'm using the upnp-tester.py module:

i created a nex function named cmd_test where i can like this:

       import coherence.upnp.devices.media_server_client as msc

       def cmd_test(self, args):
           for d in self.coherence.get_devices():
               if d.friendly_name == "<the name of my TVersity media server>":
                   my_msc = msc.MediaServerClient(d)
                   print my_msc.content_directory.browse()


with these function i want to enumerate all files included in my TVersity media server, but i really don't know if i have a good approach maybe i'm not in the right direction so what i really expect from your help is to tell me how i'can easilly create an media server client that can work with my server and if there some interessted examples or files in coherence sources that can help me in my researchs....


i'm sorry for my english but i expect you will be able to help me.

Alex






_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Frank Scholz

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
Hi Alexandre,


> for now I'm in these situation but didn't now if coherence can easily
> answer my problem.
>
> I'm using the upnp-tester.py module:
>
> i created a nex function named cmd_test where i can like this:
[...]
> with these function i want to enumerate all files included in my
> TVersity media server, but i really don't know if i have a good approach
> maybe i'm not in the right direction so what i really expect from your
> help is to tell me how i'can easilly create an media server client that
> can work with my server and if there some interessted examples or files
> in coherence sources that can help me in my researchs....

One very simple example is here:

http://coherence.beebits.net/wiki/Examples#ReactoneachMediaServerandbrowseitsroot-container:

The Inspector has a MediaServer browse method too:

http://coherence.beebits.net/browser/trunk/UPnP-Inspector/upnp_inspector/mediaserver.py#L434

Or if you would like to use the D-Bus Api, the same thing is:

http://coherence.beebits.net/browser/trunk/Coherence/coherence/ui/av_widgets.py#L666

Creating a client isn't that difficult (see first example),
but think I might have not fully understood what exactly
you want to do.

Regards,
Frank
_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Alexandre LIBERT

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
thank you for examples.

since i have posted this message i have take a look on the media server of upnp-inspector and i now my client works well as a control point. 

i can browse my media server but i have some trouble using action like import resources. Maybe i will find some interested thing about it in your links, i hope so. 

My problem is what i have to initialize to be able to import media file from my server ? av_transport ? ( i see these object but i don't what is it for).

I'm interested if you have any information about importing files.


thanks a lot for your help.

Regards,
Alex

_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Frank Scholz

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
Hi Alexandre,

> My problem is what i have to initialize to be able to import media file
> from my server ? av_transport ? ( i see these object but i don't what is
> it for).
>
> I'm interested if you have any information about importing files.

"Importing" is part of the ContentDirectory service. And the actions
needed for that are optional, so you first have to check whether the
MediaServer does support them.

The actions are 'CreateObject' and 'ImportResource'.
If there is only a 'CreateObject' and no 'ImportResource',
your only option is to push the content via a HTTP-Post
to the URI in the result of 'CreateObject'.

  service = device.get_service_by_type('ContentDirectory')
  if 'CreateObject' in service.get_actions():
      ....

The Coherence FSStore and the FlickrStore backend both support these
actions btw.

For that HTTP-Post there is already a simple helper
in the ControlPoint class.

http://coherence.beebits.net/browser/trunk/Coherence/coherence/upnp/devices/control_point.py#L158

Now to the example.

There is a Nautilus plugin to upload selected files to
an UPnP A/V MediaServer

http://coherence.beebits.net/wiki/Nautilus#uploadingselectedfilestoUPnPAVMediaServers

The code that actually imports a file is

http://coherence.beebits.net/browser/trunk/Coherence/coherence/ui/av_widgets.py#L275

It uses 'DLNA.ORG_AnyContainer' as the target container, leaving the
choice to the MediaServer where to put it.

Regards,
Frank
_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Alexandre LIBERT

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
ok thanks a lot for show me the nautilus application. I think i will found a lot of interesting informations about what i want to do with cohenrece.

What i want to do with cohrence is to be able to stream videos or musics from a server to a client with upnp technologie.

thanks a lot for your help.

regards,

alex

_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Alexandre LIBERT

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
Hi,

recently i created my own backend but i didn't succed in see it in the upnp inspector...

when i launch coherence log tel me that my plugin can't be found.

to load it i use configuration file name .coherence and i specify my pluggin like that  [[MyBackend]]   MyBackend is the same as the class i created :   class MyBackend(backenstore)....

maybe there are some files where i have to specify it or something like that ?

regards,

Alex

_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Dominik

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
Hi Alexandre,

I think you should have made a new thread for this since it has nothing to do with "using coherence as a client" but anyway.

I bet you have the same problem I had with my first backend. :-)
You have to make an entry in in Coherence.egg-info/entry_points.txt respectively the setup.py file.


2009/4/21 Alexandre LIBERT <[hidden email]>
Hi,

recently i created my own backend but i didn't succed in see it in the upnp inspector...

when i launch coherence log tel me that my plugin can't be found.

to load it i use configuration file name .coherence and i specify my pluggin like that  [[MyBackend]]   MyBackend is the same as the class i created :   class MyBackend(backenstore)....

maybe there are some files where i have to specify it or something like that ?

regards,

Alex

_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev



_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Alexandre LIBERT

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
hi Dominik,

thansk a lot for your help, now i can see my media server backend  with upnp inspector. For now i can't browse this media server but i think this is because of my item class, but your help was very nice.

regards,

Alex


_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Jean-Michel Sizun

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
In reply to this post by Dominik
Hi,
This need for a double entry in entry_points.txt and setup.py has being bugging me.
Does anybody sees a way to avoid it?
Jean-Michel


2009/4/21 Dominik Ruf <[hidden email]>
Hi Alexandre,

I think you should have made a new thread for this since it has nothing to do with "using coherence as a client" but anyway.

I bet you have the same problem I had with my first backend. :-)
You have to make an entry in in Coherence.egg-info/entry_points.txt respectively the setup.py file.


2009/4/21 Alexandre LIBERT <[hidden email]>
Hi,

recently i created my own backend but i didn't succed in see it in the upnp inspector...

when i launch coherence log tel me that my plugin can't be found.

to load it i use configuration file name .coherence and i specify my pluggin like that  [[MyBackend]]   MyBackend is the same as the class i created :   class MyBackend(backenstore)....

maybe there are some files where i have to specify it or something like that ?

regards,

Alex

_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev



_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev



_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev
Frank Scholz

Re: using coherence as a client

Reply Threaded More More options
Print post
Permalink
Hi,

> This need for a double entry in entry_points.txt and setup.py
> has being bugging me.

only setup.py is needed. entry_points.txt will be updated automatically
during the python ./setup.py install|build|... process.

Regards,
Frank

_______________________________________________
coherence-dev mailing list
[hidden email]
http://lists.beebits.net/cgi-bin/mailman/listinfo/coherence-dev