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
0dedb237
Commit
0dedb237
authored
Sep 21, 2009
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvlc: video_set_parent does not exist anymore, use media_player_set_(hwnd|xwindow)
parent
097ba5d1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
49 deletions
+49
-49
bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java
bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java
+7
-40
bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
...ava/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
+23
-5
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
...core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
+8
-2
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
.../src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
+9
-1
bindings/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java
...s/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java
+1
-1
bindings/java/samples/client/src/main/java/MultipleVideosSample.java
...va/samples/client/src/main/java/MultipleVideosSample.java
+1
-0
No files found.
bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java
View file @
0dedb237
...
@@ -35,8 +35,6 @@ import org.videolan.jvlc.internal.LibVlc;
...
@@ -35,8 +35,6 @@ import org.videolan.jvlc.internal.LibVlc;
import
org.videolan.jvlc.internal.LibVlc.LibVlcInstance
;
import
org.videolan.jvlc.internal.LibVlc.LibVlcInstance
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
import
com.sun.jna.Native
;
public
class
JVLC
public
class
JVLC
{
{
...
@@ -44,34 +42,22 @@ public class JVLC
...
@@ -44,34 +42,22 @@ public class JVLC
private
final
LibVlc
libvlc
=
LibVlc
.
SYNC_INSTANCE
;
private
final
LibVlc
libvlc
=
LibVlc
.
SYNC_INSTANCE
;
private
MediaList
mediaList
;
private
VLM
vlm
;
private
VLM
vlm
;
private
Audio
audio
;
private
Audio
audio
;
private
volatile
boolean
released
;
private
volatile
boolean
released
;
private
MediaListPlayer
mediaListPlayer
;
private
Canvas
canvas
;
public
JVLC
()
public
JVLC
()
{
{
String
[]
args
=
new
String
[]
{};
this
(
new
String
[]
{});
instance
=
createInstance
(
args
);
init
();
}
}
public
JVLC
(
String
[]
args
)
public
JVLC
(
String
[]
args
)
{
{
instance
=
createInstance
(
args
);
instance
=
createInstance
(
args
);
init
();
}
private
void
init
()
{
mediaList
=
new
MediaList
(
this
);
mediaListPlayer
=
new
MediaListPlayer
(
this
);
mediaListPlayer
.
setMediaList
(
mediaList
);
audio
=
new
Audio
(
this
);
audio
=
new
Audio
(
this
);
}
}
...
@@ -93,6 +79,10 @@ public class JVLC
...
@@ -93,6 +79,10 @@ public class JVLC
{
{
MediaDescriptor
mediaDescriptor
=
new
MediaDescriptor
(
this
,
media
);
MediaDescriptor
mediaDescriptor
=
new
MediaDescriptor
(
this
,
media
);
MediaPlayer
mediaPlayer
=
new
MediaPlayer
(
mediaDescriptor
);
MediaPlayer
mediaPlayer
=
new
MediaPlayer
(
mediaDescriptor
);
if
(
canvas
!=
null
)
{
mediaPlayer
.
setParent
(
canvas
);
}
mediaPlayer
.
play
();
mediaPlayer
.
play
();
mediaDescriptor
.
release
();
mediaDescriptor
.
release
();
return
mediaPlayer
;
return
mediaPlayer
;
...
@@ -100,9 +90,7 @@ public class JVLC
...
@@ -100,9 +90,7 @@ public class JVLC
public
void
setVideoOutput
(
Canvas
canvas
)
public
void
setVideoOutput
(
Canvas
canvas
)
{
{
long
drawable
=
Native
.
getComponentID
(
canvas
);
this
.
canvas
=
canvas
;
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
.
libvlc_video_set_parent
(
instance
,
drawable
,
exception
);
}
}
public
Logger
getLogger
()
public
Logger
getLogger
()
...
@@ -110,15 +98,6 @@ public class JVLC
...
@@ -110,15 +98,6 @@ public class JVLC
return
new
Logger
(
this
);
return
new
Logger
(
this
);
}
}
/**
* Returns the mediaList.
* @return the mediaList
*/
public
MediaList
getMediaList
()
{
return
mediaList
;
}
public
VLM
getVLM
()
public
VLM
getVLM
()
{
{
if
(
vlm
!=
null
)
if
(
vlm
!=
null
)
...
@@ -176,8 +155,6 @@ public class JVLC
...
@@ -176,8 +155,6 @@ public class JVLC
vlm
.
release
();
vlm
.
release
();
vlm
=
null
;
vlm
=
null
;
}
}
mediaList
.
release
();
mediaListPlayer
.
release
();
libvlc
.
libvlc_release
(
instance
);
libvlc
.
libvlc_release
(
instance
);
}
}
...
@@ -193,16 +170,6 @@ public class JVLC
...
@@ -193,16 +170,6 @@ public class JVLC
super
.
finalize
();
super
.
finalize
();
}
}
/**
* Returns the mediaListPlayer.
* @return the mediaListPlayer
*/
public
MediaListPlayer
getMediaListPlayer
()
{
return
mediaListPlayer
;
}
/**
/**
* @return
* @return
*/
*/
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
View file @
0dedb237
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
package
org.videolan.jvlc
;
package
org.videolan.jvlc
;
import
java.awt.Canvas
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.EnumSet
;
import
java.util.EnumSet
;
import
java.util.List
;
import
java.util.List
;
...
@@ -37,6 +38,9 @@ import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
...
@@ -37,6 +38,9 @@ import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
import
org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer
;
import
org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
import
com.sun.jna.Native
;
import
com.sun.jna.Platform
;
public
class
MediaPlayer
public
class
MediaPlayer
{
{
...
@@ -156,7 +160,7 @@ public class MediaPlayer
...
@@ -156,7 +160,7 @@ public class MediaPlayer
public
boolean
isPlaying
()
public
boolean
isPlaying
()
{
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_is_playing
(
instance
,
exception
)
==
1
?
true
:
false
;
return
libvlc
.
libvlc_media_player_is_playing
(
instance
,
exception
)
==
1
?
true
:
false
;
}
}
public
void
addListener
(
final
MediaPlayerListener
listener
)
public
void
addListener
(
final
MediaPlayerListener
listener
)
...
@@ -172,6 +176,20 @@ public class MediaPlayer
...
@@ -172,6 +176,20 @@ public class MediaPlayer
callbacks
.
add
(
callback
);
callbacks
.
add
(
callback
);
}
}
public
void
setParent
(
Canvas
canvas
)
{
long
drawable
=
Native
.
getComponentID
(
canvas
);
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
if
(
Platform
.
isWindows
())
{
libvlc
.
libvlc_media_player_set_hwnd
(
instance
,
drawable
,
exception
);
}
else
{
libvlc
.
libvlc_media_player_set_xwindow
(
instance
,
drawable
,
exception
);
}
}
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
View file @
0dedb237
...
@@ -339,7 +339,13 @@ public interface LibVlc extends Library
...
@@ -339,7 +339,13 @@ public interface LibVlc extends Library
// video
// video
void
libvlc_video_set_parent
(
LibVlcInstance
libvlc_instance
,
long
drawable
,
libvlc_exception_t
exception
);
void
libvlc_media_player_set_hwnd
(
LibVlcMediaPlayer
mediaplayer_instance
,
long
drawable
,
libvlc_exception_t
exception
);
long
libvlc_media_player_get_hwnd
(
LibVlcMediaPlayer
mediaplayer_instance
);
void
libvlc_media_player_set_xwindow
(
LibVlcMediaPlayer
mediaplayer_instance
,
long
drawable
,
libvlc_exception_t
exception
);
long
libvlc_media_player_get_xwindow
(
LibVlcMediaPlayer
mediaplayer_instance
);
void
libvlc_toggle_fullscreen
(
LibVlcMediaPlayer
libvlc_instance
);
void
libvlc_toggle_fullscreen
(
LibVlcMediaPlayer
libvlc_instance
);
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
View file @
0dedb237
...
@@ -38,6 +38,7 @@ import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer;
...
@@ -38,6 +38,7 @@ import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer;
import
org.videolan.jvlc.internal.LibVlc.libvlc_event_t
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_event_t
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
import
com.sun.jna.Platform
;
import
com.sun.jna.Pointer
;
import
com.sun.jna.Pointer
;
...
@@ -119,7 +120,14 @@ public class LibVlcImpl
...
@@ -119,7 +120,14 @@ public class LibVlcImpl
int
drawable
=
(
int
)
com
.
sun
.
jna
.
Native
.
getComponentID
(
canvas
);
int
drawable
=
(
int
)
com
.
sun
.
jna
.
Native
.
getComponentID
(
canvas
);
libVlc
.
libvlc_video_set_parent
(
libvlc_instance_t
,
drawable
,
exception
);
if
(
Platform
.
isWindows
())
{
libVlc
.
libvlc_media_player_set_hwnd
(
mediaPlayer
,
drawable
,
exception
);
}
else
{
libVlc
.
libvlc_media_player_set_xwindow
(
mediaPlayer
,
drawable
,
exception
);
}
libVlc
.
libvlc_media_player_play
(
mediaPlayer
,
exception
);
libVlc
.
libvlc_media_player_play
(
mediaPlayer
,
exception
);
}
}
}
}
bindings/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java
View file @
0dedb237
...
@@ -39,7 +39,7 @@ public class JVLCTest extends AbstractJVLCTest
...
@@ -39,7 +39,7 @@ public class JVLCTest extends AbstractJVLCTest
public
void
jvlcNew
()
public
void
jvlcNew
()
{
{
JVLC
jvlc
=
new
JVLC
();
JVLC
jvlc
=
new
JVLC
();
Assert
.
assertNotNull
(
jvlc
.
get
MediaList
());
Assert
.
assertNotNull
(
jvlc
.
get
Audio
());
}
}
@Test
@Test
...
...
bindings/java/samples/client/src/main/java/MultipleVideosSample.java
View file @
0dedb237
...
@@ -83,6 +83,7 @@ public class MultipleVideosSample
...
@@ -83,6 +83,7 @@ public class MultipleVideosSample
for
(
int
i
=
0
;
i
<
videosNumber
;
i
++)
for
(
int
i
=
0
;
i
<
videosNumber
;
i
++)
{
{
jvlcArray
[
i
].
play
(
filename
);
jvlcArray
[
i
].
play
(
filename
);
jvlcArray
[
i
].
setVideoOutput
(
videoCanvasesArray
[
i
]);
Thread
.
sleep
(
500
);
Thread
.
sleep
(
500
);
}
}
}
}
...
...
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