Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (5)
Add hooks for BDJLoader fixups
· fff34e45
hpi1
authored
Jan 02, 2019
fff34e45
CacheDir: shorter dir/file names
· b05ba084
hpi1
authored
Jan 02, 2019
b05ba084
CacheDir: improve unique temp file name creation
· 233f94da
hpi1
authored
Jan 02, 2019
233f94da
BDJLoader: use org.bluray.system.RegisterAccess for PSR numbers
· 8b5b5918
hpi1
authored
Jan 02, 2019
8b5b5918
AppEntry: add copy constructor
· 0b3f5055
hpi1
authored
Jan 02, 2019
0b3f5055
Hide whitespace changes
Inline
Side-by-side
src/libbluray/bdj/java/org/videolan/BDJLoader.java
View file @
0b3f5055
...
...
@@ -26,6 +26,7 @@ import java.util.Enumeration;
import
org.videolan.Logger
;
import
org.bluray.net.BDLocator
;
import
org.bluray.system.RegisterAccess
;
import
org.bluray.ti.TitleImpl
;
import
org.davic.media.MediaLocator
;
import
org.dvb.application.AppID
;
...
...
@@ -240,6 +241,14 @@ public class BDJLoader {
vfsCache
.
add
(
bdjo
.
getAppCaches
());
}
try
{
BDJLoaderAdapter
a
=
Libbluray
.
getLoaderAdapter
();
if
(
a
!=
null
)
appTable
=
a
.
patchAppTable
(
appTable
,
title
.
getTitleNum
());
}
catch
(
Throwable
t
)
{
logger
.
error
(
""
+
t
);
}
// initialize appProxys
for
(
int
i
=
0
;
i
<
appTable
.
length
;
i
++)
{
if
(
proxys
[
i
]
==
null
)
{
...
...
@@ -259,7 +268,7 @@ public class BDJLoader {
}
// change psr
Libbluray
.
writePSR
(
Libbluray
.
PSR_TITLE_N
UMBE
R
,
title
.
getTitleNum
());
Libbluray
.
writePSR
(
RegisterAccess
.
PSR_TITLE_NR
,
title
.
getTitleNum
());
// notify AppsDatabase
((
BDJAppsDatabase
)
BDJAppsDatabase
.
getAppsDatabase
()).
newDatabase
(
bdjo
,
proxys
);
...
...
src/libbluray/bdj/java/org/videolan/BDJLoaderAdapter.java
0 → 100644
View file @
0b3f5055
/*
* This file is part of libbluray
* Copyright (C) 2018 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
package
org.videolan
;
import
org.videolan.bdjo.AppEntry
;
public
interface
BDJLoaderAdapter
{
/*
* Modify BDJO at run time
*/
/* patch application table */
public
abstract
AppEntry
[]
patchAppTable
(
AppEntry
[]
in
,
int
title
);
}
src/libbluray/bdj/java/org/videolan/CacheDir.java
View file @
0b3f5055
...
...
@@ -84,7 +84,7 @@ class CacheDir {
cleanupCache
();
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
File
tmpDir
=
new
File
(
baseDir
,
""
+
System
.
nanoTime
());
File
tmpDir
=
new
File
(
baseDir
,
Long
.
toHexString
(
System
.
nanoTime
()
+
i
)
);
tmpDir
=
new
File
(
tmpDir
.
getCanonicalPath
());
if
(
tmpDir
.
mkdirs
())
{
...
...
src/libbluray/bdj/java/org/videolan/Libbluray.java
View file @
0b3f5055
...
...
@@ -75,21 +75,36 @@ public class Libbluray {
*/
private
static
BDJClassLoaderAdapter
classLoaderAdapter
=
null
;
private
static
BDJLoaderAdapter
loaderAdapter
=
null
;
protected
static
BDJClassLoaderAdapter
getClassLoaderAdapter
()
{
return
classLoaderAdapter
;
}
protected
static
BDJLoaderAdapter
getLoaderAdapter
()
{
return
loaderAdapter
;
}
private
static
void
loadAdapter
(
String
pkg
)
{
if
(
pkg
==
null
)
return
;
if
(
pkg
.
indexOf
(
';'
)
>
0
)
{
pkg
=
pkg
.
substring
(
0
,
pkg
.
indexOf
(
';'
));
}
try
{
final
Object
obj
=
Class
.
forName
(
"org.videolan."
+
pkg
+
".Adapter"
).
newInstance
();
if
(!((
obj
instanceof
BDJClassLoaderAdapter
)
||
(
obj
instanceof
BDJLoaderAdapter
)))
{
System
.
err
.
println
(
"Unsupported interface in "
+
obj
);
return
;
}
if
(
obj
instanceof
BDJLoaderAdapter
)
{
loaderAdapter
=
(
BDJLoaderAdapter
)
obj
;
}
if
(
obj
instanceof
BDJClassLoaderAdapter
)
{
classLoaderAdapter
=
(
BDJClassLoaderAdapter
)
obj
;
}
else
{
System
.
err
.
println
(
"Unsupported interface in "
+
obj
);
}
}
catch
(
ClassNotFoundException
ce
)
{
System
.
out
.
println
(
""
+
ce
);
/* not really an error */
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
""
+
e
);
}
...
...
@@ -364,6 +379,7 @@ public class Libbluray {
bdjoFiles
=
null
;
}
classLoaderAdapter
=
null
;
loaderAdapter
=
null
;
}
/*
...
...
src/libbluray/bdj/java/org/videolan/VFSCache.java
View file @
0b3f5055
...
...
@@ -225,7 +225,7 @@ class VFSCache {
// copy stream to tmp file in fontRoot. freetype can not read streams.
File
tmpFile
=
null
;
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
tmpFile
=
new
File
(
fontRoot
+
System
.
nanoTime
()
+
".otf"
);
tmpFile
=
new
File
(
fontRoot
+
Long
.
toHexString
(
System
.
nanoTime
()
+
i
)
+
".otf"
);
try
{
tmpFile
=
new
File
(
tmpFile
.
getCanonicalPath
());
if
(!
tmpFile
.
exists
())
{
...
...
src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java
View file @
0b3f5055
...
...
@@ -148,6 +148,28 @@ public class AppEntry implements AppAttributes {
return
((
binding
&
DISC_BOUND
)
!=
0
);
}
public
AppEntry
(
AppEntry
a
)
{
try
{
this
.
icon
=
new
AppIcon
(
new
BDLocator
(
a
.
icon
.
getLocator
().
toExternalForm
()),
(
BitSet
)
a
.
icon
.
getIconFlags
().
clone
());
}
catch
(
Throwable
t
)
{
/* may be null */
}
this
.
controlCode
=
a
.
controlCode
;
this
.
type
=
a
.
type
;
this
.
appid
=
new
AppID
(
a
.
appid
.
getOID
(),
a
.
appid
.
getAID
());
this
.
profiles
=
(
AppProfile
[])
a
.
profiles
.
clone
();
this
.
priority
=
a
.
priority
;
this
.
binding
=
a
.
binding
;
//this.visibility = visibility;
this
.
names
=
(
String
[][])
a
.
names
.
clone
();
this
.
basePath
=
a
.
basePath
;
this
.
classpathExt
=
a
.
classpathExt
;
this
.
initialClass
=
a
.
initialClass
;
this
.
params
=
(
String
[])
a
.
params
.
clone
();
}
public
AppEntry
(
int
controlCode
,
int
type
,
int
orgId
,
short
appId
,
AppProfile
[]
profiles
,
short
priority
,
int
binding
,
int
visibility
,
String
[][]
names
,
...
...