line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Win32::Videos; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
58669646
|
use strict; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
68
|
|
4
|
1
|
|
|
1
|
|
11
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
63
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
414
|
use FusionInventory::Agent::Tools::Win32; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
227
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $seen; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub isEnabled { |
11
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
12
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{video}; |
13
|
0
|
|
|
|
|
|
return 1; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub doInventory { |
17
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
foreach my $object (getWMIObjects( |
22
|
|
|
|
|
|
|
class => 'Win32_VideoController', |
23
|
|
|
|
|
|
|
properties => [ qw/ |
24
|
|
|
|
|
|
|
CurrentHorizontalResolution CurrentVerticalResolution VideoProcessor |
25
|
|
|
|
|
|
|
AdaptaterRAM Name |
26
|
|
|
|
|
|
|
/ ] |
27
|
|
|
|
|
|
|
)) { |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $video = { |
30
|
|
|
|
|
|
|
CHIPSET => $object->{VideoProcessor}, |
31
|
|
|
|
|
|
|
MEMORY => $object->{AdaptaterRAM}, |
32
|
|
|
|
|
|
|
NAME => $object->{Name}, |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
if ($object->{CurrentHorizontalResolution}) { |
36
|
0
|
|
|
|
|
|
$video->{RESOLUTION} = |
37
|
|
|
|
|
|
|
$object->{CurrentHorizontalResolution} . |
38
|
|
|
|
|
|
|
"x" . |
39
|
|
|
|
|
|
|
$object->{CurrentVerticalResolution}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
$video->{MEMORY} = int($video->{MEMORY} / (1024 * 1024)) |
43
|
|
|
|
|
|
|
if $video->{MEMORY}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# avoid duplicates |
46
|
0
|
0
|
|
|
|
|
next if $seen->{$video->{NAME}}++; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$inventory->addEntry( |
49
|
|
|
|
|
|
|
section => 'VIDEOS', |
50
|
|
|
|
|
|
|
entry => $video |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |