From: Siegfried L. <si...@us...> - 2002-08-03 17:33:09
|
Update of /cvsroot/xine/xine-lib/src/xine-engine In directory usw-pr-cvs1:/tmp/cvs-serv23360/src/xine-engine Modified Files: tvmode.c Log Message: remained incompatible xine_tvmode_* functions to xine_tvmode_*2, added backwards compatible functions => binary compatibility with former libxine0 0.9.11 and 0.9.12 Someone who uses nvtvd should definitely test this! They should be renamed back when the new API is released. Index: tvmode.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/tvmode.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- tvmode.c 2 Aug 2002 14:09:05 -0000 1.6 +++ tvmode.c 3 Aug 2002 17:33:06 -0000 1.7 @@ -124,7 +124,8 @@ /* 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 @@ */ /* 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 @@ /* 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_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 @@ /* 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 @@ } /* 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); +} |