Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
57536677
Commit
57536677
authored
May 20, 2007
by
littlejohn
Browse files
libvlc events related functions renamed
parent
67eea3ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
bindings/java/src/callback-jni.cc
View file @
57536677
...
...
@@ -56,11 +56,11 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1install_1callback( JNIEnv
wakeupListenersMethod
=
env
->
GetStaticMethodID
(
audioClass
,
"wakeupListeners"
,
"()V"
);
}
libvlc_
callback_register_for_event
(
(
libvlc_instance_t
*
)
instance
,
VOLUME_CHANGED
,
volumeChangedCallback
,
NULL
,
exception
);
libvlc_
event_add_callback
(
(
libvlc_instance_t
*
)
instance
,
VOLUME_CHANGED
,
volumeChangedCallback
,
NULL
,
exception
);
CHECK_EXCEPTION_FREE
;
}
...
...
include/vlc/libvlc.h
View file @
57536677
...
...
@@ -807,11 +807,11 @@ VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterat
* \param user_data user provided data to carry with the event
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API
void
libvlc_
callback_register_for_event
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
user_data
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
void
libvlc_
event_add_callback
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
user_data
,
libvlc_exception_t
*
p_e
);
/**
* Unregister a callback notification
...
...
@@ -820,11 +820,11 @@ VLC_PUBLIC_API void libvlc_callback_register_for_event( libvlc_instance_t *p_ins
* \param f_callback the function to call when i_event_type occurs
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API
void
libvlc_
callback_unregister_for_event
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
p_user_data
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
void
libvlc_
event_remove_callback
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
p_user_data
,
libvlc_exception_t
*
p_e
);
/** @} */
...
...
src/control/event.c
View file @
57536677
/*****************************************************************************
*
libvlc_callback
.c: New libvlc
callback
control API
*
event
.c: New libvlc
event
control API
*****************************************************************************
* Copyright (C) 2007 the VideoLAN team
* $Id $
...
...
@@ -24,9 +24,14 @@
#include "libvlc_internal.h"
#include <vlc/libvlc.h>
static
int
handle_callback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
/*
* Private functions
*/
static
int
handle_event
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
struct
libvlc_callback_entry_t
*
entry
=
p_data
;
libvlc_event_t
event
;
...
...
@@ -50,11 +55,30 @@ static int handle_callback( vlc_object_t *p_this, char const *psz_cmd,
return
VLC_SUCCESS
;
}
void
libvlc_callback_register_for_event
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
user_data
,
libvlc_exception_t
*
p_e
)
static
inline
void
add_callback_entry
(
struct
libvlc_callback_entry_t
*
entry
,
struct
libvlc_callback_entry_list_t
**
list
)
{
struct
libvlc_callback_entry_list_t
*
new_listitem
;
new_listitem
=
malloc
(
sizeof
(
struct
libvlc_callback_entry_list_t
)
);
new_listitem
->
elmt
=
entry
;
new_listitem
->
next
=
*
list
;
new_listitem
->
prev
=
NULL
;
if
(
*
list
)
(
*
list
)
->
prev
=
new_listitem
;
*
list
=
new_listitem
;
}
/*
* Public libvlc functions
*/
void
libvlc_event_add_callback
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
user_data
,
libvlc_exception_t
*
p_e
)
{
if
(
!
&
f_callback
)
...
...
@@ -81,7 +105,7 @@ void libvlc_callback_register_for_event( libvlc_instance_t *p_instance,
int
res
=
var_AddCallback
(
p_instance
->
p_libvlc_int
,
callback_name
,
handle_
callback
,
handle_
event
,
entry
);
if
(
res
!=
VLC_SUCCESS
)
...
...
@@ -95,11 +119,11 @@ void libvlc_callback_register_for_event( libvlc_instance_t *p_instance,
return
;
}
void
libvlc_
callback_unregister_for_event
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
p_user_data
,
libvlc_exception_t
*
p_e
)
void
libvlc_
event_remove_callback
(
libvlc_instance_t
*
p_instance
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
p_user_data
,
libvlc_exception_t
*
p_e
)
{
struct
libvlc_callback_entry_list_t
*
p_listitem
=
p_instance
->
p_callback_list
;
...
...
src/control/libvlc_internal.h
View file @
57536677
...
...
@@ -78,22 +78,6 @@ struct libvlc_input_t
struct
libvlc_instance_t
*
p_instance
;
///< Parent instance
};
static
inline
void
add_callback_entry
(
struct
libvlc_callback_entry_t
*
entry
,
struct
libvlc_callback_entry_list_t
**
list
)
{
struct
libvlc_callback_entry_list_t
*
new_listitem
;
new_listitem
=
malloc
(
sizeof
(
struct
libvlc_callback_entry_list_t
)
);
new_listitem
->
elmt
=
entry
;
new_listitem
->
next
=
*
list
;
new_listitem
->
prev
=
NULL
;
if
(
*
list
)
(
*
list
)
->
prev
=
new_listitem
;
*
list
=
new_listitem
;
}
#define RAISENULL( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \
return NULL; }
#define RAISEVOID( psz,a... ) { libvlc_exception_raise( p_e, psz,##a ); \
...
...
Write
Preview
Supports
Markdown
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