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
14d8d88c
Commit
14d8d88c
authored
Jul 13, 2010
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add msg_SubscriptionSetVerbosity call, so core filter message-level for subscribers
parent
2784bc2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
include/vlc_messages.h
include/vlc_messages.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/messages.c
src/misc/messages.c
+28
-0
No files found.
include/vlc_messages.h
View file @
14d8d88c
...
...
@@ -114,6 +114,7 @@ typedef void (*msg_callback_t) (msg_cb_data_t *, msg_item_t *, unsigned);
VLC_EXPORT
(
msg_subscription_t
*
,
msg_Subscribe
,
(
libvlc_int_t
*
,
msg_callback_t
,
msg_cb_data_t
*
)
);
VLC_EXPORT
(
void
,
msg_Unsubscribe
,
(
msg_subscription_t
*
)
);
VLC_EXPORT
(
void
,
msg_SubscriptionSetVerbosity
,
(
msg_subscription_t
*
,
const
int
)
);
/* Enable or disable a certain object debug messages */
VLC_EXPORT
(
void
,
msg_EnableObjectPrinting
,
(
vlc_object_t
*
,
const
char
*
psz_object
)
);
...
...
src/libvlccore.sym
View file @
14d8d88c
...
...
@@ -276,6 +276,7 @@ msg_Generic
msg_GenericVa
msg_Subscribe
msg_Unsubscribe
msg_SubscriptionSetVerbosity
msleep
mstrtime
mwait
...
...
src/misc/messages.c
View file @
14d8d88c
...
...
@@ -142,6 +142,7 @@ msg_bank_t *msg_Create (void)
static
void
const
*
kObjectPrintingEnabled
=
&
kObjectPrintingEnabled
;
static
void
const
*
kObjectPrintingDisabled
=
&
kObjectPrintingDisabled
;
#undef msg_EnableObjectPrinting
void
msg_EnableObjectPrinting
(
vlc_object_t
*
obj
,
const
char
*
psz_object
)
{
...
...
@@ -202,6 +203,7 @@ struct msg_subscription_t
libvlc_int_t
*
instance
;
msg_callback_t
func
;
msg_cb_data_t
*
opaque
;
int
verbosity
;
};
/**
...
...
@@ -224,6 +226,7 @@ msg_subscription_t *msg_Subscribe (libvlc_int_t *instance, msg_callback_t cb,
sub
->
instance
=
instance
;
sub
->
func
=
cb
;
sub
->
opaque
=
opaque
;
sub
->
verbosity
=
2
;
/* by default, give all the messages */
msg_bank_t
*
bank
=
libvlc_bank
(
instance
);
vlc_rwlock_wrlock
(
&
bank
->
lock
);
...
...
@@ -247,6 +250,18 @@ void msg_Unsubscribe (msg_subscription_t *sub)
free
(
sub
);
}
void
msg_SubscriptionSetVerbosity
(
msg_subscription_t
*
sub
,
const
int
i_verbosity
)
{
if
(
i_verbosity
<
0
||
i_verbosity
>
2
)
return
;
msg_bank_t
*
bank
=
libvlc_bank
(
sub
->
instance
);
vlc_rwlock_wrlock
(
&
bank
->
lock
);
sub
->
verbosity
=
i_verbosity
;
vlc_rwlock_unlock
(
&
bank
->
lock
);
}
/*****************************************************************************
* msg_*: print a message
*****************************************************************************
...
...
@@ -455,6 +470,19 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
if
(
val
==
kObjectPrintingEnabled
);
/* Allowed */
else
if
(
!
bank
->
all_objects_enabled
)
continue
;
}
switch
(
p_item
->
i_type
)
{
case
VLC_MSG_INFO
:
case
VLC_MSG_ERR
:
if
(
sub
->
verbosity
<
0
)
continue
;
break
;
case
VLC_MSG_WARN
:
if
(
sub
->
verbosity
<
1
)
continue
;
break
;
case
VLC_MSG_DBG
:
if
(
sub
->
verbosity
<
2
)
continue
;
break
;
}
sub
->
func
(
sub
->
opaque
,
p_item
,
0
);
}
...
...
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