summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/osd.c25
-rw-r--r--src/xine-engine/osd.h11
-rw-r--r--src/xine-engine/xine.c4
-rw-r--r--src/xine-engine/xine_interface.c10
4 files changed, 41 insertions, 9 deletions
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index 2e8ff0637..dc8383de6 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -1290,18 +1290,35 @@ static void osd_draw_bitmap(osd_object_t *osd, uint8_t *bitmap,
}
}
+static uint32_t osd_get_capabilities (osd_object_t *osd) {
+
+ osd_renderer_t *this = osd->renderer;
+ uint32_t capabilities = 0;
+
+#ifdef HAVE_FT2
+ capabilities |= XINE_OSD_CAP_FREETYPE2;
+#endif
+
+ if( this->stream->video_out->get_capabilities(this->stream->video_out) &
+ VO_CAP_UNSCALED_OVERLAY)
+ capabilities |= XINE_OSD_CAP_UNSCALED;
+
+ return capabilities;
+}
+
+
/*
* initialize the osd rendering engine
*/
-osd_renderer_t *_x_osd_renderer_init( video_overlay_manager_t *video_overlay, config_values_t *config ) {
+osd_renderer_t *_x_osd_renderer_init( video_overlay_manager_t *video_overlay, xine_stream_t *stream ) {
osd_renderer_t *this;
char str[1024];
this = xine_xmalloc(sizeof(osd_renderer_t));
this->video_overlay = video_overlay;
- this->config = config;
+ this->stream = stream;
this->event.object.overlay = xine_xmalloc( sizeof(vo_overlay_t) );
pthread_mutex_init (&this->osd_mutex, NULL);
@@ -1316,7 +1333,8 @@ osd_renderer_t *_x_osd_renderer_init( video_overlay_manager_t *video_overlay, co
osd_preload_fonts (this, str);
- this->textpalette = config->register_enum (config, "misc.osd_text_palette", 0,
+ this->textpalette = this->stream->xine->config->register_enum (this->stream->xine->config,
+ "misc.osd_text_palette", 0,
textpalettes_str,
_("Palette (foreground-border-background) to use on subtitles"),
NULL, 10, update_text_palette, this);
@@ -1344,6 +1362,7 @@ osd_renderer_t *_x_osd_renderer_init( video_overlay_manager_t *video_overlay, co
this->close = osd_renderer_close;
this->draw_bitmap = osd_draw_bitmap;
this->show_unscaled = osd_show_unscaled;
+ this->get_capabilities = osd_get_capabilities;
return this;
}
diff --git a/src/xine-engine/osd.h b/src/xine-engine/osd.h
index 9a58f1a7c..481aa3250 100644
--- a/src/xine-engine/osd.h
+++ b/src/xine-engine/osd.h
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* OSD stuff (text and graphic primitives)
- * $Id: osd.h,v 1.21 2003/11/26 01:03:32 miguelfreitas Exp $
+ * $Id: osd.h,v 1.22 2003/11/26 13:33:55 miguelfreitas Exp $
*/
#ifndef HAVE_OSD_H
@@ -207,6 +207,11 @@ struct osd_renderer_s {
*/
int (*show_unscaled) (osd_object_t *osd, int64_t vpts );
+ /*
+ * see xine.h for defined XINE_OSD_CAP_ values.
+ */
+ uint32_t (*get_capabilities) (osd_object_t *osd);
+
/* private stuff */
pthread_mutex_t osd_mutex;
@@ -216,14 +221,14 @@ struct osd_renderer_s {
osd_font_t *fonts; /* loaded fonts */
int textpalette; /* default textpalette */
- config_values_t *config;
+ xine_stream_t *stream;
};
/*
* initialize the osd rendering engine
*/
-osd_renderer_t *_x_osd_renderer_init( video_overlay_manager_t *video_overlay, config_values_t *config );
+osd_renderer_t *_x_osd_renderer_init( video_overlay_manager_t *video_overlay, xine_stream_t *stream );
/*
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 2c7b93809..18972acc7 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.270 2003/11/25 01:14:04 miguelfreitas Exp $
+ * $Id: xine.c,v 1.271 2003/11/26 13:33:55 miguelfreitas Exp $
*/
/*
@@ -465,7 +465,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
*/
if (vo)
stream->osd_renderer = _x_osd_renderer_init (stream->video_out->get_overlay_manager (stream->video_out),
- stream->xine->config );
+ stream );
else
stream->osd_renderer = NULL;
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index de12bafc7..298cf8c6a 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.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_interface.c,v 1.67 2003/11/16 23:33:49 f1rmb Exp $
+ * $Id: xine_interface.c,v 1.68 2003/11/26 13:33:55 miguelfreitas Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -603,6 +603,10 @@ xine_osd_t *xine_osd_new(xine_stream_t *stream, int x, int y, int width, int hei
return this;
}
+uint32_t xine_osd_get_capabilities(xine_osd_t *this) {
+ return this->osd.renderer->get_capabilities(&this->osd);
+}
+
void xine_osd_draw_point(xine_osd_t *this, int x, int y, int color) {
this->osd.renderer->point(&this->osd, x, y, color);
}
@@ -646,6 +650,10 @@ void xine_osd_show(xine_osd_t *this, int64_t vpts) {
this->osd.renderer->show(&this->osd, vpts);
}
+void xine_osd_show_unscaled(xine_osd_t *this, int64_t vpts) {
+ this->osd.renderer->show(&this->osd, vpts);
+}
+
void xine_osd_hide(xine_osd_t *this, int64_t vpts) {
this->osd.renderer->hide(&this->osd, vpts);
}