summaryrefslogtreecommitdiff
path: root/src/libspudec
diff options
context:
space:
mode:
Diffstat (limited to 'src/libspudec')
-rw-r--r--src/libspudec/Makefile.am1
-rw-r--r--src/libspudec/spu.c13
-rw-r--r--src/libspudec/spu_decoder_api.h64
-rw-r--r--src/libspudec/xine_decoder.c16
4 files changed, 47 insertions, 47 deletions
diff --git a/src/libspudec/Makefile.am b/src/libspudec/Makefile.am
index 6480f6788..2d7478d20 100644
--- a/src/libspudec/Makefile.am
+++ b/src/libspudec/Makefile.am
@@ -10,6 +10,7 @@ if HAVE_DVDNAV
xineplug_decode_spu_la_SOURCES = \
spu.c \
xine_decoder.c
+AM_CPPFLAGS = $(DVDNAV_CFLAGS)
xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(DVDNAV_LIBS)
else
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c
index c2e8ccabc..b09314b20 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.65 2003/05/02 15:54:33 miguelfreitas Exp $
+ * $Id: spu.c,v 1.66 2003/05/03 14:24:06 mroi Exp $
*
*/
@@ -364,18 +364,15 @@ void spudec_process (spudec_decoder_t *this, uint32_t stream_id) {
continue;
}
if ( this->pci.hli.hl_gi.fosl_btnn > 0) {
- spu_button_t spu_button;
+ int buttonN;
xine_event_t event;
this->buttonN = this->pci.hli.hl_gi.fosl_btnn ;
event.type = XINE_EVENT_INPUT_BUTTON_FORCE;
event.stream = this->stream;
- event.data = &spu_button;
- event.data_length = sizeof(spu_button);
- spu_button.buttonN = this->buttonN;
- /* The BUTTON_FORCE event cannot call "get_nav_pci",
- so the nav_pci info has to be passed in the event instead. */
- memcpy(&spu_button.nav_pci, &this->pci, sizeof(pci_t) );
+ event.data = &buttonN;
+ event.data_length = sizeof(buttonN);
+ buttonN = this->buttonN;
xine_event_send(this->stream, &event);
}
#ifdef LOG_BUTTON
diff --git a/src/libspudec/spu_decoder_api.h b/src/libspudec/spu_decoder_api.h
index e43cc51f2..7eb33ed61 100644
--- a/src/libspudec/spu_decoder_api.h
+++ b/src/libspudec/spu_decoder_api.h
@@ -24,17 +24,7 @@
#ifndef HAVE_SPU_API_H
#define HAVE_SPU_API_H
-#define SPU_DECODER_IFACE_VERSION 13
-
-#ifdef XINE_COMPILE
-# ifdef HAVE_DVDNAV
-# include <dvdnav/nav_types.h>
-# else
-# include "../input/libdvdnav/nav_types.h"
-# endif
-#else
-# include "nav_types.h"
-#endif
+#define SPU_DECODER_IFACE_VERSION 14
/*
* generic xine spu decoder plugin interface
@@ -70,38 +60,50 @@ struct spu_decoder_class_s {
struct spu_decoder_s {
-/* void (*init) (spu_decoder_t *this, vo_instance_t *video_out);*/
-
+ /*
+ * decode data from buf and feed the overlay to overlay manager
+ */
void (*decode_data) (spu_decoder_t *this, buf_element_t *buf);
+ /*
+ * reset decoder after engine flush (prepare for new
+ * SPU data not related to recently decoded data)
+ */
void (*reset) (spu_decoder_t *this);
+ /*
+ * inform decoder that a time reference discontinuity has happened.
+ * that is, it must forget any currently held pts value
+ */
void (*discontinuity) (spu_decoder_t *this);
+ /*
+ * close down, free all resources
+ */
void (*dispose) (spu_decoder_t *this);
- int (*get_nav_pci) (spu_decoder_t *this, pci_t *nav_pci);
+ /*
+ * When the SPU decoder also handles data used in user interaction,
+ * you can query the related information here. The typical example
+ * for this is DVD NAV packets which are handled by the SPU decoder
+ * and can be received readily parsed from here.
+ * The caller and the decoder must agree on the structure which is
+ * passed here.
+ * This function pointer may be NULL, if the plugin does not have
+ * such functionality.
+ */
+ int (*get_interact_info) (spu_decoder_t *this, void *data);
+ /*
+ * When the SPU decoder also handles menu overlays for user inter-
+ * action, you can set a menu button here. The typical example for
+ * this is DVD menus.
+ * This function pointer may be NULL, if the plugin does not have
+ * such functionality.
+ */
void (*set_button) (spu_decoder_t *this_gen, int32_t button, int32_t mode);
void *node; /* used by plugin loader */
};
-typedef struct spu_button_s spu_button_t;
-struct spu_button_s {
- uint32_t show;
- uint8_t color[4];
- uint8_t trans[4];
- uint16_t left, right;
- uint16_t top, bottom;
- int64_t pts;
- uint32_t buttonN;
- pci_t nav_pci;
-};
-
-typedef struct spudec_clut_table_s spudec_clut_table_t;
-struct spudec_clut_table_s {
- uint32_t clut[16];
-};
-
#endif /* HAVE_SPUDEC_H */
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c
index 68e09fa17..92b714d0c 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.97 2003/04/30 16:49:35 mroi Exp $
+ * $Id: xine_decoder.c,v 1.98 2003/05/03 14:24:07 mroi Exp $
*
* stuff needed to turn libspu into a xine decoder plugin
*/
@@ -199,15 +199,15 @@ static void spudec_dispose (spu_decoder_t *this_gen) {
/* This is not perfectly in sync with the display, but all the same, */
/* much closer than doing it at the input stage. */
/* returns a bool for error/success.*/
-static int spudec_get_nav_pci (spu_decoder_t *this_gen, pci_t *pci) {
+static int spudec_get_interact_info (spu_decoder_t *this_gen, void *data) {
spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
- /*printf("get_nav_pci() called\n");*/
- if (!this || !pci)
+ /*printf("get_interact_info() called\n");*/
+ if (!this || !data)
return 0;
- /*printf("get_nav_pci() coping nav_pci\n");*/
+ /*printf("get_interact_info() coping nav_pci\n");*/
pthread_mutex_lock(&this->nav_pci_lock);
- memcpy(pci, &this->pci, sizeof(pci_t) );
+ memcpy(data, &this->pci, sizeof(pci_t) );
pthread_mutex_unlock(&this->nav_pci_lock);
return 1;
@@ -305,7 +305,7 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t
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.get_interact_info = spudec_get_interact_info;
this->spu_decoder.set_button = spudec_set_button;
this->stream = stream;
this->class = (spudec_class_t *) class_gen;
@@ -379,6 +379,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, 13, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
+ { PLUGIN_SPU_DECODER, 14, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};