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
bda1fc3c
Commit
bda1fc3c
authored
May 18, 2009
by
Sébastien Escudier
Committed by
Rémi Denis-Courmont
May 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle VLM events in libvlc
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
0537633a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
1 deletion
+90
-1
include/vlc/libvlc_events.h
include/vlc/libvlc_events.h
+13
-0
include/vlc/libvlc_vlm.h
include/vlc/libvlc_vlm.h
+13
-0
src/control/core.c
src/control/core.c
+3
-0
src/control/libvlc_internal.h
src/control/libvlc_internal.h
+1
-0
src/control/vlm.c
src/control/vlm.c
+59
-1
src/libvlc.sym
src/libvlc.sym
+1
-0
No files found.
include/vlc/libvlc_events.h
View file @
bda1fc3c
...
@@ -93,6 +93,12 @@ enum libvlc_event_type_t {
...
@@ -93,6 +93,12 @@ enum libvlc_event_type_t {
libvlc_MediaPlayerTitleChanged
,
libvlc_MediaPlayerTitleChanged
,
libvlc_MediaPlayerSnapshotTaken
,
libvlc_MediaPlayerSnapshotTaken
,
libvlc_MediaPlayerLengthChanged
,
libvlc_MediaPlayerLengthChanged
,
libvlc_VlmMediaAdded
,
libvlc_VlmMediaRemoved
,
libvlc_VlmMediaChanged
,
libvlc_VlmMediaInstanceStarted
,
libvlc_VlmMediaInstanceStopped
,
/* New event types HERE */
/* New event types HERE */
};
};
...
@@ -212,6 +218,13 @@ struct libvlc_event_t
...
@@ -212,6 +218,13 @@ struct libvlc_event_t
{
{
libvlc_time_t
new_length
;
libvlc_time_t
new_length
;
}
media_player_length_changed
;
}
media_player_length_changed
;
/* VLM media */
struct
{
const
char
*
psz_media_name
;
}
vlm_media_event
;
}
u
;
}
u
;
};
};
...
...
include/vlc/libvlc_vlm.h
View file @
bda1fc3c
...
@@ -333,6 +333,19 @@ VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *,
...
@@ -333,6 +333,19 @@ VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *,
const
char
*
,
int
,
const
char
*
,
int
,
libvlc_exception_t
*
);
libvlc_exception_t
*
);
/**
* Get libvlc_event_manager from a vlm media.
* The p_event_manager is immutable, so you don't have to hold the lock
*
* \param p_instance a libvlc instance
* \param psz_name name of vlm media instance
* \param p_exception an initialized exception pointer
* \return libvlc_event_manager
*/
VLC_PUBLIC_API
libvlc_event_manager_t
*
libvlc_vlm_get_event_manager
(
libvlc_instance_t
*
,
libvlc_exception_t
*
);
/** @} */
/** @} */
# ifdef __cplusplus
# ifdef __cplusplus
...
...
src/control/core.c
View file @
bda1fc3c
...
@@ -138,6 +138,7 @@ libvlc_instance_t * libvlc_new( int argc, const char *const *argv,
...
@@ -138,6 +138,7 @@ libvlc_instance_t * libvlc_new( int argc, const char *const *argv,
p_new
->
p_libvlc_int
=
p_libvlc_int
;
p_new
->
p_libvlc_int
=
p_libvlc_int
;
p_new
->
p_vlm
=
NULL
;
p_new
->
p_vlm
=
NULL
;
p_new
->
p_event_manager
=
NULL
;
p_new
->
b_playlist_locked
=
0
;
p_new
->
b_playlist_locked
=
0
;
p_new
->
ref_count
=
1
;
p_new
->
ref_count
=
1
;
p_new
->
verbosity
=
1
;
p_new
->
verbosity
=
1
;
...
@@ -173,6 +174,8 @@ void libvlc_release( libvlc_instance_t *p_instance )
...
@@ -173,6 +174,8 @@ void libvlc_release( libvlc_instance_t *p_instance )
{
{
vlc_mutex_destroy
(
lock
);
vlc_mutex_destroy
(
lock
);
vlc_mutex_destroy
(
&
p_instance
->
event_callback_lock
);
vlc_mutex_destroy
(
&
p_instance
->
event_callback_lock
);
if
(
p_instance
->
p_event_manager
)
libvlc_event_manager_release
(
p_instance
->
p_event_manager
);
libvlc_InternalCleanup
(
p_instance
->
p_libvlc_int
);
libvlc_InternalCleanup
(
p_instance
->
p_libvlc_int
);
libvlc_InternalDestroy
(
p_instance
->
p_libvlc_int
);
libvlc_InternalDestroy
(
p_instance
->
p_libvlc_int
);
free
(
p_instance
);
free
(
p_instance
);
...
...
src/control/libvlc_internal.h
View file @
bda1fc3c
...
@@ -61,6 +61,7 @@ struct libvlc_instance_t
...
@@ -61,6 +61,7 @@ struct libvlc_instance_t
{
{
libvlc_int_t
*
p_libvlc_int
;
libvlc_int_t
*
p_libvlc_int
;
vlm_t
*
p_vlm
;
vlm_t
*
p_vlm
;
libvlc_event_manager_t
*
p_event_manager
;
int
b_playlist_locked
;
int
b_playlist_locked
;
unsigned
ref_count
;
unsigned
ref_count
;
int
verbosity
;
int
verbosity
;
...
...
src/control/vlm.c
View file @
bda1fc3c
...
@@ -105,13 +105,63 @@ char* libvlc_vlm_show_media( libvlc_instance_t *p_instance,
...
@@ -105,13 +105,63 @@ char* libvlc_vlm_show_media( libvlc_instance_t *p_instance,
}
}
#endif
/* 0 */
#endif
/* 0 */
/* VLM events callback. Transmit to libvlc */
static
int
VlmEvent
(
vlc_object_t
*
p_this
,
const
char
*
name
,
vlc_value_t
old_val
,
vlc_value_t
newval
,
void
*
param
)
{
vlm_event_t
*
event
=
(
vlm_event_t
*
)
newval
.
p_address
;
libvlc_event_manager_t
*
p_event_manager
=
(
libvlc_event_manager_t
*
)
param
;
libvlc_event_t
libvlc_event
;
libvlc_event
.
u
.
vlm_media_event
.
psz_media_name
=
event
->
psz_name
;
switch
(
event
->
i_type
)
{
case
VLM_EVENT_MEDIA_ADDED
:
libvlc_event
.
type
=
libvlc_VlmMediaAdded
;
break
;
case
VLM_EVENT_MEDIA_REMOVED
:
libvlc_event
.
type
=
libvlc_VlmMediaRemoved
;
break
;
case
VLM_EVENT_MEDIA_CHANGED
:
libvlc_event
.
type
=
libvlc_VlmMediaChanged
;
break
;
case
VLM_EVENT_MEDIA_INSTANCE_STARTED
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStarted
;
break
;
case
VLM_EVENT_MEDIA_INSTANCE_STOPPED
:
libvlc_event
.
type
=
libvlc_VlmMediaInstanceStopped
;
break
;
}
libvlc_event_send
(
p_event_manager
,
&
libvlc_event
);
return
0
;
}
static
int
libvlc_vlm_init
(
libvlc_instance_t
*
p_instance
,
static
int
libvlc_vlm_init
(
libvlc_instance_t
*
p_instance
,
libvlc_exception_t
*
p_exception
)
libvlc_exception_t
*
p_exception
)
{
{
if
(
!
p_instance
->
p_event_manager
)
{
p_instance
->
p_event_manager
=
libvlc_event_manager_new
(
p_instance
->
p_vlm
,
p_instance
,
p_exception
);
libvlc_event_manager_register_event_type
(
p_instance
->
p_event_manager
,
libvlc_VlmMediaAdded
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
p_event_manager
,
libvlc_VlmMediaRemoved
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
p_event_manager
,
libvlc_VlmMediaChanged
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
p_event_manager
,
libvlc_VlmMediaInstanceStarted
,
NULL
);
libvlc_event_manager_register_event_type
(
p_instance
->
p_event_manager
,
libvlc_VlmMediaInstanceStopped
,
NULL
);
}
if
(
!
p_instance
->
p_vlm
)
if
(
!
p_instance
->
p_vlm
)
{
p_instance
->
p_vlm
=
vlm_New
(
p_instance
->
p_libvlc_int
);
p_instance
->
p_vlm
=
vlm_New
(
p_instance
->
p_libvlc_int
);
var_AddCallback
(
(
vlc_object_t
*
)
p_instance
->
p_vlm
,
"intf-event"
,
VlmEvent
,
p_instance
->
p_event_manager
);
}
if
(
!
p_instance
->
p_vlm
)
if
(
!
p_instance
->
p_vlm
)
{
{
libvlc_exception_raise
(
p_exception
,
libvlc_exception_raise
(
p_exception
,
...
@@ -530,3 +580,11 @@ int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *p_instance,
...
@@ -530,3 +580,11 @@ int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *p_instance,
vlm_media_instance_Delete
(
p_mi
);
vlm_media_instance_Delete
(
p_mi
);
return
p_mi
?
0
:
-
1
;
return
p_mi
?
0
:
-
1
;
}
}
libvlc_event_manager_t
*
libvlc_vlm_get_event_manager
(
libvlc_instance_t
*
p_instance
,
libvlc_exception_t
*
p_exception
)
{
vlm_t
*
p_vlm
;
VLM_RET
(
p_vlm
,
NULL
);
return
p_instance
->
p_event_manager
;
}
src/libvlc.sym
View file @
bda1fc3c
...
@@ -202,6 +202,7 @@ libvlc_vlm_add_vod
...
@@ -202,6 +202,7 @@ libvlc_vlm_add_vod
libvlc_vlm_add_input
libvlc_vlm_add_input
libvlc_vlm_change_media
libvlc_vlm_change_media
libvlc_vlm_del_media
libvlc_vlm_del_media
libvlc_vlm_get_event_manager
libvlc_vlm_get_media_instance_chapter
libvlc_vlm_get_media_instance_chapter
libvlc_vlm_get_media_instance_length
libvlc_vlm_get_media_instance_length
libvlc_vlm_get_media_instance_position
libvlc_vlm_get_media_instance_position
...
...
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