annotate vidix/vidixlib.h @ 22865:441582f3ed87

simplified function prototypes to avoid casts but keep external API compatibility
author ben
date Sun, 01 Apr 2007 12:39:06 +0000
parents b9f09be55449
children d74001dbe2a6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
1 /*
dcc632dd2097 preliminary version
nick
parents:
diff changeset
2 * vidixlib.h
dcc632dd2097 preliminary version
nick
parents:
diff changeset
3 * VIDIXLib - Library for VIDeo Interface for *niX
dcc632dd2097 preliminary version
nick
parents:
diff changeset
4 * This interface is introduced as universal one to MPEG decoder,
dcc632dd2097 preliminary version
nick
parents:
diff changeset
5 * BES == Back End Scaler and YUV2RGB hw accelerators.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
6 * In the future it may be expanded up to capturing and audio things.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
7 * Main goal of this this interface imlpementation is providing DGA
dcc632dd2097 preliminary version
nick
parents:
diff changeset
8 * everywhere where it's possible (unlike X11 and other).
dcc632dd2097 preliminary version
nick
parents:
diff changeset
9 * Copyright 2002 Nick Kurshev
dcc632dd2097 preliminary version
nick
parents:
diff changeset
10 * Licence: GPL
dcc632dd2097 preliminary version
nick
parents:
diff changeset
11 * This interface is based on v4l2, fbvid.h, mga_vid.h projects
dcc632dd2097 preliminary version
nick
parents:
diff changeset
12 * and personally my ideas.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
13 * NOTE: This interface is introduces as APP interface.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
14 * Don't use it for driver.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
15 * It provides multistreaming. This mean that APP can handle
dcc632dd2097 preliminary version
nick
parents:
diff changeset
16 * several streams simultaneously. (Example: Video capturing and video
dcc632dd2097 preliminary version
nick
parents:
diff changeset
17 * playback or capturing, video playback, audio encoding and so on).
dcc632dd2097 preliminary version
nick
parents:
diff changeset
18 */
dcc632dd2097 preliminary version
nick
parents:
diff changeset
19 #ifndef VIDIXLIB_H
dcc632dd2097 preliminary version
nick
parents:
diff changeset
20 #define VIDIXLIB_H
dcc632dd2097 preliminary version
nick
parents:
diff changeset
21
dcc632dd2097 preliminary version
nick
parents:
diff changeset
22 #ifdef __cplusplus
dcc632dd2097 preliminary version
nick
parents:
diff changeset
23 extern "C" {
dcc632dd2097 preliminary version
nick
parents:
diff changeset
24 #endif
dcc632dd2097 preliminary version
nick
parents:
diff changeset
25
dcc632dd2097 preliminary version
nick
parents:
diff changeset
26 #include "vidix.h"
dcc632dd2097 preliminary version
nick
parents:
diff changeset
27
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
28 typedef struct VDXDriver {
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
29 const char *name;
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
30 struct VDXDriver *next;
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
31 int (* probe) (int verbose, int force);
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
32 int (* get_caps) (vidix_capability_t *cap);
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
33 int (*query_fourcc)(vidix_fourcc_t *);
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
34 int (*init)(void);
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
35 void (*destroy)(void);
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
36 int (*config_playback)(vidix_playback_t *);
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
37 int (*playback_on)( void );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
38 int (*playback_off)( void );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
39 /* Functions below can be missed in driver ;) */
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
40 int (*frame_sel)( unsigned frame_idx );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
41 int (*get_eq)( vidix_video_eq_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
42 int (*set_eq)( const vidix_video_eq_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
43 int (*get_deint)( vidix_deinterlace_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
44 int (*set_deint)( const vidix_deinterlace_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
45 int (*copy_frame)( const vidix_dma_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
46 int (*get_gkey)( vidix_grkey_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
47 int (*set_gkey)( const vidix_grkey_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
48 int (*get_num_fx)( unsigned * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
49 int (*get_fx)( vidix_oem_fx_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
50 int (*set_fx)( const vidix_oem_fx_t * );
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
51 } VDXDriver;
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
52
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
53 typedef struct VDXContext {
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
54 VDXDriver *drv;
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
55 /* might be filled in by much more info later on */
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
56 } VDXContext;
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 4191
diff changeset
57
22865
441582f3ed87 simplified function prototypes to avoid casts but keep external API compatibility
ben
parents: 22862
diff changeset
58 typedef VDXContext * VDL_HANDLE;
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
59
dcc632dd2097 preliminary version
nick
parents:
diff changeset
60 /* returns library version */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
61 unsigned vdlGetVersion( void );
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
62
dcc632dd2097 preliminary version
nick
parents:
diff changeset
63 /* Opens corresponded video driver and returns handle
dcc632dd2097 preliminary version
nick
parents:
diff changeset
64 of associated stream.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
65 path - specifies path where drivers are located.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
66 name - specifies prefered driver name (can be NULL).
dcc632dd2097 preliminary version
nick
parents:
diff changeset
67 cap - specifies driver capability (TYPE_* constants).
3995
0d9de811e312 minor interface changing
nick
parents: 3991
diff changeset
68 verbose - specifies verbose level
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
69 returns !0 if ok else NULL.
dcc632dd2097 preliminary version
nick
parents:
diff changeset
70 */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
71 VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose);
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
72 /* Closes stream and corresponded driver. */
22865
441582f3ed87 simplified function prototypes to avoid casts but keep external API compatibility
ben
parents: 22862
diff changeset
73 void vdlClose(VDL_HANDLE ctx);
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
74
dcc632dd2097 preliminary version
nick
parents:
diff changeset
75 /* Queries driver capabilities. Return 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
76 int vdlGetCapability(VDL_HANDLE, vidix_capability_t *);
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
77
dcc632dd2097 preliminary version
nick
parents:
diff changeset
78 /* Queries support for given fourcc. Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
79 int vdlQueryFourcc(VDL_HANDLE,vidix_fourcc_t *);
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
80
dcc632dd2097 preliminary version
nick
parents:
diff changeset
81 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
82 int vdlConfigPlayback(VDL_HANDLE, vidix_playback_t *);
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
83
dcc632dd2097 preliminary version
nick
parents:
diff changeset
84 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
85 int vdlPlaybackOn(VDL_HANDLE);
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
86
dcc632dd2097 preliminary version
nick
parents:
diff changeset
87 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
88 int vdlPlaybackOff(VDL_HANDLE);
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
89
dcc632dd2097 preliminary version
nick
parents:
diff changeset
90 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
91 int vdlPlaybackFrameSelect(VDL_HANDLE, unsigned frame_idx );
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
92
dcc632dd2097 preliminary version
nick
parents:
diff changeset
93 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
94 int vdlGetGrKeys(VDL_HANDLE, vidix_grkey_t * );
4070
b61ba6c256dd Minor interface changes: color and video keys are moved out from playback configuring
nick
parents: 3995
diff changeset
95
b61ba6c256dd Minor interface changes: color and video keys are moved out from playback configuring
nick
parents: 3995
diff changeset
96 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
97 int vdlSetGrKeys(VDL_HANDLE, const vidix_grkey_t * );
4070
b61ba6c256dd Minor interface changes: color and video keys are moved out from playback configuring
nick
parents: 3995
diff changeset
98
b61ba6c256dd Minor interface changes: color and video keys are moved out from playback configuring
nick
parents: 3995
diff changeset
99 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
100 int vdlPlaybackGetEq(VDL_HANDLE, vidix_video_eq_t * );
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
101
dcc632dd2097 preliminary version
nick
parents:
diff changeset
102 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
103 int vdlPlaybackSetEq(VDL_HANDLE, const vidix_video_eq_t * );
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
104
dcc632dd2097 preliminary version
nick
parents:
diff changeset
105 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
106 int vdlPlaybackGetDeint(VDL_HANDLE, vidix_deinterlace_t * );
4191
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
107
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
108 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
109 int vdlPlaybackSetDeint(VDL_HANDLE, const vidix_deinterlace_t * );
4191
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
110
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
111 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
112 int vdlQueryNumOemEffects(VDL_HANDLE, unsigned * number );
4191
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
113
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
114 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
115 int vdlGetOemEffect(VDL_HANDLE, vidix_oem_fx_t * );
4191
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
116
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
117 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
118 int vdlSetOemEffect(VDL_HANDLE, const vidix_oem_fx_t * );
4191
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
119
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
120
62a6135d090e + new features and possibility
nick
parents: 4070
diff changeset
121 /* Returns 0 if ok else errno */
22862
b9f09be55449 useless externs
ben
parents: 22858
diff changeset
122 int vdlPlaybackCopyFrame(VDL_HANDLE, const vidix_dma_t * );
3991
dcc632dd2097 preliminary version
nick
parents:
diff changeset
123
dcc632dd2097 preliminary version
nick
parents:
diff changeset
124 #ifdef __cplusplus
dcc632dd2097 preliminary version
nick
parents:
diff changeset
125 }
dcc632dd2097 preliminary version
nick
parents:
diff changeset
126 #endif
dcc632dd2097 preliminary version
nick
parents:
diff changeset
127
dcc632dd2097 preliminary version
nick
parents:
diff changeset
128 #endif