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