Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
adc653a9
Commit
adc653a9
authored
Jul 20, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvlc: remove MediaInstace
parent
bc91ae25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
196 deletions
+0
-196
bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java
...a/core/src/main/java/org/videolan/jvlc/MediaInstance.java
+0
-196
No files found.
bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java
deleted
100644 → 0
View file @
bc91ae25
/*****************************************************************************
* MediaInstance.java: VLC Java Bindings Media Instance
*****************************************************************************
* Copyright (C) 1998-2008 the VideoLAN team
*
* Authors: Filippo Carone <filippo@carone.org>
*
*
* $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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
package
org.videolan.jvlc
;
import
java.util.ArrayList
;
import
java.util.EnumSet
;
import
java.util.List
;
import
org.videolan.jvlc.event.MediaInstanceCallback
;
import
org.videolan.jvlc.event.MediaInstanceListener
;
import
org.videolan.jvlc.internal.LibVlc
;
import
org.videolan.jvlc.internal.LibVlcEventType
;
import
org.videolan.jvlc.internal.LibVlc.LibVlcEventManager
;
import
org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance
;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
public
class
MediaInstance
{
private
final
LibVlcMediaInstance
instance
;
private
final
LibVlc
libvlc
;
private
final
LibVlcEventManager
eventManager
;
private
List
<
MediaInstanceCallback
>
callbacks
=
new
ArrayList
<
MediaInstanceCallback
>();
private
MediaDescriptor
mediaDescriptor
;
MediaInstance
(
JVLC
jvlc
,
LibVlcMediaInstance
instance
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
this
.
instance
=
instance
;
libvlc
=
jvlc
.
getLibvlc
();
eventManager
=
libvlc
.
libvlc_media_player_event_manager
(
instance
,
exception
);
}
public
MediaInstance
(
MediaDescriptor
mediaDescriptor
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
=
mediaDescriptor
.
getLibvlc
();
instance
=
libvlc
.
libvlc_media_player_new_from_media
(
mediaDescriptor
.
getInstance
(),
exception
);
eventManager
=
libvlc
.
libvlc_media_player_event_manager
(
instance
,
exception
);
this
.
mediaDescriptor
=
mediaDescriptor
;
}
public
MediaDescriptor
getMediaDescriptor
()
{
return
mediaDescriptor
;
}
public
void
play
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
.
libvlc_media_player_play
(
instance
,
exception
);
}
public
void
stop
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
.
libvlc_media_player_stop
(
instance
,
exception
);
}
public
void
pause
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
.
libvlc_media_player_pause
(
instance
,
exception
);
}
public
long
getLength
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_get_length
(
instance
,
exception
);
}
public
long
getTime
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_get_time
(
instance
,
exception
);
}
public
void
setTime
(
long
time
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
.
libvlc_media_player_set_time
(
instance
,
time
,
exception
);
}
public
float
getPosition
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_get_position
(
instance
,
exception
);
}
public
void
setPosition
(
float
position
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
.
libvlc_media_player_set_position
(
instance
,
position
,
exception
);
}
public
boolean
willPlay
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
(
libvlc
.
libvlc_media_player_will_play
(
instance
,
exception
)
==
1
);
}
public
float
getRate
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_get_rate
(
instance
,
exception
);
}
public
void
setRate
(
float
rate
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlc
.
libvlc_media_player_set_rate
(
instance
,
rate
,
exception
);
}
public
boolean
hasVideoOutput
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
(
libvlc
.
libvlc_media_player_has_vout
(
instance
,
exception
)
==
1
);
}
public
float
getFPS
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_get_fps
(
instance
,
exception
);
}
public
void
addListener
(
final
MediaInstanceListener
listener
)
{
MediaInstanceCallback
callback
=
new
MediaInstanceCallback
(
this
,
listener
);
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
for
(
LibVlcEventType
event
:
EnumSet
.
range
(
LibVlcEventType
.
libvlc_MediaPlayerPlayed
,
LibVlcEventType
.
libvlc_MediaPlayerTimeChanged
))
{
libvlc
.
libvlc_event_attach
(
eventManager
,
event
.
ordinal
(),
callback
,
null
,
exception
);
}
callbacks
.
add
(
callback
);
}
/**
* {@inheritDoc}
*/
@Override
protected
void
finalize
()
throws
Throwable
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
for
(
MediaInstanceCallback
callback
:
callbacks
)
{
for
(
LibVlcEventType
event
:
EnumSet
.
range
(
LibVlcEventType
.
libvlc_MediaPlayerPlayed
,
LibVlcEventType
.
libvlc_MediaPlayerPositionChanged
))
{
libvlc
.
libvlc_event_detach
(
eventManager
,
event
.
ordinal
(),
callback
,
null
,
exception
);
}
}
libvlc
.
libvlc_media_player_release
(
instance
);
super
.
finalize
();
}
/**
* Returns the instance.
* @return the instance
*/
LibVlcMediaInstance
getInstance
()
{
return
instance
;
}
}
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