line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::MacOS::Videos; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
89680751
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
95
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
109
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1273
|
use FusionInventory::Agent::Tools; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
429
|
|
7
|
2
|
|
|
2
|
|
1225
|
use FusionInventory::Agent::Tools::MacOS; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
983
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
0
|
return 0 if $params{no_category}->{video}; |
12
|
0
|
|
|
|
|
0
|
return canRun('/usr/sbin/system_profiler'); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
0
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
0
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
my %displays = _getDisplays(logger => $logger); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
foreach my $monitor (@{$displays{MONITORS}}) { |
|
0
|
|
|
|
|
0
|
|
24
|
0
|
|
|
|
|
0
|
$inventory->addEntry( |
25
|
|
|
|
|
|
|
section => 'MONITORS', |
26
|
|
|
|
|
|
|
entry => $monitor, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
foreach my $video (@{$displays{VIDEOS}}) { |
|
0
|
|
|
|
|
0
|
|
31
|
0
|
|
|
|
|
0
|
$inventory->addEntry( |
32
|
|
|
|
|
|
|
section => 'VIDEOS', |
33
|
|
|
|
|
|
|
entry => $video, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _getDisplays { |
39
|
1
|
|
|
1
|
|
199
|
my (%params) = @_; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $infos = getSystemProfilerInfos( |
42
|
|
|
|
|
|
|
type => 'SPDisplaysDataType', |
43
|
|
|
|
|
|
|
logger => $params{logger}, |
44
|
|
|
|
|
|
|
file => $params{file} |
45
|
1
|
|
|
|
|
29
|
); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
12
|
my @monitors; |
48
|
|
|
|
|
|
|
my @videos; |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
2
|
foreach my $videoName (keys %{$infos->{'Graphics/Displays'}}) { |
|
1
|
|
|
|
|
4
|
|
51
|
1
|
|
|
|
|
2
|
my $videoCardInfo = $infos->{'Graphics/Displays'}->{$videoName}; |
52
|
1
|
|
|
|
|
2
|
foreach my $displayName (keys %{$videoCardInfo->{Displays}}) { |
|
1
|
|
|
|
|
3
|
|
53
|
3
|
100
|
|
|
|
9
|
next if $displayName eq 'Display Connector'; |
54
|
2
|
50
|
|
|
|
6
|
next if $displayName eq 'Display'; |
55
|
2
|
|
|
|
|
3
|
my $displayInfo = $videoCardInfo->{Displays}->{$displayName}; |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
|
|
4
|
my $resolution = $displayInfo->{Resolution}; |
58
|
2
|
50
|
|
|
|
5
|
if ($resolution) { |
59
|
2
|
|
|
|
|
8
|
$resolution =~ s/\ //g; |
60
|
2
|
|
|
|
|
8
|
$resolution =~ s/\@.*//g; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
|
|
3
|
my $memory = $videoCardInfo->{'VRAM (Total)'}; |
64
|
2
|
50
|
|
|
|
8
|
$memory =~ s/\ .*//g if $memory; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
push @videos, { |
67
|
|
|
|
|
|
|
CHIPSET => $videoCardInfo->{'Chipset Model'}, |
68
|
|
|
|
|
|
|
MEMORY => $memory, |
69
|
|
|
|
|
|
|
NAME => $videoName, |
70
|
|
|
|
|
|
|
RESOLUTION => $resolution, |
71
|
|
|
|
|
|
|
PCISLOT => $videoCardInfo->{Slot} |
72
|
2
|
|
|
|
|
9
|
}; |
73
|
|
|
|
|
|
|
|
74
|
2
|
|
|
|
|
8
|
push @monitors, { |
75
|
|
|
|
|
|
|
CAPTION => $displayName, |
76
|
|
|
|
|
|
|
DESCRIPTION => $displayName, |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
return ( |
82
|
1
|
|
|
|
|
6
|
MONITORS => \@monitors, |
83
|
|
|
|
|
|
|
VIDEOS => \@videos |
84
|
|
|
|
|
|
|
); |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |