annotate vidix/drivers.c @ 37107:3c5c93a30fb7

vidix: Replace printf with mp_msg - Make MPlayer more quiet when requested (e.g. when using -really-quiet) - Additionally change some minor capitalization and "bla:" to "[bla]" Patch-by: Arne Bochem >arneb.mp ccan de< Patch-also-OKed-by: Reimar
author al
date Sat, 17 May 2014 01:38:00 +0000
parents ddab7b946042
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22902
d74001dbe2a6 missing headers in vidix drivers registry files
ben
parents: 22878
diff changeset
1 /*
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
2 * VIDIX Drivers Registry Handler.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
3 * Copyright (C) 2007 Benjamin Zores <ben@geexbox.org>
22902
d74001dbe2a6 missing headers in vidix drivers registry files
ben
parents: 22878
diff changeset
4 *
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
5 * This file is part of MPlayer.
22902
d74001dbe2a6 missing headers in vidix drivers registry files
ben
parents: 22878
diff changeset
6 *
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
7 * MPlayer is free software; you can redistribute it and/or modify
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
8 * it under the terms of the GNU General Public License as published by
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
10 * (at your option) any later version.
22902
d74001dbe2a6 missing headers in vidix drivers registry files
ben
parents: 22878
diff changeset
11 *
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
12 * MPlayer is distributed in the hope that it will be useful,
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
15 * GNU General Public License for more details.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22974
diff changeset
16 *
26719
3abd1629658b Use standard license headers.
diego
parents: 26203
diff changeset
17 * You should have received a copy of the GNU General Public License along
3abd1629658b Use standard license headers.
diego
parents: 26203
diff changeset
18 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
3abd1629658b Use standard license headers.
diego
parents: 26203
diff changeset
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22902
d74001dbe2a6 missing headers in vidix drivers registry files
ben
parents: 22878
diff changeset
20 */
d74001dbe2a6 missing headers in vidix drivers registry files
ben
parents: 22878
diff changeset
21
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:
diff changeset
22 #include <stdlib.h>
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:
diff changeset
23 #include <stdio.h>
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:
diff changeset
24 #include <errno.h>
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:
diff changeset
25 #include <string.h>
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:
diff changeset
26
26203
0d255d03016f #include config.h before all other headers.
diego
parents: 26096
diff changeset
27 #include "config.h"
27079
df448e1248b2 remove now useless vidixlib.h file
ben
parents: 26719
diff changeset
28 #include "vidix.h"
30550
ddab7b946042 VIDIX: #include drivers.h in drivers.c.
diego
parents: 29263
diff changeset
29 #include "drivers.h"
22905
f34e5d778267 consistent include paths for config.h et al.
diego
parents: 22902
diff changeset
30 #include "libavutil/common.h"
f34e5d778267 consistent include paths for config.h et al.
diego
parents: 22902
diff changeset
31 #include "mpbswap.h"
37107
3c5c93a30fb7 vidix: Replace printf with mp_msg
al
parents: 30550
diff changeset
32 #include "mp_msg.h"
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
33 #include "config.h"
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:
diff changeset
34
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:
diff changeset
35 VDXDriver *first_driver = NULL;
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:
diff changeset
36
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:
diff changeset
37 extern VDXDriver cyberblade_drv;
23275
17fcd644f32e new VIDIX driver for IVTV cards, original patch by Lutz Koschorreck
ben
parents: 23046
diff changeset
38 extern VDXDriver ivtv_drv;
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:
diff changeset
39 extern VDXDriver mach64_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:
diff changeset
40 extern VDXDriver mga_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:
diff changeset
41 extern VDXDriver mga_crtc2_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:
diff changeset
42 extern VDXDriver nvidia_drv;
22974
30341a2c2179 added vidix driver for Permedia2 cards from upstream vidix
ben
parents: 22973
diff changeset
43 extern VDXDriver pm2_drv;
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:
diff changeset
44 extern VDXDriver pm3_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:
diff changeset
45 extern VDXDriver radeon_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:
diff changeset
46 extern VDXDriver rage128_drv;
26096
e6a565ec1a3b New S3 VIDIX driver.
ben
parents: 23275
diff changeset
47 extern VDXDriver s3_drv;
27420
917c93c652b0 Add VIDIX driver for SuperH Mobile VEU hardware block.
ben
parents: 27079
diff changeset
48 extern VDXDriver sh_veu_drv;
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:
diff changeset
49 extern VDXDriver sis_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:
diff changeset
50 extern VDXDriver unichrome_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:
diff changeset
51
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:
diff changeset
52 static void vidix_register_driver (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:
diff changeset
53 {
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:
diff changeset
54 VDXDriver **d;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27420
diff changeset
55
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:
diff changeset
56 d = &first_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:
diff changeset
57 while (*d != NULL)
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:
diff changeset
58 d = &(*d)->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:
diff changeset
59 *d = 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:
diff changeset
60 drv->next = NULL;
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:
diff changeset
61 }
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:
diff changeset
62
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:
diff changeset
63 void vidix_register_all_drivers (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:
diff changeset
64 {
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
65 #ifdef CONFIG_VIDIX_DRV_CYBERBLADE
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:
diff changeset
66 vidix_register_driver (&cyberblade_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
67 #endif
23275
17fcd644f32e new VIDIX driver for IVTV cards, original patch by Lutz Koschorreck
ben
parents: 23046
diff changeset
68 #ifdef CONFIG_VIDIX_DRV_IVTV
17fcd644f32e new VIDIX driver for IVTV cards, original patch by Lutz Koschorreck
ben
parents: 23046
diff changeset
69 vidix_register_driver (&ivtv_drv);
17fcd644f32e new VIDIX driver for IVTV cards, original patch by Lutz Koschorreck
ben
parents: 23046
diff changeset
70 #endif
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
71 #ifdef CONFIG_VIDIX_DRV_MACH64
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:
diff changeset
72 vidix_register_driver (&mach64_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
73 #endif
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
74 #ifdef CONFIG_VIDIX_DRV_MGA
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:
diff changeset
75 vidix_register_driver (&mga_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
76 #endif
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
77 #ifdef CONFIG_VIDIX_DRV_MGA_CRTC2
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:
diff changeset
78 vidix_register_driver (&mga_crtc2_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
79 #endif
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
80 #ifdef CONFIG_VIDIX_DRV_NVIDIA
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:
diff changeset
81 vidix_register_driver (&nvidia_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
82 #endif
22974
30341a2c2179 added vidix driver for Permedia2 cards from upstream vidix
ben
parents: 22973
diff changeset
83 #ifdef CONFIG_VIDIX_DRV_PM2
30341a2c2179 added vidix driver for Permedia2 cards from upstream vidix
ben
parents: 22973
diff changeset
84 vidix_register_driver (&pm2_drv);
30341a2c2179 added vidix driver for Permedia2 cards from upstream vidix
ben
parents: 22973
diff changeset
85 #endif
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
86 #ifdef CONFIG_VIDIX_DRV_PM3
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:
diff changeset
87 vidix_register_driver (&pm3_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
88 #endif
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
89 #ifdef CONFIG_VIDIX_DRV_RADEON
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:
diff changeset
90 vidix_register_driver (&radeon_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
91 #endif
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
92 #ifdef CONFIG_VIDIX_DRV_RAGE128
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:
diff changeset
93 vidix_register_driver (&rage128_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
94 #endif
26096
e6a565ec1a3b New S3 VIDIX driver.
ben
parents: 23275
diff changeset
95 #ifdef CONFIG_VIDIX_DRV_S3
e6a565ec1a3b New S3 VIDIX driver.
ben
parents: 23275
diff changeset
96 vidix_register_driver (&s3_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
97 #endif
27420
917c93c652b0 Add VIDIX driver for SuperH Mobile VEU hardware block.
ben
parents: 27079
diff changeset
98 #ifdef CONFIG_VIDIX_DRV_SH_VEU
917c93c652b0 Add VIDIX driver for SuperH Mobile VEU hardware block.
ben
parents: 27079
diff changeset
99 vidix_register_driver (&sh_veu_drv);
917c93c652b0 Add VIDIX driver for SuperH Mobile VEU hardware block.
ben
parents: 27079
diff changeset
100 #endif
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
101 #ifdef CONFIG_VIDIX_DRV_SIS
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:
diff changeset
102 vidix_register_driver (&sis_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
103 #endif
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
104 #ifdef CONFIG_VIDIX_DRV_UNICHROME
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:
diff changeset
105 vidix_register_driver (&unichrome_drv);
22973
46597c69d843 added conditional vidix drivers compilation
ben
parents: 22905
diff changeset
106 #endif
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:
diff changeset
107 }
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:
diff changeset
108
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:
diff changeset
109 static int vidix_probe_driver (VDXContext *ctx, 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:
diff changeset
110 unsigned int cap, int verbose)
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:
diff changeset
111 {
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:
diff changeset
112 vidix_capability_t vid_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:
diff changeset
113
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:
diff changeset
114 if (verbose)
37107
3c5c93a30fb7 vidix: Replace printf with mp_msg
al
parents: 30550
diff changeset
115 mp_msg(MSGT_VO, MSGL_STATUS, "[vidixlib] PROBING: %s\n", drv->name);
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:
diff changeset
116
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:
diff changeset
117 if (!drv->probe || drv->probe (verbose, PROBE_NORMAL) != 0)
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:
diff changeset
118 return 0;
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:
diff changeset
119
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:
diff changeset
120 if (!drv->get_caps || drv->get_caps (&vid_cap) != 0)
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:
diff changeset
121 return 0;
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:
diff changeset
122
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:
diff changeset
123 if ((vid_cap.type & cap) != 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:
diff changeset
124 {
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:
diff changeset
125 if (verbose)
37107
3c5c93a30fb7 vidix: Replace printf with mp_msg
al
parents: 30550
diff changeset
126 mp_msg(MSGT_VO, MSGL_STATUS, "[vidixlib] Found %s but has no required capability\n",
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:
diff changeset
127 drv->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:
diff changeset
128 return 0;
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:
diff changeset
129 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27420
diff changeset
130
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:
diff changeset
131 if (verbose)
37107
3c5c93a30fb7 vidix: Replace printf with mp_msg
al
parents: 30550
diff changeset
132 mp_msg(MSGT_VO, MSGL_STATUS, "[vidixlib] %s probed o'k\n", drv->name);
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:
diff changeset
133
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:
diff changeset
134 ctx->drv = 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:
diff changeset
135 return 1;
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:
diff changeset
136 }
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:
diff changeset
137
22873
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
138 static void vidix_list_drivers (void)
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
139 {
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
140 VDXDriver *drv;
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
141
37107
3c5c93a30fb7 vidix: Replace printf with mp_msg
al
parents: 30550
diff changeset
142 mp_msg(MSGT_VO, MSGL_STATUS, "[vidixlib] Available VIDIX drivers:\n");
22873
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
143
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
144 drv = first_driver;
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
145 while (drv)
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
146 {
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
147 vidix_capability_t cap;
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
148 drv->get_caps (&cap);
37107
3c5c93a30fb7 vidix: Replace printf with mp_msg
al
parents: 30550
diff changeset
149 mp_msg(MSGT_VO, MSGL_STATUS, "[vidixlib] * %s - %s\n", drv->name, cap.name);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27420
diff changeset
150 drv = drv->next;
22873
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
151 }
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
152 }
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
153
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:
diff changeset
154 int vidix_find_driver (VDXContext *ctx, 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:
diff changeset
155 unsigned int cap, int verbose)
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:
diff changeset
156 {
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:
diff changeset
157 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:
diff changeset
158
22878
e0749444591f segfaults if name is NULL
ben
parents: 22873
diff changeset
159 if (name && !strcmp (name, "help"))
22873
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
160 {
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
161 vidix_list_drivers ();
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
162 ctx->drv = NULL;
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
163 return 0;
030428ba5bb3 allow passing :help to -vo [cx]vidix to get list of all compiled in vidix drivers
ben
parents: 22858
diff changeset
164 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27420
diff changeset
165
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:
diff changeset
166 drv = first_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:
diff changeset
167 while (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:
diff changeset
168 {
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:
diff changeset
169 if (name) /* forced 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:
diff changeset
170 {
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:
diff changeset
171 if (!strcmp (drv->name, 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:
diff changeset
172 {
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:
diff changeset
173 if (vidix_probe_driver (ctx, drv, cap, verbose))
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:
diff changeset
174 return 1;
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:
diff changeset
175 else
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:
diff changeset
176 {
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:
diff changeset
177 ctx->drv = NULL;
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:
diff changeset
178 return 0;
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:
diff changeset
179 }
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:
diff changeset
180 }
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:
diff changeset
181 }
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:
diff changeset
182 else /* auto-probe */
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:
diff changeset
183 {
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:
diff changeset
184 if (vidix_probe_driver (ctx, drv, cap, verbose))
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:
diff changeset
185 return 1;
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:
diff changeset
186 }
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:
diff changeset
187 drv = drv->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:
diff changeset
188 }
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:
diff changeset
189
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:
diff changeset
190 if (verbose)
37107
3c5c93a30fb7 vidix: Replace printf with mp_msg
al
parents: 30550
diff changeset
191 mp_msg(MSGT_VO, MSGL_STATUS, "[vidixlib] No suitable driver can be found.\n");
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:
diff changeset
192 ctx->drv = NULL;
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:
diff changeset
193 return 0;
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:
diff changeset
194 }