Xine Calling / Using Manually

Linux specific forum
Hydrate
Enthusiast
Enthusiast
Posts: 436
Joined: Mon May 16, 2005 9:37 pm
Contact:

Xine Calling / Using Manually

Post by Hydrate »

I wish to use Xine manually (not using the precompiled libraries PureBasic Provides). My issue is that I have no idea how to go about doing this. I have a list of commands which I need to call, but my issue is I do not know what to do with them.

Do I use some form of shared library and execute commands? Do I run some executable and read its console output and write to it?

Any help on this would be great as the Xine developers website does not help, looking at xine.h doesnt help me much either.
.::Image::.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

Hi,

this is a quick start to use the libxine.so without the PB internal commands. It uses Prototypes which have some advatages on Callfunction/callFunctionFast (see pb helpfile)

Hope, it helps a bit.... if there are questions left... ask :wink: ... and there is no way without the Xine.h

Code: Select all

#XINE_MAJOR_VERSION = 1
#XINE_MINOR_VERSION =1
#XINE_SUB_VERSION   = 15
#XINE_VERSION     =  "1.1.15"

Prototype xine_new_(); returns new xine pointer = *self
Prototype xine_init_(*self)
Prototype xine_osd_new_(*self,x.i,y.i,w.i,h.i)
Prototype xine_stream_new_(*stream, *xine_audio_port_t, *xine_video_port_t ) 
Prototype xine_check_version_(major, iminor, int )
Prototype xine_exit_(*self)

If OpenLibrary(0,"libxine.so")
    myXineNew.xine_new_=GetFunction(0,"xine_new")
    myXineInit.xine_init_=GetFunction(0,"xine_init")
    myXineStreamNew.xine_stream_new_=GetFunction(0,"xine_stream_new")
    myOSD.xine_osd_new_=GetFunction(0,"xine_osd_new")
    myXineCheckVersion.xine_check_version_=GetFunction(0,"xine_check_version")
    myXineExit.xine_exit_=GetFunction(0,"xine_exit")
    
    If  myXineCheckVersion(#XINE_MAJOR_VERSION,#XINE_MINOR_VERSION,#XINE_SUB_VERSION)
        MessageRequester("Xine ready","Version "+#XINE_VERSION+" found",#PB_MessageRequester_Ok)
        *pointer=myXineNew()
        ;before you call the myXineInit, you have to load approbriate audio and video drivers installed with xine 
        ;see *xine_open_video_driver (xine_t *self, const char *id, int visual, void *Data) etc in xine.h for more details
        ;
;         ret=myXineInit(*pointer)
;         *stream=myXineStreamNew(*pointer,0,0)
;         MyOSD(*stream,10,10,500,20)
        myXineExit(*pointer);free all resources!
    Else
        MessageRequester("Incompatible Version","At least Version "+#XINE_VERSION+" is required",#PB_MessageRequester_Ok)
    EndIf
    CloseLibrary(0)
EndIf
End
If your list of commands isn't too long, i would help you to adapt them into prototypes :)
Hydrate
Enthusiast
Enthusiast
Posts: 436
Joined: Mon May 16, 2005 9:37 pm
Contact:

Post by Hydrate »

Thank you very much for the reply, this was most helpful to me. I am using the muxine.c file which can be found on the xine website here:

http://www.xine-project.org/samples/muxine.c

All of the commands I need to call are in that (as I wish to in effect copy the code posted above there). I am not especially good with Linux API as this is my first time in using it, therefore I am still learning how it all works. Knowing what I need is in a shared object was of much help, so now I must ask, there are alot of X11 functions called in this file (such as XOpenDisplay). Do I access these in the same manner? If so where can I find the shared object to do this with?
.::Image::.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

:D :D

.. i think it's defined in one of the x-org libs(xlib.h is a good start) - may you have to install the sources for the x environment of your distribution - and then make a seach accross the source files.... :roll:

if you know the lib and the parameters from the header-files.. you can theoretically call every function of every library :)
Post Reply