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
88bc3a7e
Commit
88bc3a7e
authored
Apr 18, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msg_Subscribe: expose structure to plugins
This eliminates one error case that nobody dealt with anyway.
parent
b549105c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
34 deletions
+24
-34
include/vlc_interface.h
include/vlc_interface.h
+11
-6
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+1
-1
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+2
-2
modules/gui/ncurses.c
modules/gui/ncurses.c
+3
-3
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+2
-2
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/messages.hpp
+1
-1
modules/misc/logger.c
modules/misc/logger.c
+3
-3
src/misc/messages.c
src/misc/messages.c
+1
-16
No files found.
include/vlc_interface.h
View file @
88bc3a7e
...
...
@@ -107,11 +107,6 @@ VLC_API void libvlc_Quit( libvlc_int_t * );
* @{
*/
/**
* Used by interface plugins which subscribe to the message bank.
*/
typedef
struct
msg_subscription_t
msg_subscription_t
;
/**
* Message logging callback signature.
* Accepts one private data pointer, the message, and an overrun counter.
...
...
@@ -119,7 +114,17 @@ typedef struct msg_subscription_t msg_subscription_t;
typedef
void
(
*
msg_callback_t
)
(
void
*
,
int
,
const
msg_item_t
*
,
const
char
*
,
va_list
);
VLC_API
msg_subscription_t
*
vlc_Subscribe
(
msg_callback_t
,
void
*
)
VLC_USED
;
/**
* Used by interface plugins which subscribe to the message bank.
*/
typedef
struct
msg_subscription
{
struct
msg_subscription
*
prev
,
*
next
;
msg_callback_t
func
;
void
*
opaque
;
}
msg_subscription_t
;
VLC_API
void
vlc_Subscribe
(
msg_subscription_t
*
,
msg_callback_t
,
void
*
);
VLC_API
void
vlc_Unsubscribe
(
msg_subscription_t
*
);
/*@}*/
...
...
modules/gui/macosx/intf.h
View file @
88bc3a7e
...
...
@@ -75,7 +75,7 @@ struct intf_sys_t
bool
b_vout_update
;
/* The messages window */
msg_subscription_t
*
p_
sub
;
msg_subscription_t
sub
;
};
/*****************************************************************************
...
...
modules/gui/macosx/intf.m
View file @
88bc3a7e
...
...
@@ -106,7 +106,7 @@ int OpenIntf ( vlc_object_t *p_this )
memset
(
p_intf
->
p_sys
,
0
,
sizeof
(
*
p_intf
->
p_sys
)
);
/* subscribe to LibVLCCore's messages */
p_intf
->
p_sys
->
p_sub
=
vlc_Subscribe
(
MsgCallback
,
NULL
);
vlc_Subscribe
(
&
p_intf
->
p_sys
->
sub
,
MsgCallback
,
NULL
);
p_intf
->
pf_run
=
Run
;
p_intf
->
b_should_run_on_first_thread
=
true
;
...
...
@@ -775,7 +775,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[
o_eyetv
release
];
/* unsubscribe from libvlc's debug messages */
vlc_Unsubscribe
(
p_intf
->
p_sys
->
p_
sub
);
vlc_Unsubscribe
(
&
p_intf
->
p_sys
->
sub
);
[
o_msg_arr
removeAllObjects
];
[
o_msg_arr
release
];
...
...
modules/gui/ncurses.c
View file @
88bc3a7e
...
...
@@ -190,7 +190,7 @@ struct intf_sys_t
int
box_start
;
// first line of box displayed
int
box_idx
;
// selected line
msg_subscription_t
*
sub
;
// message bank subscription
msg_subscription_t
sub
;
// message bank subscription
struct
{
int
type
;
...
...
@@ -1789,7 +1789,7 @@ static int Open(vlc_object_t *p_this)
vlc_mutex_init
(
&
sys
->
pl_lock
);
sys
->
verbosity
=
var_InheritInteger
(
intf
,
"verbose"
);
sys
->
sub
=
vlc_Subscribe
(
MsgCallback
,
sys
);
vlc_Subscribe
(
&
sys
->
sub
,
MsgCallback
,
sys
);
sys
->
box_type
=
BOX_PLAYLIST
;
sys
->
plidx_follow
=
true
;
...
...
@@ -1842,7 +1842,7 @@ static void Close(vlc_object_t *p_this)
endwin
();
/* Close the ncurses interface */
vlc_Unsubscribe
(
sys
->
sub
);
vlc_Unsubscribe
(
&
sys
->
sub
);
vlc_mutex_destroy
(
&
sys
->
msg_lock
);
vlc_mutex_destroy
(
&
sys
->
pl_lock
);
for
(
unsigned
i
=
0
;
i
<
sizeof
sys
->
msgs
/
sizeof
*
sys
->
msgs
;
i
++
)
{
...
...
modules/gui/qt4/dialogs/messages.cpp
View file @
88bc3a7e
...
...
@@ -121,13 +121,13 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
readSettings
(
"Messages"
,
QSize
(
600
,
450
)
);
/* Hook up to LibVLC messaging */
sub
=
vlc_Subscribe
(
MsgCallback
,
this
);
vlc_Subscribe
(
&
sub
,
MsgCallback
,
this
);
}
MessagesDialog
::~
MessagesDialog
()
{
writeSettings
(
"Messages"
);
vlc_Unsubscribe
(
sub
);
vlc_Unsubscribe
(
&
sub
);
};
void
MessagesDialog
::
changeVerbosity
(
int
i_verbosity
)
...
...
modules/gui/qt4/dialogs/messages.hpp
View file @
88bc3a7e
...
...
@@ -48,7 +48,7 @@ private:
virtual
~
MessagesDialog
();
Ui
::
messagesPanelWidget
ui
;
msg_subscription_t
*
sub
;
msg_subscription_t
sub
;
static
void
sinkMessage
(
void
*
,
msg_item_t
*
,
unsigned
);
void
customEvent
(
QEvent
*
);
void
sinkMessage
(
const
MsgEvent
*
);
...
...
modules/misc/logger.c
View file @
88bc3a7e
...
...
@@ -74,7 +74,7 @@
*****************************************************************************/
struct
intf_sys_t
{
msg_subscription_t
*
p_
sub
;
msg_subscription_t
sub
;
FILE
*
p_file
;
const
char
*
footer
;
};
...
...
@@ -298,7 +298,7 @@ static int Open( vlc_object_t *p_this )
fputs
(
header
,
p_sys
->
p_file
);
}
p_sys
->
p_sub
=
vlc_Subscribe
(
cb
,
p_intf
);
vlc_Subscribe
(
&
p_sys
->
sub
,
cb
,
p_intf
);
return
VLC_SUCCESS
;
}
...
...
@@ -311,7 +311,7 @@ static void Close( vlc_object_t *p_this )
intf_sys_t
*
p_sys
=
p_intf
->
p_sys
;
/* Flush the queue and unsubscribe from the message queue */
vlc_Unsubscribe
(
p_sys
->
p_
sub
);
vlc_Unsubscribe
(
&
p_sys
->
sub
);
/* Close the log file */
#ifdef HAVE_SYSLOG_H
...
...
src/misc/messages.c
View file @
88bc3a7e
...
...
@@ -55,13 +55,6 @@
vlc_rwlock_t
msg_lock
=
VLC_STATIC_RWLOCK
;
msg_subscription_t
*
msg_head
;
struct
msg_subscription_t
{
msg_subscription_t
*
prev
,
*
next
;
msg_callback_t
func
;
void
*
opaque
;
};
/**
* Subscribe to the message queue.
* Whenever a message is emitted, a callback will be called.
...
...
@@ -69,14 +62,9 @@ struct msg_subscription_t
*
* @param cb callback function
* @param opaque data for the callback function
* @return a subscription pointer, or NULL in case of failure
*/
msg_subscription_t
*
vlc_Subscribe
(
msg_callback_t
cb
,
void
*
opaque
)
void
vlc_Subscribe
(
msg_subscription_t
*
sub
,
msg_callback_t
cb
,
void
*
opaque
)
{
msg_subscription_t
*
sub
=
malloc
(
sizeof
(
*
sub
));
if
(
sub
==
NULL
)
return
NULL
;
sub
->
prev
=
NULL
;
sub
->
func
=
cb
;
sub
->
opaque
=
opaque
;
...
...
@@ -85,8 +73,6 @@ msg_subscription_t *vlc_Subscribe (msg_callback_t cb, void *opaque)
sub
->
next
=
msg_head
;
msg_head
=
sub
;
vlc_rwlock_unlock
(
&
msg_lock
);
return
sub
;
}
/**
...
...
@@ -106,7 +92,6 @@ void vlc_Unsubscribe (msg_subscription_t *sub)
msg_head
=
sub
->
next
;
}
vlc_rwlock_unlock
(
&
msg_lock
);
free
(
sub
);
}
/**
...
...
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