diff options
-rw-r--r-- | include/xine.h.tmpl.in | 14 | ||||
-rw-r--r-- | src/xine-engine/tvmode.c | 48 |
2 files changed, 46 insertions, 16 deletions
diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in index b68a0c1bf..b36a0ed50 100644 --- a/include/xine.h.tmpl.in +++ b/include/xine.h.tmpl.in @@ -28,7 +28,7 @@ \endverbatim */ /* - * $Id: xine.h.tmpl.in,v 1.103 2002/07/17 21:23:57 f1rmb Exp $ + * $Id: xine.h.tmpl.in,v 1.104 2002/08/03 17:33:06 siggi Exp $ * */ @@ -2045,14 +2045,16 @@ char *xine_set_locale(void); * \brief connect to nvtvd server and save current TV and X settings * \param self xine object. */ -void xine_tvmode_init (xine_t *self); +void xine_tvmode_init (void); +void xine_tvmode_init2 (xine_t *self); /** * \fn void xine_tvmode_exit (xine_t *self); * \brief restore old TV and X settings and close nvtvd connection * \param self xine object. */ -void xine_tvmode_exit (xine_t *self); +void xine_tvmode_exit (void); +void xine_tvmode_exit2 (xine_t *self); /** * \fn int xine_tvmode_switch (xine_t *self, int type, int width, int height, double fps); @@ -2065,7 +2067,8 @@ void xine_tvmode_exit (xine_t *self); * \return finally selected state * \sa xine_tvmode_init(), xine_tvmode_exit(), xine_tvmode_size() */ -int xine_tvmode_switch (xine_t *self, int type, int width, int height, double fps); +int xine_tvmode_switch (int type, int width, int height, double fps); +int xine_tvmode_switch2 (xine_t *self, int type, int width, int height, double fps); /** * \fn void xine_tvmode_size (xine_t *self, int *width, int *height, double *pixelaspect, double *fps); @@ -2076,7 +2079,8 @@ int xine_tvmode_switch (xine_t *self, int type, int width, int height, double fp * \param pixelaspect pixel aspect to be adapted or NULL * \param frame rate of current TV mode to be adapted or NULL */ -void xine_tvmode_size (xine_t *self, int *width, int *height, double *pixelaspect, double *fps); +void xine_tvmode_size (int *width, int *height, double *pixelaspect, double *fps); +void xine_tvmode_size2 (xine_t *self, int *width, int *height, double *pixelaspect, double *fps); /** @} end of xine_tvmode */ diff --git a/src/xine-engine/tvmode.c b/src/xine-engine/tvmode.c index 4df7fff8d..6c5bf45c3 100644 --- a/src/xine-engine/tvmode.c +++ b/src/xine-engine/tvmode.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: tvmode.c,v 1.6 2002/08/02 14:09:05 mshopf Exp $ + * $Id: tvmode.c,v 1.7 2002/08/03 17:33:06 siggi Exp $ * * tvmode - TV output selection * @@ -124,7 +124,8 @@ static char *scan_overscan[] = { /* Just turn off warnings */ -void xine_tvmode_exit (xine_t *this); +void xine_tvmode_exit (void); +void xine_tvmode_exit2 (xine_t *this); /* Try to connect to nvtvd server */ @@ -489,7 +490,7 @@ static void tvmode_settvstate (xine_t *this, int width, int height, double fps) */ /* Set to 'regular'(0) or 'tv'(1) state, that is if it is enabled */ -int xine_tvmode_switch (xine_t *this, int type, int width, int height, double fps) { +int xine_tvmode_switch2 (xine_t *this, int type, int width, int height, double fps) { if (back_card) { switch (type) { @@ -512,7 +513,7 @@ int xine_tvmode_switch (xine_t *this, int type, int width, int height, double fp /* Addapt (maximum) output size to visible area and set pixel aspect and fps */ -void xine_tvmode_size (xine_t *this, int *width, int *height, +void xine_tvmode_size2 (xine_t *this, int *width, int *height, double *pixelratio, double *fps) { switch (tv_current_type) { @@ -543,27 +544,28 @@ static void tvmode_system_cb (void *data, cfg_entry_t *entry) { static void tvmode_policy_cb (void *data, cfg_entry_t *entry) { xine_t *this = (xine_t *) data; tv_policy = entry->num_value; - xine_tvmode_switch (this, tv_current_type, tv_stream_width, + xine_tvmode_switch2 (this, tv_current_type, tv_stream_width, tv_stream_height, tv_stream_fps); } static void tvmode_mode_cb (void *data, cfg_entry_t *entry) { xine_t *this = (xine_t *) data; tv_scan_mode = entry->str_value; - if (*tv_scan_mode == '-') + if (this && *tv_scan_mode == '-') + /*^^^^^^^ FIXME: this check can be removed in new API */ this->config->update_string (this->config, "tv.modes", tv_scan_mode_default); - xine_tvmode_switch (this, tv_current_type, tv_stream_width, + xine_tvmode_switch2 (this, tv_current_type, tv_stream_width, tv_stream_height, tv_stream_fps); } static void tvmode_aspect_cb (void *data, cfg_entry_t *entry) { xine_t *this = (xine_t *) data; tv_aspect = tv_aspect_aspects[entry->num_value]; - xine_tvmode_switch (this, tv_current_type, tv_stream_width, + xine_tvmode_switch2 (this, tv_current_type, tv_stream_width, tv_stream_height, tv_stream_fps); } static void tvmode_preferred_fps_cb (void *data, cfg_entry_t *entry) { xine_t *this = (xine_t *) data; tv_prefered_fps = entry->num_value ? 25 : 30; - xine_tvmode_switch (this, tv_current_type, tv_stream_width, + xine_tvmode_switch2 (this, tv_current_type, tv_stream_width, tv_stream_height, tv_stream_fps); } static void tvmode_verbose_cb (void *data, cfg_entry_t *entry) { @@ -572,7 +574,7 @@ static void tvmode_verbose_cb (void *data, cfg_entry_t *entry) { /* Connect to nvtvd server if possible and register settings */ -void xine_tvmode_init (xine_t *this) { +void xine_tvmode_init2 (xine_t *this) { /* TODO: * more config options that can be imagined: * - disable deinterlacing for tv mode only @@ -640,8 +642,32 @@ void xine_tvmode_init (xine_t *this) { } /* Restore old CRT and TV registers and close nvtvd connection */ -void xine_tvmode_exit (xine_t *this) { +void xine_tvmode_exit2 (xine_t *this) { tvmode_closedown (this); } +/***************************************************************** + * + * compatibility functions + * FIXME: these should be replaced by the *2-functions in the next release + */ + +void xine_tvmode_init () { + tvmode_connect (NULL); + if (back_card) + tvmode_savestate (NULL); +} + +void xine_tvmode_exit () { + + tvmode_closedown (NULL); +} + +int xine_tvmode_switch (int type, int width, int height, double fps){ + return xine_tvmode_switch2(NULL, type, width, height, fps); +} + +void xine_tvmode_size (int *width, int *height, double *pixelaspect, double *fps){ + xine_tvmode_size2 (NULL, width, height, pixelaspect, fps); +} |