Thread: [Libxine-java-devel] Capabilities and future
Status: Beta
Brought to you by:
freckle
From: Kristian L. L. <wa...@pa...> - 2008-09-22 18:59:51
|
Hey. I'm thinking about trying to write a simple linux-based mediacenter in java. I've made some early tests with libxine-java, and made video play. What I was wondering is, if there is (or is planned) to be able to do OSD? /walker |
From: Matthias R. <mri...@in...> - 2008-09-22 20:51:46
|
Hi Kristian On Sep 22, 2008, at 8:43 PM, Kristian Lindemann Larsen wrote: > Hey. > I'm thinking about trying to write a simple linux-based mediacenter in > java. That's the exact reason why I started libxine-java... > I've made some early tests with libxine-java, and made video play. Fine. > What I was wondering is, if there is (or is planned) to be able to > do OSD? libxine-java basically wraps the complete xine-lib. xine-lib contains support for OSD. See the section of their hacker guide at http://xinehq.de/index.php/hackersguide#OSD I just tried the example and it works both in a simple C application and in Java (I never tried the OSD before). The only catch is that the documented API is not available to user applications, but function with similar exists as xine_osd_... For a quick test, just add this code before calling controller.playOnce(): // xine.h constants not provided by libxine-java (yet) final int TEXTPALETTE_WHITE_BLACK_TRANSPARENT = 0; final int TEXTPALETTE_WHITE_NONE_TRANSLUCID = 3; final int OSD_TEXT1 = 0 * 11; final int OSD_TEXT2 = 1 * 11; // used in this example final int width = 320; final int height = 240; // get xine stream SWIGTYPE_p_xine_stream_s stream = controller.getNativeStream(); SWIGTYPE_p_xine_osd_s osd = XineLib.xine_osd_new(stream, 0, 0, width, height); /* set sans serif 24 font */ XineLib.xine_osd_set_font( osd, "sans", 24); /* copy pre-defined colors for white, black border, transparent background to starting at the index used by the first text palette */ XineLib.xine_osd_set_text_palette(osd, TEXTPALETTE_WHITE_BLACK_TRANSPARENT, OSD_TEXT1); /* copy pre-defined colors for white, no border, translucid background to starting at the index used by the second text palette */ XineLib.xine_osd_set_text_palette(osd, TEXTPALETTE_WHITE_NONE_TRANSLUCID, OSD_TEXT2); XineLib.xine_osd_draw_text(osd, 0, 100, "white text, black border", OSD_TEXT1); XineLib.xine_osd_draw_text(osd, 0, 130, "white text, no border", OSD_TEXT2); XineLib.xine_osd_draw_line(osd, 0, 0, width-1, height-1, 10); XineLib.xine_osd_draw_line(osd, width-1, 0, 0 , height-1, 10); XineLib.xine_osd_show(osd, 0); /* 0 stands for 'now' */ As this works fine, I will add a org.libxine.OSD class that provide an object-oriented API and makes the calls simpler, e.g., XineLib.xine_osd_show(osd,..) -> osd.show(..) good luck with your project, Matthias |
From: Kristian L. L. <wa...@pa...> - 2008-09-23 05:21:19
|
Hey Matthias Thanx, i'll try this out. I'll probably try to write some wrapper classes for this. BTW: This is the first time i'm writing to mail-lists, so i hope i send the mails right. thanx walker Matthias Ringwald skrev: > Hi Kristian > > On Sep 22, 2008, at 8:43 PM, Kristian Lindemann Larsen wrote: > >> Hey. >> I'm thinking about trying to write a simple linux-based mediacenter in >> java. > That's the exact reason why I started libxine-java... > >> I've made some early tests with libxine-java, and made video play. > Fine. > >> What I was wondering is, if there is (or is planned) to be able to do >> OSD? > libxine-java basically wraps the complete xine-lib. xine-lib contains > support for OSD. See the section of their hacker guide > at http://xinehq.de/index.php/hackersguide#OSD > I just tried the example and it works both in a simple C application > and in Java (I never tried the OSD before). The only catch is that the > documented API is not available to user applications, but function > with similar exists as xine_osd_... For a quick test, just add this > code before calling controller.playOnce(): > > // xine.h constants not provided by libxine-java (yet) > final int TEXTPALETTE_WHITE_BLACK_TRANSPARENT = 0; > final int TEXTPALETTE_WHITE_NONE_TRANSLUCID = 3; > final int OSD_TEXT1 = 0 * 11; > final int OSD_TEXT2 = 1 * 11; > > // used in this example > final int width = 320; > final int height = 240; > > > > // get xine stream > SWIGTYPE_p_xine_stream_s stream = controller.getNativeStream(); > SWIGTYPE_p_xine_osd_s osd = XineLib.xine_osd_new(stream, 0, 0, > width, height); > > /* set sans serif 24 font */ > XineLib.xine_osd_set_font( osd, "sans", 24); > > > > /* copy pre-defined colors for white, black border, > transparent background to > starting at the index used by the first text palette */ > XineLib.xine_osd_set_text_palette(osd, > TEXTPALETTE_WHITE_BLACK_TRANSPARENT, OSD_TEXT1); > > > > /* copy pre-defined colors for white, no border, translucid > background to > starting at the index used by the second text palette */ > XineLib.xine_osd_set_text_palette(osd, > TEXTPALETTE_WHITE_NONE_TRANSLUCID, OSD_TEXT2); > > XineLib.xine_osd_draw_text(osd, 0, 100, "white text, black > border", OSD_TEXT1); > XineLib.xine_osd_draw_text(osd, 0, 130, "white text, no > border", OSD_TEXT2); > > XineLib.xine_osd_draw_line(osd, 0, 0, width-1, height-1, 10); > XineLib.xine_osd_draw_line(osd, width-1, 0, 0 , height-1, 10); > > > > XineLib.xine_osd_show(osd, 0); /* 0 stands for 'now' */ > > > As this works fine, I will add a org.libxine.OSD class that provide an > object-oriented API and makes the calls simpler, e.g., > XineLib.xine_osd_show(osd,..) -> osd.show(..) > > good luck with your project, > Matthias |
From: Matthias R. <mri...@in...> - 2008-09-23 05:42:31
|
Hi Kristian On Sep 23, 2008, at 7:21 AM, Kristian Lindemann Larsen wrote: > Hey Matthias > Thanx, i'll try this out. I'll probably try to write some wrapper > classes for this. Hm.. maybe the next time. :) I added XineOSD yesterday (CET), but was temporarily lacking an SVN client to commit. Have a lookt at http://libxine-java.ringwald.ch/?n=Main.OSD > BTW: This is the first time i'm writing to mail-lists, so i hope i > send > the mails right. Everything's fine. Its also really low-traffic here anyway. Matthias |
From: Matthias R. <mri...@in...> - 2008-09-24 08:10:23
|
concerning the album cover in oxine: from their installation notes, I conclude that they reduce the number of color for a thumbnail to less than 255 and then let xineosd show it. > This library is necessary if you wish to display thumbnail or cover > images. Although it is also possible to use ImageMagick for this > purpose the higher speed of gdk-pixbuf (around factor 10 compared to > ImageMagick) makes it the better choic. > > Because gdk-puxbuf does not provide a method for reducing the number > of colors in an image and because the OSD of xine-lib only support > 256 colors oxine has to do the color reduction. This leads to a > slightly worse image-quality than when using ImageMagick. I still have to figure out, how the pass the thumbnail to the xine osd renderer, as there is only draw_bitmap which I thought would only use B/W images, but it should be possible. Loading images in Java is actually pretty easy, and even reducing the color space might even be already provided by standard Java libs. let's see. matthias |
From: Kristian L. L. <wa...@pa...> - 2008-09-24 15:18:45
|
What i actualy was going for, was more like LinuxMCE. That has a navigation bar on the bottom, which throws up translucent menues over the video. I know LinuxMCE also uses xine, but i don't think it uses OSD though. That's why i was led to the idea of maybe look into some 3d libraries. Anyway, it isn't a vital feature in my media center idea, though it'd be cool. Matthias Ringwald skrev: > > On Sep 24, 2008, at 7:26 AM, Kristian Lindemann Larsen wrote: > >> Nice class. >> I've been trying to figure out something about coloring, but i'm pretty >> stuck. When drawing text i guess it's limited, but what about drawing >> lines and stuff? There's an integer argument to ex. drawline which >> defines color, but can't seem to figure out how to use it. I've tried >> differing values, but only gets translucent black to white. > As far as I understand the xine documentation, you can use a > palette of max 256 colors. the color integer in the draw* methods specify > the color index into the color table/palette. > To actually set the at color, the xine_osd_set_palette function is used > which I did not wrap yet, as it require to pass on pointers. Adding this > isn't hard but will probably require bits of native code. I will add that > in the next days. > >> Is it possible to draw advanced graphics on the OSD? > I guess this depends on your definition of "advanced". I don't know > if you show e.g. a album cover, but showing a volume control, > a slider for seeking, the time, some text will be fine. check out the > oxine project which uses xine for a media center and only uses > OSD for everything. http://oxine.sourceforge.net/ > now that I looked at it, too, I can see from their screenshots that > they even have album cover. Ok, I will have to look at the source > to see, if they use the standard xine mechanisms or do something else. > >> I'm planning to look in to JOGL (opengl bindings) you know if there's >> any issues or anything? > In addition to JOGL, also have a look at LWJGL http://www.lwjgl.org/ > anyway. no I don't think there are any issues with using JOGL or LWJGL > for doing OpenGL drawing... as long as you don't intend to show OpenGL > and videos in the same window... > Jokes aside, without changes to the internals of e.g. xine, they would > not > work togehter. what I can imagine is to use opengl for showing a 3d scene > and having a video playing on a "virtual" wall inside the 3d world. > both the xine opengl output plugin (used for x11) and the xine mac os x > video output plugin make use of open gl to just copy a video frame to > the screen by creating the frame in opengl texture. if the frame is a > texture > it can be copied anywhere into the 3d scene, in any shape. > however, I never tried this or have seen an example of this. > > > about the 64-bit stuff. a colleague of mine has an AMD64 ubuntu > installation > and is away, so I can check what's going on between libxine-java and the > native code. > > cheer,s > matthias |
From: Matthias R. <mri...@in...> - 2008-09-24 18:45:37
|
On 24.09.2008, at 17:18, Kristian Lindemann Larsen wrote: > What i actualy was going for, was more like LinuxMCE. That has a > navigation bar on the bottom, which throws up translucent menues over > the video. As long as you only use 256 colors, xine-lib can do it. :) > I know LinuxMCE also uses xine, but i don't think it uses OSD > though. Do you know if LinuxMCE uses xine-lib when showint the flashy menue? LinuxMCE is a even worse then MythTV, when you try to find out how it works. In the SVN, I can find at least 3 video player backends: xine, VideoLan and MPlayer > Anyway, it isn't a vital feature in my media center idea, though > it'd be > cool. let's figure out, how much xine can do. oxine looks quite decent to me actually. matthias |
From: Kristian L. L. <wa...@pa...> - 2008-09-24 18:56:01
|
Matthias Ringwald skrev: > > On 24.09.2008, at 17:18, Kristian Lindemann Larsen wrote: > >> What i actualy was going for, was more like LinuxMCE. That has a >> navigation bar on the bottom, which throws up translucent menues over >> the video. > As long as you only use 256 colors, xine-lib can do it. :) > > >> I know LinuxMCE also uses xine, but i don't think it uses OSD >> though. > Do you know if LinuxMCE uses xine-lib when showint the flashy menue? > LinuxMCE is a even worse then MythTV, when you try to find out how it > works. > In the SVN, I can find at least 3 video player backends: xine, > VideoLan and MPlayer > >> Anyway, it isn't a vital feature in my media center idea, though it'd be >> cool. > let's figure out, how much xine can do. oxine looks quite decent to me > actually. > > matthias I asked on the LinuxMCE IRC once, and someone told me that i used xine to play the video... They also pretty much restricted to nvidia cards, when using the "nice" UI, because of alpha blending. I must admit, I don't know much about that stuff, but i took a look at oxine, and was supprised how nice it actualy looked at the screenshots. Yes, indeed. Let's see how much potential xine has with OSD, so far it looks good. /walker |