Statistics
| Branch: | Tag: | Revision:

root / tools / perl / lib / FusionInventory / Agent / Task / Inventory / OS / Win32 / Video.pm @ fa47cac2

History | View | Annotate | Download (1.1 kB)

1
package FusionInventory::Agent::Task::Inventory::OS::Win32::Video;
2

    
3
use strict;
4
use warnings;
5

    
6
use FusionInventory::Agent::Task::Inventory::OS::Win32;
7

    
8
sub isInventoryEnabled {
9
    return 1;
10
}
11

    
12
sub doInventory {
13
    my $params = shift;
14
    my $inventory = $params->{inventory};
15

    
16

    
17
    foreach my $Properties (getWmiProperties('Win32_VideoController', qw/
18
        CurrentHorizontalResolution CurrentVerticalResolution VideoProcessor
19
        AdaptaterRAM Name
20
    /)) {
21

    
22
        my $resolution;
23
        if ($Properties->{CurrentHorizontalResolution}) {
24
            $resolution =
25
                $Properties->{CurrentHorizontalResolution} .
26
                "x" .
27
                $Properties->{CurrentVerticalResolution};
28
        }
29

    
30
        my $memory;
31
        if ($Properties->{AdaptaterRAM}) {
32
            $memory = int($Properties->{AdaptaterRAM} / (1024*1024));
33
        }
34

    
35
        $inventory->addVideo({
36
            CHIPSET    => $Properties->{VideoProcessor},
37
            MEMORY     => $memory,
38
            NAME       => $Properties->{Name},
39
            RESOLUTION => $resolution
40
        });
41
    }
42
}
43

    
44
1;