summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2002-01-05 21:29:37 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2002-01-05 21:29:37 +0000
commite7776382d3c2cf58c7cd0127f9c29581a5469679 (patch)
tree69916f9afd1c5a4fee45217b8439486ff17cb48c
parentc7e12ec82d1c5a44e3cc15b9112d62a6cc3b3776 (diff)
downloadxine-lib-e7776382d3c2cf58c7cd0127f9c29581a5469679.tar.gz
xine-lib-e7776382d3c2cf58c7cd0127f9c29581a5469679.tar.bz2
NAV packets not provide input to SPU clut,trans and clip info all in libspudec.
Still need a communication between libspudec and dvdnav for button numbers. CVS patchset: 1342 CVS date: 2002/01/05 21:29:37
-rw-r--r--src/libspudec/spu.c5
-rw-r--r--src/libspudec/spu.h4
-rw-r--r--src/libspudec/xine_decoder.c56
3 files changed, 61 insertions, 4 deletions
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c
index 1b0289f93..59b1f0cd4 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.28 2002/01/05 18:14:27 jcdutton Exp $
+ * $Id: spu.c,v 1.29 2002/01/05 21:29:37 jcdutton Exp $
*
*/
@@ -218,13 +218,14 @@ void spu_do_commands(spu_state_t *state, spu_seq_t* seq, vo_overlay_t *ovl)
ovl->trans[2] = trans->entry1;
ovl->trans[1] = trans->entry2;
ovl->trans[0] = trans->entry3;
+/**************************88
if ( (trans->entry0 | trans->entry1 | trans->entry2 | trans->entry3) == 0) {
ovl->trans[3] = 15;
ovl->trans[2] = 15;
ovl->trans[1] = 15;
ovl->trans[0] = 0;
}
-
+*************************/
#ifdef LOG_DEBUG
printf ("spu: \ttrans [%d %d %d %d]\n",
ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]);
diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h
index 8571060e8..c49817f12 100644
--- a/src/libspudec/spu.h
+++ b/src/libspudec/spu.h
@@ -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: spu.h,v 1.7 2001/11/28 22:19:12 miguelfreitas Exp $
+ * $Id: spu.h,v 1.8 2002/01/05 21:29:37 jcdutton Exp $
*
* This file was originally part of the OMS program.
*
@@ -35,6 +35,7 @@
#include <inttypes.h>
#include "video_out.h"
#include "video_overlay.h"
+#include "nav_types.h"
#define NUM_SEQ_BUFFERS 50
#define MAX_STREAMS 32
@@ -127,6 +128,7 @@ typedef struct spudec_decoder_s {
vo_overlay_t overlay;
int ovl_caps;
int output_open;
+ pci_t pci;
} spudec_decoder_t;
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c
index 42c8ef300..07a930650 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.50 2002/01/05 18:14:27 jcdutton Exp $
+ * $Id: xine_decoder.c,v 1.51 2002/01/05 21:29:37 jcdutton Exp $
*
* stuff needed to turn libspu into a xine decoder plugin
*/
@@ -124,6 +124,49 @@ static void spudec_print_overlay( vo_overlay_t *ovl ) {
#endif
return;
}
+static void spudec_copy_nav_to_spu(spudec_decoder_t *this) {
+ int button = 1;
+ btni_t *button_ptr;
+ int i;
+ /* FIXME: Need to communicate with dvdnav vm to get/set
+ "self->vm->state.HL_BTNN_REG" info.
+ */
+ if ( this->pci.hli.hl_gi.fosl_btnn > 0) {
+ button = this->pci.hli.hl_gi.fosl_btnn ;
+ }
+ if((button <= 0) || (button > this->pci.hli.hl_gi.btn_ns)) {
+ printf("Unable to select button number %i as it doesn't exist",
+ button);
+ return ;
+ }
+ /* FIXME:Only the first grouping of buttons are used at the moment */
+ button_ptr = &this->pci.hli.btnit[button-1];
+ this->overlay.clip_left = button_ptr->x_start;
+ this->overlay.clip_top = button_ptr->y_start;
+ this->overlay.clip_right = button_ptr->x_end;
+ this->overlay.clip_bottom = button_ptr->y_end;
+ if(button_ptr->btn_coln != 0) {
+ for (i = 0;i < 4; i++) {
+ this->overlay.color[i] = this->state.clut[0xf & (this->pci.hli.btn_colit.btn_coli[button_ptr->btn_coln-1][0] >> (16 + 4*i))];
+ this->overlay.trans[i] = 0xf & (this->pci.hli.btn_colit.btn_coli[button_ptr->btn_coln-1][0] >> (4*i));
+ }
+/*************************
+ printf("libspudec:xine_decode.c:color3=%08x\n",this->overlay.color[3]);
+ printf("libspudec:xine_decode.c:color2=%08x\n",this->overlay.color[2]);
+ printf("libspudec:xine_decode.c:color1=%08x\n",this->overlay.color[1]);
+ printf("libspudec:xine_decode.c:color0=%08x\n",this->overlay.color[0]);
+ printf("libspudec:xine_decode.c:trans3=%08x\n",this->overlay.trans[3]);
+ printf("libspudec:xine_decode.c:trans2=%08x\n",this->overlay.trans[2]);
+ printf("libspudec:xine_decode.c:trans1=%08x\n",this->overlay.trans[1]);
+ printf("libspudec:xine_decode.c:trans0=%08x\n",this->overlay.trans[0]);
+*************************/
+ } else {
+ /* No colours present in the NAV packet */
+ }
+
+ printf("libspudec:xine_decoder.c:NAV to SPU pts match!\n");
+
+}
static void spu_process (spudec_decoder_t *this, uint32_t stream_id) {
// spu_overlay_event_t *event;
@@ -177,6 +220,14 @@ static void spu_process (spudec_decoder_t *this, uint32_t stream_id) {
/* spudec_print_overlay( &this->overlay ); */
printf ("spu: forced display:%s\n", this->state.menu ? "Yes" : "No" );
#endif
+ if (this->pci.hli.hl_gi.hli_s_ptm == this->spu_stream_state[stream_id].pts) {
+ spudec_copy_nav_to_spu(this);
+ }
+ if ( !(this->overlay.trans[0] | this->overlay.trans[1] | this->overlay.trans[2] | this->overlay.trans[3]) ) {
+ /* SPU is transparent so why bother displaying it. */
+ printf ("spu: transparent spu found, discarding it.\n" );
+ return;
+ }
if ((this->state.modified) ) {
spu_draw_picture(&this->state, this->cur_seq, &this->overlay);
@@ -339,6 +390,9 @@ static void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) {
// self->vobu_length = self->dsi.dsi_gi.vobu_ea;
}
}
+ if (pci->hli.hl_gi.hli_ss == 1) {
+ xine_fast_memcpy(&this->pci, pci, sizeof(pci_t));
+ }
free(pci);
free(dsi);
return;