aboutsummaryrefslogtreecommitdiffhomepage
path: root/vidix
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@symbol.nonexistent.invalid>2008-06-23 03:58:44 +0300
committerGravatar Uoti Urpala <uau@symbol.nonexistent.invalid>2008-06-23 03:58:44 +0300
commitde560e8167c21a8fd9ea34f5f42f377102d65232 (patch)
treed5ef49221ccbb17308b0d14a96e6bd8cfba5916f /vidix
parent68e70b3ec34af2e1002d17d0dc81b3408a399ade (diff)
parent5eee4632d3e2bcf17a29483467d247c71c202e0d (diff)
Merge svn changes up to r27123
Conflicts: libmenu/menu_filesel.c libmenu/menu_pt.c
Diffstat (limited to 'vidix')
-rw-r--r--vidix/cyberblade_vid.c1
-rw-r--r--vidix/drivers.c2
-rw-r--r--vidix/drivers.h2
-rw-r--r--vidix/ivtv_vid.c1
-rw-r--r--vidix/mach64_vid.c1
-rw-r--r--vidix/mga_vid.c1
-rw-r--r--vidix/nvidia_vid.c1
-rw-r--r--vidix/pm2_vid.c1
-rw-r--r--vidix/pm3_vid.c1
-rw-r--r--vidix/radeon_vid.c1
-rw-r--r--vidix/s3_vid.c1
-rw-r--r--vidix/sis_vid.c1
-rw-r--r--vidix/unichrome_vid.c1
-rw-r--r--vidix/vidix.c (renamed from vidix/vidixlib.c)51
-rw-r--r--vidix/vidix.h82
-rw-r--r--vidix/vidixlib.h134
16 files changed, 102 insertions, 180 deletions
diff --git a/vidix/cyberblade_vid.c b/vidix/cyberblade_vid.c
index 5a323dd163..558d915acb 100644
--- a/vidix/cyberblade_vid.c
+++ b/vidix/cyberblade_vid.c
@@ -40,7 +40,6 @@
#include "config.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/drivers.c b/vidix/drivers.c
index cf26cf94dc..483428ff3b 100644
--- a/vidix/drivers.c
+++ b/vidix/drivers.c
@@ -25,7 +25,7 @@
#include <string.h>
#include "config.h"
-#include "vidixlib.h"
+#include "vidix.h"
#include "libavutil/common.h"
#include "mpbswap.h"
#include "config.h"
diff --git a/vidix/drivers.h b/vidix/drivers.h
index 1dbe0b8417..157f918c4b 100644
--- a/vidix/drivers.h
+++ b/vidix/drivers.h
@@ -22,7 +22,7 @@
#ifndef MPLAYER_DRIVERS_H
#define MPLAYER_DRIVERS_H
-#include "vidixlib.h"
+#include "vidix.h"
void vidix_register_all_drivers (void);
diff --git a/vidix/ivtv_vid.c b/vidix/ivtv_vid.c
index ca2d4aa046..15bf38d85c 100644
--- a/vidix/ivtv_vid.c
+++ b/vidix/ivtv_vid.c
@@ -39,7 +39,6 @@
#include <linux/fb.h>
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/mach64_vid.c b/vidix/mach64_vid.c
index 0163deb4c3..dd6084d126 100644
--- a/vidix/mach64_vid.c
+++ b/vidix/mach64_vid.c
@@ -34,7 +34,6 @@
#include "libavutil/common.h"
#include "mpbswap.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/mga_vid.c b/vidix/mga_vid.c
index b6504fa5df..fd414fa3bb 100644
--- a/vidix/mga_vid.c
+++ b/vidix/mga_vid.c
@@ -54,7 +54,6 @@
#include <inttypes.h>
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/nvidia_vid.c b/vidix/nvidia_vid.c
index a895a084c8..c53fa93d64 100644
--- a/vidix/nvidia_vid.c
+++ b/vidix/nvidia_vid.c
@@ -33,7 +33,6 @@
#include "config.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/pm2_vid.c b/vidix/pm2_vid.c
index a1058d6882..748a9fd884 100644
--- a/vidix/pm2_vid.c
+++ b/vidix/pm2_vid.c
@@ -29,7 +29,6 @@
#include "config.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/pm3_vid.c b/vidix/pm3_vid.c
index 0ee01e0734..25b0a60988 100644
--- a/vidix/pm3_vid.c
+++ b/vidix/pm3_vid.c
@@ -28,7 +28,6 @@
#include "config.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/radeon_vid.c b/vidix/radeon_vid.c
index 5088a987fd..b72391b51d 100644
--- a/vidix/radeon_vid.c
+++ b/vidix/radeon_vid.c
@@ -37,7 +37,6 @@
#include "pci_ids.h"
#include "pci_names.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "radeon.h"
diff --git a/vidix/s3_vid.c b/vidix/s3_vid.c
index 98904cedd8..cecd39d955 100644
--- a/vidix/s3_vid.c
+++ b/vidix/s3_vid.c
@@ -32,7 +32,6 @@
#include "config.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/sis_vid.c b/vidix/sis_vid.c
index 57e934c017..1028a6c5db 100644
--- a/vidix/sis_vid.c
+++ b/vidix/sis_vid.c
@@ -32,7 +32,6 @@
#include "config.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/unichrome_vid.c b/vidix/unichrome_vid.c
index 15b86fc662..796b7e5885 100644
--- a/vidix/unichrome_vid.c
+++ b/vidix/unichrome_vid.c
@@ -32,7 +32,6 @@
#include "config.h"
#include "vidix.h"
-#include "vidixlib.h"
#include "fourcc.h"
#include "dha.h"
#include "pci_ids.h"
diff --git a/vidix/vidixlib.c b/vidix/vidix.c
index 78dc703e77..f5da49da7f 100644
--- a/vidix/vidixlib.c
+++ b/vidix/vidix.c
@@ -39,12 +39,12 @@
#include <string.h>
#include "config.h"
-#include "vidixlib.h"
+#include "vidix.h"
#include "drivers.h"
#include "libavutil/common.h"
#include "mpbswap.h"
-VDL_HANDLE vdlOpen(const char *name,unsigned cap,int verbose)
+VDXContext *vdlOpen(const char *name,unsigned cap,int verbose)
{
VDXContext *ctx;
@@ -90,7 +90,7 @@ VDL_HANDLE vdlOpen(const char *name,unsigned cap,int verbose)
return ctx;
}
-void vdlClose(VDL_HANDLE ctx)
+void vdlClose(VDXContext *ctx)
{
if (ctx->drv->destroy)
ctx->drv->destroy ();
@@ -99,7 +99,7 @@ void vdlClose(VDL_HANDLE ctx)
free (ctx);
}
-int vdlGetCapability(VDL_HANDLE ctx, vidix_capability_t *cap)
+int vdlGetCapability(VDXContext *ctx, vidix_capability_t *cap)
{
return ctx->drv->get_caps (cap);
}
@@ -108,87 +108,72 @@ int vdlGetCapability(VDL_HANDLE ctx, vidix_capability_t *cap)
#define MPLAYER_IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
#define MPLAYER_IMGFMT_RGB_MASK 0xFFFFFF00
-static uint32_t normalize_fourcc(uint32_t fourcc)
+static uint32_t normalize_fourcc (uint32_t fourcc)
{
if((fourcc & MPLAYER_IMGFMT_RGB_MASK) == (MPLAYER_IMGFMT_RGB|0) ||
(fourcc & MPLAYER_IMGFMT_RGB_MASK) == (MPLAYER_IMGFMT_BGR|0))
return bswap_32(fourcc);
- else return fourcc;
+ return fourcc;
}
-int vdlQueryFourcc(VDL_HANDLE ctx,vidix_fourcc_t *f)
+int vdlQueryFourcc (VDXContext *ctx, vidix_fourcc_t *f)
{
f->fourcc = normalize_fourcc(f->fourcc);
return ctx->drv->query_fourcc (f);
}
-int vdlConfigPlayback(VDL_HANDLE ctx,vidix_playback_t *p)
+int vdlConfigPlayback (VDXContext *ctx, vidix_playback_t *p)
{
p->fourcc = normalize_fourcc(p->fourcc);
return ctx->drv->config_playback (p);
}
-int vdlPlaybackOn(VDL_HANDLE ctx)
+int vdlPlaybackOn (VDXContext *ctx)
{
return ctx->drv->playback_on ();
}
-int vdlPlaybackOff(VDL_HANDLE ctx)
+int vdlPlaybackOff (VDXContext *ctx)
{
return ctx->drv->playback_off ();
}
-int vdlPlaybackFrameSelect(VDL_HANDLE ctx, unsigned frame_idx )
+int vdlPlaybackFrameSelect (VDXContext *ctx, unsigned frame_idx)
{
return ctx->drv->frame_sel ? ctx->drv->frame_sel (frame_idx) : ENOSYS;
}
-int vdlPlaybackGetEq(VDL_HANDLE ctx, vidix_video_eq_t * e)
+int vdlPlaybackGetEq (VDXContext *ctx, vidix_video_eq_t *e)
{
return ctx->drv->get_eq ? ctx->drv->get_eq (e) : ENOSYS;
}
-int vdlPlaybackSetEq(VDL_HANDLE ctx, const vidix_video_eq_t * e)
+int vdlPlaybackSetEq (VDXContext *ctx, const vidix_video_eq_t *e)
{
return ctx->drv->set_eq ? ctx->drv->set_eq (e) : ENOSYS;
}
-int vdlPlaybackCopyFrame(VDL_HANDLE ctx, const vidix_dma_t * f)
+int vdlPlaybackCopyFrame (VDXContext *ctx, const vidix_dma_t *f)
{
return ctx->drv->copy_frame ? ctx->drv->copy_frame (f) : ENOSYS;
}
-int vdlGetGrKeys(VDL_HANDLE ctx, vidix_grkey_t * k)
+int vdlGetGrKeys (VDXContext *ctx, vidix_grkey_t *k)
{
return ctx->drv->get_gkey ? ctx->drv->get_gkey (k) : ENOSYS;
}
-int vdlSetGrKeys(VDL_HANDLE ctx, const vidix_grkey_t * k)
+int vdlSetGrKeys (VDXContext *ctx, const vidix_grkey_t *k)
{
return ctx->drv->set_gkey ? ctx->drv->set_gkey (k) : ENOSYS;
}
-int vdlPlaybackGetDeint(VDL_HANDLE ctx, vidix_deinterlace_t * d)
+int vdlPlaybackGetDeint (VDXContext *ctx, vidix_deinterlace_t *d)
{
return ctx->drv->get_deint ? ctx->drv->get_deint (d) : ENOSYS;
}
-int vdlPlaybackSetDeint(VDL_HANDLE ctx, const vidix_deinterlace_t * d)
+int vdlPlaybackSetDeint (VDXContext *ctx, const vidix_deinterlace_t *d)
{
return ctx->drv->set_deint ? ctx->drv->set_deint (d) : ENOSYS;
}
-
-int vdlQueryNumOemEffects(VDL_HANDLE ctx, unsigned * number )
-{
- return ctx->drv->get_num_fx ? ctx->drv->get_num_fx (number) : ENOSYS;
-}
-
-int vdlGetOemEffect(VDL_HANDLE ctx, vidix_oem_fx_t * f)
-{
- return ctx->drv->get_fx ? ctx->drv->get_fx (f) : ENOSYS;
-}
-
-int vdlSetOemEffect(VDL_HANDLE ctx, const vidix_oem_fx_t * f)
-{
- return ctx->drv->set_fx ? ctx->drv->set_fx (f) : ENOSYS;
-}
diff --git a/vidix/vidix.h b/vidix/vidix.h
index 01a998b004..0a00d89412 100644
--- a/vidix/vidix.h
+++ b/vidix/vidix.h
@@ -305,4 +305,86 @@ typedef struct vidix_oem_fx_s
char *name[80]; /* effect name to display */
} vidix_oem_fx_t;
+typedef struct VDXDriver {
+ const char *name;
+ struct VDXDriver *next;
+ int (* probe) (int verbose, int force);
+ int (* get_caps) (vidix_capability_t *cap);
+ int (*query_fourcc)(vidix_fourcc_t *);
+ int (*init)(void);
+ void (*destroy)(void);
+ int (*config_playback)(vidix_playback_t *);
+ int (*playback_on)( void );
+ int (*playback_off)( void );
+ /* Functions below can be missed in driver ;) */
+ int (*frame_sel)( unsigned frame_idx );
+ int (*get_eq)( vidix_video_eq_t * );
+ int (*set_eq)( const vidix_video_eq_t * );
+ int (*get_deint)( vidix_deinterlace_t * );
+ int (*set_deint)( const vidix_deinterlace_t * );
+ int (*copy_frame)( const vidix_dma_t * );
+ int (*get_gkey)( vidix_grkey_t * );
+ int (*set_gkey)( const vidix_grkey_t * );
+} VDXDriver;
+
+typedef struct VDXContext {
+ VDXDriver *drv;
+ /* might be filled in by much more info later on */
+} VDXContext;
+
+/***************************************************************************/
+/* PUBLIC API */
+/***************************************************************************/
+
+/* Opens corresponded video driver and returns handle of associated stream.
+ * path - specifies path where drivers are located.
+ * name - specifies prefered driver name (can be NULL).
+ * cap - specifies driver capability (TYPE_* constants).
+ * verbose - specifies verbose level
+ * returns handle if ok else NULL.
+ */
+VDXContext *vdlOpen (const char *name,unsigned cap,int verbose);
+
+/* Closes stream and corresponded driver. */
+void vdlClose (VDXContext *ctx);
+
+/* Queries driver capabilities. Return 0 if ok else errno */
+int vdlGetCapability (VDXContext *, vidix_capability_t *);
+
+/* Queries support for given fourcc. Returns 0 if ok else errno */
+int vdlQueryFourcc (VDXContext *, vidix_fourcc_t *);
+
+/* Returns 0 if ok else errno */
+int vdlConfigPlayback (VDXContext *, vidix_playback_t *);
+
+/* Returns 0 if ok else errno */
+int vdlPlaybackOn (VDXContext *);
+
+/* Returns 0 if ok else errno */
+int vdlPlaybackOff (VDXContext *);
+
+/* Returns 0 if ok else errno */
+int vdlPlaybackFrameSelect (VDXContext *, unsigned frame_idx);
+
+/* Returns 0 if ok else errno */
+int vdlGetGrKeys (VDXContext *, vidix_grkey_t *);
+
+/* Returns 0 if ok else errno */
+int vdlSetGrKeys (VDXContext *, const vidix_grkey_t *);
+
+/* Returns 0 if ok else errno */
+int vdlPlaybackGetEq (VDXContext *, vidix_video_eq_t *);
+
+/* Returns 0 if ok else errno */
+int vdlPlaybackSetEq (VDXContext *, const vidix_video_eq_t *);
+
+/* Returns 0 if ok else errno */
+int vdlPlaybackGetDeint (VDXContext *, vidix_deinterlace_t *);
+
+/* Returns 0 if ok else errno */
+int vdlPlaybackSetDeint (VDXContext *, const vidix_deinterlace_t *);
+
+/* Returns 0 if ok else errno */
+int vdlQueryNumOemEffects (VDXContext *, unsigned *number);
+
#endif /* MPLAYER_VIDIX_H */
diff --git a/vidix/vidixlib.h b/vidix/vidixlib.h
deleted file mode 100644
index 08ca9639da..0000000000
--- a/vidix/vidixlib.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * VIDIX - VIDeo Interface for *niX.
- *
- * This interface is introduced as universal one to MPEG decoder,
- * Back End Scaler (BES) and YUV2RGB hw accelerators.
- *
- * In the future it may be expanded up to capturing and audio things.
- * Main goal of this this interface imlpementation is providing DGA
- * everywhere where it's possible (unlike X11 and other).
- *
- * This interface is based on v4l2, fbvid.h, mga_vid.h projects
- * and personally my ideas.
- *
- * NOTE: This interface is introduced as driver interface.
- *
- * Copyright (C) 2002 Nick Kurshev
- * Copyright (C) 2007 Benjamin Zores <ben@geexbox.org>
- *
- * This file is part of MPlayer.
- *
- * MPlayer 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.
- *
- * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef MPLAYER_VIDIXLIB_H
-#define MPLAYER_VIDIXLIB_H
-
-#include "vidix.h"
-
-typedef struct VDXDriver {
- const char *name;
- struct VDXDriver *next;
- int (* probe) (int verbose, int force);
- int (* get_caps) (vidix_capability_t *cap);
- int (*query_fourcc)(vidix_fourcc_t *);
- int (*init)(void);
- void (*destroy)(void);
- int (*config_playback)(vidix_playback_t *);
- int (*playback_on)( void );
- int (*playback_off)( void );
- /* Functions below can be missed in driver ;) */
- int (*frame_sel)( unsigned frame_idx );
- int (*get_eq)( vidix_video_eq_t * );
- int (*set_eq)( const vidix_video_eq_t * );
- int (*get_deint)( vidix_deinterlace_t * );
- int (*set_deint)( const vidix_deinterlace_t * );
- int (*copy_frame)( const vidix_dma_t * );
- int (*get_gkey)( vidix_grkey_t * );
- int (*set_gkey)( const vidix_grkey_t * );
- int (*get_num_fx)( unsigned * );
- int (*get_fx)( vidix_oem_fx_t * );
- int (*set_fx)( const vidix_oem_fx_t * );
-} VDXDriver;
-
-typedef struct VDXContext {
- VDXDriver *drv;
- /* might be filled in by much more info later on */
-} VDXContext;
-
-typedef VDXContext * VDL_HANDLE;
-
- /* Opens corresponded video driver and returns handle
- of associated stream.
- path - specifies path where drivers are located.
- name - specifies prefered driver name (can be NULL).
- cap - specifies driver capability (TYPE_* constants).
- verbose - specifies verbose level
- returns !0 if ok else NULL.
- */
-VDL_HANDLE vdlOpen(const char *name,unsigned cap,int verbose);
- /* Closes stream and corresponded driver. */
-void vdlClose(VDL_HANDLE ctx);
-
- /* Queries driver capabilities. Return 0 if ok else errno */
-int vdlGetCapability(VDL_HANDLE, vidix_capability_t *);
-
- /* Queries support for given fourcc. Returns 0 if ok else errno */
-int vdlQueryFourcc(VDL_HANDLE,vidix_fourcc_t *);
-
- /* Returns 0 if ok else errno */
-int vdlConfigPlayback(VDL_HANDLE, vidix_playback_t *);
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackOn(VDL_HANDLE);
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackOff(VDL_HANDLE);
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackFrameSelect(VDL_HANDLE, unsigned frame_idx );
-
- /* Returns 0 if ok else errno */
-int vdlGetGrKeys(VDL_HANDLE, vidix_grkey_t * );
-
- /* Returns 0 if ok else errno */
-int vdlSetGrKeys(VDL_HANDLE, const vidix_grkey_t * );
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackGetEq(VDL_HANDLE, vidix_video_eq_t * );
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackSetEq(VDL_HANDLE, const vidix_video_eq_t * );
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackGetDeint(VDL_HANDLE, vidix_deinterlace_t * );
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackSetDeint(VDL_HANDLE, const vidix_deinterlace_t * );
-
- /* Returns 0 if ok else errno */
-int vdlQueryNumOemEffects(VDL_HANDLE, unsigned * number );
-
- /* Returns 0 if ok else errno */
-int vdlGetOemEffect(VDL_HANDLE, vidix_oem_fx_t * );
-
- /* Returns 0 if ok else errno */
-int vdlSetOemEffect(VDL_HANDLE, const vidix_oem_fx_t * );
-
-
- /* Returns 0 if ok else errno */
-int vdlPlaybackCopyFrame(VDL_HANDLE, const vidix_dma_t * );
-
-#endif /* MPLAYER_VIDIXLIB_H */