diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-10-02 01:39:10 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-10-02 01:39:10 +0000 |
commit | 8d14f297e162ba26492ae454e9184a8892a94f1d (patch) | |
tree | 32b4bd07aa84523f753d1022a717875ba5adb345 /src | |
parent | 827966571322c41a7cc23d46539fb95f6cb6fddd (diff) | |
download | xine-lib-8d14f297e162ba26492ae454e9184a8892a94f1d.tar.gz xine-lib-8d14f297e162ba26492ae454e9184a8892a94f1d.tar.bz2 |
remove nvtv support
CVS patchset: 5422
CVS date: 2003/10/02 01:39:10
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/Makefile.am | 12 | ||||
-rw-r--r-- | src/xine-engine/nvtv/.cvsignore | 6 | ||||
-rw-r--r-- | src/xine-engine/nvtv/Makefile.am | 23 | ||||
-rw-r--r-- | src/xine-engine/nvtv/back_client.c | 501 | ||||
-rw-r--r-- | src/xine-engine/nvtv/back_client.h | 72 | ||||
-rw-r--r-- | src/xine-engine/nvtv/backend.h | 132 | ||||
-rw-r--r-- | src/xine-engine/nvtv/debug.h | 208 | ||||
-rw-r--r-- | src/xine-engine/nvtv/error.c | 28 | ||||
-rw-r--r-- | src/xine-engine/nvtv/error.h | 84 | ||||
-rw-r--r-- | src/xine-engine/nvtv/libnvclient_dummy.c | 1 | ||||
-rw-r--r-- | src/xine-engine/nvtv/local.h | 84 | ||||
-rw-r--r-- | src/xine-engine/nvtv/miscstruct.h | 93 | ||||
-rw-r--r-- | src/xine-engine/nvtv/pipe.c | 296 | ||||
-rw-r--r-- | src/xine-engine/nvtv/pipe.h | 86 | ||||
-rw-r--r-- | src/xine-engine/nvtv/tv_chip.h | 660 | ||||
-rw-r--r-- | src/xine-engine/nvtv/tv_common.h | 81 | ||||
-rw-r--r-- | src/xine-engine/nvtv/xf86i2c.h | 90 | ||||
-rw-r--r-- | src/xine-engine/nvtv/xfree.h | 334 | ||||
-rw-r--r-- | src/xine-engine/tvmode.c | 318 |
19 files changed, 4 insertions, 3105 deletions
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index 0a4a04155..c298789bf 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -1,13 +1,10 @@ include $(top_srcdir)/misc/Makefile.common -SUBDIRS = nvtv - AM_CFLAGS = $(THREAD_CFLAGS) $(X_CFLAGS) $(FT2_CFLAGS) lib_LTLIBRARIES = libxine.la XINEUTILS_LIB = $(top_builddir)/src/xine-utils/libxineutils.la -NVTVCLIENT_LIB = $(top_builddir)/src/xine-engine/nvtv/libnvclient.la libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \ load_plugins.c video_decoder.c buffer_types.c \ @@ -19,15 +16,9 @@ libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \ # FIXME: these are currently unused: EXTRA_DIST = lrb.c lrb.h -if HAVE_NVTV -libxine_la_DEPENDENCIES = @INTLLIBS@ $(XINEUTILS_LIB) $(NVTVCLIENT_LIB) -libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) @INTLLIBS@ $(ZLIB_LIBS) \ - -lm $(XINEUTILS_LIB) $(NVTVCLIENT_LIB) $(GICONV_BSD_LIBS) $(FT2_LIBS) -else libxine_la_DEPENDENCIES = @INTLLIBS@ $(XINEUTILS_LIB) libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) @INTLLIBS@ $(ZLIB_LIBS) \ -lm $(XINEUTILS_LIB) $(GICONV_BSD_LIBS) $(FT2_LIBS) -endif libxine_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) @@ -46,6 +37,3 @@ noinst_HEADERS = bswap.h $(XINEUTILS_LIB): cd $(top_srcdir)/src/xine-utils && $(MAKE) libxineutils.la - -$(NVTVCLIENT_LIB): - cd $(top_builddir)/src/xine-engine/nvtv && $(MAKE) libnvclient.la diff --git a/src/xine-engine/nvtv/.cvsignore b/src/xine-engine/nvtv/.cvsignore deleted file mode 100644 index 7d926a554..000000000 --- a/src/xine-engine/nvtv/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -.libs -.deps -*.lo -*.la diff --git a/src/xine-engine/nvtv/Makefile.am b/src/xine-engine/nvtv/Makefile.am deleted file mode 100644 index 2cace3681..000000000 --- a/src/xine-engine/nvtv/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -include $(top_srcdir)/misc/Makefile.common - -AM_CFLAGS = $(X_CFLAGS) - -noinst_LTLIBRARIES= libnvclient.la - -libnvclient_sources = back_client.c pipe.c error.c - -libnvclient_dummy = libnvclient_dummy.c - -EXTRA_DIST = $(libnvclient_sources) $(libnvclient_dummy) - -if HAVE_NVTV -nvtv_modules = $(libnvclient_sources) -endif - -libnvclient_la_SOURCES = $(nvtv_modules) $(libnvclient_dummy) - - -noinst_HEADERS = backend.h local.h tv_chip.h xf86i2c.h back_client.h debug.h \ - miscstruct.h pipe.h tv_common.h xfree.h error.h - -libnvclient_la_LIBADD = $(X_LIBS) diff --git a/src/xine-engine/nvtv/back_client.c b/src/xine-engine/nvtv/back_client.c deleted file mode 100644 index 24289cc71..000000000 --- a/src/xine-engine/nvtv/back_client.c +++ /dev/null @@ -1,501 +0,0 @@ -/* NVTV client backend -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: back_client.c,v 1.4 2003/05/04 22:22:21 f1rmb Exp $ - * - * Contents: - * - * Client backend for accessing the server - * - */ - -#include "local.h" /* before everything else */ - -#include <stdlib.h> /* for free */ -#include <string.h> - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif - -#include <fcntl.h> - -#include "backend.h" -#include "back_client.h" -#include "pipe.h" - -/* -------- State -------- */ - -static FILE *pipe_in = NULL; -static FILE *pipe_out = NULL; - -static CardPtr bcl_root = NULL; -static CardPtr bcl_card = NULL; - -/* -------- String pool -------- */ - -/* - * Add string to pool, and free original if already in pool. - */ - -static int pool_size = 0; -static char** pool_list = NULL; - -char* pool_addFree (char *s) -{ - int l, r, i; - - DPRINTF ("pool %s ", s); - if (!s) return NULL; - l = 0; r = pool_size-1; - while (l <= r) { - register int c; - - i = (l + r) / 2; - c = strcmp (s, pool_list[i]); - if (c < 0) r = i-1; else - if (c > 0) l = i+1; else - { - DPRINTF ("found\n"); - xfree (s); - return pool_list [i]; - } - } - /* Must insert between r and l */ - if (r < 0) r = 0; /* sanitize for DPRINTF */ - if (pool_list && r >= 0) DPRINTF (" %i=%s ", r, pool_list[r]); - DPRINTF ("*"); - if (pool_list && l < pool_size) DPRINTF (" %i=%s ", l, pool_list[l]); - DPRINTF ("\n"); - pool_size++; - pool_list = xrealloc (pool_list, pool_size * sizeof (char *)); - i = l+1; - if (pool_size > 1) { - memmove (pool_list+i, pool_list+l, (pool_size-i) * sizeof(char *)); - } - pool_list[l] = s; - return s; -} - -/* -------- Driver routines -------- */ - -void bcl_openPipes (void) -{ - /* IMPORTANT: Open out pipe first, otherwise deadlock */ - pipe_out = fopen (PIPE_OUT, "w"); - pipe_in = fopen (PIPE_IN, "r"); -} - -void bcl_closePipes (void) -{ - fclose (pipe_in ); - fclose (pipe_out); -} - -void bcl_openCard (CardPtr card) -{ - CardPtr c; - int i, index; - - DPRINTF ("bcl_open\n"); - bcl_card = card; - bcl_openPipes (); - /* convert card to index */ - i = index = 0; - for (c = bcl_root; c; c = c->next) { - i++; - if (c == card) index = i; - } - pipeWriteCmd (pipe_out, PCmd_OpenCard); - pipeWriteArgs (pipe_out, 1, sizeof(index), &index); - pipeReadCmd (pipe_in); - bcl_card->chips = pipeReadList (pipe_in, sizeof (ChipInfo)); -} - -void bcl_closeCard (void) -{ - DPRINTF ("bcl_close\n"); - pipeWriteCmd (pipe_out, PCmd_CloseCard); - pipeWriteArgs (pipe_out, 0); - bcl_closePipes (); -} - -void bcl_setHeads (int main, int tv, int video) -{ - DPRINTF ("bcl_setHeads %i %i %i\n", main, tv, video); - pipeWriteCmd (pipe_out, PCmd_SetHeads); - pipeWriteArgs (pipe_out, 3, sizeof(int), &main, sizeof(int), &tv, - sizeof(int), &video); -} - -void bcl_getHeads (int *main, int *tv, int *video, int *max) -{ - DPRINTF ("bcl_getHeads\n"); - pipeWriteCmd (pipe_out, PCmd_GetHeads); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 4, sizeof(int), main, sizeof(int), tv, - sizeof(int), video, sizeof(int), max); -} - -void bcl_getHeadDev (int head, int *devFlags) -{ - DPRINTF ("bcl_getHeadDev\n"); - pipeWriteCmd (pipe_out, PCmd_GetHeadDev); - pipeWriteArgs (pipe_out, 1, sizeof (head), &head); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 1, sizeof(int), devFlags); -} - -void bcl_probeChips (void) -{ - ChipPtr chip, del; - - DPRINTF ("bcl_probe\n"); - chip = bcl_card->chips; - while (chip) { - del = chip; - chip = chip->next; - free (del->name); - free (del); - } - pipeWriteCmd (pipe_out, PCmd_ProbeChips); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - bcl_card->chips = pipeReadList (pipe_in, sizeof (ChipInfo)); -} - -void bcl_setChip (ChipPtr chip, Bool init) -{ - ChipPtr c; - int i, index; - - DPRINTF ("bcl_setChip %s %i\n", chip->name, init); - /* convert chip to index */ - i = index = 0; - for (c = bcl_card->chips; c; c = c->next) { - i++; - if (c == chip) index = i; - } - pipeWriteCmd (pipe_out, PCmd_SetChip); - pipeWriteArgs (pipe_out, 2, sizeof(index), &index, sizeof(init), &init); -} - -void bcl_setSettings (TVSettings *set) -{ - DPRINTF ("bcl_setSettings\n"); - pipeWriteCmd (pipe_out, PCmd_SetSettings); - pipeWriteArgs (pipe_out, 1, sizeof(TVSettings), set); -} - -void bcl_getSettings (TVSettings *set) -{ - DPRINTF ("bcl_getSettings\n"); - pipeWriteCmd (pipe_out, PCmd_GetSettings); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 1, sizeof(TVSettings), set); -} - -void bcl_setMode (TVRegs *regs) -{ - DPRINTF ("bcl_setMode\n"); - pipeWriteCmd (pipe_out, PCmd_SetMode); - pipeWriteArgs (pipe_out, 1, sizeof(TVRegs), regs); -} - -void bcl_getMode (TVRegs *regs) -{ - DPRINTF ("bcl_getMode\n"); - pipeWriteCmd (pipe_out, PCmd_GetMode); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 1, sizeof(TVRegs), regs); -} - -void bcl_setModeSettings (TVRegs *regs, TVSettings *set) -{ - DPRINTF ("bcl_setModeSettings\n"); - pipeWriteCmd (pipe_out, PCmd_SetModeSettings); - pipeWriteArgs (pipe_out, 2, sizeof(TVRegs), regs, sizeof(TVSettings), set); -} - -void bcl_setTestImage (TVEncoderRegs *tv, TVSettings *set) -{ - DPRINTF ("bcl_setTestImage\n"); - pipeWriteCmd (pipe_out, PCmd_SetTestImage); - pipeWriteArgs (pipe_out, 2, sizeof(TVEncoderRegs), tv, - sizeof(TVSettings), set); -} - -long bcl_getStatus (int index) -{ - long l; - - DPRINTF ("bcl_getStatus\n"); - pipeWriteCmd (pipe_out, PCmd_GetStatus); - pipeWriteArgs (pipe_out, 1, sizeof(index), &index); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 1, sizeof(l), &l); - return l; -} - -TVConnect bcl_getConnection (void) -{ - TVConnect c; - - DPRINTF ("bcl_getConnection\n"); - pipeWriteCmd (pipe_out, PCmd_GetConnection); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 1, sizeof(c), &c); - DPRINTF ("bcl_getConnection got %i\n", c); - return c; -} - -int bcl_listModes (TVSystem system, TVMode *(list[])) -{ - TVMode *m, *r; - int n, i, c; - - DPRINTF ("bcl_listModes %i\n", system); - pipeWriteCmd (pipe_out, PCmd_ListModes); - pipeWriteArgs (pipe_out, 1, sizeof(system), &system); - pipeReadCmd (pipe_in); - pipeReadArray (pipe_in, &c); - m = r = xcalloc (sizeof (TVMode), c); - *list = r; - for (i = 1; i <= c; i++, m++) { - n = pipeReadArgs (pipe_in, 3, sizeof(TVMode), m, - 0, &m->spec.size, 0, &m->spec.aspect); - /* assert n == 3 */ - m->spec.size = pool_addFree (m->spec.size); - m->spec.aspect = pool_addFree (m->spec.aspect); - } - return c; -} - -Bool bcl_findBySize (TVSystem system, int xres, int yres, char *size, - TVMode *mode) -{ - int n; - - DPRINTF ("bcl_findBySize %i %i,%i %s\n", system, xres, yres, size); - pipeWriteCmd (pipe_out, PCmd_FindBySize); - pipeWriteArgs (pipe_out, 4, sizeof(system), &system, - sizeof(xres), &xres, sizeof(yres), &yres, - strlen(size)+1, size); - pipeReadCmd (pipe_in); - mode->spec.size = mode->spec.aspect = NULL; - n = pipeReadArgs (pipe_in, 3, sizeof(TVMode), mode, - 0, &mode->spec.size, 0, &mode->spec.aspect); - mode->spec.size = pool_addFree (mode->spec.size); - mode->spec.aspect = pool_addFree (mode->spec.aspect); - return (n >= 3); -} - -Bool bcl_findByOverscan (TVSystem system, int xres, int yres, - double hoc, double voc, TVMode *mode) -{ - int n; - - DPRINTF ("bcl_findByOC %i %i,%i\n", system, xres, yres); - pipeWriteCmd (pipe_out, PCmd_FindByOverscan); - pipeWriteArgs (pipe_out, 5, sizeof(system), &system, - sizeof(xres), &xres, sizeof(yres), &yres, - sizeof(hoc), &hoc, sizeof(voc), &voc); - pipeReadCmd (pipe_in); - mode->spec.size = mode->spec.aspect = NULL; - n = pipeReadArgs (pipe_in, 3, sizeof(TVMode), mode, - 0, &mode->spec.size, 0, &mode->spec.aspect); - mode->spec.size = pool_addFree (mode->spec.size); - mode->spec.aspect = pool_addFree (mode->spec.aspect); - return (n >= 3); -} - -void bcl_initSharedView (int *view_x, int *view_y) -{ - DPRINTF ("bcl_initSharedView\n"); - pipeWriteCmd (pipe_out, PCmd_InitSharedView); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 2, sizeof(int), view_x, sizeof(int), view_y); -} - -Bool bcl_getTwinView (int *view_x, int *view_y) -{ - Bool result; - - DPRINTF ("bcl_getTwinVie\n"); - pipeWriteCmd (pipe_out, PCmd_GetTwinView); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 3, sizeof(Bool), &result, - sizeof(int), view_x, sizeof(int), view_y); - return result; -} - -Bool bcl_adjustViewport (int flags, int *view_x, int *view_y) -{ - Bool result; - - DPRINTF ("bcl_adjustViewport\n"); - pipeWriteCmd (pipe_out, PCmd_AdjustView); - pipeWriteArgs (pipe_out, 3, sizeof(int), &flags, - sizeof(int), view_x, sizeof(int), view_y); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_out, 3, sizeof(int), &result, - sizeof(int), view_x, sizeof(int), view_y); - return result; -} - -Bool bcl_serviceViewportCursor (int flags, int cursor_x, int cursor_y, - int *view_x, int *view_y) -{ - Bool result; - - DPRINTF ("bcl_serviceViewportCursor\n"); - pipeWriteCmd (pipe_out, PCmd_ServiceVC); - pipeWriteArgs (pipe_out, 5, sizeof(int), &flags, - sizeof(int), &cursor_x, sizeof(int), &cursor_y, - sizeof(int), view_x, sizeof(int), view_y); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_out, 3, sizeof(int), &result, - sizeof(int), view_x, sizeof(int), view_y); - return result; -} - -/* We cannot reuse the bnull functions here, because that would require - * the client library to include a lot more files. - */ - -#ifdef DEBUG_PROBE -void bcl_probeSystem (CardPtr card_list) -{ - DPRINTF ("bcl_probeSystem\n"); -} - -void bcl_probeCard (void) -{ - DPRINTF ("bcl_probeCard\n"); -} - -I2CChainPtr bcl_probeBus (void) -{ - DPRINTF ("bcl_probeBus\n"); - return NULL; -} -#endif - -BackAccessRec bcl_access_func = { - openCard: bcl_openCard, - closeCard: bcl_closeCard, -#ifdef DEBUG_PROBE - probeSystem: bcl_probeSystem, -#endif -}; - -BackCardRec bcl_card_func = { - openCard: bcl_openCard, - closeCard: bcl_closeCard, -#ifdef DEBUG_PROBE - probeCard: bcl_probeCard, - probeBus: bcl_probeBus, -#endif - setHeads: bcl_setHeads, - getHeads: bcl_getHeads, - getHeadDev: bcl_getHeadDev, - probeChips: bcl_probeChips, - setChip: bcl_setChip, - setSettings: bcl_setSettings, - getSettings: bcl_getSettings, - setMode: bcl_setMode, - getMode: bcl_getMode, - setModeSettings: bcl_setModeSettings, - setTestImage: bcl_setTestImage, - getStatus: bcl_getStatus, - getConnection: bcl_getConnection, - listModes: bcl_listModes, - findBySize: bcl_findBySize, - findByOverscan: bcl_findByOverscan, - initSharedView: bcl_initSharedView, - getTwinView: bcl_getTwinView, - adjustViewport: bcl_adjustViewport, - serviceViewportCursor: bcl_serviceViewportCursor, -}; - -/* -------- Init -------- */ - -Bool back_client_avail (void) -{ - int version; - int fd_out, fd_in; - - /* IMPORTANT: Open out pipe first, otherwise deadlock */ - fd_out = open (PIPE_OUT, O_WRONLY | O_NONBLOCK); - if (fd_out < 0) return FALSE; - fd_in = open (PIPE_IN, O_RDONLY | O_NONBLOCK); - if (fd_in < 0) { - close (fd_out); - return FALSE; - } - close (fd_in); - close (fd_out); - bcl_openPipes (); - if (!pipe_in || !pipe_out) { - /* FIXME TODO: error message */ - bcl_closePipes (); - return FALSE; - } - pipeWriteCmd (pipe_out, PCmd_Version); - pipeWriteArgs (pipe_out, 0); - pipeReadCmd (pipe_in); - pipeReadArgs (pipe_in, 1, sizeof(version), &version); - bcl_closePipes (); - if (version != PIPE_VERSION) - ERROR ("Server protocol version mismatch\n"); - return (version == PIPE_VERSION); -} - - -CardPtr back_client_init (void) -{ - CardPtr card; - -#ifdef XINE_HAVE_NVTV - back_access = &bcl_access_func; - back_card = &bcl_card_func; -#endif - bcl_openPipes (); - pipeWriteCmd (pipe_out, PCmd_Init); - pipeWriteArgs (pipe_out, 0); - bcl_root = pipeReadList (pipe_in, sizeof (CardInfo)); - bcl_card = bcl_root; - bcl_closePipes (); - for (card = bcl_card; card; card = card->next) { - card->dev = ""; - card->arch = ""; - card->chips = NULL; - card->dev = NULL; - } - return bcl_root; -} - diff --git a/src/xine-engine/nvtv/back_client.h b/src/xine-engine/nvtv/back_client.h deleted file mode 100644 index 49b2e29d5..000000000 --- a/src/xine-engine/nvtv/back_client.h +++ /dev/null @@ -1,72 +0,0 @@ -/* NVTV client backend header -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: back_client.h,v 1.3 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Header for client backend - */ - -#ifndef _BACK_CLIENT_H -#define _BACK_CLIENT_H - -#include "debug.h" -#include "backend.h" - -Bool back_client_avail (void); -CardPtr back_client_init (void); - -/* client backend methods */ - -/* Attention! The 'size' and 'aspect' strings returned by the find - operations in mode.spec are allocated, and should be freed when not - needed anymore. For the moment, this creates a memory leak, as this - behaviour is different from the other backends. -*/ - -void bcl_openCard (CardPtr card); -void bcl_closeCard (void); -#ifdef DEBUG_PROBE -void bcl_probeCards (CardPtr card_list); -#endif -void bcl_setHeads (int main, int tv, int video); -void bcl_getHeads (int *main, int *tv, int *video, int *max); -void bcl_probeChips (void); -void bcl_setChip (ChipPtr chip, Bool init); -void bcl_setSettings (TVSettings *set); -void bcl_getSettings (TVSettings *set); -void bcl_setMode (TVRegs *r); -void bcl_getMode (TVRegs *r); -void bcl_setModeSettings (TVRegs *r, TVSettings *set); -void bcl_setTestImage (TVEncoderRegs *tv, TVSettings *set); -long bcl_getStatus (int index); -TVConnect bcl_getConnection (void); -Bool bcl_findBySize (TVSystem system, int xres, int yres, char *size, - TVMode *mode); -Bool bcl_findByOverscan (TVSystem system, int xres, int yres, - double hoc, double voc, TVMode *mode); - -void bcl_initSharedView (int *view_x, int *view_y); -Bool bcl_getTwinView (int *view_x, int *view_y); -Bool bcl_adjustViewportVideo (int flags, int *view_x, int *view_y); -Bool bcl_serviceViewportVideoCursor (int flags, int cursor_x, int cursor_y, - int *view_x, int *view_y); - -#endif /* _BACK_CLIENT_H */ - diff --git a/src/xine-engine/nvtv/backend.h b/src/xine-engine/nvtv/backend.h deleted file mode 100644 index a496fa51f..000000000 --- a/src/xine-engine/nvtv/backend.h +++ /dev/null @@ -1,132 +0,0 @@ -/* NVTV backend (header) -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: backend.h,v 1.4 2003/05/04 22:22:21 f1rmb Exp $ - * - * Contents: - * - * Common header for all backends - */ - -#ifndef _BACKEND_H -#define _BACKEND_H - -#include "debug.h" -#include "tv_chip.h" - -#ifdef DEBUG_PROBE -#include "tv_common.h" -#endif - -#include "local.h" /* for Bool */ - -/* WARNING! The first entry of the two following data structures MUST be - the 'next' field, and the second entry MUST be a string. If they are not, - the pipe routines will crash. Other pointers besides those two are - transfered through the pipe, but should be ignored, as there value is - invalid. */ - -/* List of chips accessible on one card. Most of the time, there will - be only one tv chip, though in theory one could use two on dual-head - cards. Other chips can be stored here as well. We duplicate the - information in I2Chain and I2CDev to make the frontend independent - of the back end. -*/ - -typedef struct chip_info { - struct chip_info *next; /* must be 1st entry! */ - char *name; /* must be 2nd entry! (name including version and I2C addr) */ - TVChip chip; /* chip type */ - int bus, addr; /* I2C bus and address */ - void *private; /* identify device, backend private */ -} ChipInfo, *ChipPtr; - -/* List of all NVidia cards available */ - -typedef struct card_info { - struct card_info *next; /* must be 1st entry! */ - char *name; /* must be 2nd entry! (name including bus addr) */ - char *dev; /* name of device for mmap (not via pipe) */ - char *arch; /* architecture (not via pipe) */ - CardType type; - unsigned long reg_base; - unsigned long pio_base; - int addr_bus, addr_slot, addr_func; - int pci_id; - ChipPtr chips; -} CardInfo, *CardPtr; - -#define BACK_SERVICE_CURSOR (1 << 0) -#define BACK_SERVICE_VIDEO (1 << 1) -#define BACK_SERVICE_VIEW_CURSOR (1 << 2) -#define BACK_SERVICE_VIEW_MAIN (1 << 3) - -typedef struct { - void (*openCard) (CardPtr card); - void (*closeCard) (void); -#ifdef DEBUG_PROBE - void (*probeSystem) (CardPtr card_list); -#endif -} BackAccessRec, *BackAccessPtr; - -/* - * listModes: Allocate a list of modes matching system, and return - * size of list. System may be TV_SYSTEM_NONE to match all systems. - */ - -typedef struct { - void (*openCard) (CardPtr card); - void (*closeCard) (void); - void (*probeChips) (void); -#ifdef DEBUG_PROBE - void (*probeCard) (void); - I2CChainPtr (*probeBus) (void); -#endif - void (*setHeads) (int main, int tv, int video); - void (*getHeads) (int *main, int *tv, int *video, int *max); - void (*getHeadDev) (int head, int *devFlags); - void (*setChip) (ChipPtr chip, Bool init); - void (*setSettings) (TVSettings *set); - void (*getSettings) (TVSettings *set); - void (*setMode) (TVRegs *r); - void (*getMode) (TVRegs *r); - void (*setModeSettings) (TVRegs *r, TVSettings *set); - void (*setTestImage) (TVEncoderRegs *tv, TVSettings *set); - long (*getStatus) (int index); - TVConnect (*getConnection) (void); - int (*listModes) (TVSystem system, TVMode *(modes[])); - Bool (*findBySize) (TVSystem system, int xres, int yres, char *size, - TVMode *mode); - Bool (*findByOverscan) (TVSystem system, int xres, int yres, - double hoc, double voc, TVMode *mode); - void (*initSharedView) (int *view_x, int *view_y); - Bool (*getTwinView) (int *view_x, int *view_y); - Bool (*adjustViewport) (int flags, int *view_x, int *view_y); - Bool (*serviceViewportCursor) (int flags, int cursor_x, int cursor_y, - int *view_x, int *view_y); -} BackCardRec, *BackCardPtr; - -/* The backend(s) use static information, so there can only be one - backend active: */ - -#ifdef XINE_HAVE_NVTV -extern BackAccessPtr back_access; -extern BackCardPtr back_card; -#endif - -#endif /* _BACKEND_H */ diff --git a/src/xine-engine/nvtv/debug.h b/src/xine-engine/nvtv/debug.h deleted file mode 100644 index 72b0a5cf7..000000000 --- a/src/xine-engine/nvtv/debug.h +++ /dev/null @@ -1,208 +0,0 @@ -/* NVTV debug -- Dirk Thierbach <dthierbach@gmx.de> - * - * This is open software protected by the GPL. See GPL.txt for details. - * - * Debug definitions. - * - */ - -#ifndef _DEBUG_H -#define _DEBUG_H - -#include <stdio.h> - -/* -------- Config defines -------- */ - -/* Chrontel slave sync modes (normally not necessary) */ -/* #define CONFIG_SLAVE_CH */ - -/* Brooktree async modes (test) */ -/* #define CONFIG_ASYNC_BT */ - -/* Setup BlankEnd for Voodoo cards */ -#define CONFIG_TDFX_SETUP_BLANK - -/* Allow GeForce2Go */ -#define CONFIG_GEFORCEGO_OK - -/* Allow overlay modes */ -/* #define CONFIG_OVERLAY_NV */ - -/* -------- Debugging defines -------- */ - -/* Temporary define for philips 7104 test modes */ -/* #define TEST_PHILIPS */ - -/* Enable DPRINTF messages */ -/* #define NVTV_DEBUG */ - -/* Disable timeout procs */ -/* #define DISABLE_TIMEOUT */ - -/* Enable probe/debug routines */ -#define DEBUG_PROBE - -/* Scan all unknown chips of no known tv chip is found (nv_tv.c) */ -#define PROBE_ALL_UNKNOWN - -/* The EEPROM on the XBox bus might cause problems when probed. */ -#ifdef XBOX_SUPPORT -#undef PROBE_ALL_UNKOWN -#endif - -/* -------- Meta */ - -/* Fake XBox (Meta) */ -/* #define FAKE_XBOX */ - -/* Fake GeForce3 (Meta) */ -/* #define FAKE_GEFORCE3 */ - -/* Fake Voodoo3 (Meta) */ -/* #define FAKE_VOODOO */ - -/* Fake Intel i810 (Meta) */ -/* #define FAKE_I810 */ - -/* Fake Brooktree chip (Meta) */ -/* #define FAKE_BROOKTREE */ - -/* Fake Conexant chip (Meta) */ -/* #define FAKE_CONEXANT */ - -/* Fake Chrontel chip (Meta) */ -/* #define FAKE_CHRONTEL */ - -/* Fake Philips chip (Meta) */ -/* #define FAKE_PHILIPS */ - -/* Fake TV mode (Meta) */ -/* #define FAKE_TV */ - -/* -------- Assertions */ - -/* Check MMIO when faking it */ -/* #define CHECK_MMIO */ - -/* Base and range for check */ -/* #define CHECK_MMIO_BASE 0x601 */ -/* #define CHECK_MMIO_MIN 0x2000 */ -/* #define CHECK_MMIO_MAX 0x4000 */ -/* #define CHECK_MMIO_ABORT */ - -/* -------- */ - -/* Fake successful probing of all tv chips (nv_tv.c) */ -/* #define FAKE_PROBE_ALL */ - -/* Fake successful probing of this addr on all busses (nv_tv.c) */ -/* #define FAKE_PROBE_ADDR 0xEA */ - -/* Fake Brooktree chip identification */ -/* #define FAKE_PROBE_BROOKTREE */ - -/* Fake Conexant chip identification */ -/* #define FAKE_PROBE_CONEXANT */ - -/* Fake Chrontel chip identification */ -/* #define FAKE_PROBE_CHRONTEL */ - -/* Fake Philips chip identification */ -/* #define FAKE_PROBE_PHILIPS */ - -/* Fake id to return on identification */ -/* #define FAKE_PROBE_ID TV_PHILIPS_7104 */ - -/* Fake I2C Bus reads and writes (nv_tv.c) */ -/* #define FAKE_I2C */ - -/* Fake CRTC register writes (nv_tv.c) */ -/* #define FAKE_CRTC */ - -/* Fake mmapped register writes (tv_nv.c) */ -/* #define FAKE_MMIO */ - -/* Fake pci card in root backend */ -/* #define FAKE_CARD */ - -/* Fake memory mapping */ -/* #define FAKE_CARD_MMAP */ - -/* Fake vendor id of pci card. */ -/* #define FAKE_CARD_VENDOR PCI_VENDOR_3DFX */ - -/* Fake device id of pci card */ -/* #define FAKE_CARD_DEVICE PCI_CHIP_VOODOO3 */ - -/* -------- */ - -#ifdef FAKE_XBOX -#define FAKE_CARD -#define FAKE_CARD_MMAP -#define FAKE_MMIO -#define FAKE_CRTC -#define FAKE_I2C -#define FAKE_CARD_VENDOR PCI_VENDOR_NVIDIA -#define FAKE_CARD_DEVICE PCI_CHIP_GEFORCE3_MCPX -#endif - -#ifdef FAKE_GEFORCE3 -#define FAKE_CARD -#define FAKE_CARD_MMAP -#define FAKE_MMIO -#define FAKE_CARD_VENDOR PCI_VENDOR_NVIDIA -#define FAKE_CARD_DEVICE PCI_CHIP_GEFORCE3 -#endif - -#ifdef FAKE_VOODOO -#define FAKE_CARD -#define FAKE_CARD_MMAP -#define FAKE_CARD_VENDOR PCI_VENDOR_3DFX -#define FAKE_CARD_DEVICE PCI_CHIP_VOODOO3 -#endif - -#ifdef FAKE_I810 -#define FAKE_CARD -#define FAKE_CARD_MMAP -#define FAKE_CARD_VENDOR PCI_VENDOR_INTEL -#define FAKE_CARD_DEVICE PCI_CHIP_I810 -#endif - -#ifdef FAKE_BROOKTREE -#define FAKE_MMIO -#define FAKE_CRTC -#define FAKE_I2C -#define FAKE_PROBE_ADDR 0x8A -#define FAKE_PROBE_BROOKTREE -#endif - -#ifdef FAKE_CONEXANT -#define FAKE_MMIO -#define FAKE_CRTC -#define FAKE_I2C -#define FAKE_PROBE_ADDR 0x8A -#define FAKE_PROBE_CONEXANT -#endif - -#ifdef FAKE_CHRONTEL -#define FAKE_MMIO -#define FAKE_CRTC -#define FAKE_I2C -#define FAKE_PROBE_ADDR 0xEA -#define FAKE_PROBE_CHRONTEL -#endif - -#ifdef FAKE_PHILIPS -#define FAKE_MMIO -#define FAKE_CRTC -#define FAKE_I2C -#define FAKE_PROBE_ADDR 0x88 -#define FAKE_PROBE_PHILIPS -#endif - -#ifdef FAKE_TV -#define FAKE_MMIO -#define FAKE_CRTC -#endif - -#endif /* _DEBUG_H */ diff --git a/src/xine-engine/nvtv/error.c b/src/xine-engine/nvtv/error.c deleted file mode 100644 index 517eed306..000000000 --- a/src/xine-engine/nvtv/error.c +++ /dev/null @@ -1,28 +0,0 @@ -/* NVTV error -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: error.c,v 1.2 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Error handling. - * - */ - -#include "error.h" - diff --git a/src/xine-engine/nvtv/error.h b/src/xine-engine/nvtv/error.h deleted file mode 100644 index 918c777bf..000000000 --- a/src/xine-engine/nvtv/error.h +++ /dev/null @@ -1,84 +0,0 @@ -/* NVTV error header -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: error.h,v 1.2 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Error handling. - * - */ - -#ifndef _ERROR_H -#define _ERROR_H - -#include "debug.h" - -/* - * This header file must do the following: - * - * 1) Define error macros for standalone usage - * 2) Map error macros to XFree error macros if compiled under X - * 3) Map error macros and XFree macros function names for Borland C++, - * as the compiler does not support macros with a variable number - * of arguments. - */ - - -#ifdef __BORLANDC__ - -#include <stdarg.h> - -int dprintf (char *format, ...); -int errorf (char *format, ...); -int errorf1 (int arg1, char *format, ...); -int errorf2 (int arg1, int arg2, char *format, ...); - -#define ERROR errorf -#define FPRINTF errorf -#define DPRINTF dprintf -#define xf86Msg errorf1 -#define xf86DrvMsg errorf2 - -#else /* __BORLANDC__ */ - -/* -------- */ - -#define ERROR(X...) fprintf(stderr, X) - -/* Fake output */ -#define FPRINTF(X...) fprintf(stderr, X) - -#ifdef NVTV_DEBUG -#define DPRINTF(X...) fprintf(stderr, X) -#else -#define DPRINTF(X...) /* */ -#endif - -/* -------- */ - -#define xf86Msg(type,format,args...) /* fprintf(stderr,format,args) */ -#define xf86DrvMsg(scrnIndex,type,format, args...) /* fprintf(stderr,format,args) */ - -#endif /* __BORLANDC__ */ - -#define DEBUG(x) /*x*/ -#define ErrorF ERROR - -#endif /* _ERROR_H */ - diff --git a/src/xine-engine/nvtv/libnvclient_dummy.c b/src/xine-engine/nvtv/libnvclient_dummy.c deleted file mode 100644 index d0a6912b8..000000000 --- a/src/xine-engine/nvtv/libnvclient_dummy.c +++ /dev/null @@ -1 +0,0 @@ -char libnvclient_dummy; diff --git a/src/xine-engine/nvtv/local.h b/src/xine-engine/nvtv/local.h deleted file mode 100644 index 1b89ec977..000000000 --- a/src/xine-engine/nvtv/local.h +++ /dev/null @@ -1,84 +0,0 @@ -/* NVTV Local header -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: local.h,v 1.3 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Header: Local declarations. - * - * - Defines for GTK2 vs. GTK. - * - Define for Bool (must be included after xfree.h for this reason) - * - * Defines for all basic types, for - * a) without X, b) with xfree.h, c) under windows. - * Map allocations a) X to normal b) normal to X - */ - -#ifndef _LOCAL_H -#define _LOCAL_H - -#include "config.h" -#include "debug.h" -#include "error.h" - -/* -------- GTK -------- */ - -#ifdef HAVE_GTK - -#if HAVE_GTK_VERSION == 1 -#define my_gdk_screen gdk_screen -#define my_gdk_root_window gdk_root_window -#define my_gtk_spin_button_set_shadow_type(x, y) gtk_spin_button_set_shadow_type (x,y) -#endif - -#if HAVE_GTK_VERSION == 2 -#define my_gdk_screen gdk_x11_get_default_screen() -#define my_gdk_root_window gdk_x11_get_default_root_xwindow() -#define my_gtk_spin_button_set_shadow_type(x, y) -#endif - -#endif /* HAVE_GTK */ - -/* -------- Allocation layer -------- */ - -/* Simulate X via stdlib. nf means 'no failure' */ - -#define xalloc(_size) malloc(_size) -#define xnfcalloc(_num, _size) calloc(_num, _size) -#define xcalloc(_num, _size) calloc(_num, _size) -#define xfree(_ptr) free(_ptr) -#define xrealloc(_ptr, _size) realloc(_ptr, _size) - -/* -------- Basic types -------- */ - -#ifndef _XDEFS_H - -#define Bool int - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#endif /* _XDEFS_H */ - -#endif /* _LOCAL_H */ diff --git a/src/xine-engine/nvtv/miscstruct.h b/src/xine-engine/nvtv/miscstruct.h deleted file mode 100644 index 538d9ac62..000000000 --- a/src/xine-engine/nvtv/miscstruct.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Excerpt from: miscstruct.h and misc.h */ - -/* $TOG: miscstruct.h /main/11 1998/02/09 14:29:04 kaleb $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -All Rights Reserved. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/miscstruct.h,v 3.0 1996/02/18 03:45:10 dawes Exp $ */ - -#ifndef MISCSTRUCT_H -#define MISCSTRUCT_H 1 - -#ifdef HAVE_X - -#include <X11/Xdefs.h> - -#else - -typedef unsigned char CARD8; -typedef unsigned short CARD16; -typedef unsigned long CARD32; -typedef long INT32; -typedef void* pointer; - -#ifndef Bool -#define Bool int -#endif - -#endif /* HAVE_X */ - -/**** misc.h */ - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/**** miscstruct.h */ - -typedef struct _Box { - short x1, y1, x2, y2; -} BoxRec; - -typedef union _DevUnion { - pointer ptr; - long val; - unsigned long uval; - pointer (*fptr)(void); -} DevUnion; - -#endif /* MISCSTRUCT_H */ - diff --git a/src/xine-engine/nvtv/pipe.c b/src/xine-engine/nvtv/pipe.c deleted file mode 100644 index 7d428cbcf..000000000 --- a/src/xine-engine/nvtv/pipe.c +++ /dev/null @@ -1,296 +0,0 @@ -/* NVTV pipe -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: pipe.c,v 1.3 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Routines to access the named pipe for server/client communication - * - */ - -#include "local.h" /* before everything else */ - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> - -#include "pipe.h" - -/* - * The communication will always include sizes and number of elements - * sent, so even if there are version mismatches, the other end will be - * able to properly synchronize. - * A message consists of - * - the command - * - the number of arguments - * - the size of each argument, followed by the argument itself - */ - -/* - * Read a command from a pipe - */ - -PipeCmd pipeReadCmd (FILE *pipe) -{ - PipeCmd cmd; - - DPRINTF ("pipe read cmd\n"); - fread (&cmd, sizeof(PipeCmd), 1, pipe); - DPRINTF ("pipe read cmd, got %i\n", cmd); - return cmd; -} - -/* - * Write a command to a pipe - */ - -void pipeWriteCmd (FILE *pipe, PipeCmd cmd) -{ - DPRINTF ("pipe write cmd %i\n", cmd); - fwrite (&cmd, sizeof(PipeCmd), 1, pipe); - fflush (pipe); - DPRINTF ("pipe write cmd done\n"); -} - -/* - * Write arguments to a pipe. Ellipsis paramaters are: - * size1, pointer1, size2, pointer2, ..., 0 - * Ignore zero size of null pointer arguments. - */ - -void pipeWriteArgs (FILE *pipe, int n, ...) -{ - va_list ap; - int i, s; - void *p; - - DPRINTF ("pipe write args\n"); - fwrite (&n, sizeof(n), 1, pipe); - va_start(ap, n); - for (i = 0; i < n; i++) { - s = va_arg(ap, int); - p = va_arg(ap, void *); - if (!p) s = 0; - fwrite (&s, sizeof(s), 1, pipe); - if (s != 0) { - fwrite (p, s, 1, pipe); - } - } - fflush (pipe); - va_end(ap); -} - -/* - * Implements the three following read routines. Allocate elements - * with zero size, and optionally set results. - */ - -int pipeReadArgsMulti (FILE *pipe, int res, int n, va_list ap) -{ - int i, j; - int m, s, t, r; - void *p; - void **q; - int ok; - - r = 0; - fread (&m, sizeof(m), 1, pipe); - ok = (m == n); - for (i = 0; i < m; i++) { - fread (&t, sizeof(t), 1, pipe); - s = va_arg(ap, int); - p = va_arg(ap, void *); - if (ok) { - if (s != 0 && t != 0 && s != t) ok = 0; - } - if (ok) { - r++; - } else { - p = NULL; - } - if (t == 0) p = NULL; - if (s == 0 && p) { /* alloc zero size */ - q = (void **) p; - p = malloc (t); - *q = p; - } - if (res) { /* store result pointer */ - q = va_arg(ap, void **); - if (q) *q = p; - } - if (p) { - fread (p, t, 1, pipe); - } else { - for (j = 0; j < t; j++) fgetc (pipe); - } - } - return r; -} - -/* - * Read arguments from a pipe. Ellipsis parameters are: - * size_1, pointer_1, size_2, pointer_2, ..., size_n, pointer_n - * Ignore null pointer arguments, and allocate arguments with zero size. - * Return number of initial arguments that matched input stream. - */ - -int pipeReadArgs (FILE *pipe, int n, ...) -{ - va_list ap; - int r; - - DPRINTF ("pipe read args\n"); - va_start(ap, n); - r = pipeReadArgsMulti (pipe, 0, n, ap); - va_end(ap); - return r; -} - -/* - * Read optional arguments from a pipe. Ellipsis parameters are: - * size_1, pointer_1, result_1, ..., size_n, pointer_n, result_n - * Ignore zero size or null pointer data. Return number of initial - * arguments that matched input stream, and set each result either to - * NULL or to pointer. - */ - -int pipeReadArgsOpt (FILE *pipe, int n, ...) -{ - va_list ap; - int r; - - DPRINTF ("pipe read args opt\n"); - va_start(ap, n); - r = pipeReadArgsMulti (pipe, 1, n, ap); - va_end(ap); - return r; -} - -/* - * Read list from a pipe, alloc elements, and return pointer to first - * element. The elements MUST contain the next field as first entry, - * and a string as second entry. - */ - -void* pipeReadList (FILE *pipe, int size) -{ - void *root, *p, *q; - int i, j, n, t; - char *s; - - DPRINTF ("pipe read list\n"); - root = p = NULL; - fread (&n, sizeof(n), 1, pipe); - n /= 2; - for (i = 0; i < n; i++) { - fread (&t, sizeof(t), 1, pipe); - if (t == size) { - q = malloc (t); - fread (q, t, 1, pipe); - if (p) { - * (void **) p = q; - } else { - root = q; - } - p = q; - } else { - q = NULL; - for (j = 0; j < t; j++) fgetc (pipe); - } - fread (&t, sizeof(t), 1, pipe); - if (q) { - s = NULL; - if (t != 0) { - s = malloc (t); - fread (s, sizeof(char), t, pipe); - } - * (((char **) q) + 1) = s; - } else { - for (j = 0; j < t; j++) fgetc (pipe); - } - } - return root; -} - -/* - * Write list to a pipe. The elements MUST contain the next field as - * first entry, and a string as second entry. - */ - -void pipeWriteList (FILE *pipe, int size, void *list) -{ - void *l; - char *s; - int n, k; - - DPRINTF ("pipe write list\n"); - n = 0; - for (l = list; l; l = * (void **) l) n++; - n *= 2; - fwrite (&n, sizeof(n), 1, pipe); - for (l = list; l; l = * (void **) l) { - fwrite (&size, sizeof(size), 1, pipe); - fwrite (l, size, 1, pipe); - s = * (((char **) l) + 1); - if (s) { - k = strlen(s) + 1; - fwrite (&k, sizeof(k), 1, pipe); - fwrite (s, sizeof(char), k, pipe); - } else { - k = 0; - fwrite (&k, sizeof(k), 1, pipe); - } - } - fflush (pipe); -} - -/* - * Read an array with 'nelem' elements. The elements themselves are - * written by their own pipeWrite commands to allow the transfer of - * embedded strings. - */ - -void pipeReadArray (FILE *pipe, int *nelem) -{ - int n; - - DPRINTF ("pipe read array "); - fread (&n, sizeof(n), 1, pipe); - fread (nelem, sizeof(int), 1, pipe); - DPRINTF ("%i (%i)\n", *nelem, n); -} - -/* - * Write an array with 'nelem' elements, each of which has 'nsub' elements - * of size 'size' to the pipe. The elements themselves are written - * by their own pipeWrite commands to allow the transfer of embedded - * strings. - */ - -void pipeWriteArray (FILE *pipe, int nelem, int nsub) -{ - int n; - - DPRINTF ("pipe write array %i * %i\n", nelem, nsub); - n = nelem * nsub + 1; - fwrite (&n, sizeof(n), 1, pipe); - fwrite (&nelem, sizeof(nelem), 1, pipe); - fflush (pipe); -} diff --git a/src/xine-engine/nvtv/pipe.h b/src/xine-engine/nvtv/pipe.h deleted file mode 100644 index 0cfaaac6d..000000000 --- a/src/xine-engine/nvtv/pipe.h +++ /dev/null @@ -1,86 +0,0 @@ -/* NVTV pipe header -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: pipe.h,v 1.3 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Routine prototypes to access the named pipe for server/client - * communication, and communication protocol constants. - * - */ - -#ifndef _PIPE_H -#define _PIPE_H - -#include <stdio.h> - -#ifndef CONFIG_PIPE_PATH -#define CONFIG_PIPE_PATH "/var/run" -#endif - -#define PIPE_IN CONFIG_PIPE_PATH "/nvtv-in" -#define PIPE_OUT CONFIG_PIPE_PATH "/nvtv-out" - -#define PIPE_VERSION 0x000404 /* 0.4.4 */ - -/* even numbered commands expect no return, odd numbered commands do */ - -typedef enum { - PCmd_None = 0, /* In: None */ - PCmd_Init = 1, /* In: None; Out: card list */ - PCmd_Kill = 2, /* In: None */ - PCmd_Version = 3, /* In: None; Out: version */ - PCmd_CloseCard = 10, /* In: None */ - PCmd_OpenCard = 11, /* In: Card index; Out: chip list */ - PCmd_SetChip = 12, /* In: Chip index, init; */ - PCmd_ProbeChips = 13, /* In: None; Out: chip list */ - PCmd_SetSettings = 14, /* In: Settings; */ - PCmd_GetSettings = 15, /* In: None; Out: Settings */ - PCmd_SetMode = 16, /* In: Regs */ - PCmd_GetMode = 17, /* In: None; Out: Regs */ - PCmd_SetModeSettings = 18, /* In: Regs, Settings; */ - PCmd_SetTestImage = 20, /* In: EncRegs, Setttings; */ - PCmd_GetStatus = 23, /* In: Index; Out: status */ - PCmd_GetConnection = 25, /* In: None; Out: connect */ - PCmd_FindBySize = 31, /* In: System, x, y, size; Out: mode */ - PCmd_FindByOverscan = 33, /* In: System, x, y, hoc, voc; Out: mode */ - PCmd_ListModes = 35, /* In: System Out: int, modes */ - PCmd_SetHeads = 40, /* In: 3 heads */ - PCmd_GetHeads = 41, /* In: None; Out: 3 heads */ - PCmd_GetHeadDev = 43, /* In: Head; Out: Dev Flags */ - PCmd_InitSharedView = 51, /* In: None; Out: 4 int */ - PCmd_GetTwinView = 53, /* In: None; Out: 2 int, bool */ - PCmd_AdjustView = 55, /* In: 3 int; Out: 2 int, bool */ - PCmd_ServiceVC = 57, /* In: 5 int; Out: 2 int, bool */ -} PipeCmd; - -PipeCmd pipeReadCmd (FILE *pipe); -void pipeWriteCmd (FILE *pipe, PipeCmd cmd); - -int pipeReadArgs (FILE *pipe, int n, ...); -int pipeReadArgsOpt (FILE *pipe, int n, ...); -void pipeWriteArgs (FILE *pipe, int n, ...); - -void* pipeReadList (FILE *pipe, int size); -void pipeWriteList (FILE *pipe, int size, void *list); - -void pipeReadArray (FILE *pipe, int *nelem); -void pipeWriteArray (FILE *pipe, int nelem, int nsub); - -#endif /* _PIPE_H */ diff --git a/src/xine-engine/nvtv/tv_chip.h b/src/xine-engine/nvtv/tv_chip.h deleted file mode 100644 index 880a0e9e3..000000000 --- a/src/xine-engine/nvtv/tv_chip.h +++ /dev/null @@ -1,660 +0,0 @@ -/* NVTV tv_chip header -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: tv_chip.h,v 1.3 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Header: Structures and defines for the Brooktree, the Chrontel and the - * Philips chip. This part could eventually become a part of the XFree - * NV-Driver. - * - */ - -#ifndef _TV_CHIP_H -#define _TV_CHIP_H - -typedef enum { - TYPE_NONE = 0, - TYPE_INT = 1, - TYPE_ULONG = 2, -} VarType; - -typedef enum { - CARD_NONE = 0, - CARD_FIRST = 1, - CARD_NVIDIA = 1, - CARD_TDFX = 2, - CARD_I810 = 3, - CARD_XBOX = 4, - CARD_LAST = 4, -} CardType; - -typedef enum { - TV_SYSTEM_NONE = -1, - TV_SYSTEM_NTSC = 0, - TV_SYSTEM_NTSC_J = 1, /* same as NTSC_60 */ - TV_SYSTEM_PAL = 2, - TV_SYSTEM_PAL_60 = 3, - TV_SYSTEM_PAL_N = 4, - TV_SYSTEM_PAL_NC = 5, - TV_SYSTEM_PAL_M = 6, - TV_SYSTEM_PAL_M60 = 7, - TV_SYSTEM_PAL_X = 8, /* Fake PAL System to correct color carriers, - useful at least in Sweden PAL-B */ - TV_SYSTEM_SECAM = 9, /* only on Conexant chips */ -} TVSystem; - -typedef enum { - TV_CHIP_BY_ADDR = -1, - TV_NO_CHIP = 0, - TV_CHRONTEL = 0x1100, - TV_BROOKTREE = 0x2100, - TV_CONEXANT = 0x2200, - TV_PHILIPS = 0x3000, - TV_PHILIPS_MODEL1 = 0x3100, - TV_PHILIPS_MODEL2 = 0x3200, - TV_PHILIPS_7102 = 0x3100, - TV_PHILIPS_7103 = 0x3101, - TV_PHILIPS_7108 = 0x3102, - TV_PHILIPS_7109 = 0x3103, - TV_PHILIPS_7104 = 0x3200, - TV_PHILIPS_7105 = 0x3201, - TV_PHILIPS_7108A = 0x3202, - TV_PHILIPS_7109A = 0x3203, -} TVChip; - -#define TV_COMPANY 0xf000 /* mask for company encoder type */ -#define TV_ENCODER 0xff00 /* mask for principal encoder type */ - -/* -------- Host interface flags, all chips -------- */ - -/* These constants are used both for the host port and the encoder port. - Direction is seen in both cases from the encoder, so "in" means - "to encoder", "out" means "to host" */ - -#define PORT_SYNC_DIR (1 << 0) -#define PORT_SYNC_OUT (0 << 0) -#define PORT_SYNC_IN (1 << 0) - -#define PORT_SYNC_MASTER PORT_SYNC_OUT -#define PORT_SYNC_SLAVE PORT_SYNC_IN - -#define PORT_BLANK_MODE (1 << 1) -#define PORT_BLANK_REGION (0 << 1) -#define PORT_BLANK_DOTCLK (1 << 1) - -#define PORT_BLANK_DIR (1 << 2) -#define PORT_BLANK_OUT (0 << 2) -#define PORT_BLANK_IN (1 << 2) - -#define PORT_PCLK_MODE (1 << 3) -#define PORT_PCLK_MASTER (0 << 3) -#define PORT_PCLK_SLAVE (1 << 3) - -#define PORT_VSYNC_POLARITY (1 << 4) -#define PORT_VSYNC_LOW (0 << 4) -#define PORT_VSYNC_HIGH (1 << 4) - -#define PORT_HSYNC_POLARITY (1 << 5) -#define PORT_HSYNC_LOW (0 << 5) -#define PORT_HSYNC_HIGH (1 << 5) - -#define PORT_BLANK_POLARITY (1 << 6) -#define PORT_BLANK_LOW (0 << 6) -#define PORT_BLANK_HIGH (1 << 6) - -#define PORT_PCLK_POLARITY (1 << 7) -#define PORT_PCLK_LOW (0 << 7) -#define PORT_PCLK_HIGH (1 << 7) - -#define PORT_FORMAT_MASK (3 << 8) -#define PORT_FORMAT_MASK_COLOR (1 << 8) -#define PORT_FORMAT_MASK_ALT (2 << 8) -#define PORT_FORMAT_RGB (0 << 8) -#define PORT_FORMAT_YCRCB (1 << 8) -#define PORT_FORMAT_ALT_RGB (2 << 8) -#define PORT_FORMAT_ALT_YCRCB (3 << 8) - -#define PORT_XBOX \ - (PORT_VSYNC_HIGH | PORT_HSYNC_HIGH | PORT_SYNC_IN | \ - PORT_BLANK_LOW | PORT_BLANK_OUT | PORT_PCLK_HIGH | PORT_PCLK_MASTER | \ - PORT_FORMAT_ALT_YCRCB) - -#define PORT_NVIDIA \ - (PORT_VSYNC_HIGH | PORT_HSYNC_HIGH | PORT_SYNC_OUT | \ - PORT_BLANK_LOW | PORT_BLANK_OUT | PORT_PCLK_HIGH | PORT_PCLK_MASTER | \ - PORT_FORMAT_RGB) - -#define PORT_NVIDIA_SYNC_SLAVE \ - (PORT_VSYNC_HIGH | PORT_HSYNC_HIGH | PORT_SYNC_IN | \ - PORT_BLANK_LOW | PORT_BLANK_OUT | PORT_PCLK_HIGH | PORT_PCLK_MASTER | \ - PORT_FORMAT_RGB) - -#define PORT_NVIDIA_PCLK_SLAVE \ - (PORT_VSYNC_HIGH | PORT_HSYNC_HIGH | PORT_SYNC_OUT | \ - PORT_BLANK_LOW | PORT_BLANK_OUT | PORT_PCLK_HIGH | PORT_PCLK_SLAVE | \ - PORT_FORMAT_RGB) - -#define PORT_TDFX \ - (PORT_VSYNC_HIGH | PORT_HSYNC_HIGH | PORT_SYNC_OUT | \ - PORT_BLANK_LOW | PORT_BLANK_IN | PORT_BLANK_REGION | \ - PORT_PCLK_HIGH | PORT_PCLK_MASTER | PORT_FORMAT_RGB) - -#define PORT_I810 \ - (PORT_VSYNC_LOW | PORT_HSYNC_LOW | PORT_SYNC_IN | \ - PORT_BLANK_LOW | PORT_BLANK_OUT | PORT_PCLK_HIGH | PORT_PCLK_MASTER | \ - PORT_FORMAT_RGB) - -/* -------- Brooktree -------- */ - -#define BT_FLAG1_NI_OUT (1 << 0) -#define BT_FLAG1_SETUP (1 << 1) -#define BT_FLAG1_625LINE (1 << 2) -#define BT_FLAG1_VSYNC_DUR (1 << 3) -#define BT_FLAG1_DIS_SCRESET (1 << 4) -#define BT_FLAG1_PAL_MD (1 << 5) -#define BT_FLAG1_ECLIP (1 << 6) -#define BT_FLAG1_EN_ASYNC (1 << 8) - -#define BT_FLAG1_SYSTEM (BT_FLAG1_VSYNC_DUR | BT_FLAG1_SETUP | \ - BT_FLAG1_PAL_MD | BT_FLAG1_625LINE) -#define BT_FLAG1_NTSC (BT_FLAG1_VSYNC_DUR | BT_FLAG1_SETUP) -#define BT_FLAG1_NTSC_J (BT_FLAG1_VSYNC_DUR) -#define BT_FLAG1_PAL_BDGHI (BT_FLAG1_PAL_MD | BT_FLAG1_625LINE) -#define BT_FLAG1_PAL_N (BT_FLAG1_VSYNC_DUR | BT_FLAG1_SETUP | \ - BT_FLAG1_PAL_MD | BT_FLAG1_625LINE) -#define BT_FLAG1_PAL_M (BT_FLAG1_VSYNC_DUR | BT_FLAG1_SETUP | \ - BT_FLAG1_PAL_MD) -#define BT_FLAG1_PAL_BDGHI (BT_FLAG1_PAL_MD | BT_FLAG1_625LINE) -#define BT_FLAG1_PAL_60 (BT_FLAG1_PAL_MD | BT_FLAG1_VSYNC_DUR) - -#define BT_FLAG2_DIS_FFILT (1 << 0) -#define BT_FLAG2_DIS_YFLPF (1 << 1) -#define BT_FLAG2_DIS_GMSHY (1 << 2) -#define BT_FLAG2_DIS_GMUSHY (1 << 3) -#define BT_FLAG2_DIS_GMSHC (1 << 4) -#define BT_FLAG2_DIS_GMUSHC (1 << 5) -#define BT_FLAG2_DIS_CHROMA (1 << 6) - -#define BT_FLAG2_DIS_GM (BT_FLAG2_DIS_GMSHY | BT_FLAG2_DIS_GMUSHY \ - | BT_FLAG2_DIS_GMSHC | BT_FLAG2_DIS_GMUSHC) - -#define BT_FLAG3_DACDISA (1 << 0) -#define BT_FLAG3_DACDISB (1 << 1) -#define BT_FLAG3_DACDISC (1 << 2) -#define BT_FLAG3_DACDISD (1 << 3) -#define BT_FLAG3_DAC (BT_FLAG3_DACDISA | BT_FLAG3_DACDISB \ - | BT_FLAG3_DACDISC | BT_FLAG3_DACDISD) - -#define BT_FLAG3_FBAS (BT_FLAG3_DACDISB | BT_FLAG3_DACDISC) -#define BT_FLAG3_SVHS (BT_FLAG3_DACDISA) -#define BT_FLAG3_CONVERT (BT_FLAG3_DACDISA) -#define BT_FLAG3_BOTH 0 - -/* DACDISD is available only for the Conexant chip, and is reserved for - the Brooktree chip. It is reset by default */ - -/* FIXME URGENT: Conexant doc says no more than 1 DAC should be disabled */ - -typedef struct { - int hsynoffset; /* time */ - int vsynoffset; /* time */ - int hsynwidth; /* time */ /* don't confuse with hsync_width ! */ - int vsynwidth; /* time */ - int h_clko; /* time */ - int h_active; /* time */ - int hsync_width; /* time(system) */ - int hburst_begin; /* time(system) */ - int hburst_end; /* time(system) */ - int h_blanko; /* time */ - int v_blanko; /* time */ - int v_activeo; /* time */ - int h_fract; /* time */ - int h_clki; /* time */ - int h_blanki; /* time */ - int v_linesi; /* time */ - int v_blanki; /* time */ - int v_activei; /* time */ - int v_scale; /* time */ - int pll_fract; /* time */ - int pll_int; /* time */ - int sync_amp; /* level(system) */ - int bst_amp; /* level(system) */ - int mcr; /* level(system) */ - int mcb; /* level(system) */ - int my; /* level(system) */ - unsigned long msc; /* time */ - int flags1; /* time */ - int flags2; /* func */ - int flags3; /* func */ - int f_selc; /* func */ - int f_sely; /* func */ - int ycoring; /* func */ - int ccoring; /* func */ - int yattenuate; /* func */ - int cattenuate; /* func */ - int ylpf; /* func */ - int clpf; /* func */ - int out_muxa; /* func */ - int out_muxb; /* func */ - int out_muxc; /* func */ - int out_muxd; /* func */ - int phase_off; /* time(?) */ - int macro; /* time(all) */ -} TVBtRegs; - -/* -------- Conexant -------- */ - -#define CX_FLAG1_FM (1 << 7) -#define CX_FLAG1_EXT (1 << 9) /* Is extension, don't init */ - -#define CX_FLAG4_PROG_SC (1 << 0) -#define CX_FLAG4_SC_PATTERN (1 << 1) -#define CX_FLAG4_FIELD_ID (1 << 3) -#define CX_FLAG4_BY_YCCR (1 << 6) -#define CX_FLAG4_CHROMA_BW (1 << 7) - -#define CX_FLAG4_MASK (CX_FLAG4_PROG_SC | CX_FLAG4_SC_PATTERN | \ - CX_FLAG4_FIELD_ID | CX_FLAG4_BY_YCCR | \ - CX_FLAG4_CHROMA_BW) - -#define CX_FLAG5_ADPT_FF (1 << 0) -#define CX_FLAG5_FFRTN (1 << 1) -#define CX_FLAG5_YSELECT (1 << 2) -#define CX_FLAG5_DIV2 (1 << 4) -#define CX_FLAG5_PLL_32CLK (1 << 5) -#define CX_FLAG5_PIX_DOUBLE (1 << 6) -#define CX_FLAG5_EWSSF1 (1 << 8) -#define CX_FLAG5_EWSSF2 (1 << 9) - -typedef struct { - TVBtRegs bt; - unsigned long msc_db; /* time */ - int dr_limitp; /* time */ - int dr_limitn; /* time */ - int db_limitp; /* time */ - int db_limitn; /* time */ - int filfsconv; /* ?? */ - int filincr; /* ?? */ /* fil4286incr */ - int flags4; /* time & func */ - int flags5; /* time & func */ - int mcompy; /* level */ - int mcompu; /* level */ - int mcompv; /* level */ - int y_off; /* level */ - int hue_adj; /* time(?) */ - long wsdat; /* time */ - int wssinc; /* time */ - int c_altff; /* func */ - int y_altff; /* func */ - int c_thresh; /* func */ - int y_thresh; /* func */ - int pkfil_sel; /* func */ -} TVCxRegs; - -/* -------- Chrontel -------- */ - -#define CH_FLAG_DAC 1:0 -#define CH_FLAG_DAC_MASK 3 -#define CH_FLAG_DAC_PD0 (1 << 0) -#define CH_FLAG_DAC_PD1 (1 << 1) -#define CH_FLAG_FBAS 2 -#define CH_FLAG_SVHS 0 -#define CH_FLAG_BOTH 3 - -#define CH_FLAG_POUTP (1 << 3) -#define CH_FLAG_ACIV (1 << 4) -#define CH_FLAG_CFRB (1 << 5) -#define CH_FLAG_CVBW (1 << 6) -#define CH_FLAG_SCART (1 << 7) - -typedef struct { - int dmr_ir; /* time */ - int dmr_vs; /* time */ - int dmr_sr; /* time */ - int ffr_fc; /* func */ - int ffr_fy; /* func */ - int ffr_ft; /* func */ - int vbw_flff; /* func */ /* flag */ - int vbw_cbw; /* func */ - int vbw_ypeak; /* func */ /* flag */ - int vbw_ysv; /* func */ - int vbw_ycv; /* func */ /* flag */ - int dacg; /* level(system) */ /* flag */ - int civh; /* func */ - int sav; /* time */ - int blr; /* level(system) */ - int hpr; /* func/time */ - int vpr; /* func/time */ - int ce; /* func */ - int te; /* func, CH7009 only */ - int pll_m; /* time */ - int pll_n; /* time */ - int pllcap; /* time */ /* flag */ - unsigned long fsci; -#if 0 /* Test register; no documentation */ - int ylm; /* y multiplier ? */ - int clm; /* c multiplier ? */ -#endif - int flags; /* func */ - int mode; /* for macrovision table */ - int macro; -} TVChRegs; - -/* -------- Philips -------- */ - -#define PH_FLAG1_FISE (1 << 0) -#define PH_FLAG1_PAL (1 << 1) -#define PH_FLAG1_SCBW (1 << 2) -#define PH_FLAG1_YGS (1 << 4) -#define PH_FLAG1_YFIL (1 << 8) - -#define PH_FLAG1_MASK (PH_FLAG1_FISE | PH_FLAG1_PAL | \ - PH_FLAG1_SCBW | PH_FLAG1_YGS) - -#define PH_FLAG2_CVBSEN2 (1 << 1) /* Model2 only */ -#define PH_FLAG2_CEN (1 << 4) -#define PH_FLAG2_CVBSEN0 (1 << 5) -#define PH_FLAG2_CVBSEN1 (1 << 6) -#define PH_FLAG2_VBSEN (1 << 7) - -#define PH_FLAG2_MASK (PH_FLAG2_CEN | PH_FLAG2_CVBSEN0 | \ - PH_FLAG2_CVBSEN1 | PH_FLAG2_CVBSEN2 | \ - PH_FLAG2_VBSEN) - -#define PH_FLAG2_NORMAL (PH_FLAG2_CEN | PH_FLAG2_CVBSEN0 | \ - PH_FLAG2_VBSEN) -#define PH_FLAG2_CONVERT (PH_FLAG2_CEN | PH_FLAG2_CVBSEN0 | \ - PH_FLAG2_CVBSEN1) -#define PH_FLAG2_FBAS PH_FLAG2_NORMAL -#define PH_FLAG2_SVHS PH_FLAG2_NORMAL -#define PH_FLAG2_BOTH PH_FLAG2_NORMAL - -typedef struct { - int adwhs; /* time */ - int adwhe; /* time */ - int xofs; /* time */ - int xpix; /* time */ - int xinc; /* time */ - int hlen; /* time */ - int fal; /* time */ - int lal; /* time */ - int yinc; /* time */ - int yskip; /* time */ - int yofso; /* time */ - int yofse; /* time */ - int ypix; /* time */ - int yiwgto; /* time */ - int yiwgte; /* time */ - long pcl; /* time */ - long fsc; /* time */ - int idel; /* init */ - int bs; /* time(system) */ - int be; /* time(system) */ - int bsta; /* level(system) */ - int blckl; /* level(system) */ - int blnnl; /* level(system) */ - int chps; /* time(phase) */ - int gy; /* level */ - int gcd; /* level */ - int bcy; /* func */ - int bcu; /* func */ - int bcv; /* func */ - int ccrs; /* func */ - int gainu; /* func */ - int gainv; /* func */ - int flc; /* time */ - int phres; /* func(phase) */ - int flags1; - int flags2; - int flags3; - int macro; -} TVPh1Regs; - -#define PH_FLAG3_XINT (1 << 0) /* interpol. filter for upscaling */ -#define PH_FLAG3_IFBP (1 << 4) /* (for high pixel rates) */ -#define PH_FLAG3_IFRA (1 << 5) -#define PH_FLAG3_YUPSC (1 << 6) /* y upscaling enabled */ -#define PH_FLAG3_EIDIV (1 << 7) - -typedef struct { - TVPh1Regs super; /* watch alignment? */ - int yfil; - int fili; - int pcle; - int pcli; - int flags3; -} TVPh2Regs; - -/* -------- CRT -------- */ - -/* Flags for devices */ - -#define DEV_MONITOR (1 << 0) -#define DEV_TELEVISION (1 << 1) -#define DEV_FLATPANEL (1 << 2) -#define DEV_OVERLAY (1 << 3) - -/* Flags that describe the mode, capabilities and defaults - (in TVMode.descFlags). TODO: Get rid of Dualview, etc. */ - -#define TV_DESC_DUALVIEW (1 << 2) /* Default dualview */ -#define TV_DESC_MACROVISION (1 << 3) /* Default macrovision */ -#define TV_DESC_NONINTERLACED (1 << 4) /* Default noninterlace */ -#define TV_DESC_MONOCHROME (1 << 5) /* Default monochrome */ -#define TV_DESC_CARRIER_LOCK (1 << 6) /* Default carrier lock */ -#define TV_DESC_COLORFIX (1 << 7) /* Default color fix */ - -#define TV_CAP_DUALVIEW (1 << 10) /* Has dualview */ -#define TV_CAP_MACROVISION (1 << 11) /* Has macrovision choice */ -#define TV_CAP_NONINTERLACED (1 << 12) /* Has noninterlace */ -#define TV_CAP_MONOCHROME (1 << 13) /* Has monochrome */ -#define TV_CAP_CARRIER_LOCK (1 << 14) /* Has carrier lock */ -#define TV_CAP_COLORFIX (1 << 15) /* Has color fix */ - -#define TV_CAP_OVERLAY (1 << 24) /* Is overlay mode */ - -#define TV_CAP_BIT 8 /* Bit shift for DESC -> CAP */ - -#define TV_CAP_MASK (TV_CAP_DUALVIEW | TV_CAP_MACROVISION | \ - TV_CAP_MONOCHROME | TV_CAP_NONINTERLACED | \ - TV_CAP_COLORFIX) - -#define TV_DEF_DUALVIEW (TV_CAP_DUALVIEW | TV_DESC_DUALVIEW) - -#define NV_FLAG_DOUBLE_SCAN (1 << 0) -#define NV_FLAG_DOUBLE_PIX (1 << 1) - -typedef struct { - int HSyncStart; - int HSyncEnd; - int HTotal; - int VSyncStart; - int VSyncEnd; - int VTotal; - int Unknown; -} TVNvSlaveRegs; - -typedef struct { - int HDisplay; - int HSyncStart; - int HSyncEnd; - int HTotal; - int HValidStart; - int HValidEnd; - int HCrtc; - int VDisplay; - int VSyncStart; - int VSyncEnd; - int VTotal; - int VValidStart; - int VValidEnd; - int VCrtc; -} TVNvFpRegs; - -typedef struct { - long clock; /* Pixel clock in kHz, 0 = ignore */ - int HDisplay; /* horizontal timing */ - int HBlankStart; - int HSyncStart; - int HSyncEnd; - int HBlankEnd; - int HTotal; - int VDisplay; /* vertical timing */ - int VBlankStart; - int VSyncStart; - int VSyncEnd; - int VBlankEnd; - int VTotal; - int latency; /* internal TV clock delay */ - int flags; - TVNvSlaveRegs slave; - TVNvFpRegs fp; -} TVNvRegs; - -typedef struct { - int tvHDisplay; /* horizontal timing */ - int tvHBlankStart; - int tvHSyncStart; - int tvHSyncEnd; - int tvHBlankEnd; - int tvHTotal; - int tvVDisplay; /* vertical timing */ - int tvVBlankStart; - int tvVSyncStart; - int tvVSyncEnd; - int tvVBlankEnd; - int tvVTotal; - int borderRed; - int borderGreen; - int borderBlue; -} TVI810Regs; - -#define TDFX_FLAG_CLOCK2X (1 << 0) -#define TDFX_FLAG_DOUBLE_PIX (1 << 1) -#define TDFX_FLAG_HALF_MODE (1 << 2) - -typedef struct { - long clock; /* Pixel clock in kHz, 0 = ignore */ - int HDisplay; /* horizontal timing */ - int HBlankStart; - int HSyncStart; - int HSyncEnd; - int HBlankEnd; - int HTotal; - int VDisplay; /* vertical timing */ - int VBlankStart; - int VSyncStart; - int VSyncEnd; - int VBlankEnd; - int VTotal; - int HScreenSize; - int VScreenSize; - int tvHBlankStart; - int tvHBlankEnd; - int tvVBlankStart; - int tvVBlankEnd; - int tvBlankDelay; - int tvSyncDelay; - int tvLatency; /* internal TV clock delay */ - int flags; -} TVTdfxRegs; - -/* -------- Common -------- */ - -typedef union { - TVBtRegs bt; - TVCxRegs cx; - TVChRegs ch; - TVPh1Regs ph1; - TVPh2Regs ph2; -} TVEncoderRegs; - -typedef union { - TVNvRegs nv; - TVI810Regs i810; - TVTdfxRegs tdfx; -} TVCrtcRegs; - -typedef struct { - int devFlags; /* device(s) used for this mode */ - TVCrtcRegs crtc; - TVEncoderRegs enc; - int portHost; - int portEnc; -} TVRegs; - -/* External mode specification. TODO: Change this into x, y, and list - of attributes */ - -typedef struct { - TVSystem system; - int res_x; - int res_y; - char *size; - char *aspect; - double hoc; - double voc; -} TVModeSpec; - -typedef struct { - TVModeSpec spec; - TVRegs regs; - int descFlags; /* capabilities and defaults */ -} TVMode; - -typedef enum { - TV_UNKNOWN = 0, - TV_OFF = 1, - TV_BARS = 2, - TV_ON = 3 -} TVState; - -typedef enum { - CONNECT_AUTO = -2, - CONNECT_NONE = -1, - CONNECT_FBAS = 0, - CONNECT_SVHS = 1, - CONNECT_BOTH = 2, - CONNECT_CONVERT = 3, /* FBAS on both S-VHS lines, for converter */ -} TVConnect; - -typedef struct { - int tv_hoffset, tv_voffset; - int mon_hoffset, mon_voffset; - int brightness_sig; /* -50 - 50 % */ - int contrast; /* -100 - 100 % */ - int contrast_sig; /* -50 - 50 % */ - int saturation; /* -100 - 100 % */ - int saturation_sig; /* -50 - 50 % */ - int phase; /* -90 - 90 deg */ - int hue; /* -90 - 90 deg */ - int flicker; /* 0 - 100 % */ - int flicker_adapt; /* 0 - 100 % */ - int luma_bandwidth; /* 0 - 100 % */ - int chroma_bandwidth; /* 0 - 100 % */ - int sharpness; /* 0 - 100 % */ - int cross_color; /* 0 - 100 % */ - int flags; - TVConnect connector; -} TVSettings; - -/* FIXME: defines for TVSettings flags */ - -#endif /* _TV_CHIP */ diff --git a/src/xine-engine/nvtv/tv_common.h b/src/xine-engine/nvtv/tv_common.h deleted file mode 100644 index 7189506e6..000000000 --- a/src/xine-engine/nvtv/tv_common.h +++ /dev/null @@ -1,81 +0,0 @@ -/* NVTV TV types header -- Dirk Thierbach <dthierbach@gmx.de> - * - * This file is part of nvtv, a tool for tv-output on NVidia cards. - * - * nvtv is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * nvtv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: tv_common.h,v 1.3 2003/05/04 01:35:06 hadess Exp $ - * - * Contents: - * - * Header: Common tv-related data types and defines. - * - */ - -#ifndef _TV_COMMON_H -#define _TV_COMMON_H - -#include "xf86i2c.h" -#include "tv_chip.h" - -typedef struct _I2CChainRec *I2CChainPtr; -typedef struct _I2CChainRec { - char *name; - I2CDevPtr dev; - I2CChainPtr next; - TVChip chip; -} I2CChainRec; - -typedef struct _TvEncoderObj TVEncoderObj; - -struct _TvEncoderObj { - TVChip chip; - I2CDevPtr dev; - long minClock, maxClock; /* in kHz */ - void (*Create) (TVEncoderObj *this, TVChip chip, I2CDevPtr dev); - void (*InitRegs) (TVEncoderObj *this, int port); - void (*SetRegs) (TVEncoderObj *this, TVEncoderRegs *r, TVState state); - void (*GetRegs) (TVEncoderObj *this, TVEncoderRegs *r); - void (*SetPort) (TVEncoderObj *this, int port); - void (*GetPort) (TVEncoderObj *this, int *port); - void (*SetState) (TVEncoderObj *this, TVEncoderRegs *r, TVState state); - TVConnect (*GetConnect) (TVEncoderObj *this); - long (*GetStatus) (TVEncoderObj *this, int index); - int hwconfig; - int hwstate; -}; - -/* I2C Id of device for use in (s)printf */ -#define I2C_ID(dev) dev->pI2CBus->BusName+2,dev->SlaveAddr - -I2CChainPtr TVFindDevice (I2CChainPtr root, TVChip chip); -I2CChainPtr TVCreateChain (I2CBusPtr busses[], int nbus, Bool all); - -void TVDestroyChain (I2CChainPtr root); -void TVDestroyDevices (I2CBusPtr busses[], int nbus); -void TVDestroyBusses (I2CBusPtr busses[], int nbus); - -void TVProbeDevice (I2CBusPtr bus, I2CSlaveAddr addr, char *format, ...); -void TVProbeCreateKnown (I2CBusPtr busses[], int nbus, I2CChainPtr *chain); -void TVProbeCreateAll (I2CBusPtr busses[], int nbus, I2CChainPtr *chain); - -void TVSetTvEncoder (TVEncoderObj *encoder, I2CChainPtr chain); - -TVChip TVDetectDeviceA (I2CDevPtr dev); /* for 0x88/0x8A */ -TVChip TVDetectDeviceB (I2CDevPtr dev); /* for 0xEA/0xEC */ - -extern TVState tvState; - -#endif /* _TV_COMMON_H */ diff --git a/src/xine-engine/nvtv/xf86i2c.h b/src/xine-engine/nvtv/xf86i2c.h deleted file mode 100644 index 2c41d9fd4..000000000 --- a/src/xine-engine/nvtv/xf86i2c.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 1998 Itai Nahshon, Michael Schimek - */ - -/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.4 1999/04/11 13:11:01 dawes Exp $ */ -#ifndef _XF86I2C_H -#define _XF86I2C_H - -#include "miscstruct.h" - -typedef unsigned char I2CByte; -typedef unsigned short I2CSlaveAddr; - -typedef struct _I2CBusRec *I2CBusPtr; -typedef struct _I2CDevRec *I2CDevPtr; - -/* I2C masters have to register themselves */ - -typedef struct _I2CBusRec { - char * BusName; - int scrnIndex; - - void (*I2CUDelay) (I2CBusPtr b, int usec); - - void (*I2CPutBits)(I2CBusPtr b, int scl, int sda); - void (*I2CGetBits)(I2CBusPtr b, int *scl, int *sda); - - /* Look at the generic routines to see how these functions should behave. */ - - Bool (*I2CAddress)(I2CDevPtr d, I2CSlaveAddr); - void (*I2CStop) (I2CDevPtr d); - Bool (*I2CPutByte)(I2CDevPtr d, I2CByte data); - Bool (*I2CGetByte)(I2CDevPtr d, I2CByte *data, Bool); - - DevUnion DriverPrivate; - - int HoldTime; /* 1 / bus clock frequency, 5 or 2 usec */ - - int BitTimeout; /* usec */ - int ByteTimeout; /* usec */ - int AcknTimeout; /* usec */ - int StartTimeout; /* usec */ - int RiseFallTime; /* usec */ - - I2CDevPtr FirstDev; - I2CBusPtr NextBus; -} I2CBusRec; - -I2CBusPtr xf86CreateI2CBusRec(void); -void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too); -Bool xf86I2CBusInit(I2CBusPtr pI2CBus); -I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name); - -/* I2C slave devices */ - -typedef struct _I2CDevRec { - char * DevName; - - int BitTimeout; /* usec */ - int ByteTimeout; /* usec */ - int AcknTimeout; /* usec */ - int StartTimeout; /* usec */ - - I2CSlaveAddr SlaveAddr; - I2CBusPtr pI2CBus; - I2CDevPtr NextDev; -} I2CDevRec; - -I2CDevPtr xf86CreateI2CDevRec(void); -void xf86DestroyI2CDevRec(I2CDevPtr pI2CDev, Bool unalloc); -Bool xf86I2CDevInit(I2CDevPtr pI2CDev); -I2CDevPtr xf86I2CFindDev(I2CBusPtr, I2CSlaveAddr); - -/* See descriptions of these functions in xf86i2c.c */ - -Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr); -Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite, - I2CByte *ReadBuffer, int nRead); -#define xf86I2CRead(d, rb, nr) xf86I2CWriteRead(d, NULL, 0, rb, nr) -Bool xf86I2CReadStatus(I2CDevPtr d, I2CByte *pbyte); -Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte); -Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte, int n); -Bool xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword); -#define xf86I2CWrite(d, wb, nw) xf86I2CWriteRead(d, wb, nw, NULL, 0) -Bool xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte); -Bool xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *WriteBuffer, int nWrite); -Bool xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word); -Bool xf86I2CWriteVec(I2CDevPtr d, I2CByte *vec, int nValues); - -#endif /*_XF86I2C_H */ diff --git a/src/xine-engine/nvtv/xfree.h b/src/xine-engine/nvtv/xfree.h deleted file mode 100644 index c65a0681b..000000000 --- a/src/xine-engine/nvtv/xfree.h +++ /dev/null @@ -1,334 +0,0 @@ -/* NVTV xfree -- Dirk Thierbach <dthierbach@gmx.de> - * - * Header: All definitions from xfree that are needed. - * - */ - -#ifndef _XFREE_H -#define _XFREE_H 1 - -#include "config.h" - -#include <stdio.h> -#include <stdlib.h> - -#ifdef HAVE_X -#include <X11/Xmd.h> -#endif - -#include "miscstruct.h" - -#define __inline__ inline - -/**** common/compiler.h */ - -#define MMIO_IN8(base, offset) \ - *(volatile CARD8 *)(((CARD8*)(base)) + (offset)) -#define MMIO_IN16(base, offset) \ - *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) -#define MMIO_IN32(base, offset) \ - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) -#define MMIO_OUT8(base, offset, val) \ - *(volatile CARD8 *)(((CARD8*)(base)) + (offset)) = (val) -#define MMIO_OUT16(base, offset, val) \ - *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) = (val) -#define MMIO_OUT32(base, offset, val) \ - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val) -#define MMIO_ONB8(base, offset, val) MMIO_OUT8(base, offset, val) -#define MMIO_ONB16(base, offset, val) MMIO_OUT16(base, offset, val) -#define MMIO_ONB32(base, offset, val) MMIO_OUT32(base, offset, val) - -/* -------- vgahw/vgaHW.h -------- */ - -/* Standard VGA registers */ -#define VGA_ATTR_INDEX 0x3C0 -#define VGA_ATTR_DATA_W 0x3C0 -#define VGA_ATTR_DATA_R 0x3C1 -#define VGA_IN_STAT_0 0x3C2 /* read */ -#define VGA_MISC_OUT_W 0x3C2 /* write */ -#define VGA_ENABLE 0x3C3 -#define VGA_SEQ_INDEX 0x3C4 -#define VGA_SEQ_DATA 0x3C5 -#define VGA_DAC_MASK 0x3C6 -#define VGA_DAC_READ_ADDR 0x3C7 -#define VGA_DAC_WRITE_ADDR 0x3C8 -#define VGA_DAC_DATA 0x3C9 -#define VGA_FEATURE_R 0x3CA /* read */ -#define VGA_MISC_OUT_R 0x3CC /* read */ -#define VGA_GRAPH_INDEX 0x3CE -#define VGA_GRAPH_DATA 0x3CF - -#define VGA_IOBASE_MONO 0x3B0 -#define VGA_IOBASE_COLOR 0x3D0 - -#define VGA_CRTC_INDEX_OFFSET 0x04 -#define VGA_CRTC_DATA_OFFSET 0x05 -#define VGA_IN_STAT_1_OFFSET 0x0A /* read */ -#define VGA_FEATURE_W_OFFSET 0x0A /* write */ - - -/**** common/xf86str.h */ - -/* Flags for driver messages */ -typedef enum { - X_PROBED, /* Value was probed */ - X_CONFIG, /* Value was given in the config file */ - X_DEFAULT, /* Value is a default */ - X_CMDLINE, /* Value was given on the command line */ - X_NOTICE, /* Notice */ - X_ERROR, /* Error message */ - X_WARNING, /* Warning message */ - X_INFO, /* Informational message */ - X_NONE, /* No prefix */ - X_NOT_IMPLEMENTED /* Not implemented */ -} MessageType; - -/* Video mode flags */ - -typedef enum { - V_PHSYNC = 0x0001, - V_NHSYNC = 0x0002, - V_PVSYNC = 0x0004, - V_NVSYNC = 0x0008, - V_INTERLACE = 0x0010, - V_DBLSCAN = 0x0020, - V_CSYNC = 0x0040, - V_PCSYNC = 0x0080, - V_NCSYNC = 0x0100, - V_HSKEW = 0x0200, /* hskew provided */ - V_BCAST = 0x0400, - V_PIXMUX = 0x1000, - V_DBLCLK = 0x2000, - V_CLKDIV2 = 0x4000 -} ModeFlags; - -typedef enum { - INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */ -} CrtcAdjustFlags; - -/* Flags passed to ChipValidMode() */ -typedef enum { - MODECHECK_INITIAL = 0, - MODECHECK_FINAL = 1 -} ModeCheckFlags; - -/* These are possible return values for xf86CheckMode() and ValidMode() */ -typedef enum { - MODE_OK = 0, /* Mode OK */ - MODE_HSYNC, /* hsync out of range */ - MODE_VSYNC, /* vsync out of range */ - MODE_H_ILLEGAL, /* mode has illegal horizontal timings */ - MODE_V_ILLEGAL, /* mode has illegal horizontal timings */ - MODE_BAD_WIDTH, /* requires an unsupported linepitch */ - MODE_NOMODE, /* no mode with a maching name */ - MODE_NO_INTERLACE, /* interlaced mode not supported */ - MODE_NO_DBLESCAN, /* doublescan mode not supported */ - MODE_NO_VSCAN, /* multiscan mode not supported */ - MODE_MEM, /* insufficient video memory */ - MODE_VIRTUAL_X, /* mode width too large for specified virtual size */ - MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */ - MODE_MEM_VIRT, /* insufficient video memory given virtual size */ - MODE_NOCLOCK, /* no fixed clock available */ - MODE_CLOCK_HIGH, /* clock required is too high */ - MODE_CLOCK_LOW, /* clock required is too low */ - MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */ - MODE_BAD_HVALUE, /* horizontal timing was out of range */ - MODE_BAD_VVALUE, /* vertical timing was out of range */ - MODE_BAD_VSCAN, /* VScan value out of range */ - MODE_HSYNC_NARROW, /* horizontal sync too narrow */ - MODE_HSYNC_WIDE, /* horizontal sync too wide */ - MODE_HBLANK_NARROW, /* horizontal blanking too narrow */ - MODE_HBLANK_WIDE, /* horizontal blanking too wide */ - MODE_VSYNC_NARROW, /* vertical sync too narrow */ - MODE_VSYNC_WIDE, /* vertical sync too wide */ - MODE_VBLANK_NARROW, /* vertical blanking too narrow */ - MODE_VBLANK_WIDE, /* vertical blanking too wide */ - MODE_PANEL, /* exceeds panel dimensions */ - MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */ - MODE_ONE_WIDTH, /* only one width is supported */ - MODE_ONE_HEIGHT, /* only one height is supported */ - MODE_ONE_SIZE, /* only one resolution is supported */ - MODE_BAD = -2, /* unspecified reason */ - MODE_ERROR = -1 /* error condition */ -} ModeStatus; - -# define M_T_BUILTIN 0x01 /* built-in mode */ -# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */ -# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */ -# define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C) - /* built-in mode - configure CRTC and clock */ -# define M_T_DEFAULT 0x10 /* (VESA) default modes */ - -/* Video mode */ -typedef struct _DisplayModeRec { - struct _DisplayModeRec * prev; - struct _DisplayModeRec * next; - char * name; /* identifier for the mode */ - ModeStatus status; - int type; - - /* These are the values that the user sees/provides */ - int Clock; /* pixel clock freq */ - int HDisplay; /* horizontal timing */ - int HSyncStart; - int HSyncEnd; - int HTotal; - int HSkew; - int VDisplay; /* vertical timing */ - int VSyncStart; - int VSyncEnd; - int VTotal; - int VScan; - int Flags; - - /* These are the values the hardware uses */ - int ClockIndex; - int SynthClock; /* Actual clock freq to - * be programmed */ - int CrtcHDisplay; - int CrtcHBlankStart; - int CrtcHSyncStart; - int CrtcHSyncEnd; - int CrtcHBlankEnd; - int CrtcHTotal; - int CrtcHSkew; - int CrtcVDisplay; - int CrtcVBlankStart; - int CrtcVSyncStart; - int CrtcVSyncEnd; - int CrtcVBlankEnd; - int CrtcVTotal; - Bool CrtcHAdjusted; - Bool CrtcVAdjusted; - int PrivSize; - INT32 * Private; - int PrivFlags; - - float HSync, VRefresh; -} DisplayModeRec, *DisplayModePtr; - -/* - * memType is of the size of the addressable memory (machine size) - * usually unsigned long. - */ -typedef pointer (*funcPointer)(void); - -typedef struct _ScrnInfoRec { - int scrnIndex; /* Number of this screen */ -/* ... */ - DisplayModePtr currentMode; /* current mode */ -/* ... */ - pointer driverPrivate; /* Driver private area */ - DevUnion * privates; /* Other privates can hook in - * here */ -} ScrnInfoRec; - -typedef struct _ScrnInfoRec *ScrnInfoPtr; - -/**** common/xf86.h */ - -extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ - -/* ---------------- nv driver files ---------------- */ - -/**** nv_local.h */ - -/* - * Typedefs to force certain sized values. - */ -typedef unsigned char U008; -typedef unsigned short U016; -typedef unsigned int U032; - -/* these assume memory-mapped I/O, and not normal I/O space */ -#define NV_WR08(p,i,d) MMIO_OUT8((volatile pointer)(p), (i), (d)) -#define NV_RD08(p,i) MMIO_IN8((volatile pointer)(p), (i)) -#define NV_WR16(p,i,d) MMIO_OUT16((volatile pointer)(p), (i), (d)) -#define NV_RD16(p,i) MMIO_IN16((volatile pointer)(p), (i)) -#define NV_WR32(p,i,d) MMIO_OUT32((volatile pointer)(p), (i), (d)) -#define NV_RD32(p,i) MMIO_IN32((volatile pointer)(p), (i)) - -#define VGA_WR08(p,i,d) NV_WR08(p,i,d) -#define VGA_RD08(p,i) NV_RD08(p,i) - -/**** nv_dac.c */ - -#define DDC_SDA_READ_MASK (1 << 3) -#define DDC_SCL_READ_MASK (1 << 2) -#define DDC_SDA_WRITE_MASK (1 << 4) -#define DDC_SCL_WRITE_MASK (1 << 5) - -/**** riva_hw.h */ - -typedef struct _riva_hw_inst -{ - U032 Architecture; - U032 Version; - U032 CrystalFreqKHz; - U032 RamAmountKBytes; - U032 MaxVClockFreqKHz; - U032 RamBandwidthKBytesPerSec; - U032 EnableIRQ; - U032 IO; -#if 1 /* from a different riva_hw ??? */ - U032 VBlankBit; - U032 FifoFreeCount; - U032 FifoEmptyCount; -#endif - /* - * Non-FIFO registers. - */ - volatile U032 *PCRTC; - volatile U032 *PRAMDAC; - volatile U032 *PFB; - volatile U032 *PFIFO; - volatile U032 *PGRAPH; - volatile U032 *PEXTDEV; - volatile U032 *PTIMER; - volatile U032 *PMC; - volatile U032 *PRAMIN; - volatile U032 *FIFO; - volatile U032 *CURSOR; - volatile U032 *CURSORPOS; - volatile U032 *VBLANKENABLE; - volatile U032 *VBLANK; - volatile U008 *PCIO; - volatile U008 *PVIO; - volatile U008 *PDIO; -#if 1 - volatile U032 *PVIDEO; /* extra */ -#endif - /* Remaining entries cut */ -#if 0 - /* - * Common chip functions. - */ - int (*Busy)(struct _riva_hw_inst *); - void (*CalcStateExt)(struct _riva_hw_inst *,struct _riva_hw_state *,int,int,int,int,int,int,int,int,int,int,int,int,int); - void (*LoadStateExt)(struct _riva_hw_inst *,struct _riva_hw_state *); - void (*UnloadStateExt)(struct _riva_hw_inst *,struct _riva_hw_state *); - void (*SetStartAddress)(struct _riva_hw_inst *,U032); - void (*SetSurfaces2D)(struct _riva_hw_inst *,U032,U032); - void (*SetSurfaces3D)(struct _riva_hw_inst *,U032,U032); - int (*ShowHideCursor)(struct _riva_hw_inst *,int); - void (*LockUnlock)(struct _riva_hw_inst *, int); - /* - * Current extended mode settings. - */ - struct _riva_hw_state *CurrentState; - /* - * FIFO registers. - */ - RivaRop *Rop; - RivaPattern *Patt; - RivaClip *Clip; - RivaPixmap *Pixmap; - RivaScreenBlt *Blt; - RivaBitmap *Bitmap; - RivaLine *Line; - RivaTexturedTriangle03 *Tri03; - RivaTexturedTriangle05 *Tri05; -#endif -} RIVA_HW_INST; - -#endif diff --git a/src/xine-engine/tvmode.c b/src/xine-engine/tvmode.c index 2b1f62f0c..555b57f45 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.15 2003/05/16 11:39:50 hadess Exp $ + * $Id: tvmode.c,v 1.16 2003/10/02 01:39:10 miguelfreitas Exp $ * * tvmode - TV output selection * @@ -38,320 +38,11 @@ #include "xine_internal.h" #include "xineutils.h" -#ifdef XINE_HAVE_NVTV -#include "nvtv/back_client.h" - -/* - * PRIVATE +/* nvtv support is deprecated (and will be removed) + * these dummy functions are only here to prevent serious breakage + * until front ends are updated. */ -BackCardPtr back_card = 0; -BackAccessPtr back_access = 0; - -static int current_type, current_width, current_height; -static double current_fps; - -static TVRegs old_tvregs; -static TVSettings old_settings; - -static int tvmode_enabled = 1; -static int was_enabled = 0; - -static TVSystem opt_system = TV_SYSTEM_PAL; -static TVConnect opt_connect = CONNECT_NONE; - -static TVMode *modes_pal = NULL; -static int size_modes_pal = 0; -static TVMode *modes_ntsc =NULL; -static int size_modes_ntsc = 0; - -static double opt_aspect = 4.0 / 3.0; - - -/* Try to connect to nvtvd server */ -static void tvmode_connect(xine_t *this) { - CardPtr main_card_list, main_card = NULL; - - if (was_enabled) { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf ("tvmode: Already initialized!\n"); - return; - } - if (back_client_avail ()) { - main_card_list = back_client_init (); - } else { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf ("tvmode: Nvtvd not detected, make sure nvtvd is running.\n"); - /* Handle well in some way... */ - return; - } - - if (back_access) { - back_access->closeCard (); - } - - if (!main_card_list) { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf ("tvmode: No supported video card found.\n"); - /* Handle well in some way... */ - return; - } - - /* Just pick the first, here we might want to pick an alternative card... */ - main_card = main_card_list; - - if (!main_card) { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf ("tvmode: No supported video card found at specified address.\n"); - /* Handle well in some way... */ - return; - } - - - if (back_access) { - back_access->openCard (main_card); - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: Using card %s for tvout\n", main_card->name); - was_enabled = 1; - } else { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: cannot connect to nvtvd - no TV mode switching available\n"); - } - -} - - -/* Disconnect from server */ -static void tvmode_disconnect (xine_t *this) { - back_access->closeCard (); - back_access = 0; - was_enabled = 0; -} - - -/* Save current CRT and TV register configuration */ -static void tvmode_savestate (xine_t *this) { - back_card->getSettings(&old_settings); - back_card->getMode (&old_tvregs); -} - - -/* Restore CRT and TV register configuration */ -static void tvmode_restorestate (xine_t *this) { - back_card->setModeSettings (&old_tvregs,&old_settings); - - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: Old mode saved!"); - - current_type = 0; -} - - -/* Set CRT and TV registers to given TV-Out configuration */ -static void tvmode_settvstate (xine_t *this, int width, int height, double fps) { - TVSettings settings; - TVMode mode; - TVMode *modes; - int size; - int found = 0; - int tmp_fps; - int i; - - /* TODO: do that at initialization and save possible combinations */ - /* Find supported TV mode */ - if (opt_system == TV_SYSTEM_NTSC) { - modes = modes_ntsc; - size = size_modes_ntsc; - tmp_fps = 29.97; - } else { - modes = modes_pal; - tmp_fps = 25; - size = size_modes_pal; - } - - for (i=0; i < size; i++) { - /* - printf ("Trying mode %dx%d %f %f\n", modes[i].spec.res_x, modes[i].spec.res_y, modes[i].spec.hoc, modes[i].spec.voc); - */ - if ((width <= modes[i].spec.res_x) && (height <= modes[i].spec.res_y) && - (back_card->findByOverscan (opt_system, modes[i].spec.res_x, modes[i].spec.res_y, 10, 5, &mode))) { - current_width = mode.spec.res_x; - current_height = mode.spec.res_y; - current_fps = tmp_fps; - found++; - } - } - /* Switch to mode */ - if (found) { - back_card->getSettings (&settings); - if (opt_connect > CONNECT_NONE) { - settings.connector = opt_connect; - } else { - settings.connector = CONNECT_BOTH; - } - - mode.regs.devFlags = DEV_MONITOR | DEV_TELEVISION; - settings.flags |= TV_DESC_DUALVIEW; - - back_card->setModeSettings (&mode.regs, &settings); - - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: Trying to use mode %i x %i\n",current_width,current_height); - current_type = 1; - } else { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: cannot find any valid TV mode - TV output disabled\n"); - xine_tvmode_exit (this); - } -} - -/* - * PUBLIC - */ - -/* 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) { - - if(tvmode_enabled) { - - /* - * Wasn't initialized - */ - if(!was_enabled) { - xine_tvmode_init(this); - } - if (back_card) { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: switching to %s\n", type ? "TV" : "default"); - - switch (type) { - case 0: - tvmode_restorestate (this); - break; - case 1: - tvmode_settvstate (this, width, height, fps); - break; - default: - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: illegal type for switching\n"); - tvmode_restorestate (this); - } - } else { - if (this->verbosity >= XINE_VERBOSITY_LOG) - printf("tvmode: not connected to nvtvd for switching\n"); - } - - } - return current_type; -} - -/* Addapt (maximum) output size to visible area and set pixel aspect and fps */ -void xine_tvmode_size (xine_t *this, int *width, int *height, - double *pixelratio, double *fps) { - - if(tvmode_enabled) { - - switch (current_type) { - case 1: - /* - if (width && *width > current_width) - */ - if (width) - *width = current_width; - /* - if (height && *height > current_height) - */ - if (height) - *height = current_height; - if (pixelratio) - *pixelratio = ((double) current_width / current_height) / opt_aspect; - if (fps) - *fps = current_fps; - break; - } - - } -} - -void init_modes() { - int i; - - size_modes_pal = back_card->listModes(TV_SYSTEM_PAL, &modes_pal); - - size_modes_ntsc = back_card->listModes(TV_SYSTEM_NTSC, &modes_ntsc); - - /* - for (i=0; i < size_modes_pal; i++) { - printf ("Modes PAL %dx%d %f %f\n", modes_pal[i].spec.res_x, modes_pal[i].spec.res_y, modes_pal[i].spec.hoc, modes_pal[i].spec.voc); - } - - for (i=0; i < size_modes_pal; i++) { - printf ("Modes NTSC %dx%d %f %f\n", modes_ntsc[i].spec.res_x, modes_ntsc[i].spec.res_y, modes_ntsc[i].spec.hoc, modes_ntsc[i].spec.voc); - } - */ - -} - -/* Connect to nvtvd server if possible and store settings */ -int xine_tvmode_init(xine_t *self) { - - tvmode_connect (self); - if (back_card) { - tvmode_savestate (self); - init_modes(); - return 1; - } - - return 0; -} - -int xine_tvmode_use(xine_t *self, int use_tvmode) { - - tvmode_enabled = 0; - if (use_tvmode) { - if (was_enabled || xine_tvmode_init(self)) { - tvmode_enabled = 1; - } - } - - return (tvmode_enabled); -} - -void xine_tvmode_set_tvsystem(xine_t *self, xine_tvsystem system) { - - switch (system) { - case XINE_TVSYSTEM_PAL: - opt_system = TV_SYSTEM_PAL; - break; - case XINE_TVSYSTEM_NTSC: - opt_system = TV_SYSTEM_NTSC; - break; - default: - opt_system = TV_SYSTEM_PAL; - } -} - -/* Restore old CRT and TV registers and close nvtvd connection */ -void xine_tvmode_exit (xine_t *this) { - - if(tvmode_enabled || was_enabled) { - if (back_card) { - tvmode_restorestate (this); - tvmode_disconnect (this); - } - if (modes_pal != NULL) { - free(modes_pal); - } - if (modes_ntsc != NULL) { - free(modes_ntsc); - } - } -} - -#else - -/* no nvtv support compiled in lib */ - int xine_tvmode_switch (xine_t *this, int type, int width, int height, double fps) { /* not supported: return regular mode */ return 0; @@ -374,4 +65,3 @@ void xine_tvmode_set_tvsystem(xine_t *self, xine_tvsystem system) { int xine_tvmode_use(xine_t *self, int use_tvmode) { return 0; } -#endif |