summaryrefslogtreecommitdiff
path: root/src/libspudec
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-11-19 00:45:41 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-11-19 00:45:41 +0000
commit7580770c5ff6df373c6056626abae7328ae5ab48 (patch)
treee24f050292d6562a6b169cacba4f294895105cd0 /src/libspudec
parent1667cd964d92d9c7f7f53ff7f5343cafd08c3249 (diff)
downloadxine-lib-7580770c5ff6df373c6056626abae7328ae5ab48.tar.gz
xine-lib-7580770c5ff6df373c6056626abae7328ae5ab48.tar.bz2
spu and overlay cleanups, mostly cosmetic
CVS patchset: 3298 CVS date: 2002/11/19 00:45:41
Diffstat (limited to 'src/libspudec')
-rw-r--r--src/libspudec/spu.c27
-rw-r--r--src/libspudec/spu_decoder_api.h4
-rw-r--r--src/libspudec/xine_decoder.c21
3 files changed, 30 insertions, 22 deletions
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c
index 9a3afa727..eb8ab4e1d 100644
--- a/src/libspudec/spu.c
+++ b/src/libspudec/spu.c
@@ -35,7 +35,7 @@
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: spu.c,v 1.52 2002/11/18 13:42:50 mroi Exp $
+ * $Id: spu.c,v 1.53 2002/11/19 00:45:41 miguelfreitas Exp $
*
*/
@@ -163,7 +163,7 @@ void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) {
}
if( this->menu_handle >= 0 ) {
this->event.object.handle = this->menu_handle;
- this->event.event_type = EVENT_HIDE_MENU;
+ this->event.event_type = OVERLAY_EVENT_HIDE;
/* hide menu right now */
this->event.vpts = 0;
ovl_instance->add_event(ovl_instance, (void *)&this->event);
@@ -287,7 +287,7 @@ void spudec_process (spudec_decoder_t *this, uint32_t stream_id) {
#endif
this->state.cmd_ptr = cur_seq->buf + cur_seq->cmd_offs;
this->state.modified = 1; /* Only draw picture if = 1 on first event of SPU */
- this->state.visible = EVENT_SHOW_MENU; /* 0 - No value, 1 - Show, 2 - Hide. */
+ this->state.visible = OVERLAY_EVENT_SHOW;
this->state.forced_display = 0; /* 0 - No value, 1 - Forced Display. */
this->state.delay = 0;
cur_seq->finished=0;
@@ -322,7 +322,7 @@ void spudec_process (spudec_decoder_t *this, uint32_t stream_id) {
#endif
pthread_mutex_lock(&this->nav_pci_lock);
if (this->pci.hli.hl_gi.hli_s_ptm == this->spudec_stream_state[stream_id].pts) {
- if (this->state.visible == EVENT_HIDE_MENU) {
+ if (this->state.visible == OVERLAY_EVENT_HIDE) {
/* menus are hidden via nav packet decoding, not here */
/* FIXME: James is not sure about this solution and may want to look this over.
* I'm commiting it, because I haven't found a disc it breaks, but it fixes
@@ -386,7 +386,7 @@ void spudec_process (spudec_decoder_t *this, uint32_t stream_id) {
this->overlay.rle=NULL;
/* For force display menus */
//if ( !(this->state.visible) ) {
- // this->state.visible = EVENT_SHOW_MENU;
+ // this->state.visible = OVERLAY_EVENT_SHOW;
//}
this->event.event_type = this->state.visible;
@@ -461,7 +461,7 @@ static void spudec_do_commands(spudec_state_t *state, spudec_seq_t* seq, vo_over
#ifdef LOG_DEBUG
printf ("spu: \tshow subpicture\n");
#endif
- state->visible = EVENT_SHOW_MENU;
+ state->visible = OVERLAY_EVENT_SHOW;
buf++;
break;
@@ -469,7 +469,7 @@ static void spudec_do_commands(spudec_state_t *state, spudec_seq_t* seq, vo_over
#ifdef LOG_DEBUG
printf ("spu: \thide subpicture\n");
#endif
- state->visible = EVENT_HIDE_MENU;
+ state->visible = OVERLAY_EVENT_HIDE;
buf++;
break;
@@ -574,7 +574,7 @@ static void spudec_do_commands(spudec_state_t *state, spudec_seq_t* seq, vo_over
case CMD_SPU_WIPE:
#ifdef LOG_DEBUG
- printf ("spu: \tSPU_WIPE not implemented yet\n");
+ printf ("libspudec: \tSPU_WIPE not implemented yet\n");
#endif
param_length = (buf[1] << 8) | (buf[2]);
buf += 1 + param_length;
@@ -582,7 +582,7 @@ static void spudec_do_commands(spudec_state_t *state, spudec_seq_t* seq, vo_over
case CMD_SPU_FORCE_DISPLAY:
#ifdef LOG_DEBUG
- printf ("spu: \tForce Display/Menu\n");
+ printf ("libspudec: \tForce Display/Menu\n");
#endif
state->forced_display = 1;
buf++;
@@ -674,23 +674,18 @@ static void spudec_draw_picture (spudec_state_t *state, spudec_seq_t* seq, vo_ov
ovl->data_size = seq->cmd_offs * 2 * sizeof(rle_elem_t);
-#ifdef LOG_DEBUG
- printf ("spu: MALLOC1: ovl->rle %p, len=%d\n", ovl->rle,ovl->data_size);
-#endif
+
if (ovl->rle) {
printf ("libspudec: spudec_draw_picture: ovl->rle is not empty!!!! It should be!!! You should never see this message.\n");
free(ovl->rle);
ovl->rle=NULL;
}
ovl->rle = malloc(ovl->data_size);
-#ifdef LOG_DEBUG
- printf ("spu: MALLOC2: ovl->rle %p, len=%d\n", ovl->rle,ovl->data_size);
-#endif
state->modified = 0; /* mark as already processed */
rle = ovl->rle;
#ifdef LOG_DEBUG
- printf ("spu: Draw RLE=%p\n",rle);
+ printf ("libspudec: Draw RLE=%p\n",rle);
#endif
while (bit_ptr[1] < seq->buf + seq->cmd_offs) {
diff --git a/src/libspudec/spu_decoder_api.h b/src/libspudec/spu_decoder_api.h
index 09d4094f3..e0a64c6ed 100644
--- a/src/libspudec/spu_decoder_api.h
+++ b/src/libspudec/spu_decoder_api.h
@@ -24,7 +24,7 @@
#ifndef HAVE_SPU_API_H
#define HAVE_SPU_API_H
-#define SPU_DECODER_IFACE_VERSION 10
+#define SPU_DECODER_IFACE_VERSION 11
/* FIXME: Needed for spu_button_t */
/* But will not be on all users's systems. (From the libspudec directory or libdvdread). */
/*#include "nav_types.h" */
@@ -69,7 +69,7 @@ struct spu_decoder_s {
void (*reset) (spu_decoder_t *this);
-/* void (*close) (spu_decoder_t *this); */
+ void (*discontinuity) (spu_decoder_t *this);
void (*dispose) (spu_decoder_t *this);
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c
index 36e6cae72..2da1241d0 100644
--- a/src/libspudec/xine_decoder.c
+++ b/src/libspudec/xine_decoder.c
@@ -19,7 +19,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_decoder.c,v 1.86 2002/11/17 16:18:33 mroi Exp $
+ * $Id: xine_decoder.c,v 1.87 2002/11/19 00:45:41 miguelfreitas Exp $
*
* stuff needed to turn libspu into a xine decoder plugin
*/
@@ -83,7 +83,9 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
return;
if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_CLUT ) {
+#ifdef LOG_DEBUG
printf("libspudec: SPU CLUT\n");
+#endif
if (buf->content[0]) { /* cheap endianess detection */
xine_fast_memcpy(this->state.clut, buf->content, sizeof(uint32_t)*16);
} else {
@@ -141,6 +143,10 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
static void spudec_reset (spu_decoder_t *this_gen) {
}
+static void spudec_discontinuity (spu_decoder_t *this_gen) {
+}
+
+
static void spudec_dispose (spu_decoder_t *this_gen) {
spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
@@ -224,7 +230,7 @@ static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t
overlay_event->object.handle = this->menu_handle;
overlay_event->object.pts = this->pci.hli.hl_gi.hli_s_ptm;
overlay_event->object.overlay=overlay;
- overlay_event->event_type = EVENT_MENU_BUTTON;
+ overlay_event->event_type = OVERLAY_EVENT_MENU_BUTTON;
#ifdef LOG_BUTTON
fprintf(stderr, "libspudec:Button Overlay\n");
#endif
@@ -235,7 +241,7 @@ static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t
fprintf (stderr,"libspudec:xine_decoder.c:spudec_event_listener:HIDE ????\n");
assert(0);
overlay_event->object.handle = this->menu_handle;
- overlay_event->event_type = EVENT_HIDE_MENU;
+ overlay_event->event_type = OVERLAY_EVENT_HIDE;
}
overlay_event->vpts = 0;
if (this->vo_out) {
@@ -265,6 +271,7 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t
this->spu_decoder.decode_data = spudec_decode_data;
this->spu_decoder.reset = spudec_reset;
+ this->spu_decoder.discontinuity = spudec_discontinuity;
this->spu_decoder.dispose = spudec_dispose;
this->spu_decoder.get_nav_pci = spudec_get_nav_pci;
this->spu_decoder.set_button = spudec_set_button;
@@ -295,17 +302,23 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t
}
static char *get_identifier (spu_decoder_class_t *this) {
+#ifdef LOG_DEBUG
printf ("libspudec:get_identifier called\n");
+#endif
return "spudec";
}
static char *get_description (spu_decoder_class_t *this) {
+#ifdef LOG_DEBUG
printf ("libspudec:get_description called\n");
+#endif
return "DVD/VOB SPU decoder plugin";
}
static void dispose_class (spu_decoder_class_t *this) {
+#ifdef LOG_DEBUG
printf ("libspudec:dispose_class called\n");
+#endif
free (this);
}
@@ -335,6 +348,6 @@ static decoder_info_t dec_info_data = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER, 10, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
+ { PLUGIN_SPU_DECODER, 11, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};