2 * VIDIX - VIDeo Interface for *niX.
3 * Copyright (C) 2002 Nick Kurshev
4 * Copyright (C) 2007 Benjamin Zores <ben@geexbox.org>
6 * This file is part of MPlayer.
8 * MPlayer is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * MPlayer is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with MPlayer; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 * This interface is introduced as universal one to MPEG decoder,
23 * Back End Scaler (BES) and YUV2RGB hw accelerators.
25 * In the future it may be expanded up to capturing and audio things.
26 * Main goal of this this interface imlpementation is providing DGA
27 * everywhere where it's possible (unlike X11 and other).
29 * This interface is based on v4l2, fbvid.h, mga_vid.h projects
30 * and personally my ideas.
32 * NOTE: This interface is introduces as driver interface.
35 #ifndef MPLAYER_VIDIXLIB_H
36 #define MPLAYER_VIDIXLIB_H
44 typedef struct VDXDriver
{
46 struct VDXDriver
*next
;
47 int (* probe
) (int verbose
, int force
);
48 int (* get_caps
) (vidix_capability_t
*cap
);
49 int (*query_fourcc
)(vidix_fourcc_t
*);
51 void (*destroy
)(void);
52 int (*config_playback
)(vidix_playback_t
*);
53 int (*playback_on
)( void );
54 int (*playback_off
)( void );
55 /* Functions below can be missed in driver ;) */
56 int (*frame_sel
)( unsigned frame_idx
);
57 int (*get_eq
)( vidix_video_eq_t
* );
58 int (*set_eq
)( const vidix_video_eq_t
* );
59 int (*get_deint
)( vidix_deinterlace_t
* );
60 int (*set_deint
)( const vidix_deinterlace_t
* );
61 int (*copy_frame
)( const vidix_dma_t
* );
62 int (*get_gkey
)( vidix_grkey_t
* );
63 int (*set_gkey
)( const vidix_grkey_t
* );
64 int (*get_num_fx
)( unsigned * );
65 int (*get_fx
)( vidix_oem_fx_t
* );
66 int (*set_fx
)( const vidix_oem_fx_t
* );
69 typedef struct VDXContext
{
71 /* might be filled in by much more info later on */
74 typedef VDXContext
* VDL_HANDLE
;
76 /* returns library version */
77 unsigned vdlGetVersion( void );
79 /* Opens corresponded video driver and returns handle
81 path - specifies path where drivers are located.
82 name - specifies prefered driver name (can be NULL).
83 cap - specifies driver capability (TYPE_* constants).
84 verbose - specifies verbose level
85 returns !0 if ok else NULL.
87 VDL_HANDLE
vdlOpen(const char *path
,const char *name
,unsigned cap
,int verbose
);
88 /* Closes stream and corresponded driver. */
89 void vdlClose(VDL_HANDLE ctx
);
91 /* Queries driver capabilities. Return 0 if ok else errno */
92 int vdlGetCapability(VDL_HANDLE
, vidix_capability_t
*);
94 /* Queries support for given fourcc. Returns 0 if ok else errno */
95 int vdlQueryFourcc(VDL_HANDLE
,vidix_fourcc_t
*);
97 /* Returns 0 if ok else errno */
98 int vdlConfigPlayback(VDL_HANDLE
, vidix_playback_t
*);
100 /* Returns 0 if ok else errno */
101 int vdlPlaybackOn(VDL_HANDLE
);
103 /* Returns 0 if ok else errno */
104 int vdlPlaybackOff(VDL_HANDLE
);
106 /* Returns 0 if ok else errno */
107 int vdlPlaybackFrameSelect(VDL_HANDLE
, unsigned frame_idx
);
109 /* Returns 0 if ok else errno */
110 int vdlGetGrKeys(VDL_HANDLE
, vidix_grkey_t
* );
112 /* Returns 0 if ok else errno */
113 int vdlSetGrKeys(VDL_HANDLE
, const vidix_grkey_t
* );
115 /* Returns 0 if ok else errno */
116 int vdlPlaybackGetEq(VDL_HANDLE
, vidix_video_eq_t
* );
118 /* Returns 0 if ok else errno */
119 int vdlPlaybackSetEq(VDL_HANDLE
, const vidix_video_eq_t
* );
121 /* Returns 0 if ok else errno */
122 int vdlPlaybackGetDeint(VDL_HANDLE
, vidix_deinterlace_t
* );
124 /* Returns 0 if ok else errno */
125 int vdlPlaybackSetDeint(VDL_HANDLE
, const vidix_deinterlace_t
* );
127 /* Returns 0 if ok else errno */
128 int vdlQueryNumOemEffects(VDL_HANDLE
, unsigned * number
);
130 /* Returns 0 if ok else errno */
131 int vdlGetOemEffect(VDL_HANDLE
, vidix_oem_fx_t
* );
133 /* Returns 0 if ok else errno */
134 int vdlSetOemEffect(VDL_HANDLE
, const vidix_oem_fx_t
* );
137 /* Returns 0 if ok else errno */
138 int vdlPlaybackCopyFrame(VDL_HANDLE
, const vidix_dma_t
* );
144 #endif /* MPLAYER_VIDIXLIB_H */