summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xine.h.tmpl.in98
-rw-r--r--src/xine-engine/xine.c7
-rw-r--r--src/xine-engine/xine_internal.h7
3 files changed, 108 insertions, 4 deletions
diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in
index d558cb562..52761cd8a 100644
--- a/include/xine.h.tmpl.in
+++ b/include/xine.h.tmpl.in
@@ -28,7 +28,7 @@
\endverbatim
*/
/*
- * $Id: xine.h.tmpl.in,v 1.59 2001/12/01 22:38:31 guenter Exp $
+ * $Id: xine.h.tmpl.in,v 1.60 2001/12/08 00:45:26 guenter Exp $
*
*/
@@ -1579,6 +1579,102 @@ int xine_get_current_frame (xine_t *self, int *width, int *height,
*/
#define XINE_ASPECT_RATIO_DONT_TOUCH 42
+/* osd stuff */
+
+typedef struct osd_object_s osd_object_t;
+
+typedef struct osd_renderer_s osd_renderer_t;
+typedef struct osd_font_s osd_font_t;
+
+struct osd_renderer_s {
+
+ /*
+ * open a new osd object. this will allocated an empty (all zero) drawing
+ * area where graphic primitives may be used.
+ * It is ok to specify big width and height values. The render will keep
+ * track of the smallest changed area to not generate too big overlays.
+ * A default palette is initialized (i sugest keeping color 0 as transparent
+ * for the sake of simplicity)
+ */
+ osd_object_t* (*new_object) (osd_renderer_t *self, int width, int height);
+
+ /*
+ * free osd object
+ */
+ void (*free_object) (osd_object_t *osd_to_close);
+
+
+ /*
+ * send the osd to be displayed at given pts (0=now)
+ * the object is not changed. there may be subsequent drawing on it.
+ */
+ int (*show) (osd_object_t *osd, uint32_t vpts );
+
+ /*
+ * send event to hide osd at given pts (0=now)
+ * the object is not changed. there may be subsequent drawing on it.
+ */
+ int (*hide) (osd_object_t *osd, uint32_t vpts );
+
+ /*
+ * Bresenham line implementation on osd object
+ */
+ void (*line) (osd_object_t *osd,
+ int x1, int y1, int x2, int y2, int color );
+
+ /*
+ * filled retangle
+ */
+ void (*filled_rect) (osd_object_t *osd,
+ int x1, int y1, int x2, int y2, int color );
+
+ /*
+ * set palette (color and transparency)
+ */
+ void (*set_palette) (osd_object_t *osd, uint32_t *color, uint8_t *trans );
+
+ /*
+ * get palette (color and transparency)
+ */
+ void (*get_palette) (osd_object_t *osd, uint32_t *color,
+ uint8_t *trans);
+
+ /*
+ * set position were overlay will be blended
+ */
+ void (*set_position) (osd_object_t *osd, int x, int y);
+
+ /*
+ * set the font of osd object
+ */
+
+ int (*set_font) (osd_object_t *osd, char *fontname, int size);
+
+
+ /*
+ * render text on x,y position (8 bits version)
+ * no \n yet
+ */
+ int (*render_text) (osd_object_t *osd, int x1, int y1,
+ char *text);
+
+ /*
+ * get width and height of how text will be renderized
+ */
+ int (*get_text_size) (osd_object_t *osd, char *text,
+ int *width, int *height);
+
+ /*
+ * close osd rendering engine
+ * loaded fonts are unloaded
+ * osd objects are closed
+ */
+ void (*close) (osd_renderer_t *this);
+
+};
+
+osd_renderer_t *xine_get_osd_renderer (xine_t *self);
+
/** @} end of xine_api */
#ifdef __cplusplus
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 7c33d26c7..565bc84fe 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.c,v 1.84 2001/12/01 15:11:57 miguelfreitas Exp $
+ * $Id: xine.c,v 1.85 2001/12/08 00:45:27 guenter Exp $
*
* top-level xine functions
*
@@ -714,3 +714,8 @@ int xine_is_stream_seekable (xine_t *this) {
return this->cur_input_plugin->get_capabilities (this->cur_input_plugin) & INPUT_CAP_SEEKABLE;
return 0;
}
+
+osd_renderer_t *xine_get_osd_renderer (xine_t *this) {
+
+ return this->osd_renderer;
+}
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 5fdc58f3b..e2eb847fc 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_internal.h,v 1.58 2001/11/28 22:19:12 miguelfreitas Exp $
+ * $Id: xine_internal.h,v 1.59 2001/12/08 00:45:27 guenter Exp $
*
*/
@@ -48,6 +48,7 @@ extern "C" {
#else
#include "spu_decoder_api.h"
#endif
+#include "osd.h"
#define INPUT_PLUGIN_MAX 50
#define DEMUXER_PLUGIN_MAX 50
@@ -182,7 +183,7 @@ struct xine_s {
video_decoder_t *cur_video_decoder_plugin;
int video_finished;
- void *osd_renderer;
+ osd_renderer_t *osd_renderer;
ao_instance_t *audio_out;
fifo_buffer_t *audio_fifo;
@@ -564,6 +565,8 @@ int xine_get_current_frame (xine_t *this, int *width, int *height,
#define XINE_ASPECT_RATIO_211_1 4
#define XINE_ASPECT_RATIO_DONT_TOUCH 42
+osd_renderer_t *xine_get_osd_renderer (xine_t *this);
+
#ifdef __cplusplus
}
#endif