summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-08-10 21:25:20 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-08-10 21:25:20 +0000
commite19962f736e9a0a7541314d4293c3158794d5f47 (patch)
tree674c1cceb6222e7152b57ee0cd282e5cfa94f8e7
parent6235752f3a263fb44fdbc8dca6aaa096a813ce6c (diff)
downloadxine-lib-e19962f736e9a0a7541314d4293c3158794d5f47.tar.gz
xine-lib-e19962f736e9a0a7541314d4293c3158794d5f47.tar.bz2
syncing my local tree:
- removes w32codec syncshutdown hack - vo_driver api changed to support drivers with persistent overlays. that will break binary compatibility xine-lib/xine-ui (xine-ui needs to be recompiled). in order to keep binary compatibility overlay_begin/overlay_end must be added after redraw_needed. - video_overlay cleanups - fix a hard to trigger condition where redraw wouldn't happen (freeing handles) CVS patchset: 2427 CVS date: 2002/08/10 21:25:20
-rw-r--r--include/xine.h.tmpl.in6
-rw-r--r--src/dxr3/video_out_dxr3.c4
-rw-r--r--src/libw32dll/w32codec.c98
-rw-r--r--src/video_out/video_out_aa.c6
-rw-r--r--src/video_out/video_out_directfb.c6
-rw-r--r--src/video_out/video_out_fb.c6
-rw-r--r--src/video_out/video_out_opengl.c6
-rw-r--r--src/video_out/video_out_sdl.c6
-rw-r--r--src/video_out/video_out_syncfb.c6
-rw-r--r--src/video_out/video_out_vidix.c8
-rw-r--r--src/video_out/video_out_xshm.c6
-rw-r--r--src/video_out/video_out_xv.c6
-rw-r--r--src/xine-engine/video_out.h19
-rw-r--r--src/xine-engine/video_overlay.c331
14 files changed, 250 insertions, 264 deletions
diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in
index b36a0ed50..a06856ea5 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.104 2002/08/03 17:33:06 siggi Exp $
+ * $Id: xine.h.tmpl.in,v 1.105 2002/08/10 21:25:20 miguelfreitas Exp $
*
*/
@@ -481,7 +481,9 @@ struct vo_driver_s {
/**
* Overlay functions
*/
- void (*overlay_blend) (vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay);
+ void (*overlay_begin) (vo_driver_t *this, vo_frame_t *vo_img, int changed);
+ void (*overlay_blend) (vo_driver_t *this, vo_frame_t *vo_img, vo_overlay_t *overlay);
+ void (*overlay_end) (vo_driver_t *this, vo_frame_t *vo_img);
/**
* These can be used by the gui directly:
*/
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index 072d4b75c..453cbb715 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.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_dxr3.c,v 1.45 2002/07/18 15:17:03 mroi Exp $
+ * $Id: video_out_dxr3.c,v 1.46 2002/08/10 21:25:20 miguelfreitas Exp $
*/
/* mpeg1 encoding video out plugin for the dxr3.
@@ -137,7 +137,9 @@ vo_driver_t *init_video_out_plugin(config_values_t *config, void *visual_gen)
this->vo_driver.get_capabilities = dxr3_get_capabilities;
this->vo_driver.alloc_frame = dxr3_alloc_frame;
this->vo_driver.update_frame_format = dxr3_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = dxr3_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = dxr3_display_frame;
this->vo_driver.redraw_needed = dxr3_redraw_needed;
this->vo_driver.get_property = dxr3_get_property;
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index 8f157d693..6643e52bc 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.88 2002/07/15 21:42:33 esnel Exp $
+ * $Id: w32codec.c,v 1.89 2002/08/10 21:25:20 miguelfreitas Exp $
*
* routines for using w32 codecs
* DirectShow support by Miguel Freitas (Nov/2001)
@@ -172,23 +172,6 @@ typedef struct w32a_decoder_s {
} w32a_decoder_t;
-/* This is a ugly hack (as all this win32 code!):
- * unloading one of the codecs (w32a or w32v) while the other is
- * still playing causes segfaults. using this define will make
- * the last of them to close both.
- * hopefuly some day we will fix the wine loader to remove that.
- */
-//#define SYNC_SHUTDOWN
-
-#ifdef SYNC_SHUTDOWN
-w32v_decoder_t *w32v_instance;
-w32a_decoder_t *w32a_instance;
-
-static void w32v_close (video_decoder_t *this_gen);
-static void w32a_close (audio_decoder_t *this_gen);
-#endif
-
-
/*
* RGB->YUY2 conversion, we need is for xine video-codec ->
* video-output interface
@@ -671,11 +654,6 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
xine_report_codec( this->xine, XINE_CODEC_VIDEO, 0, buf->type, 0);
}
-#ifdef SYNC_SHUTDOWN
- if( this->decoder_ok )
- w32v_instance = this;
-#endif
-
pthread_mutex_unlock(&win32_codec_mutex);
this->stream_id = -1;
@@ -896,31 +874,18 @@ static void w32v_close (video_decoder_t *this_gen) {
w32v_decoder_t *this = (w32v_decoder_t *) this_gen;
pthread_mutex_lock(&win32_codec_mutex);
-#ifdef SYNC_SHUTDOWN
- if( !w32a_instance || (w32a_instance && !w32a_instance->decoder_ok) )
-#endif
- {
- if ( !this->ds_driver ) {
- if( this->hic ) {
- ICDecompressEnd(this->hic);
- ICClose(this->hic);
- }
- } else {
- if( this->ds_dec )
- DS_VideoDecoder_Destroy(this->ds_dec);
+ if ( !this->ds_driver ) {
+ if( this->hic ) {
+ ICDecompressEnd(this->hic);
+ ICClose(this->hic);
}
-#ifdef SYNC_SHUTDOWN
- w32v_instance = NULL;
-#endif
- Restore_LDT_Keeper( this->ldt_fs );
+ } else {
+ if( this->ds_dec )
+ DS_VideoDecoder_Destroy(this->ds_dec);
}
+ Restore_LDT_Keeper( this->ldt_fs );
pthread_mutex_unlock(&win32_codec_mutex);
-#ifdef SYNC_SHUTDOWN
- if( w32a_instance && !w32a_instance->decoder_ok )
- w32a_close ((audio_decoder_t *)w32a_instance);
-#endif
-
if ( this->img_buffer ) {
free (this->img_buffer);
this->img_buffer = NULL;
@@ -1307,10 +1272,6 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
}
pthread_mutex_unlock(&win32_codec_mutex);
-#ifdef SYNC_SHUTDOWN
- if( this->decoder_ok )
- w32a_instance = this;
-#endif
} else if (this->decoder_ok) {
#ifdef LOG
printf ("w32codec: decoding %d data bytes...\n", buf->size);
@@ -1331,33 +1292,20 @@ static void w32a_close (audio_decoder_t *this_gen) {
w32a_decoder_t *this = (w32a_decoder_t *) this_gen;
pthread_mutex_lock(&win32_codec_mutex);
-#ifdef SYNC_SHUTDOWN
- if( !w32v_instance || (w32v_instance && !w32v_instance->decoder_ok) )
-#endif
- {
- if( !this->ds_driver ) {
- if( this->srcstream ) {
- acmStreamClose(this->srcstream, 0);
- this->srcstream = 0;
- }
- } else {
- if( this->ds_dec )
- DS_AudioDecoder_Destroy(this->ds_dec);
- this->ds_dec = NULL;
+ if( !this->ds_driver ) {
+ if( this->srcstream ) {
+ acmStreamClose(this->srcstream, 0);
+ this->srcstream = 0;
}
-
-#ifdef SYNC_SHUTDOWN
- w32a_instance = NULL;
-#endif
- Restore_LDT_Keeper(this->ldt_fs);
+ } else {
+ if( this->ds_dec )
+ DS_AudioDecoder_Destroy(this->ds_dec);
+ this->ds_dec = NULL;
}
+
+ Restore_LDT_Keeper(this->ldt_fs);
pthread_mutex_unlock(&win32_codec_mutex);
-#ifdef SYNC_SHUTDOWN
- if( w32v_instance && !w32v_instance->decoder_ok )
- w32v_close ((video_decoder_t *)w32v_instance);
-#endif
-
if( this->buf ) {
free(this->buf);
this->buf = NULL;
@@ -1422,10 +1370,6 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, xine_t *xine) {
this->prof_rgb2yuv = xine_profiler_allocate_slot ("w32codec rgb2yuv convert");
-#ifdef SYNC_SHUTDOWN
- w32v_instance = NULL;
-#endif
-
return (video_decoder_t *) this;
}
@@ -1468,10 +1412,6 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, xine_t *xine) {
pthread_once (&once_control, init_routine);
-#ifdef SYNC_SHUTDOWN
- w32a_instance = NULL;
-#endif
-
return (audio_decoder_t *) this;
}
diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c
index 7a75137c1..99e66522e 100644
--- a/src/video_out/video_out_aa.c
+++ b/src/video_out/video_out_aa.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_aa.c,v 1.24 2002/07/20 21:07:01 f1rmb Exp $
+ * $Id: video_out_aa.c,v 1.25 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_aa.c, ascii-art output plugin for xine
*
@@ -275,7 +275,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.alloc_frame = aa_alloc_frame ;
this->vo_driver.update_frame_format = aa_update_frame_format;
this->vo_driver.display_frame = aa_display_frame;
+ this->vo_driver.overlay_begin = NULL;
this->vo_driver.overlay_blend = NULL;
+ this->vo_driver.overlay_end = NULL;
this->vo_driver.get_property = aa_get_property;
this->vo_driver.set_property = aa_set_property;
this->vo_driver.get_property_min_max = aa_get_property_min_max;
@@ -287,7 +289,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_aa = {
- 5,
+ 6,
"aa",
NULL,
VISUAL_TYPE_AA,
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index 9cb3b6947..9f8a9e1b9 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.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_directfb.c,v 1.12 2002/07/22 18:56:57 richwareham Exp $
+ * $Id: video_out_directfb.c,v 1.13 2002/08/10 21:25:20 miguelfreitas Exp $
*
* DirectFB based output plugin.
* Rich Wareham <richwareham@users.sourceforge.net>
@@ -533,7 +533,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.get_capabilities = directfb_get_capabilities;
this->vo_driver.alloc_frame = directfb_alloc_frame;
this->vo_driver.update_frame_format = directfb_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = directfb_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = directfb_display_frame;
this->vo_driver.get_property = directfb_get_property;
this->vo_driver.set_property = directfb_set_property;
@@ -551,7 +553,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_directfb = {
- 5,
+ 6,
"DirectFB",
NULL,
VISUAL_TYPE_DFB,
diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c
index fb37f295d..5848a5453 100644
--- a/src/video_out/video_out_fb.c
+++ b/src/video_out/video_out_fb.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_fb.c,v 1.13 2002/07/15 21:42:34 esnel Exp $
+ * $Id: video_out_fb.c,v 1.14 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_fb.c, frame buffer xine driver by Miguel Freitas
*
@@ -711,7 +711,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.get_capabilities = fb_get_capabilities;
this->vo_driver.alloc_frame = fb_alloc_frame;
this->vo_driver.update_frame_format = fb_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = fb_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = fb_display_frame;
this->vo_driver.get_property = fb_get_property;
this->vo_driver.set_property = fb_set_property;
@@ -877,7 +879,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_fb = {
- 5,
+ 6,
"fb",
NULL,
VISUAL_TYPE_FB,
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index 5a06fbac4..c4ba278ef 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.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_opengl.c,v 1.15 2002/07/16 19:33:37 esnel Exp $
+ * $Id: video_out_opengl.c,v 1.16 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_glut.c, glut based OpenGL rendering interface for xine
* Matthias Hopf <mat@mshopf.de>
@@ -1077,7 +1077,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.get_capabilities = opengl_get_capabilities;
this->vo_driver.alloc_frame = opengl_alloc_frame;
this->vo_driver.update_frame_format = opengl_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = opengl_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = opengl_display_frame;
this->vo_driver.get_property = opengl_get_property;
this->vo_driver.set_property = opengl_set_property;
@@ -1099,7 +1101,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_shm = {
- 5,
+ 6,
"OpenGL",
NULL,
VISUAL_TYPE_X11,
diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c
index 0ef1508a6..e111aafd8 100644
--- a/src/video_out/video_out_sdl.c
+++ b/src/video_out/video_out_sdl.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_sdl.c,v 1.10 2002/07/15 21:42:34 esnel Exp $
+ * $Id: video_out_sdl.c,v 1.11 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_sdl.c, Simple DirectMedia Layer
*
@@ -674,7 +674,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.get_capabilities = sdl_get_capabilities;
this->vo_driver.alloc_frame = sdl_alloc_frame;
this->vo_driver.update_frame_format = sdl_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = sdl_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = sdl_display_frame;
this->vo_driver.get_property = sdl_get_property;
this->vo_driver.set_property = sdl_set_property;
@@ -689,7 +691,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_sdl = {
- 5,
+ 6,
"sdl",
NULL,
VISUAL_TYPE_X11,
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
index 8fcb91e41..07ab6e82b 100644
--- a/src/video_out/video_out_syncfb.c
+++ b/src/video_out/video_out_syncfb.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_syncfb.c,v 1.73 2002/07/15 21:42:34 esnel Exp $
+ * $Id: video_out_syncfb.c,v 1.74 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine
*
@@ -1151,7 +1151,9 @@ vo_driver_t *init_video_out_plugin(config_values_t *config, void *visual_gen)
this->vo_driver.get_capabilities = syncfb_get_capabilities;
this->vo_driver.alloc_frame = syncfb_alloc_frame;
this->vo_driver.update_frame_format = syncfb_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = syncfb_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = syncfb_display_frame;
this->vo_driver.get_property = syncfb_get_property;
this->vo_driver.set_property = syncfb_set_property;
@@ -1164,7 +1166,7 @@ vo_driver_t *init_video_out_plugin(config_values_t *config, void *visual_gen)
}
static vo_info_t vo_info_syncfb = {
- 5,
+ 6,
"SyncFB",
NULL,
VISUAL_TYPE_X11,
diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c
index 92e29bd7c..c3e8380fa 100644
--- a/src/video_out/video_out_vidix.c
+++ b/src/video_out/video_out_vidix.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_vidix.c,v 1.7 2002/07/15 21:42:34 esnel Exp $
+ * $Id: video_out_vidix.c,v 1.8 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_vidix.c
*
@@ -842,12 +842,12 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->gui_width = window_attributes.width;
this->gui_height = window_attributes.height;
-
-
this->vo_driver.get_capabilities = vidix_get_capabilities;
this->vo_driver.alloc_frame = vidix_alloc_frame;
this->vo_driver.update_frame_format = vidix_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = vidix_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = vidix_display_frame;
this->vo_driver.get_property = vidix_get_property;
this->vo_driver.set_property = vidix_set_property;
@@ -861,7 +861,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_vidix = {
- 5,
+ 6,
"vidix",
NULL,
VISUAL_TYPE_X11,
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 55f78da14..fcc4a4089 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.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_xshm.c,v 1.82 2002/07/30 00:26:45 miguelfreitas Exp $
+ * $Id: video_out_xshm.c,v 1.83 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -1308,7 +1308,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.get_capabilities = xshm_get_capabilities;
this->vo_driver.alloc_frame = xshm_alloc_frame;
this->vo_driver.update_frame_format = xshm_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = xshm_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = xshm_display_frame;
this->vo_driver.get_property = xshm_get_property;
this->vo_driver.set_property = xshm_set_property;
@@ -1451,7 +1453,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_shm = {
- 5, /* interface version */
+ 6, /* interface version */
"XShm", /* id */
NULL,
VISUAL_TYPE_X11, /* visual_type */
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index cafc6007c..0ea7b1919 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.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_xv.c,v 1.124 2002/07/20 21:46:06 esnel Exp $
+ * $Id: video_out_xv.c,v 1.125 2002/08/10 21:25:20 miguelfreitas Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -1360,7 +1360,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.get_capabilities = xv_get_capabilities;
this->vo_driver.alloc_frame = xv_alloc_frame;
this->vo_driver.update_frame_format = xv_update_frame_format;
+ this->vo_driver.overlay_begin = NULL; /* not used */
this->vo_driver.overlay_blend = xv_overlay_blend;
+ this->vo_driver.overlay_end = NULL; /* not used */
this->vo_driver.display_frame = xv_display_frame;
this->vo_driver.get_property = xv_get_property;
this->vo_driver.set_property = xv_set_property;
@@ -1494,7 +1496,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
}
static vo_info_t vo_info_xv = {
- 5,
+ 6,
"Xv",
NULL,
VISUAL_TYPE_X11,
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index 9f52e29a3..9c7e6bf78 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.56 2002/07/30 00:26:45 miguelfreitas Exp $
+ * $Id: video_out.h,v 1.57 2002/08/10 21:25:20 miguelfreitas Exp $
*
*
* xine version of video_out.h
@@ -261,7 +261,7 @@ struct vo_instance_s {
* from generic vo functions.
*/
-#define VIDEO_OUT_DRIVER_IFACE_VERSION 5
+#define VIDEO_OUT_DRIVER_IFACE_VERSION 6
struct vo_driver_s {
@@ -285,8 +285,21 @@ struct vo_driver_s {
/* display a given frame */
void (*display_frame) (vo_driver_t *this, vo_frame_t *vo_img);
- /* overlay functions */
+ /* overlay_begin and overlay_end are used by drivers suporting
+ * persistent overlays. they can be optimized to update only when
+ * overlay image has changed.
+ *
+ * sequence of operation (pseudo-code):
+ * overlay_begin(this,img,true_if_something_changed_since_last_blend );
+ * while(visible_overlays)
+ * overlay_blend(this,img,overlay[i]);
+ * overlay_end(this,img);
+ *
+ * any function pointer from this group may be set to NULL.
+ */
+ void (*overlay_begin) (vo_driver_t *this, vo_frame_t *vo_img, int changed);
void (*overlay_blend) (vo_driver_t *this, vo_frame_t *vo_img, vo_overlay_t *overlay);
+ void (*overlay_end) (vo_driver_t *this, vo_frame_t *vo_img);
/*
* these can be used by the gui directly:
diff --git a/src/xine-engine/video_overlay.c b/src/xine-engine/video_overlay.c
index 011ce7fea..f4afb92f8 100644
--- a/src/xine-engine/video_overlay.c
+++ b/src/xine-engine/video_overlay.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_overlay.c,v 1.21 2002/06/26 12:33:31 mroi Exp $
+ * $Id: video_overlay.c,v 1.22 2002/08/10 21:25:20 miguelfreitas Exp $
*
*/
@@ -53,13 +53,13 @@ typedef struct video_overlay_showing_s {
typedef struct video_overlay_s {
video_overlay_instance_t video_overlay;
- pthread_mutex_t video_overlay_events_mutex;
- video_overlay_events_t video_overlay_events[MAX_EVENTS];
- pthread_mutex_t video_overlay_objects_mutex;
- video_overlay_object_t video_overlay_objects[MAX_OBJECTS];
- pthread_mutex_t video_overlay_showing_mutex;
- video_overlay_showing_t video_overlay_showing[MAX_SHOWING];
-
+ pthread_mutex_t events_mutex;
+ video_overlay_events_t events[MAX_EVENTS];
+ pthread_mutex_t objects_mutex;
+ video_overlay_object_t objects[MAX_OBJECTS];
+ pthread_mutex_t showing_mutex;
+ video_overlay_showing_t showing[MAX_SHOWING];
+ int showing_changed;
} video_overlay_t;
@@ -67,38 +67,40 @@ static void add_showing_handle( video_overlay_t *this, int32_t handle )
{
int i;
- pthread_mutex_lock( &this->video_overlay_showing_mutex );
-
+ pthread_mutex_lock( &this->showing_mutex );
+ this->showing_changed++;
+
for( i = 0; i < MAX_SHOWING; i++ )
- if( this->video_overlay_showing[i].handle == handle )
+ if( this->showing[i].handle == handle )
break; /* already showing */
if( i == MAX_SHOWING ) {
- for( i = 0; i < MAX_SHOWING && this->video_overlay_showing[i].handle >= 0; i++ )
+ for( i = 0; i < MAX_SHOWING && this->showing[i].handle >= 0; i++ )
;
if( i != MAX_SHOWING )
- this->video_overlay_showing[i].handle = handle;
+ this->showing[i].handle = handle;
else
printf("video_overlay: error: no showing slots available\n");
}
- pthread_mutex_unlock( &this->video_overlay_showing_mutex );
+ pthread_mutex_unlock( &this->showing_mutex );
}
static void remove_showing_handle( video_overlay_t *this, int32_t handle )
{
int i;
- pthread_mutex_lock( &this->video_overlay_showing_mutex );
+ pthread_mutex_lock( &this->showing_mutex );
+ this->showing_changed++;
for( i = 0; i < MAX_SHOWING; i++ ) {
- if( this->video_overlay_showing[i].handle == handle ) {
- this->video_overlay_showing[i].handle = -1;
+ if( this->showing[i].handle == handle ) {
+ this->showing[i].handle = -1;
}
}
- pthread_mutex_unlock( &this->video_overlay_showing_mutex );
+ pthread_mutex_unlock( &this->showing_mutex );
}
static void remove_events_handle( video_overlay_t *this, int32_t handle, int lock )
@@ -106,37 +108,37 @@ static void remove_events_handle( video_overlay_t *this, int32_t handle, int loc
uint32_t last_event,this_event;
if( lock )
- pthread_mutex_lock( &this->video_overlay_events_mutex );
+ pthread_mutex_lock( &this->events_mutex );
this_event=0;
do {
last_event=this_event;
- this_event=this->video_overlay_events[last_event].next_event;
+ this_event=this->events[last_event].next_event;
while( this_event &&
- this->video_overlay_events[this_event].event->object.handle == handle ) {
+ this->events[this_event].event->object.handle == handle ) {
/* remove event from pts list */
- this->video_overlay_events[last_event].next_event=
- this->video_overlay_events[this_event].next_event;
+ this->events[last_event].next_event=
+ this->events[this_event].next_event;
/* free its overlay */
- if( this->video_overlay_events[this_event].event->object.overlay ) {
- if( this->video_overlay_events[this_event].event->object.overlay->rle )
- free( this->video_overlay_events[this_event].event->object.overlay->rle );
- free(this->video_overlay_events[this_event].event->object.overlay);
- this->video_overlay_events[this_event].event->object.overlay = NULL;
+ if( this->events[this_event].event->object.overlay ) {
+ if( this->events[this_event].event->object.overlay->rle )
+ free( this->events[this_event].event->object.overlay->rle );
+ free(this->events[this_event].event->object.overlay);
+ this->events[this_event].event->object.overlay = NULL;
}
/* mark as free */
- this->video_overlay_events[this_event].next_event = 0;
- this->video_overlay_events[this_event].event->event_type = EVENT_NULL;
+ this->events[this_event].next_event = 0;
+ this->events[this_event].event->event_type = EVENT_NULL;
- this_event=this->video_overlay_events[last_event].next_event;
+ this_event=this->events[last_event].next_event;
}
} while ( this_event );
if( lock )
- pthread_mutex_unlock( &this->video_overlay_events_mutex );
+ pthread_mutex_unlock( &this->events_mutex );
}
@@ -147,19 +149,19 @@ static int32_t video_overlay_get_handle(video_overlay_instance_t *this_gen, int
video_overlay_t *this = (video_overlay_t *) this_gen;
int n;
- pthread_mutex_lock( &this->video_overlay_objects_mutex );
+ pthread_mutex_lock( &this->objects_mutex );
- for( n=0; n < MAX_OBJECTS && this->video_overlay_objects[n].handle > -1; n++ )
+ for( n=0; n < MAX_OBJECTS && this->objects[n].handle > -1; n++ )
;
if (n == MAX_OBJECTS) {
n = -1;
} else {
- this->video_overlay_objects[n].handle = n;
- this->video_overlay_objects[n].object_type = object_type;
+ this->objects[n].handle = n;
+ this->objects[n].object_type = object_type;
}
- pthread_mutex_unlock( &this->video_overlay_objects_mutex );
+ pthread_mutex_unlock( &this->objects_mutex );
return n;
}
@@ -168,17 +170,17 @@ static int32_t video_overlay_get_handle(video_overlay_instance_t *this_gen, int
*/
static void internal_video_overlay_free_handle(video_overlay_t *this, int32_t handle) {
- pthread_mutex_lock( &this->video_overlay_objects_mutex );
+ pthread_mutex_lock( &this->objects_mutex );
- if( this->video_overlay_objects[handle].overlay ) {
- if( this->video_overlay_objects[handle].overlay->rle )
- free( this->video_overlay_objects[handle].overlay->rle );
- free( this->video_overlay_objects[handle].overlay );
- this->video_overlay_objects[handle].overlay = NULL;
+ if( this->objects[handle].overlay ) {
+ if( this->objects[handle].overlay->rle )
+ free( this->objects[handle].overlay->rle );
+ free( this->objects[handle].overlay );
+ this->objects[handle].overlay = NULL;
}
- this->video_overlay_objects[handle].handle = -1;
+ this->objects[handle].handle = -1;
- pthread_mutex_unlock( &this->video_overlay_objects_mutex );
+ pthread_mutex_unlock( &this->objects_mutex );
}
/*
@@ -194,32 +196,33 @@ static void video_overlay_free_handle(video_overlay_instance_t *this_gen, int32_
}
-
static void video_overlay_reset (video_overlay_t *this) {
int i;
- pthread_mutex_lock (&this->video_overlay_events_mutex);
+ pthread_mutex_lock (&this->events_mutex);
for (i=0; i < MAX_EVENTS; i++) {
- if (this->video_overlay_events[i].event == NULL) {
- this->video_overlay_events[i].event = xine_xmalloc (sizeof(video_overlay_event_t));
+ if (this->events[i].event == NULL) {
+ this->events[i].event = xine_xmalloc (sizeof(video_overlay_event_t));
#ifdef LOG_DEBUG
- printf ("video_overlay: MALLOC2: this->video_overlay_events[%d].event %p, len=%d\n",
+ printf ("video_overlay: MALLOC2: this->events[%d].event %p, len=%d\n",
i,
- this->video_overlay_events[i].event,
+ this->events[i].event,
sizeof(video_overlay_event_t));
#endif
}
- this->video_overlay_events[i].event->event_type = 0; /* Empty slot */
- this->video_overlay_events[i].next_event = 0;
+ this->events[i].event->event_type = 0; /* Empty slot */
+ this->events[i].next_event = 0;
}
- pthread_mutex_unlock (&this->video_overlay_events_mutex);
+ pthread_mutex_unlock (&this->events_mutex);
for (i=0; i < MAX_OBJECTS; i++) {
internal_video_overlay_free_handle(this, i);
}
for( i = 0; i < MAX_SHOWING; i++ )
- this->video_overlay_showing[i].handle = -1;
+ this->showing[i].handle = -1;
+
+ this->showing_changed = 0;
}
@@ -227,9 +230,9 @@ static void video_overlay_init (video_overlay_instance_t *this_gen) {
video_overlay_t *this = (video_overlay_t *) this_gen;
- pthread_mutex_init (&this->video_overlay_events_mutex,NULL);
- pthread_mutex_init (&this->video_overlay_objects_mutex,NULL);
- pthread_mutex_init (&this->video_overlay_showing_mutex,NULL);
+ pthread_mutex_init (&this->events_mutex,NULL);
+ pthread_mutex_init (&this->objects_mutex,NULL);
+ pthread_mutex_init (&this->showing_mutex,NULL);
video_overlay_reset(this);
}
@@ -251,12 +254,12 @@ static int32_t video_overlay_add_event(video_overlay_instance_t *this_gen, void
video_overlay_t *this = (video_overlay_t *) this_gen;
uint32_t last_event,this_event,new_event;
- pthread_mutex_lock (&this->video_overlay_events_mutex);
+ pthread_mutex_lock (&this->events_mutex);
/* We skip the 0 entry because that is used as a pointer to the first event.*/
/* Find a free event slot */
for( new_event = 1; new_event<MAX_EVENTS &&
- this->video_overlay_events[new_event].event->event_type > 0; new_event++ )
+ this->events[new_event].event->event_type > 0; new_event++ )
;
if (new_event < MAX_EVENTS) {
@@ -265,42 +268,42 @@ static int32_t video_overlay_add_event(video_overlay_instance_t *this_gen, void
/* Find where in the current queue to insert the event. I.E. Sort it. */
do {
last_event=this_event;
- this_event=this->video_overlay_events[last_event].next_event;
- } while ( this_event && this->video_overlay_events[this_event].event->vpts <= event->vpts );
+ this_event=this->events[last_event].next_event;
+ } while ( this_event && this->events[this_event].event->vpts <= event->vpts );
- this->video_overlay_events[last_event].next_event=new_event;
- this->video_overlay_events[new_event].next_event=this_event;
+ this->events[last_event].next_event=new_event;
+ this->events[new_event].next_event=this_event;
/* memcpy everything except the actual image */
- if ( this->video_overlay_events[new_event].event == NULL ) {
+ if ( this->events[new_event].event == NULL ) {
printf("video_overlay: error: event slot is NULL!\n");
}
- this->video_overlay_events[new_event].event->event_type=event->event_type;
- this->video_overlay_events[new_event].event->vpts=event->vpts;
- this->video_overlay_events[new_event].event->object.handle=event->object.handle;
- this->video_overlay_events[new_event].event->object.pts=event->object.pts;
+ this->events[new_event].event->event_type=event->event_type;
+ this->events[new_event].event->vpts=event->vpts;
+ this->events[new_event].event->object.handle=event->object.handle;
+ this->events[new_event].event->object.pts=event->object.pts;
- if ( this->video_overlay_events[new_event].event->object.overlay ) {
+ if ( this->events[new_event].event->object.overlay ) {
printf("video_overlay: add_event: event->object.overlay was not freed!\n");
}
if( event->object.overlay ) {
- this->video_overlay_events[new_event].event->object.overlay = xine_xmalloc (sizeof(vo_overlay_t));
- xine_fast_memcpy(this->video_overlay_events[new_event].event->object.overlay,
+ this->events[new_event].event->object.overlay = xine_xmalloc (sizeof(vo_overlay_t));
+ xine_fast_memcpy(this->events[new_event].event->object.overlay,
event->object.overlay, sizeof(vo_overlay_t));
/* We took the callers rle and data, therefore it will be our job to free it */
/* clear callers overlay so it will not be freed twice */
memset(event->object.overlay,0,sizeof(vo_overlay_t));
} else {
- this->video_overlay_events[new_event].event->object.overlay = NULL;
+ this->events[new_event].event->object.overlay = NULL;
}
} else {
printf("No spare subtitle event slots\n");
new_event = -1;
}
- pthread_mutex_unlock (&this->video_overlay_events_mutex);
+ pthread_mutex_unlock (&this->events_mutex);
return new_event;
}
@@ -336,41 +339,41 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) {
uint32_t this_event;
int processed = 0;
- pthread_mutex_lock (&this->video_overlay_events_mutex);
+ pthread_mutex_lock (&this->events_mutex);
- this_event=this->video_overlay_events[0].next_event;
- while ( this_event && (vpts > this->video_overlay_events[this_event].event->vpts ||
+ this_event=this->events[0].next_event;
+ while ( this_event && (vpts > this->events[this_event].event->vpts ||
vpts == 0) ) {
processed++;
- handle=this->video_overlay_events[this_event].event->object.handle;
- switch( this->video_overlay_events[this_event].event->event_type ) {
+ handle=this->events[this_event].event->object.handle;
+ switch( this->events[this_event].event->event_type ) {
case EVENT_SHOW_SPU:
#ifdef LOG_DEBUG
printf ("video_overlay: SHOW SPU NOW\n");
#endif
- if (this->video_overlay_events[this_event].event->object.overlay != NULL) {
+ if (this->events[this_event].event->object.overlay != NULL) {
#ifdef LOG_DEBUG
- video_overlay_print_overlay( this->video_overlay_events[this_event].event->object.overlay ) ;
+ video_overlay_print_overlay( this->events[this_event].event->object.overlay ) ;
#endif
- /* this->video_overlay_objects[handle].overlay is about to be
+ /* this->objects[handle].overlay is about to be
* overwritten by this event data. make sure we free it if needed.
*/
- if( this->video_overlay_objects[handle].overlay ) {
- if( this->video_overlay_objects[handle].overlay->rle )
- free( this->video_overlay_objects[handle].overlay->rle );
- free( this->video_overlay_objects[handle].overlay );
- this->video_overlay_objects[handle].overlay = NULL;
+ if( this->objects[handle].overlay ) {
+ if( this->objects[handle].overlay->rle )
+ free( this->objects[handle].overlay->rle );
+ free( this->objects[handle].overlay );
+ this->objects[handle].overlay = NULL;
}
- this->video_overlay_objects[handle].handle = handle;
- if( this->video_overlay_objects[handle].overlay ) {
+ this->objects[handle].handle = handle;
+ if( this->objects[handle].overlay ) {
printf("video_overlay: error: object->overlay was not freed!\n");
}
- this->video_overlay_objects[handle].overlay =
- this->video_overlay_events[this_event].event->object.overlay;
- this->video_overlay_objects[handle].pts =
- this->video_overlay_events[this_event].event->object.pts;
- this->video_overlay_events[this_event].event->object.overlay = NULL;
+ this->objects[handle].overlay =
+ this->events[this_event].event->object.overlay;
+ this->objects[handle].pts =
+ this->events[this_event].event->object.pts;
+ this->events[this_event].event->object.overlay = NULL;
add_showing_handle( this, handle );
}
@@ -381,13 +384,13 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) {
printf ("video_overlay: FREE SPU NOW\n");
#endif
/* free any overlay associated with this event */
- if (this->video_overlay_events[this_event].event->object.overlay != NULL) {
- free(this->video_overlay_events[this_event].event->object.overlay);
- this->video_overlay_events[this_event].event->object.overlay = NULL;
+ if (this->events[this_event].event->object.overlay != NULL) {
+ free(this->events[this_event].event->object.overlay);
+ this->events[this_event].event->object.overlay = NULL;
}
/* this avoid removing this_event from the queue
* (it will be removed at the end of this loop) */
- this->video_overlay_events[this_event].event->object.handle = -1;
+ this->events[this_event].event->object.handle = -1;
remove_showing_handle(this,handle);
remove_events_handle(this,handle,0);
internal_video_overlay_free_handle( this, handle );
@@ -401,9 +404,9 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) {
printf ("video_overlay: HIDE SPU NOW\n");
#endif
/* free any overlay associated with this event */
- if (this->video_overlay_events[this_event].event->object.overlay != NULL) {
- free(this->video_overlay_events[this_event].event->object.overlay);
- this->video_overlay_events[this_event].event->object.overlay = NULL;
+ if (this->events[this_event].event->object.overlay != NULL) {
+ free(this->events[this_event].event->object.overlay);
+ this->events[this_event].event->object.overlay = NULL;
}
remove_showing_handle( this, handle );
break;
@@ -412,9 +415,9 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) {
#ifdef LOG_DEBUG
printf ("video_overlay: HIDE MENU NOW %d\n",handle);
#endif
- if (this->video_overlay_events[this_event].event->object.overlay != NULL) {
- free(this->video_overlay_events[this_event].event->object.overlay);
- this->video_overlay_events[this_event].event->object.overlay = NULL;
+ if (this->events[this_event].event->object.overlay != NULL) {
+ free(this->events[this_event].event->object.overlay);
+ this->events[this_event].event->object.overlay = NULL;
}
remove_showing_handle( this, handle );
break;
@@ -423,47 +426,47 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) {
#ifdef LOG_DEBUG
printf ("video_overlay: SHOW MENU NOW\n");
#endif
- if (this->video_overlay_events[this_event].event->object.overlay != NULL) {
+ if (this->events[this_event].event->object.overlay != NULL) {
#ifdef LOG_DEBUG
- video_overlay_print_overlay( this->video_overlay_events[this_event].event->object.overlay ) ;
+ video_overlay_print_overlay( this->events[this_event].event->object.overlay ) ;
#endif
- /* this->video_overlay_objects[handle].overlay is about to be
+ /* this->objects[handle].overlay is about to be
* overwritten by this event data. make sure we free it if needed.
*/
- if( this->video_overlay_objects[handle].overlay ) {
- if( this->video_overlay_objects[handle].overlay->rle )
- free( this->video_overlay_objects[handle].overlay->rle );
- free( this->video_overlay_objects[handle].overlay );
- this->video_overlay_objects[handle].overlay = NULL;
+ if( this->objects[handle].overlay ) {
+ if( this->objects[handle].overlay->rle )
+ free( this->objects[handle].overlay->rle );
+ free( this->objects[handle].overlay );
+ this->objects[handle].overlay = NULL;
}
- this->video_overlay_objects[handle].handle = handle;
- if( this->video_overlay_objects[handle].overlay ) {
+ this->objects[handle].handle = handle;
+ if( this->objects[handle].overlay ) {
printf("video_overlay: error: object->overlay was not freed!\n");
}
- this->video_overlay_objects[handle].overlay =
- this->video_overlay_events[this_event].event->object.overlay;
- this->video_overlay_objects[handle].pts =
- this->video_overlay_events[this_event].event->object.pts;
- this->video_overlay_events[this_event].event->object.overlay = NULL;
+ this->objects[handle].overlay =
+ this->events[this_event].event->object.overlay;
+ this->objects[handle].pts =
+ this->events[this_event].event->object.pts;
+ this->events[this_event].event->object.overlay = NULL;
add_showing_handle( this, handle );
}
-break;
+ break;
case EVENT_MENU_BUTTON:
/* mixes palette and copy clip coords */
#ifdef LOG_DEBUG
printf ("video_overlay:MENU BUTTON NOW\n");
#endif
- if ( (this->video_overlay_events[this_event].event->object.overlay != NULL) &&
- (this->video_overlay_objects[handle].overlay) &&
- (this->video_overlay_events[this_event].event->object.pts ==
- this->video_overlay_objects[handle].pts) ) {
- vo_overlay_t *overlay = this->video_overlay_objects[handle].overlay;
- vo_overlay_t *event_overlay = this->video_overlay_events[this_event].event->object.overlay;
+ if ( (this->events[this_event].event->object.overlay != NULL) &&
+ (this->objects[handle].overlay) &&
+ (this->events[this_event].event->object.pts ==
+ this->objects[handle].pts) ) {
+ vo_overlay_t *overlay = this->objects[handle].overlay;
+ vo_overlay_t *event_overlay = this->events[this_event].event->object.overlay;
printf ("video_overlay:overlay present\n");
- this->video_overlay_objects[handle].handle = handle;
+ this->objects[handle].handle = handle;
overlay->clip_top = event_overlay->clip_top;
overlay->clip_bottom = event_overlay->clip_bottom;
overlay->clip_left = event_overlay->clip_left;
@@ -500,28 +503,28 @@ break;
}
***********************************/
#ifdef LOG_DEBUG
- video_overlay_print_overlay( this->video_overlay_events[this_event].event->object.overlay ) ;
+ video_overlay_print_overlay( this->events[this_event].event->object.overlay ) ;
#endif
add_showing_handle( this, handle );
} else {
printf ("video_overlay:overlay not present\n");
}
- if ( (this->video_overlay_events[this_event].event->object.pts !=
- this->video_overlay_objects[handle].pts) ) {
+ if ( (this->events[this_event].event->object.pts !=
+ this->objects[handle].pts) ) {
printf ("MENU BUTTON DROPPED menu pts=%lld spu pts=%lld\n",
- this->video_overlay_events[this_event].event->object.pts,
- this->video_overlay_objects[handle].pts);
+ this->events[this_event].event->object.pts,
+ this->objects[handle].pts);
}
- if( this->video_overlay_events[this_event].event->object.overlay->rle ) {
+ if( this->events[this_event].event->object.overlay->rle ) {
printf ("video_overlay: warning EVENT_MENU_BUTTON with rle data\n");
- free( this->video_overlay_events[this_event].event->object.overlay->rle );
- this->video_overlay_events[this_event].event->object.overlay->rle = NULL;
+ free( this->events[this_event].event->object.overlay->rle );
+ this->events[this_event].event->object.overlay->rle = NULL;
}
- if (this->video_overlay_events[this_event].event->object.overlay != NULL) {
- free (this->video_overlay_events[this_event].event->object.overlay);
- this->video_overlay_events[this_event].event->object.overlay = NULL;
+ if (this->events[this_event].event->object.overlay != NULL) {
+ free (this->events[this_event].event->object.overlay);
+ this->events[this_event].event->object.overlay = NULL;
}
break;
@@ -530,14 +533,14 @@ break;
break;
}
- this->video_overlay_events[0].next_event = this->video_overlay_events[this_event].next_event;
- this->video_overlay_events[this_event].next_event = 0;
- this->video_overlay_events[this_event].event->event_type = 0;
+ this->events[0].next_event = this->events[this_event].next_event;
+ this->events[this_event].next_event = 0;
+ this->events[this_event].event->event_type = 0;
- this_event=this->video_overlay_events[0].next_event;
+ this_event=this->events[0].next_event;
}
- pthread_mutex_unlock (&this->video_overlay_events_mutex);
+ pthread_mutex_unlock (&this->events_mutex);
return processed;
}
@@ -558,14 +561,24 @@ static void video_overlay_multiple_overlay_blend(video_overlay_instance_t *this_
/* Scan through 5 entries and display any present.
*/
- pthread_mutex_lock( &this->video_overlay_showing_mutex );
+ pthread_mutex_lock( &this->showing_mutex );
+
+ if( output->overlay_begin )
+ output->overlay_begin(output, vo_img, this->showing_changed);
+
for( i = 0; enabled && output->overlay_blend && i < MAX_SHOWING; i++ ) {
- handle=this->video_overlay_showing[i].handle;
+ handle=this->showing[i].handle;
if (handle >= 0 ) {
- output->overlay_blend(output, vo_img, this->video_overlay_objects[handle].overlay);
+ output->overlay_blend(output, vo_img, this->objects[handle].overlay);
}
}
- pthread_mutex_unlock( &this->video_overlay_showing_mutex );
+
+ if( output->overlay_end )
+ output->overlay_end(output, vo_img);
+
+ this->showing_changed = 0;
+
+ pthread_mutex_unlock( &this->showing_mutex );
}
@@ -586,7 +599,8 @@ static int video_overlay_redraw_needed(video_overlay_instance_t *this_gen, int64
{
video_overlay_t *this = (video_overlay_t *) this_gen;
- return video_overlay_event( this, vpts );
+ video_overlay_event( this, vpts );
+ return this->showing_changed;
}
@@ -596,21 +610,21 @@ static void video_overlay_dispose(video_overlay_instance_t *this_gen) {
int i;
for (i=0; i < MAX_EVENTS; i++) {
- if (this->video_overlay_events[i].event != NULL) {
- if (this->video_overlay_events[i].event->object.overlay != NULL) {
- if (this->video_overlay_events[i].event->object.overlay->rle)
- free (this->video_overlay_events[i].event->object.overlay->rle);
- free (this->video_overlay_events[i].event->object.overlay);
+ if (this->events[i].event != NULL) {
+ if (this->events[i].event->object.overlay != NULL) {
+ if (this->events[i].event->object.overlay->rle)
+ free (this->events[i].event->object.overlay->rle);
+ free (this->events[i].event->object.overlay);
}
- free (this->video_overlay_events[i].event);
+ free (this->events[i].event);
}
}
for (i=0; i < MAX_OBJECTS; i++) {
- if (this->video_overlay_objects[i].overlay != NULL) {
- if (this->video_overlay_objects[i].overlay->rle)
- free (this->video_overlay_objects[i].overlay->rle);
- free (this->video_overlay_objects[i].overlay);
+ if (this->objects[i].overlay != NULL) {
+ if (this->objects[i].overlay->rle)
+ free (this->objects[i].overlay->rle);
+ free (this->objects[i].overlay);
}
}
@@ -635,4 +649,3 @@ video_overlay_instance_t *video_overlay_new_instance () {
return (video_overlay_instance_t *) &this->video_overlay;
}
-