summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSiggi Langauf <siggi@users.sourceforge.net>2002-05-02 01:44:44 +0000
committerSiggi Langauf <siggi@users.sourceforge.net>2002-05-02 01:44:44 +0000
commitfe98e9b0a0ab7fae382cba26239492970e7d7253 (patch)
tree14544c8cf1e30d953928e7605a039f4b415075bc /src
parent0a0717bf7d68e804eb969b81113a760cc4b68a37 (diff)
downloadxine-lib-fe98e9b0a0ab7fae382cba26239492970e7d7253.tar.gz
xine-lib-fe98e9b0a0ab7fae382cba26239492970e7d7253.tar.bz2
new logo code; xine uses a logo MRL instead of proprietary logo files.
advantages of this implementation: - less (ie simpler) code - works around the wrong-coloured-logo issue (okay, .yv12.gz did as well) - logo doesn't flash between streams any more - smaller logo file (currently MPEG1 elementary stream, as that's all I could create with the GIMP. Other formats may compress even better...) - support for animated logos, even with sound CVS patchset: 1830 CVS date: 2002/05/02 01:44:44
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/video_out.c129
-rw-r--r--src/xine-engine/xine.c21
2 files changed, 19 insertions, 131 deletions
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index a3bd2f592..569177f4d 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.95 2002/05/01 20:38:19 guenter Exp $
+ * $Id: video_out.c,v 1.96 2002/05/02 01:44:44 siggi Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -60,7 +60,6 @@ typedef struct {
vo_frame_t *last_frame;
vo_frame_t *img_backup;
- int backup_is_logo;
int redraw_needed;
int video_loop_running;
@@ -74,10 +73,6 @@ typedef struct {
/* pts value when decoder delivered last video frame */
int64_t last_delivery_pts;
- char *logo_pathname;
- pthread_mutex_t logo_mutex;
- int logo_w, logo_h;
- uint8_t *logo_yv12;
video_overlay_instance_t *overlay_source;
int overlay_enabled;
@@ -373,7 +368,6 @@ static void expire_frames (vos_t *this, int64_t cur_vpts) {
printf("video_out: possible still frame (old)\n");
this->img_backup = img;
- this->backup_is_logo = 0;
/* wait 4 frames before drawing this one.
this allow slower systems to recover. */
@@ -406,35 +400,6 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) {
printf ("video_out: no frame\n");
#endif
- /*
- * display logo ?
- */
- if (!this->video_opened && (!this->img_backup || !this->backup_is_logo)) {
-
- if (this->img_backup) {
-#ifdef LOG
- printf("video_out: overwriting frame backup\n");
-#endif
- vo_frame_dec_lock( this->img_backup );
- }
-
- printf("video_out: copying logo image\n");
-
- pthread_mutex_lock(&this->logo_mutex);
-
- this->img_backup = vo_get_frame (&this->vo, this->logo_w, this->logo_h,
- 42, IMGFMT_YV12, VO_BOTH_FIELDS);
-
- this->img_backup->duration = 3000;
-
- xine_fast_memcpy(this->img_backup->base[0], this->logo_yv12,
- this->logo_w*this->logo_h*3/2);
-
- pthread_mutex_unlock(&this->logo_mutex);
- this->backup_is_logo = 1;
- this->redraw_needed = 1;
- }
-
if (this->img_backup && (this->redraw_needed==1)) {
#ifdef LOG
@@ -498,7 +463,6 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) {
this->xine->video_fifo->size(this->xine->video_fifo));
this->img_backup = this->vo.duplicate_frame (&this->vo, img);
- this->backup_is_logo = 0;
}
/*
@@ -811,12 +775,6 @@ static void vo_exit (vo_instance_t *this_gen) {
free (this->free_img_buf_queue);
free (this->display_img_buf_queue);
- pthread_mutex_lock(&this->logo_mutex);
- if (this->logo_yv12)
- free (this->logo_yv12);
- pthread_mutex_unlock(&this->logo_mutex);
- pthread_mutex_destroy(&this->logo_mutex);
-
free (this);
}
@@ -839,65 +797,6 @@ static void vo_enable_overlay (vo_instance_t *this_gen, int overlay_enabled) {
this->overlay_enabled = overlay_enabled;
}
-/*
- * Logo related functions + config callback.
- */
-static uint16_t gzread_i16(gzFile *fp) {
- uint16_t ret;
- ret = gzgetc(fp) << 8 ;
- ret |= gzgetc(fp);
- return ret;
-}
-
-static int _load_logo_file(vos_t *this) {
- gzFile *fp;
- int retval = 0;
-
- pthread_mutex_lock(&this->logo_mutex);
-
- if ((fp = gzopen (this->logo_pathname, "rb")) != NULL) {
-
- if (this->logo_yv12)
- free (this->logo_yv12);
-
- this->logo_w = gzread_i16 (fp);
- this->logo_h = gzread_i16 (fp);
-#ifdef LOG
- printf ("video_out: loading logo %d x %d pixels, yv12\n",
- this->logo_w, this->logo_h);
-#endif
-
- this->logo_yv12 = malloc (this->logo_w * this->logo_h *3/2);
-
- gzread (fp, this->logo_yv12, this->logo_w * this->logo_h *3/2);
- gzclose (fp);
-
- this->backup_is_logo = 0;
-
- retval = 1;
- }
-
- pthread_mutex_unlock(&this->logo_mutex);
- return retval;
-}
-
-#ifdef LOGO_CONFIG_OPTION
-static void _logo_change_cb(void *data, cfg_entry_t *cfg) {
- vos_t *this = (vos_t *) data;
- char default_logo[2048];
-
- this->logo_pathname = cfg->str_value;
-
- if(!_load_logo_file(this)) {
-#ifdef LOG
- printf("_load_logo_file() failed, reload default\n");
-#endif
- snprintf(default_logo, 2048, "%s/xine_logo.yv12.gz", XINE_SKINDIR);
- cfg->config->update_string(cfg->config, cfg->key, default_logo);
- }
-}
-
-#endif
vo_instance_t *vo_new_instance (vo_driver_t *driver, xine_t *xine) {
@@ -932,7 +831,6 @@ vo_instance_t *vo_new_instance (vo_driver_t *driver, xine_t *xine) {
this->video_loop_running = 0;
this->img_backup = NULL;
- this->backup_is_logo = 0;
this->overlay_source = video_overlay_new_instance();
this->overlay_source->init (this->overlay_source);
@@ -962,31 +860,6 @@ vo_instance_t *vo_new_instance (vo_driver_t *driver, xine_t *xine) {
}
- /*
- * load xine logo
- */
- {
- config_values_t *config;
- char default_logo[2048];
-
- config = xine->config;
-
- pthread_mutex_init(&this->logo_mutex, NULL);
-
-#ifdef LOGO_CONFIG_OPTION
- snprintf(default_logo, 2048, "%s/xine_logo.yv12.gz", XINE_SKINDIR);
-
- this->logo_pathname = config->register_string(config, "video.logo_file", default_logo,
- "logo displayed in video output window", NULL,
- _logo_change_cb, (void *) this);
-#else
- this->logo_pathname = malloc (2048);
- snprintf (this->logo_pathname, 2048, "%s/xine_logo.yv12.gz", XINE_SKINDIR);
-#endif
-
- _load_logo_file(this);
- }
-
/*
* start video output thread
*
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 7814fdae6..d9eb2f396 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.123 2002/05/01 19:42:57 guenter Exp $
+ * $Id: xine.c,v 1.124 2002/05/02 01:44:44 siggi Exp $
*
* top-level xine functions
*
@@ -56,15 +56,25 @@
#include "xineutils.h"
#include "compat.h"
+static char *logo_mrl= XINE_SKINDIR "/xine_logo.mpg";
+#define LOGO_DELAY 500000 /* usec */
+
void * xine_notify_stream_finished_thread (void * this_gen) {
xine_t *this = this_gen;
xine_event_t event;
xine_stop_internal (this);
- event.type = XINE_EVENT_PLAYBACK_FINISHED;
+ if (strcmp(this->cur_mrl, logo_mrl)) {
+
+ event.type = XINE_EVENT_PLAYBACK_FINISHED;
+ xine_send_event (this, &event);
- xine_send_event (this, &event);
+ xine_usec_sleep (LOGO_DELAY);
+ if (this->status == XINE_STOP) {
+ xine_play(this, logo_mrl, 0, 0);
+ }
+ }
pthread_detach( pthread_self() );
@@ -213,6 +223,7 @@ void xine_stop_internal (xine_t *this) {
printf ("xine_stop: done\n");
pthread_mutex_unlock (&this->xine_lock);
+
}
void xine_stop (xine_t *this) {
@@ -224,6 +235,9 @@ void xine_stop (xine_t *this) {
*/
this->metronom->adjust_clock(this->metronom,
this->metronom->get_current_time(this->metronom) + 30 * 90000 );
+
+ xine_play(this, logo_mrl,0,0);
+
}
@@ -612,6 +626,7 @@ xine_t *xine_init (vo_driver_t *vo,
this->osd_renderer->hide (this->osd, 300000);
}
+ xine_play(this, logo_mrl,0,0);
return this;
}