Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
76ca9001
Commit
76ca9001
authored
Jan 06, 2009
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc, jvlc: media_player_is_playing method added
parent
d7ee744d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
1 deletion
+54
-1
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
...core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
+1
-1
bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
...ava/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
+6
-0
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
...core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
+2
-0
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
...ava/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
+12
-0
include/vlc/libvlc.h
include/vlc/libvlc.h
+9
-0
src/control/media_player.c
src/control/media_player.c
+23
-0
src/libvlc.sym
src/libvlc.sym
+1
-0
No files found.
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
View file @
76ca9001
...
...
@@ -35,7 +35,7 @@ public class MediaListPlayer
private
final
LibVlcMediaListPlayer
instance
;
private
final
JVLC
jvlc
;
public
MediaListPlayer
(
JVLC
jvlc
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
View file @
76ca9001
...
...
@@ -150,6 +150,12 @@ public class MediaPlayer
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_get_fps
(
instance
,
exception
);
}
public
boolean
isPlaying
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
return
libvlc
.
libvlc_media_player_is_playing
(
instance
,
exception
)
==
1
?
true
:
false
;
}
public
void
addListener
(
final
MediaPlayerListener
listener
)
{
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
View file @
76ca9001
...
...
@@ -454,6 +454,8 @@ public interface LibVlc extends Library
void
libvlc_media_player_set_position
(
LibVlcMediaPlayer
instance
,
float
position
,
libvlc_exception_t
exception
);
int
libvlc_media_player_is_playing
(
LibVlcMediaPlayer
instance
,
libvlc_exception_t
exception
);
int
libvlc_media_player_will_play
(
LibVlcMediaPlayer
instance
,
libvlc_exception_t
exception
);
void
libvlc_media_player_set_rate
(
LibVlcMediaPlayer
instance
,
float
rate
,
libvlc_exception_t
exception
);
...
...
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
View file @
76ca9001
...
...
@@ -58,6 +58,18 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
Assert
.
assertEquals
(
0
,
exception
.
raised
);
}
@Test
public
void
mediaPlayerIsPlaying
()
throws
Exception
{
LibVlcMedia
md
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
LibVlcMediaPlayer
mi
=
libvlc
.
libvlc_media_player_new_from_media
(
md
,
exception
);
Assert
.
assertEquals
(
0
,
libvlc
.
libvlc_media_player_is_playing
(
mi
,
exception
));
libvlc
.
libvlc_media_player_play
(
mi
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
Thread
.
sleep
(
200
);
Assert
.
assertEquals
(
1
,
libvlc
.
libvlc_media_player_is_playing
(
mi
,
exception
));
}
@Test
public
void
mediaPlayerPauseBad
()
{
...
...
include/vlc/libvlc.h
View file @
76ca9001
...
...
@@ -498,6 +498,15 @@ VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_play
*/
VLC_PUBLIC_API
libvlc_event_manager_t
*
libvlc_media_player_event_manager
(
libvlc_media_player_t
*
,
libvlc_exception_t
*
);
/**
* is_playing
*
* \param p_mi the Media Player
* \param p_e an initialized exception pointer
* \return 1 if the media player is playing, 0 otherwise
*/
VLC_PUBLIC_API
int
libvlc_media_player_is_playing
(
libvlc_media_player_t
*
,
libvlc_exception_t
*
);
/**
* Play
*
...
...
src/control/media_player.c
View file @
76ca9001
...
...
@@ -633,6 +633,29 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi,
vlc_object_release
(
p_input_thread
);
}
/**************************************************************************
* is_playing
**************************************************************************/
int
libvlc_media_player_is_playing
(
libvlc_media_player_t
*
p_mi
,
libvlc_exception_t
*
p_e
)
{
input_thread_t
*
p_input_thread
=
libvlc_get_input_thread
(
p_mi
,
p_e
);
if
(
!
p_input_thread
)
return
0
;
libvlc_state_t
state
=
libvlc_media_player_get_state
(
p_mi
,
p_e
);
vlc_object_release
(
p_input_thread
);
if
(
state
==
libvlc_Playing
)
{
return
1
;
}
return
0
;
}
/**************************************************************************
* Stop
**************************************************************************/
...
...
src/libvlc.sym
View file @
76ca9001
...
...
@@ -134,6 +134,7 @@ libvlc_media_player_get_title
libvlc_media_player_get_title_count
libvlc_media_player_has_vout
libvlc_media_player_is_seekable
libvlc_media_player_is_playing
libvlc_media_player_new
libvlc_media_player_new_from_input_thread
libvlc_media_player_new_from_media
...
...
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