From: Rocky B. <ro...@us...> - 2005-06-19 03:47:54
|
Update of /cvsroot/xine/xine-lib/src/input/vcd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22828 Modified Files: vcdplayer.c vcdplayer.h xineplug_inp_vcd.c Log Message: Correct the way the hot-spot coordinate system is treated. Note: some of the vcdplayer.c code to get screen max_x, max_y will probably get moved to libvcdinfo. Index: vcdplayer.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/input/vcd/vcdplayer.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- vcdplayer.c 14 Jun 2005 17:27:13 -0000 1.17 +++ vcdplayer.c 19 Jun 2005 03:47:45 -0000 1.18 @@ -534,23 +534,59 @@ switch (segtype) { case VCDINFO_FILES_VIDEO_NTSC_STILL: + p_vcdplayer->max_x = 704; + p_vcdplayer->max_y = 480; + /* Note that we are reading a still frame but haven't + got to the end. */ + p_vcdplayer->i_still = STILL_READING; + break; case VCDINFO_FILES_VIDEO_NTSC_STILL2: + p_vcdplayer->max_x = 352; + p_vcdplayer->max_y = 240; + /* Note that we are reading a still frame but haven't + got to the end. */ + p_vcdplayer->i_still = STILL_READING; + break; case VCDINFO_FILES_VIDEO_PAL_STILL: + p_vcdplayer->max_x = 704; + p_vcdplayer->max_y = 576; + /* Note that we are reading a still frame but haven't + got to the end. */ + p_vcdplayer->i_still = STILL_READING; + break; case VCDINFO_FILES_VIDEO_PAL_STILL2: + p_vcdplayer->max_x = 352; + p_vcdplayer->max_y = 288; /* Note that we are reading a still frame but haven't - got to the end. - */ + got to the end. */ p_vcdplayer->i_still = STILL_READING; break; default: /* */ switch (p_vcdplayer->vcd_format) { case VCD_TYPE_VCD: + p_vcdplayer->max_x = 352; + p_vcdplayer->max_y = 240; + /* aspect ratio for VCD's is known to be 4:3 for any + type of VCD's */ + p_vcdplayer->set_aspect_ratio(1); + break; case VCD_TYPE_VCD11: case VCD_TYPE_VCD2: + p_vcdplayer->max_x = 352; + switch(segtype) { + case VCDINFO_FILES_VIDEO_NTSC_MOTION: + p_vcdplayer->max_y = 240; + break; + case VCDINFO_FILES_VIDEO_PAL_MOTION: + p_vcdplayer->max_y = 288; + default: + p_vcdplayer->max_y = 289; + } + + p_vcdplayer->set_aspect_ratio(1); /* aspect ratio for VCD's is known to be 4:3 for any type of VCD's */ - p_vcdplayer->set_aspect_ratio(1); break; default: ; } Index: vcdplayer.h =================================================================== RCS file: /cvsroot/xine/xine-lib/src/input/vcd/vcdplayer.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- vcdplayer.h 14 Jun 2005 17:27:13 -0000 1.9 +++ vcdplayer.h 19 Jun 2005 03:47:45 -0000 1.10 @@ -183,6 +183,9 @@ lsn_t track_lsn; /* LSN of start track origin of track we are in. */ lsn_t track_end_lsn; /* LSN of end of current track (if entry). */ + uint16_t max_x; /* Largest screen x coordinate */ + uint16_t max_y; /* Largest screen y coordinate */ + /*-------------------------------------------------------------- (S)VCD Medium information ---------------------------------------------------------------*/ @@ -305,10 +308,6 @@ void vcdplayer_send_button_update(vcdplayer_t *p_vcdplayer, int mode); -int -vcdinfo_get_area_selection(const vcdinfo_obj_t *p_vcdinfo, - lid_t lid, int x, int y); - #endif /* _VCDPLAYER_H_ */ /* * Local variables: Index: xineplug_inp_vcd.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/input/vcd/xineplug_inp_vcd.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- xineplug_inp_vcd.c 14 Jun 2005 17:27:13 -0000 1.39 +++ xineplug_inp_vcd.c 19 Jun 2005 03:47:45 -0000 1.40 @@ -1177,13 +1177,8 @@ { int i_selection; - /* mouse coordinates seem to be before aspect ratio is applied. - For now we're hacking to assume 4:3 which is generally correct. - */ - const int16_t x_scaled = p_input->x * 3 / 4; - - dbg_print(INPUT_DBG_EVENT, "Button to x: %d, scaled x: %d, y: %d\n", - p_input->x, x_scaled, p_input->y); + dbg_print(INPUT_DBG_EVENT, "Button to x: %d, y: %d\n", + p_input->x, p_input->y); #if LIBVCD_VERSION_NUM >= 23 /* xine_dvd_send_button_update(this, 1); */ @@ -1193,8 +1188,10 @@ i_selection = vcdinfo_get_area_selection(p_vcdplayer->vcd, p_vcdplayer->i_lid, - x_scaled, - p_input->y); + p_input->x, + p_input->y, + p_vcdplayer->max_x, + p_vcdplayer->max_y); dbg_print(INPUT_DBG_EVENT, "Selection is: %d\n", i_selection); if (vcdplayer_pbc_is_on(p_vcdplayer)) { |