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
f8b641ed
Commit
f8b641ed
authored
Mar 09, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlcexample shows audio class uses
parent
9ac46b4e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
81 deletions
+30
-81
bindings/java/VLCExample.java
bindings/java/VLCExample.java
+30
-81
No files found.
bindings/java/VLCExample.java
View file @
f8b641ed
import
org.videolan.jvlc.Audio
;
import
org.videolan.jvlc.JVLC
;
import
org.videolan.jvlc.JVLC
;
import
org.videolan.jvlc.MediaDescriptor
;
import
org.videolan.jvlc.MediaDescriptor
;
import
org.videolan.jvlc.MediaInstance
;
import
org.videolan.jvlc.MediaInstance
;
import
org.videolan.jvlc.Playlist
;
import
org.videolan.jvlc.VLCException
;
import
org.videolan.jvlc.VLCException
;
import
org.videolan.jvlc.Video
;
import
org.videolan.jvlc.Video
;
import
org.videolan.jvlc.event.MediaInstanceListener
;
import
org.videolan.jvlc.event.MediaInstanceListener
;
...
@@ -13,7 +13,6 @@ public class VLCExample
...
@@ -13,7 +13,6 @@ public class VLCExample
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
{
System
.
out
.
println
(
"== Starting VLCExample =="
);
System
.
out
.
println
(
"== Starting VLCExample =="
);
boolean
videoInput
=
false
;
if
(
args
.
length
==
0
)
if
(
args
.
length
==
0
)
{
{
System
.
out
.
print
(
"Creating a JVLC instance without args"
);
System
.
out
.
print
(
"Creating a JVLC instance without args"
);
...
@@ -27,14 +26,14 @@ public class VLCExample
...
@@ -27,14 +26,14 @@ public class VLCExample
}
}
}
}
JVLC
jvlc
=
new
JVLC
(
args
);
JVLC
jvlc
=
new
JVLC
(
args
);
Playlist
playlist
=
new
Playlist
(
jvlc
);
System
.
out
.
println
(
"... done."
);
System
.
out
.
println
(
"... done."
);
MediaDescriptor
mediaDescriptor
=
new
MediaDescriptor
(
jvlc
,
"/home/carone/a.avi"
);
MediaDescriptor
mediaDescriptor
=
new
MediaDescriptor
(
jvlc
,
"/home/carone/a
pps/a
.avi"
);
MediaInstance
mediaInstance
=
mediaDescriptor
.
getMediaInstance
();
MediaInstance
mediaInstance
=
mediaDescriptor
.
getMediaInstance
();
mediaInstance
.
addListener
(
new
MediaInstanceListener
()
mediaInstance
.
addListener
(
new
MediaInstanceListener
()
{
{
@Override
@Override
public
void
endReached
(
MediaInstance
mediaInstance
)
public
void
endReached
(
MediaInstance
mediaInstance
)
{
{
...
@@ -67,26 +66,11 @@ public class VLCExample
...
@@ -67,26 +66,11 @@ public class VLCExample
});
});
mediaInstance
.
play
();
mediaInstance
.
play
();
// MediaInstance mediaInstance = playlist.getMediaInstance();
while
(!
mediaInstance
.
hasVideoOutput
())
//
{
// while (! mediaInstance. playlist.isPlaying())
Thread
.
sleep
(
100
);
// {
}
// Thread.sleep(100);
// }
// while (! jvlc.hasVout() )
// {
// Thread.sleep(100);
// }
// testing vout functionalities
// Thread.sleep(2500);
// if (jvlc.hasVout())
// {
// videoInput = true;
// }
//
// if (videoInput)
// {
try
try
{
{
Video
video
=
new
Video
(
jvlc
);
Video
video
=
new
Video
(
jvlc
);
...
@@ -110,64 +94,29 @@ public class VLCExample
...
@@ -110,64 +94,29 @@ public class VLCExample
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
// System.out.print("Muting...");
System
.
out
.
print
(
"Muting..."
);
// jvlc.audio.setMute(true);
Audio
audio
=
new
Audio
(
jvlc
);
// Thread.sleep(3000);
audio
.
setMute
(
true
);
// System.out.println("unmuting.");
Thread
.
sleep
(
3000
);
// jvlc.audio.setMute(false);
System
.
out
.
println
(
"unmuting."
);
// Thread.sleep(3000);
audio
.
setMute
(
false
);
// System.out.println("Volume is: " + jvlc.audio.getVolume());
Thread
.
sleep
(
3000
);
// System.out.print("Setting volume to 150... ");
System
.
out
.
println
(
"Volume is: "
+
audio
.
getVolume
());
// jvlc.audio.setVolume(150);
System
.
out
.
print
(
"Setting volume to 150... "
);
// System.out.println("done");
audio
.
setVolume
(
150
);
// System.out.println("== AUDIO INFO ==");
System
.
out
.
println
(
"done"
);
// int currentChannel = jvlc.audio.getChannel();
System
.
out
.
println
(
"== AUDIO INFO =="
);
// System.out.println("Audio track number: " + jvlc.audio.getTrack());
System
.
out
.
println
(
"Audio track number: "
+
audio
.
getTrack
(
mediaInstance
));
// System.out.println("Audio channel info: " + jvlc.audio.getChannel());
System
.
out
.
println
(
"Audio channel info: "
+
audio
.
getChannel
());
// System.out.print("Setting left channel... ");
Thread
.
sleep
(
3000
);
// jvlc.audio.setChannel(AudioIntf.LEFT_CHANNEL);
System
.
out
.
println
(
"MEDIA INSTANCE INFORMATION"
);
// System.out.println("done.");
System
.
out
.
println
(
"--------------------------"
);
// Thread.sleep(3000);
System
.
out
.
println
(
"Total length (ms) :\t"
+
mediaInstance
.
getLength
());
// System.out.print("Setting right channel... ");
System
.
out
.
println
(
"Input time (ms) :\t"
+
mediaInstance
.
getTime
());
// jvlc.audio.setChannel(AudioIntf.RIGHT_CHANNEL);
System
.
out
.
println
(
"Input position [0-1]:\t"
+
mediaInstance
.
getPosition
());
// System.out.println("done.");
System
.
out
.
println
(
"Input FPS :\t"
+
mediaInstance
.
getFPS
());
// Thread.sleep(3000);
// System.out.print("Reverting to original channel");
// jvlc.audio.setChannel(currentChannel);
// System.out.println("done.");
// Thread.sleep(3000);
// System.out.println("INPUT INFORMATION");
// System.out.println("-----------------");
// System.out.println("Total length (ms) :\t" + jvlc.input.getLength());
// System.out.println("Input time (ms) :\t" + jvlc.input.getTime());
// System.out.println("Input position [0-1]:\t" + jvlc.input.getPosition());
// if (videoInput)
// System.out.println("Input FPS :\t" + jvlc.input.getFPS());
//
// }
//
// catch (Exception e)
// {
// System.out.println("Something was wrong. I die :(.");
// jvlc.destroy();
// e.printStackTrace();
// System.exit(0);
// }
System
.
out
.
println
(
"Everything fine ;)"
);
System
.
out
.
println
(
"Everything fine ;)"
);
System
.
out
.
println
(
"Playing next item"
);
// try
// {
// jvlc.playlist.next();
// }
// catch (VLCException e)
// {
// e.printStackTrace();
// }
//
// Thread.sleep(3000);
// jvlc.destroy();
return
;
return
;
}
}
}
}
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