line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Win32::Videos; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
78986890
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
67
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
82
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
756
|
use FusionInventory::Agent::Tools::Win32; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
323
|
|
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
|
|
|
|
|
|
|
my $video = { |
30
|
|
|
|
|
|
|
CHIPSET => $object->{VideoProcessor}, |
31
|
|
|
|
|
|
|
MEMORY => $object->{AdaptaterRAM}, |
32
|
|
|
|
|
|
|
NAME => $object->{Name}, |
33
|
0
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
if ($object->{CurrentHorizontalResolution}) { |
36
|
|
|
|
|
|
|
$video->{RESOLUTION} = |
37
|
|
|
|
|
|
|
$object->{CurrentHorizontalResolution} . |
38
|
|
|
|
|
|
|
"x" . |
39
|
0
|
|
|
|
|
|
$object->{CurrentVerticalResolution}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
$video->{MEMORY} = int($video->{MEMORY} / (1024 * 1024)) |
43
|
0
|
0
|
|
|
|
|
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; |