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
f17ac07e
Commit
f17ac07e
authored
Dec 16, 2006
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bindings for new audio functions, thanks to Philippe Morin
parent
24977cae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
9 deletions
+138
-9
bindings/java/VLCExample.java
bindings/java/VLCExample.java
+12
-1
bindings/java/org/videolan/jvlc/Audio.java
bindings/java/org/videolan/jvlc/Audio.java
+21
-1
bindings/java/org/videolan/jvlc/AudioIntf.java
bindings/java/org/videolan/jvlc/AudioIntf.java
+50
-0
bindings/java/src/audio-jni.cc
bindings/java/src/audio-jni.cc
+55
-7
No files found.
bindings/java/VLCExample.java
View file @
f17ac07e
...
...
@@ -10,7 +10,8 @@ public class VLCExample
boolean
videoInput
=
false
;
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.avi", "a.avi");
jvlc
.
playlist
.
add
(
"file:///home/little/a.avi"
,
"a.avi"
);
jvlc
.
playlist
.
add
(
"file://"
+
System
.
getProperty
(
"user.dir"
)
+
"/a.mp3"
,
"a.mp3"
);
jvlc
.
playlist
.
play
(
-
1
,
null
);
}
catch
(
VLCException
e
)
{
...
...
@@ -65,6 +66,15 @@ public class VLCExample
System
.
out
.
print
(
"Setting volume to 150... "
);
jvlc
.
audio
.
setVolume
(
150
);
System
.
out
.
println
(
"done"
);
System
.
out
.
println
(
"Audio channel info: "
+
jvlc
.
audio
.
getChannel
());
System
.
out
.
println
(
"Audio track info: "
+
jvlc
.
audio
.
getTrack
());
System
.
out
.
print
(
"Setting left channel... "
);
jvlc
.
audio
.
setChannel
(
"left"
);
System
.
out
.
print
(
"done."
);
Thread
.
sleep
(
3000
);
System
.
out
.
print
(
"Setting right channel... "
);
jvlc
.
audio
.
setChannel
(
"right"
);
System
.
out
.
print
(
"done."
);
Thread
.
sleep
(
3000
);
System
.
out
.
println
(
"INPUT INFORMATION"
);
System
.
out
.
println
(
"-----------------"
);
...
...
@@ -81,6 +91,7 @@ public class VLCExample
{
System
.
out
.
println
(
"Something was wrong. I die :(."
);
jvlc
.
destroy
();
e
.
printStackTrace
();
}
System
.
out
.
println
(
"Everything fine ;)"
);
...
...
bindings/java/org/videolan/jvlc/Audio.java
View file @
f17ac07e
...
...
@@ -4,6 +4,10 @@ public class Audio implements AudioIntf {
private
long
libvlcInstance
;
private
native
int
_getTrack
();
private
native
void
_setTrack
(
int
track
);
private
native
String
_getChannel
();
private
native
void
_setChannel
(
String
channel
);
private
native
boolean
_getMute
();
private
native
void
_setMute
(
boolean
value
);
private
native
void
_toggleMute
();
...
...
@@ -14,11 +18,27 @@ public class Audio implements AudioIntf {
this
.
libvlcInstance
=
instance
;
}
public
int
getTrack
()
throws
VLCException
{
return
_getTrack
();
}
public
void
setTrack
(
int
track
)
throws
VLCException
{
_setTrack
(
track
);
}
public
String
getChannel
()
throws
VLCException
{
return
_getChannel
();
}
public
void
setChannel
(
String
channel
)
throws
VLCException
{
_setChannel
(
channel
);
}
public
boolean
getMute
()
throws
VLCException
{
return
_getMute
();
}
public
void
setMute
(
boolean
value
)
throws
VLCException
{
public
void
setMute
(
boolean
value
)
throws
VLCException
{
_setMute
(
value
);
}
...
...
bindings/java/org/videolan/jvlc/AudioIntf.java
View file @
f17ac07e
...
...
@@ -30,6 +30,56 @@
package
org.videolan.jvlc
;
public
interface
AudioIntf
{
/**
* Constant for left channel audio
*/
final
String
LEFT_CHANNEL
=
"left"
;
/**
* Constant for right channel audio
*/
final
String
RIGHT_CHANNEL
=
"right"
;
/**
* Constant for reverse channel audio
*/
final
String
REVERSE_CHANNEL
=
"reverse"
;
/**
* Constant for stereo channel audio
*/
final
String
STEREO_CHANNEL
=
"stereo"
;
/**
* Constant for dolby channel audio
*/
final
String
DOLBY_CHANNEL
=
"dolby"
;
/**
* @return audio track
* @throws VLCException
*/
int
getTrack
()
throws
VLCException
;
/**
* @param audio track
* @throws VLCException
*/
void
setTrack
(
int
track
)
throws
VLCException
;
/**
* @return channel
* @throws VLCException
*/
String
getChannel
()
throws
VLCException
;
/**
* @param channel
* @throws VLCException
*/
void
setChannel
(
String
channel
)
throws
VLCException
;
/**
* @return True if input is currently muted.
* @throws VLCException
...
...
bindings/java/src/audio-jni.cc
View file @
f17ac07e
...
...
@@ -4,6 +4,7 @@
* Copyright (C) 1998-2006 the VideoLAN team
*
* Authors: Filippo Carone <filippo@carone.org>
* Philippe Morin <phmorin@free.fr>
*
*
* $Id $
...
...
@@ -32,6 +33,54 @@
#include "../includes/Audio.h"
#include "utils.h"
JNIEXPORT
jint
JNICALL
Java_org_videolan_jvlc_Audio__1getTrack
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
jint
res
=
0
;
res
=
libvlc_audio_get_track
(
(
libvlc_instance_t
*
)
instance
,
exception
);
CHECK_EXCEPTION_FREE
;
return
res
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Audio__1setTrack
(
JNIEnv
*
env
,
jobject
_this
,
jint
value
)
{
INIT_FUNCTION
;
libvlc_audio_set_track
(
(
libvlc_instance_t
*
)
instance
,
value
,
exception
);
CHECK_EXCEPTION_FREE
;
}
JNIEXPORT
jstring
JNICALL
Java_org_videolan_jvlc_Audio__1getChannel
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
char
*
res
;
res
=
libvlc_audio_get_channel
(
(
libvlc_instance_t
*
)
instance
,
exception
);
CHECK_EXCEPTION_FREE
;
return
env
->
NewStringUTF
(
res
);
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Audio__1setChannel
(
JNIEnv
*
env
,
jobject
_this
,
jstring
channel
)
{
INIT_FUNCTION
;
const
char
*
value
=
env
->
GetStringUTFChars
(
channel
,
0
);
libvlc_audio_set_channel
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
value
,
exception
);
env
->
ReleaseStringUTFChars
(
channel
,
value
);
CHECK_EXCEPTION_FREE
;
}
JNIEXPORT
jboolean
JNICALL
Java_org_videolan_jvlc_Audio__1getMute
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
...
...
@@ -39,7 +88,7 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Audio__1getMute (JNIEnv *env,
res
=
(
jboolean
)
libvlc_audio_get_mute
(
(
libvlc_instance_t
*
)
instance
,
exception
);
CHECK_EXCEPTION
;
CHECK_EXCEPTION
_FREE
;
return
res
;
...
...
@@ -51,7 +100,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setMute (JNIEnv *env, jobj
libvlc_audio_set_mute
(
(
libvlc_instance_t
*
)
instance
,
value
,
exception
);
CHECK_EXCEPTION
;
CHECK_EXCEPTION
_FREE
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Audio__1toggleMute
(
JNIEnv
*
env
,
jobject
_this
)
...
...
@@ -60,7 +109,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1toggleMute (JNIEnv *env, j
libvlc_audio_get_mute
(
(
libvlc_instance_t
*
)
instance
,
exception
);
CHECK_EXCEPTION
;
CHECK_EXCEPTION
_FREE
;
}
JNIEXPORT
jint
JNICALL
Java_org_videolan_jvlc_Audio__1getVolume
(
JNIEnv
*
env
,
jobject
_this
)
...
...
@@ -70,7 +119,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getVolume (JNIEnv *env, jo
res
=
libvlc_audio_get_volume
(
(
libvlc_instance_t
*
)
instance
,
exception
);
CHECK_EXCEPTION
;
CHECK_EXCEPTION
_FREE
;
return
res
;
}
...
...
@@ -81,6 +130,5 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setVolume (JNIEnv *env, jo
libvlc_audio_set_volume
(
(
libvlc_instance_t
*
)
instance
,
volume
,
exception
);
CHECK_EXCEPTION
;
CHECK_EXCEPTION
_FREE
;
}
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