xbmc minified as a server?

  Thread Rating:
  • 6 Votes - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
frals Offline
Junior Member
Posts: 7
Joined: Aug 2012
Reputation: 0
Post: #81
(2012-06-13 10:48)vicbitter Wrote:  With the latest code from head you now create a libxbmc.so shared library that can be used to create your own CLI (or server-based) XBMC applications... Smile

Here is a sample Video Library scanner application that uses libxbmc.so to update XBMCs Video Library...

http://pastebin.com/WpEvRTws

Enjoy!

Awesome stuff, thank you!

I had some crashes while uploading my library due to the rarlib wanting to show progressbar whenever it unpacked a sub, here's a patch for it: https://github.com/frals/xbmc/commit/06f...7b152ab457

EDIT: fix part of master as of now: https://github.com/xbmc/xbmc/commit/4577...027cf38180
(This post was last modified: 2012-08-25 17:47 by frals.)
find quote
vicbitter Offline
Member+
Posts: 244
Joined: Jan 2011
Reputation: 3
Post: #82
You might want to use the updated sample code from this post
find quote
schmoko Offline
Junior Member
Posts: 47
Joined: Jul 2008
Reputation: 0
Post: #83
Has anyone created a less kludgy way of building the sample application? My makefile-fu is pretty weak, so I'm hoping someone else has.

Ideally there should be a way to build without having to link the entire xbmc source tree (isn't that the point of a standalone lib?), but I would be happy just to be able to build xbmc-server in parallel with xbmc without temporary Makefile changes.

Ian.
find quote
frals Offline
Junior Member
Posts: 7
Joined: Aug 2012
Reputation: 0
Post: #84
(2012-08-25 21:52)vicbitter Wrote:  You might want to use the updated sample code from this post

Totally missed that, thanks. Here's a version that compiles against current master: https://gist.github.com/3475929 - g_application.getApplicationMessenger() replaced with CApplicationMessenger::Get().
find quote
Odon Offline
Member
Posts: 68
Joined: Apr 2010
Reputation: 0
Post: #85
(2012-08-26 02:54)schmoko Wrote:  Has anyone created a less kludgy way of building the sample application? My makefile-fu is pretty weak, so I'm hoping someone else has.

Ideally there should be a way to build without having to link the entire xbmc source tree (isn't that the point of a standalone lib?), but I would be happy just to be able to build xbmc-server in parallel with xbmc without temporary Makefile changes.

Ian.

Makefile for xbmc-server (sample application is xbmc-server.cpp in a subfolder of XBMC tree with included Makefile => "make all"):
Code:
SOURCES := xbmc-server.cpp

LFLAGS += -lxbmc -L..

# Objs are all the sources, with .cpp replaced by .o
OBJS := $(SOURCES:.cpp=.o)

all: xbmc-server
        include ../Makefile.include

xbmc-server: $(OBJS)
    $(CC) $(CFLAGS) -o xbmc-server $(OBJS) $(LFLAGS) $(LIBS)

# Get a .o from a .cpp by calling compiler with cflags and includes (if defined)
.cpp.o:
    $(CC) $(CFLAGS) $(INCLUDES) -c $<
find quote
schmoko Offline
Junior Member
Posts: 47
Joined: Jul 2008
Reputation: 0
Post: #86
(2012-08-27 23:23)Odon Wrote:  
(2012-08-26 02:54)schmoko Wrote:  Has anyone created a less kludgy way of building the sample application? My makefile-fu is pretty weak, so I'm hoping someone else has.

Ideally there should be a way to build without having to link the entire xbmc source tree (isn't that the point of a standalone lib?), but I would be happy just to be able to build xbmc-server in parallel with xbmc without temporary Makefile changes.

Ian.

Makefile for xbmc-server (sample application is xbmc-server.cpp in a subfolder of XBMC tree with included Makefile => "make all"):

Thanks, this is perfect. I now realize that rebuilding shouldn't be required unless the database or APIs change, but at least now its a painless part of the normal deployment procedure.

Ian.
find quote
Bootlegninja Offline
Member
Posts: 96
Joined: May 2011
Reputation: 0
Post: #87
Any chance we could get a cleaned up guide on compiling the headless server? I'm curious on this since I've started using the shared database on my NAS.
find quote
vicbitter Offline
Member+
Posts: 244
Joined: Jan 2011
Reputation: 3
Post: #88
To use with the latest code from XBMC head (ie. Frodo)

1) If you haven't built libxbmc.so

Code:
cd xbmc-frodo directory
./bootstrap
./configure --enable-shared-lib
make

copy the libxbmc.so shared library to /lib

2) Build the sample application

a) Copy the following make and sample code into the xbmc directory under the xbmc-frodo directory
i) xbmcVideoLibraryScan.cpp
ii) make_xbmcVideoLibraryScan

b) Build the application
Code:
cd xbmc-frodo directory
cd xbmc
make -f make_xbmcVideoLibraryScan all

3) To run the sample application
Code:
XBMC_BIN_HOME=/usr/local/lib/xbmc XBMC_HOME=/usr/local/share/xbmc ./xbmcVideoLibraryScan
find quote
Bootlegninja Offline
Member
Posts: 96
Joined: May 2011
Reputation: 0
Post: #89
Thanks! I'll be working on this later as I have to redo my OMV machine from screwing it up learning. Big Grin
find quote
edhen Offline
Banned
Posts: 71
Joined: May 2012
Post: #90
So after being away for a long time, as i had been without my server. I thought i would check in to ask how development is going. As i had mentioned in the first post of this thread, I was working on a web UI to interact with both server & clients in 1 setup, Only the last few weeks had i started too engage in the development. Below is a picture off where im up too soo far,

[Image: xbmcn.jpg]

Now in regards to my plans, everything is being set as a server / client model structure, Soooo..... any video, audio scans will be processed through the server and any player commands will be sent through to the clients (I use the term client xbmc, as many others may refer to it as a server, but in regards to this situation, imo any xbmc receiving files and acting as a player is regarded as a client). Now.. Back to the first post when i tested the headless version months ago, i noticed it didn't gather streaming data, I don't know if this had been rectified or not, but it didn't allow me to determine the quality of videos and there outputs etc. In my web UI, i will be integrating the update and clean options as well as any other server tasks. I also find that if we are to set art data locally on the server, it delays loading times on the clients. I think maybe doing a rsync callback after each update to every xbmc is the way to go atm, Although i heard Fredo will resolve this issue.

Other than that, as long as the server version does the basic tasks will be sufficient for 99% of server client xbmc setups. Also is the direction heading towards cli or daemon? I will try the latest version in a day or 2 as im not in the mind set to play around with the server atm lol....cli wouldnt be a bad idea, only problem is 3rd party apps wouldn't have access to scan or clean libraries remotely... Either way i'm happy to see this coming along and hopefully be the norm in the near future.

EDIT: come to think about it, I prefer the continuation off a daemon version (Continually running) as this still allows browsing and administrative tasks on items while other clients are powered down. I also use the server to list the libraries as the clients all reference the same id's for each item. This elimates reloads when switching clients and makes transitions a snap when doing player tasks on multiple Xbmc's....
(This post was last modified: 2012-09-20 16:32 by edhen.)
find quote
Post Reply