Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f89d6ff9
Commit
f89d6ff9
authored
Sep 14, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvlc: update libvlc_exception_t structure.
parent
18555a9e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
51 deletions
+46
-51
bindings/java/core/src/main/java/org/videolan/jvlc/Logger.java
...ngs/java/core/src/main/java/org/videolan/jvlc/Logger.java
+2
-2
bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java
.../java/core/src/main/java/org/videolan/jvlc/MediaList.java
+1
-1
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
...core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
+1
-6
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java
.../test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java
+2
-2
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcLogTest.java
...c/test/java/org/videolan/jvlc/internal/LibVlcLogTest.java
+3
-3
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListPlayerTest.java
...org/videolan/jvlc/internal/LibVlcMediaListPlayerTest.java
+16
-16
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListTest.java
.../java/org/videolan/jvlc/internal/LibVlcMediaListTest.java
+8
-8
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
...ava/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
+9
-9
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaTest.java
...test/java/org/videolan/jvlc/internal/LibVlcMediaTest.java
+4
-4
No files found.
bindings/java/core/src/main/java/org/videolan/jvlc/Logger.java
View file @
f89d6ff9
...
...
@@ -46,9 +46,9 @@ public class Logger
this
.
libvlc
=
jvlc
.
getLibvlc
();
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
this
.
logInstance
=
jvlc
.
getLibvlc
().
libvlc_log_open
(
jvlc
.
getInstance
(),
exception
);
if
(
exception
.
raised
==
1
)
if
(
exception
.
b_
raised
==
1
)
{
throw
new
RuntimeException
(
"Native exception thrown
: "
+
exception
.
message
);
throw
new
RuntimeException
(
"Native exception thrown
"
);
}
}
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java
View file @
f89d6ff9
...
...
@@ -125,7 +125,7 @@ public class MediaList
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
jvlc
.
getLibvlc
().
libvlc_media_list_remove_index
(
instance
,
index
,
exception
);
if
(
exception
.
raised
==
0
)
if
(
exception
.
b_
raised
==
0
)
{
items
.
remove
(
index
);
return
true
;
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
View file @
f89d6ff9
...
...
@@ -44,12 +44,7 @@ public interface LibVlc extends Library
public
static
class
libvlc_exception_t
extends
Structure
{
public
int
raised
;
public
int
code
;
public
String
message
;
public
int
b_raised
;
}
public
static
class
libvlc_log_message_t
extends
Structure
...
...
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java
View file @
f89d6ff9
...
...
@@ -42,7 +42,7 @@ public class LibVlcCoreTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcInstance
libvlcInstance
=
instance
.
libvlc_new
(
0
,
new
String
[]
{
"-I"
,
"dummy"
,
"--aout=dummy"
,
"--vout=dummy"
},
exception
);
Assert
.
assertNotNull
(
libvlcInstance
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -59,7 +59,7 @@ public class LibVlcCoreTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcInstance
libvlcInstance
=
instance
.
libvlc_new
(
0
,
new
String
[]
{},
exception
);
instance
.
libvlc_add_intf
(
libvlcInstance
,
"dummy"
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
instance
.
libvlc_release
(
libvlcInstance
);
}
...
...
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcLogTest.java
View file @
f89d6ff9
...
...
@@ -49,7 +49,7 @@ public class LibVlcLogTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcLog
libvlcLog
=
libvlc
.
libvlc_log_open
(
libvlcInstance
,
exception
);
libvlc
.
libvlc_log_close
(
libvlcLog
,
exception
);
Assert
.
assertEquals
(
exception
.
message
,
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
//@Test
...
...
@@ -58,7 +58,7 @@ public class LibVlcLogTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcLog
libvlcLog
=
libvlc
.
libvlc_log_open
(
libvlcInstance
,
exception
);
libvlc
.
libvlc_log_clear
(
libvlcLog
,
exception
);
Assert
.
assertEquals
(
exception
.
message
,
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
Assert
.
assertEquals
(
0
,
libvlc
.
libvlc_log_count
(
libvlcLog
,
exception
));
}
...
...
@@ -68,7 +68,7 @@ public class LibVlcLogTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcLog
libvlcLog
=
libvlc
.
libvlc_log_open
(
libvlcInstance
,
exception
);
libvlc
.
libvlc_log_clear
(
libvlcLog
,
exception
);
Assert
.
assertEquals
(
exception
.
message
,
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
Assert
.
assertEquals
(
0
,
libvlc
.
libvlc_log_count
(
libvlcLog
,
exception
));
LibVlcLogIterator
logIterator
=
libvlc
.
libvlc_log_get_iterator
(
libvlcLog
,
exception
);
Assert
.
assertNotNull
(
logIterator
);
...
...
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListPlayerTest.java
View file @
f89d6ff9
...
...
@@ -47,7 +47,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaListPlayer
mediaListPlayer
=
libvlc
.
libvlc_media_list_player_new
(
libvlcInstance
,
exception
);
Assert
.
assertNotNull
(
mediaListPlayer
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_list_player_release
(
mediaListPlayer
);
}
...
...
@@ -58,7 +58,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
LibVlcMediaListPlayer
mediaListPlayer
=
libvlc
.
libvlc_media_list_player_new
(
libvlcInstance
,
exception
);
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
libvlc
.
libvlc_media_list_player_set_media_list
(
mediaListPlayer
,
mediaList
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_list_release
(
mediaList
);
libvlc
.
libvlc_media_list_player_release
(
mediaListPlayer
);
}
...
...
@@ -72,7 +72,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
LibVlcMedia
mediaDescriptor
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
mediaDescriptor
,
exception
);
libvlc
.
libvlc_media_list_player_set_media_list
(
mediaListPlayer
,
mediaList
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_list_release
(
mediaList
);
libvlc
.
libvlc_media_list_player_release
(
mediaListPlayer
);
}
...
...
@@ -84,7 +84,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
LibVlcMediaListPlayer
mediaListPlayer
=
libvlc
.
libvlc_media_list_player_new
(
libvlcInstance
,
exception
);
int
result
=
libvlc
.
libvlc_media_list_player_is_playing
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
0
,
result
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_list_player_release
(
mediaListPlayer
);
}
...
...
@@ -94,7 +94,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaListPlayer
mediaListPlayer
=
libvlc
.
libvlc_media_list_player_new
(
libvlcInstance
,
exception
);
libvlc
.
libvlc_media_list_player_play
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
1
,
exception
.
raised
);
Assert
.
assertEquals
(
1
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_list_player_release
(
mediaListPlayer
);
}
...
...
@@ -109,7 +109,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
mediaDescriptor
,
exception
);
libvlc
.
libvlc_media_list_player_set_media_list
(
mediaListPlayer
,
mediaList
,
exception
);
libvlc
.
libvlc_media_list_player_play
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
"Exception message: "
+
exception
.
message
+
".\n"
,
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_release
(
mediaDescriptor
);
libvlc
.
libvlc_media_list_release
(
mediaList
);
}
...
...
@@ -127,7 +127,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
while
(
true
)
{
int
playing
=
libvlc
.
libvlc_media_list_player_is_playing
(
mediaListPlayer
,
exception
);
if
(
exception
.
raised
==
1
)
if
(
exception
.
b_
raised
==
1
)
{
throw
new
RuntimeException
(
"Native exception thrown"
);
}
...
...
@@ -158,11 +158,11 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
mediaDescriptor
,
exception
);
libvlc
.
libvlc_media_list_player_set_media_list
(
mediaListPlayer
,
mediaList
,
exception
);
libvlc
.
libvlc_media_list_player_play_item
(
mediaListPlayer
,
mediaDescriptor
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
while
(
true
)
{
int
playing
=
libvlc
.
libvlc_media_list_player_is_playing
(
mediaListPlayer
,
exception
);
if
(
exception
.
raised
==
1
)
if
(
exception
.
b_
raised
==
1
)
{
throw
new
RuntimeException
(
"Native exception thrown"
);
}
...
...
@@ -201,7 +201,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
while
(
true
)
{
int
playing
=
libvlc
.
libvlc_media_list_player_is_playing
(
mediaListPlayer
,
exception
);
if
(
exception
.
raised
==
1
)
if
(
exception
.
b_
raised
==
1
)
{
throw
new
RuntimeException
(
"Native exception thrown"
);
}
...
...
@@ -214,7 +214,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_list_player_pause
(
mediaListPlayer
,
exception
);
int
state
=
libvlc
.
libvlc_media_list_player_get_state
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
exception
.
message
,
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
Thread
.
sleep
(
200L
);
Assert
.
assertEquals
(
"Expected state: "
+
LibVlcState
.
libvlc_Paused
+
".\n"
,
...
...
@@ -233,7 +233,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
libvlc
.
libvlc_media_list_player_set_media_player
(
mediaListPlayer
,
mi
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -242,7 +242,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaListPlayer
mediaListPlayer
=
libvlc
.
libvlc_media_list_player_new
(
libvlcInstance
,
exception
);
libvlc
.
libvlc_media_list_player_next
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
1
,
exception
.
raised
);
Assert
.
assertEquals
(
1
,
exception
.
b_
raised
);
}
/**
...
...
@@ -261,7 +261,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_list_player_play_item_at_index
(
mediaListPlayer
,
0
,
exception
);
Thread
.
sleep
(
150
);
libvlc
.
libvlc_media_list_player_next
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_list_release
(
mediaList
);
}
...
...
@@ -279,7 +279,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
while
(
true
)
{
int
playing
=
libvlc
.
libvlc_media_list_player_get_state
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
if
(
playing
==
LibVlcState
.
libvlc_Playing
.
ordinal
())
{
break
;
...
...
@@ -291,7 +291,7 @@ public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest
while
(
true
)
{
int
playing
=
libvlc
.
libvlc_media_list_player_is_playing
(
mediaListPlayer
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
if
(
playing
==
0
)
{
break
;
...
...
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListTest.java
View file @
f89d6ff9
...
...
@@ -42,7 +42,7 @@ public class LibVlcMediaListTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
Assert
.
assertNotNull
(
mediaList
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -56,7 +56,7 @@ public class LibVlcMediaListTest extends AbstractVLCInternalTest
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
libvlc_media
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -72,12 +72,12 @@ public class LibVlcMediaListTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
libvlc_media
,
exception
);
int
result
=
libvlc
.
libvlc_media_list_count
(
mediaList
,
exception
);
Assert
.
assertEquals
(
1
,
result
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
libvlc_media
,
exception
);
result
=
libvlc
.
libvlc_media_list_count
(
mediaList
,
exception
);
Assert
.
assertEquals
(
2
,
result
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -86,7 +86,7 @@ public class LibVlcMediaListTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
Assert
.
assertNotNull
(
libvlc
.
libvlc_media_list_event_manager
(
mediaList
,
exception
));
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -102,7 +102,7 @@ public class LibVlcMediaListTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
libvlc_media
,
exception
);
int
index
=
libvlc
.
libvlc_media_list_index_of_item
(
mediaList
,
libvlc_media
,
exception
);
Assert
.
assertEquals
(
0
,
index
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -117,7 +117,7 @@ public class LibVlcMediaListTest extends AbstractVLCInternalTest
exception
);
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
libvlc_media
,
exception
);
libvlc
.
libvlc_media_list_remove_index
(
mediaList
,
0
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -132,7 +132,7 @@ public class LibVlcMediaListTest extends AbstractVLCInternalTest
exception
);
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
libvlc_media
,
exception
);
libvlc
.
libvlc_media_list_remove_index
(
mediaList
,
0
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
libvlc_media
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
...
...
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
View file @
f89d6ff9
...
...
@@ -38,7 +38,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
{
LibVlcMediaPlayer
instance
=
libvlc
.
libvlc_media_player_new
(
libvlcInstance
,
exception
);
Assert
.
assertNotNull
(
instance
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -46,7 +46,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
{
LibVlcMediaPlayer
instance
=
libvlc
.
libvlc_media_player_new
(
libvlcInstance
,
exception
);
libvlc
.
libvlc_media_player_play
(
instance
,
exception
);
Assert
.
assertEquals
(
1
,
exception
.
raised
);
// no associated media descriptor
Assert
.
assertEquals
(
1
,
exception
.
b_
raised
);
// no associated media descriptor
}
@Test
...
...
@@ -55,7 +55,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
libvlc
.
libvlc_media_player_play
(
mi
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -65,7 +65,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
Assert
.
assertEquals
(
0
,
libvlc
.
libvlc_media_player_is_playing
(
mi
,
exception
));
libvlc
.
libvlc_media_player_play
(
mi
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
Thread
.
sleep
(
200
);
Assert
.
assertEquals
(
1
,
libvlc
.
libvlc_media_player_is_playing
(
mi
,
exception
));
}
...
...
@@ -76,7 +76,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
libvlc
.
libvlc_media_player_pause
(
mi
,
exception
);
Assert
.
assertEquals
(
1
,
exception
.
raised
);
Assert
.
assertEquals
(
1
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -86,7 +86,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
libvlc
.
libvlc_media_player_play
(
mi
,
exception
);
libvlc
.
libvlc_media_player_pause
(
mi
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -96,7 +96,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
libvlc
.
libvlc_media_player_play
(
mi
,
exception
);
libvlc
.
libvlc_media_player_set_position
(
mi
,
0.5f
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
float
position
=
libvlc
.
libvlc_media_player_get_position
(
mi
,
exception
);
Assert
.
assertTrue
(
"Position is: "
+
position
,
position
>=
0.5f
);
}
...
...
@@ -107,7 +107,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
libvlc
.
libvlc_media_player_stop
(
mi
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
(
timeout
=
2000L
)
...
...
@@ -119,7 +119,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
Thread
.
sleep
(
100
);
libvlc
.
libvlc_media_player_stop
(
mi
,
exception
);
Thread
.
sleep
(
500
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
}
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaTest.java
View file @
f89d6ff9
...
...
@@ -42,7 +42,7 @@ public class LibVlcMediaTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
Assert
.
assertNotNull
(
md
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
}
@Test
...
...
@@ -70,7 +70,7 @@ public class LibVlcMediaTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
LibVlcEventManager
evManager
=
libvlc
.
libvlc_media_event_manager
(
md
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
Assert
.
assertNotNull
(
evManager
);
}
...
...
@@ -80,7 +80,7 @@ public class LibVlcMediaTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
int
state
=
libvlc
.
libvlc_media_get_state
(
md
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
Assert
.
assertEquals
(
LibVlcState
.
libvlc_NothingSpecial
.
ordinal
(),
state
);
}
...
...
@@ -90,7 +90,7 @@ public class LibVlcMediaTest extends AbstractVLCInternalTest
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
int
state
=
libvlc
.
libvlc_media_is_preparsed
(
md
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Assert
.
assertEquals
(
0
,
exception
.
b_
raised
);
Assert
.
assertEquals
(
0
,
state
);
}
...
...
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