Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
0e977f2f
Commit
0e977f2f
authored
Jul 26, 2006
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync bindings/java with jvlc head (release is close ;).
parent
d48bf82b
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
782 additions
and
203 deletions
+782
-203
bindings/java/Makefile.am
bindings/java/Makefile.am
+8
-10
bindings/java/VLCExample.java
bindings/java/VLCExample.java
+23
-9
bindings/java/VlcClient.java
bindings/java/VlcClient.java
+34
-3
bindings/java/org/videolan/jvlc/AudioIntf.java
bindings/java/org/videolan/jvlc/AudioIntf.java
+29
-5
bindings/java/org/videolan/jvlc/InputIntf.java
bindings/java/org/videolan/jvlc/InputIntf.java
+29
-9
bindings/java/org/videolan/jvlc/JLibVLC.java
bindings/java/org/videolan/jvlc/JLibVLC.java
+1
-1
bindings/java/org/videolan/jvlc/JVLC.java
bindings/java/org/videolan/jvlc/JVLC.java
+100
-44
bindings/java/org/videolan/jvlc/Playlist.java
bindings/java/org/videolan/jvlc/Playlist.java
+15
-15
bindings/java/org/videolan/jvlc/PlaylistIntf.java
bindings/java/org/videolan/jvlc/PlaylistIntf.java
+67
-13
bindings/java/org/videolan/jvlc/VLCException.java
bindings/java/org/videolan/jvlc/VLCException.java
+46
-0
bindings/java/org/videolan/jvlc/VLMIntf.java
bindings/java/org/videolan/jvlc/VLMIntf.java
+59
-7
bindings/java/org/videolan/jvlc/VideoIntf.java
bindings/java/org/videolan/jvlc/VideoIntf.java
+7
-14
bindings/java/vlc-graphics-jni.cc
bindings/java/vlc-graphics-jni.cc
+1
-10
bindings/java/vlc-libvlc-jni.cc
bindings/java/vlc-libvlc-jni.cc
+363
-63
No files found.
bindings/java/Makefile.am
View file @
0e977f2f
...
...
@@ -4,16 +4,15 @@
if
BUILD_JAVA
OBJECTS
=
org/videolan/jvlc/Playlist.class org/videolan/jvlc/AudioIntf.class org/videolan/jvlc/InputIntf.class org/videolan/jvlc/PlaylistIntf.class org/videolan/jvlc/VideoIntf.class org/videolan/jvlc/JLibVLC.class org/videolan/jvlc/JVLC.class org/videolan/jvlc/JVLCCanvas.class org/videolan/jvlc/JVLCPanel.class org/videolan/jvlc/VLMIntf.class org/videolan/jvlc/GenericVideoWidget.class
OBJECTS
=
org/videolan/jvlc/
VLCException.class org/videolan/jvlc/
Playlist.class org/videolan/jvlc/AudioIntf.class org/videolan/jvlc/InputIntf.class org/videolan/jvlc/PlaylistIntf.class org/videolan/jvlc/VideoIntf.class org/videolan/jvlc/JLibVLC.class org/videolan/jvlc/JVLC.class org/videolan/jvlc/JVLCCanvas.class org/videolan/jvlc/JVLCPanel.class org/videolan/jvlc/VLMIntf.class org/videolan/jvlc/GenericVideoWidget.class
# Include some JAVA stuff
PROCESSOR_FAMILY
=
`
uname
-m
|
sed
-e
's/^i.86/i386/'
|
sed
-e
's/^x86_64/amd64/'
`
if
HAVE_WIN32
JINCLUDES
=
-I
${JAVA_HOME}
/include
-I
${JAVA_HOME}
/include/win32
LIBJINCLUDES
=
-L
${JAVA_HOME}
/lib
-ljawt
J
C
C
=
javac
J
AVA
C
=
javac
JCH
=
javah
JCC_FLAGS
=
#CXX = g++ -Wall -mno-cygwin -g
#LDFLAGS = -mno-cygwin `vlc-config --libs external pic` -Wl,--kill-at
JAVACXXFLAGS
=
`
top_builddir
=
../.. ../../vlc-config
--cflags
pic
`
-I
../../
-I
../../include
$(JINCLUDES)
...
...
@@ -21,11 +20,10 @@ JAVALDFLAGS = -mno-cygwin -L../../src -lvlc `top_builddir=../.. ../../vlc-config
else
JINCLUDES
=
-I
$(JAVA_HOME)
/include
-I
$(JAVA_HOME)
/include/linux
LIBJINCLUDES
=
-L
$(JAVA_HOME)
/jre/lib/
$(PROCESSOR_FAMILY)
-ljawt
J
CC
=
gcj
-g
J
AVAC
=
gcj
-Wall
-g
-C
JCH
=
gcjh
-jni
SWT_PATH
=
/usr/share/java
# Compile flags
JCC_FLAGS
=
-C
JAVACXXFLAGS
=
`
top_builddir
=
../.. ../../vlc-config
--cflags
pic
`
-I
../../
-I
../../include
$(JINCLUDES)
JAVALDFLAGS
=
-L
../../src
-lvlc
`
top_builddir
=
../.. ../../vlc-config
--libs
builtin
vlc pic
`
endif
...
...
@@ -48,18 +46,18 @@ vlc-libvlc-jni.o: VlcClient
$(CXX)
-c
vlc-libvlc-jni.cc
$(CXXFLAGS)
$(JAVACXXFLAGS)
VlcClient
:
$(OBJECTS)
$(J
CC)
$(JCC_FLAGS
)
VlcClient.java
$(J
AVAC
)
VlcClient.java
VLCExample
:
$(OBJECTS)
$(J
CC)
$(JCC_FLAGS
)
VLCExample.java
$(J
AVAC
)
VLCExample.java
if
HAVE_WIN32
%.class
:
%.java
$(J
CC)
$(JCC_FLAGS)
$?
$(J
AVAC)
$?
$(JCH)
org.videolan.jvlc.
$
(
*
F
)
else
%.class
:
%.java
$(J
CC)
$(JCC_FLAGS
)
$?
$(J
AVAC
)
$?
$(JCH)
org/videolan/jvlc/
$
(
*
F
)
endif
...
...
bindings/java/VLCExample.java
View file @
0e977f2f
import
org.videolan.jvlc.JVLC
;
import
org.videolan.jvlc.VLCException
;
public
class
VLCExample
...
...
@@ -7,27 +8,36 @@ public class VLCExample
public
static
void
main
(
String
[]
args
)
{
boolean
videoInput
=
false
;
JVLC
jvlc
=
new
JVLC
();
JVLC
jvlc
=
new
JVLC
(
args
);
try
{
jvlc
.
playlist
.
add
(
"file://"
+
System
.
getProperty
(
"user.dir"
)
+
"/a.avi"
,
"a.avi"
);
jvlc
.
playlist
.
add
(
"file://"
+
System
.
getProperty
(
"user.dir"
)
+
"/a.mp3"
,
"a.mp3"
);
jvlc
.
playlist
.
play
(
-
1
,
null
);
}
catch
(
VLCException
e
)
{
e
.
printStackTrace
();
}
while
(!
jvlc
.
isInputPlaying
())
;
while
(!
jvlc
.
hasVout
()
);
// testing vout functionalities
try
{
Thread
.
sleep
(
500
);
Thread
.
sleep
(
2
500
);
if
(
jvlc
.
hasVout
())
videoInput
=
true
;
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
if
(
videoInput
)
{
try
{
System
.
out
.
print
(
jvlc
.
getVideoWidth
());
System
.
out
.
print
(
"x"
);
System
.
out
.
println
(
jvlc
.
getVideoHeight
());
}
catch
(
VLCException
e
)
{
e
.
printStackTrace
();
}
}
try
{
...
...
@@ -71,7 +81,11 @@ public class VLCExample
System
.
out
.
println
(
"Everything fine ;)"
);
System
.
out
.
println
(
"Playing next item"
);
try
{
jvlc
.
playlist
.
next
();
}
catch
(
VLCException
e
)
{
e
.
printStackTrace
();
}
try
{
Thread
.
sleep
(
3000
);
...
...
bindings/java/VlcClient.java
View file @
0e977f2f
/*****************************************************************************
* VlcClient.java: Sample Swing player
*****************************************************************************
* Copyright (C) 1998-2006 the VideoLAN team
*
* Created on 28-feb-2006
*
* $Id: AudioIntf.java 8 2006-02-28 12:03:47Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
import
java.awt.Frame
;
import
java.awt.event.WindowAdapter
;
import
java.awt.event.WindowEvent
;
import
org.videolan.jvlc.JVLCPanel
;
import
org.videolan.jvlc.JVLC
;
import
org.videolan.jvlc.VLCException
;
class
VLCPlayerFrame
extends
Frame
{
public
VLCPlayerFrame
()
{
...
...
@@ -109,15 +135,20 @@ class VLCPlayerFrame extends Frame {
private
void
pauseButtonActionPerformed
(
java
.
awt
.
event
.
ActionEvent
evt
)
{
try
{
//System.out.println(mci.getMediaPosition(PositionOrigin.ABSOLUTE, PositionKey.BYTECOUNT));
jvlc
.
playlist
.
p
ause
();
jvlc
.
playlist
.
toggleP
ause
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
private
void
setButtonActionPerformed
(
java
.
awt
.
event
.
ActionEvent
evt
)
{
try
{
jvlc
.
playlist
.
add
(
"file:///home/little/a.avi"
,
"a.avi"
);
jvlc
.
playlist
.
play
(-
1
,
null
);
}
catch
(
VLCException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
private
void
fullScreenButtonActionPerformed
(
java
.
awt
.
event
.
ActionEvent
evt
)
{
...
...
bindings/java/org/videolan/jvlc/AudioIntf.java
View file @
0e977f2f
...
...
@@ -30,9 +30,33 @@
package
org.videolan.jvlc
;
public
interface
AudioIntf
{
boolean
getMute
();
void
setMute
(
boolean
value
);
void
toggleMute
();
int
getVolume
();
void
setVolume
(
int
volume
);
/**
* @return True if input is currently muted.
* @throws VLCException
*/
boolean
getMute
()
throws
VLCException
;
/**
* @param value If true, then the input is muted.
* @throws VLCException
*/
void
setMute
(
boolean
value
)
throws
VLCException
;
/**
* Toggles mute
* @throws VLCException
*/
void
toggleMute
()
throws
VLCException
;
/**
* @return The volume level
* @throws VLCException
*/
int
getVolume
()
throws
VLCException
;
/**
* @param volume The volume level (0-200) to set.
* @throws VLCException
*/
void
setVolume
(
int
volume
)
throws
VLCException
;
}
bindings/java/org/videolan/jvlc/InputIntf.java
View file @
0e977f2f
...
...
@@ -29,21 +29,41 @@
package
org.videolan.jvlc
;
/**
* @author little
*
*/
public
interface
InputIntf
{
/**
* This function returns the total length of the current file playing
* in millis.
* @return The total length of the current file playing in millis.
* @throws VLCException
*/
long
getInputLength
()
throws
VLCException
;
/**
* @return The current position in millis within the playing item.
* @throws VLCException
*/
long
getInputTime
()
throws
VLCException
;
/**
* @return The position in %.
* @throws VLCException
*/
float
getInputPosition
()
throws
VLCException
;
/**
* Not implemented
* @throws VLCException
*/
long
getInputLength
();
void
setInputTime
()
throws
VLCException
;
/**
*
This function returns the current position in millis within the
*
currently playing playlist item.
*
@return If the playing item is a video file, returns the FPS, otherwise 0.
*
@throws VLCException
*/
long
getInputTime
();
float
getInputPosition
();
void
setInputTime
();
double
getInputFPS
();
double
getInputFPS
()
throws
VLCException
;
}
bindings/java/org/videolan/jvlc/JLibVLC.java
View file @
0e977f2f
...
...
@@ -28,4 +28,4 @@
package
org.videolan.jvlc
;
public
interface
JLibVLC
extends
AudioIntf
,
VideoIntf
,
InputIntf
{
}
public
interface
JLibVLC
extends
AudioIntf
,
VideoIntf
,
InputIntf
,
VLMIntf
{
}
bindings/java/org/videolan/jvlc/JVLC.java
View file @
0e977f2f
...
...
@@ -5,6 +5,7 @@
* Copyright (C) 1998-2006 the VideoLAN team
*
* Author: Filippo Carone <filippo@carone.org>
* Philippe Morin <phmorin@free.fr>
*
* Created on 28-feb-2006
*
...
...
@@ -29,14 +30,10 @@
package
org.videolan.jvlc
;
/**
* @author little
*
*/
public
class
JVLC
implements
JLibVLC
,
Runnable
{
static
{
System
.
load
(
System
.
getProperty
(
"user.dir"
)
+
"/libjvlc.so
"
);
System
.
load
Library
(
"jvlc
"
);
}
/**
...
...
@@ -47,12 +44,20 @@ public class JVLC implements JLibVLC, Runnable {
private
boolean
beingDestroyed
=
false
;
/**
* This is the time in millis VLC checks for internal status
*/
private
long
resolution
=
50
;
private
boolean
inputPlaying
=
false
;
private
boolean
inputVout
=
false
;
public
JVLC
()
{
_instance
=
createInstance
();
String
[]
args
=
new
String
[
1
];
args
[
0
]
=
""
;
_instance
=
createInstance
(
args
);
playlist
=
new
Playlist
(
_instance
);
new
Thread
(
this
).
start
();
}
...
...
@@ -109,90 +114,139 @@ public class JVLC implements JLibVLC, Runnable {
private
native
void
_getSnapshot
(
String
filename
);
public
boolean
getMute
()
{
/*
* VLM native methods
*/
private
native
void
_addBroadcast
(
String
mediaName
,
String
meditInputMRL
,
String
mediaOutputMRL
,
String
[]
additionalOptions
,
boolean
enableBroadcast
,
boolean
isPlayableInLoop
);
private
native
void
_deleteMedia
(
String
mediaName
);
private
native
void
_setEnabled
(
String
mediaName
,
boolean
newStatus
);
private
native
void
_setOutput
(
String
mediaName
,
String
mediaOutputMRL
);
private
native
void
_setInput
(
String
mediaName
,
String
mediaInputMRL
);
private
native
void
_setLoop
(
String
mediaName
,
boolean
isPlayableInLoop
);
private
native
void
_changeMedia
(
String
newMediaName
,
String
inputMRL
,
String
outputMRL
,
String
[]
additionalOptions
,
boolean
enableNewBroadcast
,
boolean
isPlayableInLoop
);
/*
* Native methods wrappers
*/
public
boolean
getMute
()
throws
VLCException
{
return
_getMute
();
}
public
void
setMute
(
boolean
value
)
{
public
void
setMute
(
boolean
value
)
throws
VLCException
{
_setMute
(
value
);
}
public
void
toggleMute
()
{
public
void
toggleMute
()
throws
VLCException
{
_toggleMute
();
}
public
int
getVolume
()
{
public
int
getVolume
()
throws
VLCException
{
return
_getVolume
();
}
public
void
setVolume
(
int
volume
)
{
public
void
setVolume
(
int
volume
)
throws
VLCException
{
_setVolume
(
volume
);
}
public
void
toggleFullscreen
()
{
public
void
toggleFullscreen
()
throws
VLCException
{
_toggleFullscreen
();
}
public
void
setFullscreen
(
boolean
value
)
{
public
void
setFullscreen
(
boolean
value
)
throws
VLCException
{
_setFullscreen
(
value
);
}
public
boolean
getFullscreen
()
{
public
boolean
getFullscreen
()
throws
VLCException
{
return
_getFullscreen
();
}
public
int
getVideoHeight
()
{
public
int
getVideoHeight
()
throws
VLCException
{
return
_getVideoHeight
();
}
public
int
getVideoWidth
()
{
public
int
getVideoWidth
()
throws
VLCException
{
return
_getVideoWidth
();
}
public
long
getInputLength
()
{
public
long
getInputLength
()
throws
VLCException
{
return
_getInputLength
();
}
public
long
getInputTime
()
{
public
long
getInputTime
()
throws
VLCException
{
return
_getInputTime
();
}
public
float
getInputPosition
()
{
public
float
getInputPosition
()
throws
VLCException
{
return
_getInputPosition
();
}
public
void
setInputTime
()
{
public
void
setInputTime
()
throws
VLCException
{
// TODO Auto-generated method stub
}
public
double
getInputFPS
()
{
public
double
getInputFPS
()
throws
VLCException
{
return
_getInputFPS
();
}
public
long
getInstance
()
{
public
long
getInstance
()
throws
VLCException
{
return
_instance
;
}
/*
* Getters and setters
*/
public
Playlist
getPlaylist
()
{
public
Playlist
getPlaylist
()
throws
VLCException
{
return
playlist
;
}
public
void
getSnapshot
(
String
filename
)
{
public
void
getSnapshot
(
String
filename
)
throws
VLCException
{
_getSnapshot
(
filename
);
}
public
void
addBroadcast
(
String
name
,
String
input
,
String
output
,
String
[]
options
,
boolean
enabled
,
boolean
loop
)
throws
VLCException
{
_addBroadcast
(
name
,
input
,
output
,
options
,
enabled
,
loop
);
}
public
void
deleteMedia
(
String
name
)
throws
VLCException
{
_deleteMedia
(
name
);
}
public
void
setEnabled
(
String
name
,
boolean
enabled
)
throws
VLCException
{
_setEnabled
(
name
,
enabled
);
}
public
void
setOutput
(
String
name
,
String
output
)
throws
VLCException
{
_setOutput
(
name
,
output
);
}
public
void
setInput
(
String
name
,
String
input
)
throws
VLCException
{
_setInput
(
name
,
input
);
}
public
void
setLoop
(
String
name
,
boolean
loop
)
throws
VLCException
{
_setLoop
(
name
,
loop
);
}
public
void
changeMedia
(
String
name
,
String
input
,
String
output
,
String
[]
options
,
boolean
enabled
,
boolean
loop
)
throws
VLCException
{
_changeMedia
(
name
,
input
,
output
,
options
,
enabled
,
loop
);
}
/**
* Checks if the input is playing.
* @return True if there is a playing input.
...
...
@@ -217,6 +271,7 @@ public class JVLC implements JLibVLC, Runnable {
*/
public
void
run
()
{
while
(!
beingDestroyed
)
{
try
{
while
(
playlist
.
isRunning
())
{
if
(
playlist
.
inputIsPlaying
())
{
inputPlaying
=
true
;
...
...
@@ -236,7 +291,8 @@ public class JVLC implements JLibVLC, Runnable {
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
// while playlist running
}
}
catch
(
VLCException
e1
)
{
}
// while playlist running
inputPlaying
=
false
;
inputVout
=
false
;
try
{
...
...
bindings/java/org/videolan/jvlc/Playlist.java
View file @
0e977f2f
...
...
@@ -54,71 +54,71 @@ public class Playlist implements PlaylistIntf {
native
private
boolean
_inputHasVout
();
public
synchronized
void
play
(
int
id
,
String
[]
options
)
{
public
synchronized
void
play
(
int
id
,
String
[]
options
)
throws
VLCException
{
_play
(
id
,
options
);
}
public
synchronized
void
play
()
{
public
synchronized
void
play
()
throws
VLCException
{
play
(-
1
,
null
);
}
public
synchronized
void
pause
()
{
public
synchronized
void
togglePause
()
throws
VLCException
{
_pause
();
}
public
synchronized
void
stop
()
{
public
synchronized
void
stop
()
throws
VLCException
{
_stop
();
}
public
boolean
isRunning
()
{
public
boolean
isRunning
()
throws
VLCException
{
return
(
_isRunning
()
==
0
)?
false
:
true
;
}
public
synchronized
int
itemsCount
()
{
public
synchronized
int
itemsCount
()
throws
VLCException
{
return
_itemsCount
();
}
public
synchronized
void
next
()
{
public
synchronized
void
next
()
throws
VLCException
{
if
(!
isRunning
())
play
();
_next
();
}
public
synchronized
void
prev
()
{
public
synchronized
void
prev
()
throws
VLCException
{
if
(!
isRunning
())
play
();
_prev
();
}
public
synchronized
void
clear
()
{
public
synchronized
void
clear
()
throws
VLCException
{
_clear
();
}
public
synchronized
int
add
(
String
uri
,
String
name
,
String
[]
options
)
{
public
synchronized
int
add
(
String
uri
,
String
name
,
String
[]
options
)
throws
VLCException
{
return
_playlist_add
(
uri
,
name
,
options
);
}
public
synchronized
int
add
(
String
uri
,
String
name
)
{
public
synchronized
int
add
(
String
uri
,
String
name
)
throws
VLCException
{
return
add
(
uri
,
name
,
null
);
}
public
synchronized
void
addExtended
()
{
}
public
synchronized
void
deleteItem
(
int
itemID
)
{
public
synchronized
void
deleteItem
(
int
itemID
)
throws
VLCException
{
_deleteItem
(
itemID
);
}
public
long
getInstance
()
{
public
long
getInstance
()
throws
VLCException
{
return
libvlcInstance
;
}
public
synchronized
boolean
inputIsPlaying
()
{
public
synchronized
boolean
inputIsPlaying
()
throws
VLCException
{
return
_inputIsPlaying
();
}
public
synchronized
boolean
inputHasVout
()
{
public
synchronized
boolean
inputHasVout
()
throws
VLCException
{
return
_inputHasVout
();
}
...
...
bindings/java/org/videolan/jvlc/PlaylistIntf.java
View file @
0e977f2f
...
...
@@ -30,18 +30,72 @@
package
org.videolan.jvlc
;
public
interface
PlaylistIntf
{
void
play
(
int
id
,
String
[]
options
);
void
pause
();
void
stop
();
boolean
isRunning
();
int
itemsCount
();
boolean
inputIsPlaying
();
void
next
();
void
prev
();
void
clear
();
int
add
(
String
uri
,
String
name
);
void
addExtended
();
boolean
inputHasVout
();
/**
* @param id The ID to play
* @param options Options to play the item withs
*/
void
play
(
int
id
,
String
[]
options
)
throws
VLCException
;
/**
* Plays the current item
*/
void
play
()
throws
VLCException
;
/**
* Toggles pause for the current item.
*/
void
togglePause
()
throws
VLCException
;
/**
* Stops the playlist.
*/
void
stop
()
throws
VLCException
;
/**
* @return True if playlist is not stopped
*/
boolean
isRunning
()
throws
VLCException
;
/**
* @return Current number of items in the playlist
*/
int
itemsCount
()
throws
VLCException
;
/**
* @return True if the current input is really playing
*/
boolean
inputIsPlaying
()
throws
VLCException
;
/**
* Move to next item
*/
void
next
()
throws
VLCException
;
/**
* Move to previous item
*/
void
prev
()
throws
VLCException
;
/**
* Clear the playlist
*/
void
clear
()
throws
VLCException
;
/**
* Add a new item in the playlist
* @param uri Location of the item
* @param name Name of the item
* @return The item ID
*/
int
add
(
String
uri
,
String
name
)
throws
VLCException
;
/**
* Currently not implemented
*/
void
addExtended
();
/**
* @return True if the current input has spawned a video output window
*/
boolean
inputHasVout
()
throws
VLCException
;
}
bindings/java/org/videolan/jvlc/VLCException.java
0 → 100644
View file @
0e977f2f
/*****************************************************************************
* JVLC.java: Main Java Class, represents a libvlc_instance_t object
*****************************************************************************
*
* Copyright (C) 1998-2006 the VideoLAN team
*
* Author: Philippe Morin <phmorin@free.fr>
*
* Created on 18-jul-2006
*
* $Id $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*
*/
package
org.videolan.jvlc
;
import
java.lang.Exception
;
public
class
VLCException
extends
Exception
{
public
VLCException
()
{
super
();
}
public
VLCException
(
String
message
)
{
super
(
message
);
}
public
VLCException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
VLCException
(
Throwable
cause
)
{
super
(
cause
);
}
}
bindings/java/org/videolan/jvlc/VLMIntf.java
View file @
0e977f2f
...
...
@@ -29,12 +29,64 @@
package
org.videolan.jvlc
;
public
interface
VLMIntf
{
void
addBroadcast
(
String
name
,
String
input
,
String
output
,
String
[]
options
,
boolean
enabled
,
boolean
loop
);
void
deleteMedia
(
String
name
);
void
setEnabled
(
String
name
,
boolean
enabled
);
void
setOutput
(
String
name
,
String
output
);
void
setInput
(
String
name
,
String
input
);
void
setLoop
(
String
name
,
boolean
loop
);
void
changeMedia
(
String
name
,
String
input
,
String
output
,
String
[]
options
,
boolean
enabled
,
boolean
loop
);
/**
* Add a broadcast, with one input
* @param mediaName the name of the new broadcast
* @param medInputMRL the input MRL
* @param mediaOutputURL the output MRL (the parameter to the "sout" variable)
* @param additionalOptions additional options
* @param enableBroadcast boolean for enabling the new broadcast
* @param isPlayableInLoop Should this broadcast be played in loop ?
*/
void
addBroadcast
(
String
name
,
String
input
,
String
output
,
String
[]
options
,
boolean
enabled
,
boolean
loop
)
throws
VLCException
;
/**
* Delete a media (vod or broadcast)
* @param name the media to delete
*/
void
deleteMedia
(
String
name
)
throws
VLCException
;
/**
* Enable or disable a media (vod or broadcast)
* @param name the media to work on
* @param enabled the new status
*/
void
setEnabled
(
String
name
,
boolean
enabled
)
throws
VLCException
;
/**
* Set the output for a media
* @param name the media to work on
* @param output the output MRL (the parameter to the "sout" variable)
*/
void
setOutput
(
String
name
,
String
output
)
throws
VLCException
;
/**
* Set a media's input MRL. This will delete all existing inputs and
* add the specified one.
* @param name the media to work on
* @param input the input MRL
*/
void
setInput
(
String
name
,
String
input
)
throws
VLCException
;
/**
* Set output for a media
* @param name the media to work on
* @param loop the new status
*/
void
setLoop
(
String
name
,
boolean
loop
)
throws
VLCException
;
/**
* Edit the parameters of a media. This will delete all existing inputs and
* add the specified one.
* @param name the name of the new broadcast
* @param input the input MRL
* @param output the output MRL (the parameter to the "sout" variable)
* @param options additional options
* @param enabled boolean for enabling the new broadcast
* @param loop Should this broadcast be played in loop ?
*/
void
changeMedia
(
String
name
,
String
input
,
String
output
,
String
[]
options
,
boolean
enabled
,
boolean
loop
)
throws
VLCException
;
}
bindings/java/org/videolan/jvlc/VideoIntf.java
View file @
0e977f2f
...
...
@@ -29,32 +29,25 @@
package
org.videolan.jvlc
;
/**
* @author little
*
*/
/**
* @author little
*
*/
public
interface
VideoIntf
{
/**
* Toggles the fullscreen.
*/
void
toggleFullscreen
();
void
toggleFullscreen
()
throws
VLCException
;
/**
* Sets fullscreen if fullscreen argument is true.
* @param fullscreen
*/
void
setFullscreen
(
boolean
fullscreen
);
void
setFullscreen
(
boolean
fullscreen
)
throws
VLCException
;
/**
* @return True if the current video window is in fullscreen mode.
*/
boolean
getFullscreen
();
boolean
getFullscreen
()
throws
VLCException
;
/**
...
...
@@ -63,16 +56,16 @@ public interface VideoIntf {
* If you only give a path, not including the filename, the snapshot will be saved in
* the specified path using vlc naming conventions.
*/
void
getSnapshot
(
String
filepath
);
void
getSnapshot
(
String
filepath
)
throws
VLCException
;
/**
* @return The current video window height
*/
int
getVideoHeight
();
int
getVideoHeight
()
throws
VLCException
;
/**
* @return The current video window width
*/
int
getVideoWidth
();
int
getVideoWidth
()
throws
VLCException
;
}
bindings/java/vlc-graphics-jni.cc
View file @
0e977f2f
...
...
@@ -26,10 +26,7 @@
#include <jawt.h>
#include <jawt_md.h>
#ifndef WIN32
#include <X11/Xlib.h> // for Xlibs graphics functions
#endif
#include <stdio.h> // for printf
/* JVLC internal imports, generated by gcjh */
...
...
@@ -44,16 +41,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
JAWT
awt
;
JAWT_DrawingSurface
*
ds
;
JAWT_DrawingSurfaceInfo
*
dsi
;
#ifdef WIN32
JAWT_Win32DrawingSurfaceInfo
*
dsi_win
;
#else
JAWT_X11DrawingSurfaceInfo
*
dsi_x11
;
GC
gc
;
#endif
jint
lock
;
GC
gc
;
vlc_value_t
value
;
...
...
bindings/java/vlc-libvlc-jni.cc
View file @
0e977f2f
...
...
@@ -4,8 +4,9 @@
* Copyright (C) 1998-2006 the VideoLAN team
*
* Authors: Filippo Carone <filippo@carone.org>
* Philippe Morin <phmorin@free.fr>
*
* $Id$
* $Id
: vlc-libvlc-jni.cc 140 2006-07-26 13:47:20Z littlejohn
$
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -38,30 +39,19 @@
jlong
getClassInstance
(
JNIEnv
*
env
,
jobject
_this
);
jlong
getPlaylistInstance
(
JNIEnv
*
env
,
jobject
_this
);
JNIEXPORT
jlong
JNICALL
Java_org_videolan_jvlc_JVLC_createInstance__
(
JNIEnv
*
env
,
jobject
_this
)
{
void
handle_vlc_exception
(
JNIEnv
*
env
,
libvlc_exception_t
*
exception
)
{
jclass
newExcCls
;
// res is the pointer to libvlc_instance_t
long
res
;
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
char
temp_argv
[
1
][
5
]
=
{
""
};
libvlc_exception_init
(
exception
);
res
=
(
long
)
libvlc_new
(
0
,
(
char
**
)
temp_argv
,
exception
);
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
// raise a Java exception
newExcCls
=
env
->
FindClass
(
"org/videolan/jvlc/VLCException"
);
if
(
newExcCls
==
0
)
{
/* Unable to find the new exception class, give up. */
return
;
}
env
->
ThrowNew
(
newExcCls
,
libvlc_exception_get_message
(
exception
));
free
(
exception
);
//libvlc_playlist_lock( ( libvlc_instance_t * ) res, NULL);
return
res
;
}
JNIEXPORT
jlong
JNICALL
Java_org_videolan_jvlc_JVLC_createInstance___3Ljava_lang_String_2
(
JNIEnv
*
env
,
jobject
_this
,
jobjectArray
args
)
{
long
res
;
...
...
@@ -74,7 +64,10 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_JVLC_createInstance___3Ljava_lang
argc
=
(
int
)
env
->
GetArrayLength
((
jarray
)
args
)
+
1
;
argv
=
(
const
char
**
)
malloc
(
argc
*
sizeof
(
char
*
));
sprintf
(
(
char
*
)
argv
[
0
],
"%s"
,
"jvlc"
);
argv
[
0
]
=
"vlc"
;
for
(
int
i
=
0
;
i
<
argc
-
1
;
i
++
)
{
argv
[
i
+
1
]
=
env
->
GetStringUTFChars
((
jstring
)
env
->
GetObjectArrayElement
(
args
,
i
),
0
...
...
@@ -125,8 +118,7 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_JVLC__1getMute (JNIEnv *env, j
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -149,8 +141,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLC__1setMute (JNIEnv *env, jobje
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -172,8 +163,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLC__1toggleMute (JNIEnv *env, jo
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -196,8 +186,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_JVLC__1getVolume (JNIEnv *env, job
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -221,8 +210,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLC__1setVolume (JNIEnv *env, job
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -250,8 +238,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLC__1toggleFullscreen (JNIEnv *e
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -273,8 +260,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLC__1setFullscreen (JNIEnv *env,
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -297,8 +283,7 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_JVLC__1getFullscreen (JNIEnv *
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -321,16 +306,14 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLC__1getSnapshot (JNIEnv *env, j
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
libvlc_video_take_snapshot
(
input
,
(
char
*
)
psz_filepath
,
exception
);
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
...
...
@@ -357,8 +340,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_JVLC__1getVideoHeight (JNIEnv *env
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -383,8 +365,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_JVLC__1getVideoWidth (JNIEnv *env,
if
(
libvlc_exception_raised
(
exception
))
{
///\TODO: raise java exception
printf
(
"%s
\n
"
,
libvlc_exception_get_message
(
exception
));
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
...
...
@@ -419,8 +400,17 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Playlist__1playlist_1add (JNIEnv *
env
->
GetStringUTFChars
(
(
jstring
)
env
->
GetObjectArrayElement
(
options
,
i
),
0
);
}
res
=
libvlc_playlist_add_extended
(
(
libvlc_instance_t
*
)
instance
,
psz_uri
,
psz_name
,
i_options
,
ppsz_options
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
}
else
{
res
=
libvlc_playlist_add
(
(
libvlc_instance_t
*
)
instance
,
psz_uri
,
psz_name
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
}
/// \todo check exceptions
...
...
@@ -451,17 +441,19 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1play (JNIEnv *env, jobj
libvlc_exception_init
(
exception
);
if
(
options
!=
NULL
)
{
i_options
=
(
int
)
env
->
GetArrayLength
(
(
jarray
)
options
)
+
1
;
i_options
=
(
int
)
env
->
GetArrayLength
(
(
jarray
)
options
);
ppsz_options
=
(
const
char
**
)
malloc
(
i_options
*
sizeof
(
char
*
)
);
sprintf
(
(
char
*
)
ppsz_options
[
0
],
"%s"
,
"jvlc"
);
for
(
int
i
=
0
;
i
<
i_options
-
1
;
i
++
)
{
ppsz_options
[
i
+
1
]
=
ppsz_options
[
i
]
=
env
->
GetStringUTFChars
(
(
jstring
)
env
->
GetObjectArrayElement
(
options
,
i
),
0
);
}
}
libvlc_playlist_play
(
p_instance
,
id
,
i_options
,
(
char
**
)
ppsz_options
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
;
...
...
@@ -476,6 +468,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1pause (JNIEnv *env, job
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_playlist_pause
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
;
...
...
@@ -488,10 +484,13 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1stop (JNIEnv *env, jobj
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_playlist_stop
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Playlist__1next
(
JNIEnv
*
env
,
jobject
_this
)
{
...
...
@@ -501,6 +500,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1next (JNIEnv *env, jobj
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_playlist_next
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
;
...
...
@@ -514,6 +517,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1prev (JNIEnv *env, jobj
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_playlist_prev
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
;
...
...
@@ -526,6 +533,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1clear (JNIEnv *env, job
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_playlist_clear
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
;
...
...
@@ -539,6 +550,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1deleteItem (JNIEnv *env
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_playlist_delete_item
(
(
libvlc_instance_t
*
)
instance
,
itemID
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
;
...
...
@@ -553,6 +568,10 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Playlist__1itemsCount (JNIEnv *env
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
res
=
libvlc_playlist_items_count
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
...
...
@@ -567,6 +586,10 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Playlist__1isRunning (JNIEnv *env,
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
res
=
libvlc_playlist_isplaying
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
...
...
@@ -584,10 +607,16 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Playlist__1inputIsPlaying (JNI
instance
=
getPlaylistInstance
(
env
,
_this
);
input
=
libvlc_playlist_get_input
(
(
libvlc_instance_t
*
)
instance
,
exception
);
/// \todo check exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
res
=
libvlc_input_will_play
(
input
,
exception
);
/// \todo check exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
...
...
@@ -604,10 +633,16 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Playlist__1inputHasVout (JNIEn
instance
=
getPlaylistInstance
(
env
,
_this
);
input
=
libvlc_playlist_get_input
(
(
libvlc_instance_t
*
)
instance
,
exception
);
/// \todo check exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
res
=
libvlc_input_has_vout
(
input
,
exception
);
/// \todo check exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
...
...
@@ -628,9 +663,16 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_JVLC__1getInputLength (JNIEnv *en
instance
=
getPlaylistInstance
(
env
,
_this
);
input
=
libvlc_playlist_get_input
(
(
libvlc_instance_t
*
)
instance
,
exception
);
/// \todo check exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
res
=
libvlc_input_get_length
(
input
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
...
...
@@ -647,9 +689,17 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_JVLC__1getInputTime (JNIEnv *env,
instance
=
getPlaylistInstance
(
env
,
_this
);
input
=
libvlc_playlist_get_input
(
(
libvlc_instance_t
*
)
instance
,
exception
);
/// \todo check exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
res
=
libvlc_input_get_time
(
input
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
...
...
@@ -667,9 +717,17 @@ JNIEXPORT jfloat JNICALL Java_org_videolan_jvlc_JVLC__1getInputPosition (JNIEnv
instance
=
getPlaylistInstance
(
env
,
_this
);
input
=
libvlc_playlist_get_input
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
res
=
libvlc_input_get_position
(
input
,
exception
);
/// \todo handle exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
...
...
@@ -688,15 +746,257 @@ JNIEXPORT jfloat JNICALL Java_org_videolan_jvlc_JVLC__1getInputFPS (JNIEnv *env,
instance
=
getPlaylistInstance
(
env
,
_this
);
input
=
libvlc_playlist_get_input
(
(
libvlc_instance_t
*
)
instance
,
exception
);
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
res
=
libvlc_input_get_fps
(
input
,
exception
);
/// \todo handle exceptions
if
(
libvlc_exception_raised
(
exception
)
)
{
handle_vlc_exception
(
env
,
exception
);
}
free
(
exception
);
return
res
;
}
/*
* VLM native functions
*/
/*
* Class: org_videolan_jvlc_JVLC
* Method: _addBroadcast
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;ZZ)V
*/
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLC__1addBroadcast
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
,
jstring
inputmrl
,
jstring
outputmrl
,
jobjectArray
options
,
jboolean
enable
,
jboolean
loop
)
{
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
const
char
*
psz_inputmrl
=
env
->
GetStringUTFChars
(
inputmrl
,
0
);
const
char
*
psz_outputmrl
=
env
->
GetStringUTFChars
(
outputmrl
,
0
);
long
instance
=
0
;
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
int
i_options
=
0
;
const
char
**
ppsz_options
=
NULL
;
if
(
options
!=
NULL
)
{
i_options
=
(
int
)
env
->
GetArrayLength
(
(
jarray
)
options
);
ppsz_options
=
(
const
char
**
)
malloc
(
i_options
*
sizeof
(
char
*
)
);
for
(
int
i
=
0
;
i
<
i_options
-
1
;
i
++
)
{
ppsz_options
[
i
]
=
env
->
GetStringUTFChars
(
(
jstring
)
env
->
GetObjectArrayElement
(
options
,
i
),
0
);
}
}
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_vlm_add_broadcast
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_inputmrl
,
(
char
*
)
psz_outputmrl
,
i_options
,
(
char
**
)
ppsz_options
,
enable
,
loop
,
exception
);
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
if
(
psz_inputmrl
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
inputmrl
,
psz_inputmrl
);
}
if
(
psz_outputmrl
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
outputmrl
,
psz_outputmrl
);
}
handle_vlc_exception
(
env
,
exception
);
free
(
exception
);
}
/*
* Class: org_videolan_jvlc_JVLC
* Method: _deleteMedia
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLC__1deleteMedia
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
)
{
long
instance
=
0
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_vlm_del_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
exception
);
handle_vlc_exception
(
env
,
exception
);
/* free resources */
free
(
exception
);
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
}
/*
* Class: org_videolan_jvlc_JVLC
* Method: _setEnabled
* Signature: (Ljava/lang/String;Z)V
*/
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLC__1setEnabled
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
,
jboolean
newStatus
)
{
long
instance
=
0
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_vlm_set_enabled
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
newStatus
,
exception
);
handle_vlc_exception
(
env
,
exception
);
/* free resources */
free
(
exception
);
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
}
/*
* Class: org_videolan_jvlc_JVLC
* Method: _setOutput
* Signature: (Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLC__1setOutput
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
,
jstring
mrl
)
{
long
instance
=
0
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
const
char
*
psz_mrl
=
env
->
GetStringUTFChars
(
mrl
,
0
);
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_vlm_set_output
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_mrl
,
exception
);
handle_vlc_exception
(
env
,
exception
);
/* free resources */
free
(
exception
);
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
if
(
psz_mrl
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
mrl
,
psz_mrl
);
}
}
/*
* Class: org_videolan_jvlc_JVLC
* Method: _setInput
* Signature: (Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLC__1setInput
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
,
jstring
mrl
)
{
long
instance
=
0
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
const
char
*
psz_mrl
=
env
->
GetStringUTFChars
(
mrl
,
0
);
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_vlm_set_input
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_mrl
,
exception
);
handle_vlc_exception
(
env
,
exception
);
/* free resources */
free
(
exception
);
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
if
(
psz_mrl
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
mrl
,
psz_mrl
);
}
}
/*
* Class: org_videolan_jvlc_JVLC
* Method: _setLoop
* Signature: (Ljava/lang/String;Z)V
*/
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLC__1setLoop
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
,
jboolean
newStatus
)
{
long
instance
=
0
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_vlm_set_loop
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
newStatus
,
exception
);
handle_vlc_exception
(
env
,
exception
);
/* free resources */
free
(
exception
);
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
}
/*
* Class: org_videolan_jvlc_JVLC
* Method: _changeMedia
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;ZZ)V
*/
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLC__1changeMedia
(
JNIEnv
*
env
,
jobject
_this
,
jstring
name
,
jstring
inputmrl
,
jstring
outputmrl
,
jobjectArray
options
,
jboolean
enablenewbroadcast
,
jboolean
broadcast
)
{
int
i_options
=
0
;
const
char
**
ppsz_options
=
NULL
;
long
instance
=
0
;
if
(
options
!=
NULL
)
{
i_options
=
(
int
)
env
->
GetArrayLength
(
(
jarray
)
options
);
ppsz_options
=
(
const
char
**
)
malloc
(
i_options
*
sizeof
(
char
*
)
);
for
(
int
i
=
0
;
i
<
i_options
-
1
;
i
++
)
{
ppsz_options
[
i
]
=
env
->
GetStringUTFChars
(
(
jstring
)
env
->
GetObjectArrayElement
(
options
,
i
),
0
);
}
}
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
const
char
*
psz_inputmrl
=
env
->
GetStringUTFChars
(
inputmrl
,
0
);
const
char
*
psz_outputmrl
=
env
->
GetStringUTFChars
(
outputmrl
,
0
);
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
libvlc_exception_init
(
exception
);
instance
=
getPlaylistInstance
(
env
,
_this
);
libvlc_vlm_change_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_inputmrl
,
(
char
*
)
psz_outputmrl
,
i_options
,
(
char
**
)
ppsz_options
,
enablenewbroadcast
,
broadcast
,
exception
);
handle_vlc_exception
(
env
,
exception
);
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
}
if
(
psz_inputmrl
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_inputmrl
);
}
if
(
psz_outputmrl
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_outputmrl
);
}
}
/*
* Utility functions
...
...
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