annotate vidix/pci_names.c @ 30109:0f25d3062987

First steps to supporting different YUV->RGB conversion definitions. The numbers are possibly still wrong though.
author reimar
date Thu, 31 Dec 2009 19:59:58 +0000
parents fb44c9cb05fa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30052
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
1 /*
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
2 * VIDIX - VIDeo Interface for *niX.
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
3 *
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
4 * This file is part of MPlayer.
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
5 *
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
6 * MPlayer is free software; you can redistribute it and/or modify
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
9 * (at your option) any later version.
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
10 *
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
11 * MPlayer is distributed in the hope that it will be useful,
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
14 * GNU General Public License for more details.
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
15 *
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License along
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
19 */
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
20
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
21 #include <stddef.h>
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
22 #include "pci_names.h"
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
23 #include "pci_vendor_ids.h"
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
24
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
25 const char *pci_vendor_name(unsigned short id)
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
26 {
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
27 unsigned i;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
28 for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
29 if (vendor_ids[i].id == id)
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
30 return vendor_ids[i].name;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
31 }
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
32 return NULL;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
33 }
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
34
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
35 const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
36 {
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
37 unsigned i, j;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
38 for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
39 if (vendor_ids[i].id == vendor_id) {
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
40 j = 0;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
41 while (vendor_ids[i].dev_list[j].id != 0xFFFF) {
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
42 if (vendor_ids[i].dev_list[j].id == device_id)
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
43 return vendor_ids[i].dev_list[j].name;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
44 j++;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
45 };
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
46 break;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
47 }
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
48 }
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
49 return NULL;
fb44c9cb05fa Do not auto-generate the C code to handle PCI vendor and device names.
diego
parents:
diff changeset
50 }