Re: [Libxine-java-devel] Capabilities and future
Status: Beta
Brought to you by:
freckle
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 |