summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/events.h10
-rw-r--r--src/xine-engine/video_out.c11
-rw-r--r--src/xine-engine/video_out.h4
-rw-r--r--src/xine-engine/xine.c32
4 files changed, 51 insertions, 6 deletions
diff --git a/src/xine-engine/events.h b/src/xine-engine/events.h
index c812d7960..3eebe4b3d 100644
--- a/src/xine-engine/events.h
+++ b/src/xine-engine/events.h
@@ -53,6 +53,16 @@ typedef struct mouse_event_s {
uint16_t x,y; /* In Image space */
} mouse_event_t;
+/**
+ * Overlay event - used for plugins/UIs to request that a specific overlay be
+ * displayed.
+ */
+#define XINE_OVERLAY_EVENT 0x0002
+typedef struct overlay_event_s {
+ event_t event;
+ vo_overlay_t overlay;
+} overlay_event_t;
+
#ifdef __cplusplus
}
#endif
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 838423c42..f9ebefe15 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.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: video_out.c,v 1.36 2001/07/24 12:57:30 guenter Exp $
+ * $Id: video_out.c,v 1.37 2001/07/25 23:26:14 richwareham Exp $
*
*/
@@ -574,6 +574,7 @@ static vo_overlay_t *vo_get_overlay (vo_instance_t *this) {
if (this->first_overlay==NULL) {
this->first_overlay = this->last_overlay = xmalloc (sizeof (vo_overlay_t)) ;
this->first_overlay->data=NULL;
+ this->first_overlay->clut_tbl=NULL;
this->first_overlay->next=NULL;
this->first_overlay->priv=NULL;
this->first_overlay->state=OVERLAY_CREATING;
@@ -601,10 +602,12 @@ static vo_overlay_t *vo_get_overlay (vo_instance_t *this) {
}
static void vo_queue_overlay (vo_instance_t *this, vo_overlay_t *overlay) {
-
overlay->PTS = this->metronom->got_spu_packet (this->metronom, overlay->PTS,overlay->duration);
- if (overlay->data==NULL) overlay->state=OVERLAY_FREE;
- else overlay->state=OVERLAY_READY_TO_SHOW;
+ if (overlay->data==NULL) {
+ overlay->state=OVERLAY_FREE;
+ } else {
+ overlay->state=OVERLAY_READY_TO_SHOW;
+ }
}
vo_instance_t *vo_new_instance (vo_driver_t *driver, metronom_t *metronom) {
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index a17b30f67..0e9c366d8 100644
--- a/src/xine-engine/video_out.h
+++ b/src/xine-engine/video_out.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: video_out.h,v 1.14 2001/07/24 12:57:30 guenter Exp $
+ * $Id: video_out.h,v 1.15 2001/07/25 23:26:14 richwareham Exp $
*
*
* xine version of video_out.h
@@ -279,6 +279,8 @@ struct vo_overlay_s {
vo_overlay_t *priv; /* optionally more overlays */
int state; /* State:FREE,SHOWING etc. */
+ uint32_t *clut_tbl; /* Pointer to CLUT palette */
+
/* private stuff */
int _x; /* current destination x, y */
int _y;
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 4691bb071..cdb0f52b5 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.35 2001/07/14 23:17:37 richwareham Exp $
+ * $Id: xine.c,v 1.36 2001/07/25 23:26:14 richwareham Exp $
*
* top-level xine functions
*
@@ -207,6 +207,12 @@ static void xine_play_internal (xine_t *this, char *mrl,
printf ("xine: using input plugin >%s< for this MRL.\n",
this->cur_input_plugin->get_identifier(this->cur_input_plugin));
+ /* FIXME: This is almost certainly the WRONG way to do this but it is
+ * only temporary until a better way if found for plugins to send events.
+ */
+ this->cur_input_plugin->get_optional_data(this->cur_input_plugin,
+ (void*)this, 0x1010);
+
/*
* find demuxer plugin
*/
@@ -378,6 +384,30 @@ void event_handler(xine_t *xine, event_t *event, void *data) {
}
}
break;
+ case XINE_OVERLAY_EVENT:
+ {
+ overlay_event_t *oevent = (overlay_event_t*)event;
+ if(xine->video_out != NULL) {
+ int i;
+ vo_overlay_t *overlay = xine->video_out->get_overlay (xine->video_out);
+ if(overlay != NULL) {
+ overlay->data = oevent->overlay.data;
+ overlay->x = oevent->overlay.x;
+ overlay->y = oevent->overlay.y;
+ overlay->width = oevent->overlay.width;
+ overlay->height = oevent->overlay.height;
+ for(i=0; i<4; i++) {
+ overlay->clut[i] = oevent->overlay.clut[i];
+ overlay->trans[i] = oevent->overlay.trans[i];
+ }
+ overlay->PTS = oevent->overlay.PTS;
+ overlay->clut_tbl = oevent->overlay.clut_tbl;
+ overlay->duration = oevent->overlay.duration;
+ xine->video_out->queue_overlay (xine->video_out, overlay);
+ }
+ }
+ }
+ break;
}
}