Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
315
Issues
315
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLC-Android
Commits
797f094a
Commit
797f094a
authored
Jun 20, 2016
by
Geoffrey Métais
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not exit hasCompatibleCPU to early
parent
0f135d64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
38 deletions
+19
-38
libvlc/src/org/videolan/libvlc/util/VLCUtil.java
libvlc/src/org/videolan/libvlc/util/VLCUtil.java
+19
-38
No files found.
libvlc/src/org/videolan/libvlc/util/VLCUtil.java
View file @
797f094a
...
@@ -132,29 +132,27 @@ public class VLCUtil {
...
@@ -132,29 +132,27 @@ public class VLCUtil {
br
=
new
BufferedReader
(
fileReader
);
br
=
new
BufferedReader
(
fileReader
);
String
line
;
String
line
;
while
((
line
=
br
.
readLine
())
!=
null
)
{
while
((
line
=
br
.
readLine
())
!=
null
)
{
if
(
!
hasArmV7
&&
line
.
contains
(
"AArch64"
))
{
if
(
line
.
contains
(
"AArch64"
))
{
hasArmV7
=
true
;
hasArmV7
=
true
;
hasArmV6
=
true
;
/* Armv8 is backwards compatible to < v7 */
hasArmV6
=
true
;
/* Armv8 is backwards compatible to < v7 */
}
}
else
if
(
line
.
contains
(
"ARMv7"
))
{
if
(!
hasArmV7
&&
line
.
contains
(
"ARMv7"
))
{
hasArmV7
=
true
;
hasArmV7
=
true
;
hasArmV6
=
true
;
/* Armv7 is backwards compatible to < v6 */
hasArmV6
=
true
;
/* Armv7 is backwards compatible to < v6 */
}
}
else
if
(
line
.
contains
(
"ARMv6"
))
if
(!
hasArmV7
&&
!
hasArmV6
&&
line
.
contains
(
"ARMv6"
))
hasArmV6
=
true
;
hasArmV6
=
true
;
// "clflush size" is a x86-specific cpuinfo tag.
// "clflush size" is a x86-specific cpuinfo tag.
// (see kernel sources arch/x86/kernel/cpu/proc.c)
// (see kernel sources arch/x86/kernel/cpu/proc.c)
if
(
line
.
contains
(
"clflush size"
))
else
if
(
line
.
contains
(
"clflush size"
))
hasX86
=
true
;
hasX86
=
true
;
if
(
line
.
contains
(
"GenuineIntel"
))
else
if
(
line
.
contains
(
"GenuineIntel"
))
hasX86
=
true
;
hasX86
=
true
;
// "microsecond timers" is specific to MIPS.
// "microsecond timers" is specific to MIPS.
// see arch/mips/kernel/proc.c
// see arch/mips/kernel/proc.c
if
(
line
.
contains
(
"microsecond timers"
))
else
if
(
line
.
contains
(
"microsecond timers"
))
hasMips
=
true
;
hasMips
=
true
;
if
(
!
hasNeon
&&
(
line
.
contains
(
"neon"
)
||
line
.
contains
(
"asimd"
)
))
if
(
line
.
contains
(
"neon"
)
||
line
.
contains
(
"asimd"
))
hasNeon
=
true
;
hasNeon
=
true
;
if
(
!
hasFpu
&&
(
line
.
contains
(
"vfp"
)
||
(
line
.
contains
(
"Features"
)
&&
line
.
contains
(
"fp"
)
)))
if
(
line
.
contains
(
"vfp"
)
||
(
line
.
contains
(
"Features"
)
&&
line
.
contains
(
"fp"
)))
hasFpu
=
true
;
hasFpu
=
true
;
if
(
line
.
startsWith
(
"processor"
))
if
(
line
.
startsWith
(
"processor"
))
processors
++;
processors
++;
...
@@ -168,23 +166,18 @@ public class VLCUtil {
...
@@ -168,23 +166,18 @@ public class VLCUtil {
}
}
}
}
}
catch
(
IOException
ex
)
{
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
errorMsg
=
"IOException whilst reading cpuinfo flags"
;
errorMsg
=
"IOException whilst reading cpuinfo flags"
;
Log
.
e
(
TAG
,
errorMsg
,
ex
);
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
finally
{
}
finally
{
if
(
br
!=
null
)
{
if
(
br
!=
null
)
try
{
try
{
br
.
close
();
br
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{}
}
if
(
fileReader
!=
null
)
}
if
(
fileReader
!=
null
)
{
try
{
try
{
fileReader
.
close
();
fileReader
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{}
}
}
}
}
if
(
processors
==
0
)
if
(
processors
==
0
)
processors
=
1
;
// possibly borked cpuinfo?
processors
=
1
;
// possibly borked cpuinfo?
...
@@ -193,37 +186,30 @@ public class VLCUtil {
...
@@ -193,37 +186,30 @@ public class VLCUtil {
if
(
elfHasX86
&&
!
hasX86
)
{
if
(
elfHasX86
&&
!
hasX86
)
{
errorMsg
=
"x86 build on non-x86 device"
;
errorMsg
=
"x86 build on non-x86 device"
;
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
else
if
(
elfHasArm
&&
!
hasArmV6
)
{
}
else
if
(
elfHasArm
&&
!
hasArmV6
)
{
errorMsg
=
"ARM build on non ARM device"
;
errorMsg
=
"ARM build on non ARM device"
;
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
}
if
(
elfHasMips
&&
!
hasMips
)
{
if
(
elfHasMips
&&
!
hasMips
)
{
errorMsg
=
"MIPS build on non-MIPS device"
;
errorMsg
=
"MIPS build on non-MIPS device"
;
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
else
if
(
elfHasArm
&&
hasMips
)
{
}
else
if
(
elfHasArm
&&
hasMips
)
{
errorMsg
=
"ARM build on MIPS device"
;
errorMsg
=
"ARM build on MIPS device"
;
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
}
if
(
elf
.
e_machine
==
EM_ARM
&&
elf
.
att_arch
.
startsWith
(
"v7"
)
&&
!
hasArmV7
)
{
if
(
elf
.
e_machine
==
EM_ARM
&&
elf
.
att_arch
.
startsWith
(
"v7"
)
&&
!
hasArmV7
)
{
errorMsg
=
"ARMv7 build on non-ARMv7 device"
;
errorMsg
=
"ARMv7 build on non-ARMv7 device"
;
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
}
if
(
elf
.
e_machine
==
EM_ARM
)
{
if
(
elf
.
e_machine
==
EM_ARM
)
{
if
(
elf
.
att_arch
.
startsWith
(
"v6"
)
&&
!
hasArmV6
)
{
if
(
elf
.
att_arch
.
startsWith
(
"v6"
)
&&
!
hasArmV6
)
{
errorMsg
=
"ARMv6 build on non-ARMv6 device"
;
errorMsg
=
"ARMv6 build on non-ARMv6 device"
;
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
else
if
(
elf
.
att_fpu
&&
!
hasFpu
)
{
}
else
if
(
elf
.
att_fpu
&&
!
hasFpu
)
{
errorMsg
=
"FPU-enabled build on non-FPU device"
;
errorMsg
=
"FPU-enabled build on non-FPU device"
;
isCompatible
=
false
;
isCompatible
=
false
;
return
false
;
}
}
}
}
if
(
elfIs64bits
&&
!
is64bits
)
{
if
(
elfIs64bits
&&
!
is64bits
)
{
...
@@ -247,22 +233,17 @@ public class VLCUtil {
...
@@ -247,22 +233,17 @@ public class VLCUtil {
Log
.
w
(
TAG
,
"Could not parse maximum CPU frequency!"
);
Log
.
w
(
TAG
,
"Could not parse maximum CPU frequency!"
);
Log
.
w
(
TAG
,
"Failed to parse: "
+
line
);
Log
.
w
(
TAG
,
"Failed to parse: "
+
line
);
}
finally
{
}
finally
{
if
(
br
!=
null
)
{
if
(
br
!=
null
)
try
{
try
{
br
.
close
();
br
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{}
}
if
(
fileReader
!=
null
)
}
if
(
fileReader
!=
null
)
{
try
{
try
{
fileReader
.
close
();
fileReader
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{}
}
}
}
}
errorMsg
=
null
;
isCompatible
=
errorMsg
==
null
;
isCompatible
=
true
;
// Store into MachineSpecs
// Store into MachineSpecs
machineSpecs
=
new
MachineSpecs
();
machineSpecs
=
new
MachineSpecs
();
machineSpecs
.
hasArmV6
=
hasArmV6
;
machineSpecs
.
hasArmV6
=
hasArmV6
;
...
@@ -275,7 +256,7 @@ public class VLCUtil {
...
@@ -275,7 +256,7 @@ public class VLCUtil {
machineSpecs
.
bogoMIPS
=
bogoMIPS
;
machineSpecs
.
bogoMIPS
=
bogoMIPS
;
machineSpecs
.
processors
=
processors
;
machineSpecs
.
processors
=
processors
;
machineSpecs
.
frequency
=
frequency
;
machineSpecs
.
frequency
=
frequency
;
return
tru
e
;
return
isCompatibl
e
;
}
}
public
static
MachineSpecs
getMachineSpecs
()
{
public
static
MachineSpecs
getMachineSpecs
()
{
...
...
Geoffrey Métais
@Dekans
mentioned in commit
98fd1a34
·
Jun 29, 2016
mentioned in commit
98fd1a34
mentioned in commit 98fd1a34bd05b0d0b4df1d9cda8682cf939d39e4
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment