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
9f9d8982
Commit
9f9d8982
authored
Jul 06, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: Add a --verbose-objects option to select which objects should print their msg.
Sample usage: --verbose-objects=+input,-all
parent
dfa0e1e9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
0 deletions
+83
-0
include/vlc_messages.h
include/vlc_messages.h
+6
-0
src/libvlc-module.c
src/libvlc-module.c
+10
-0
src/libvlc.c
src/libvlc.c
+22
-0
src/libvlc.h
src/libvlc.h
+2
-0
src/misc/messages.c
src/misc/messages.c
+43
-0
No files found.
include/vlc_messages.h
View file @
9f9d8982
...
...
@@ -108,6 +108,12 @@ VLC_EXPORT( void, __msg_Dbg, ( vlc_object_t *, const char *, ... ) LIBVLC_FOR
VLC_EXPORT
(
msg_subscription_t
*
,
__msg_Subscribe
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
void
,
__msg_Unsubscribe
,
(
vlc_object_t
*
,
msg_subscription_t
*
)
);
/* Enable or disable a certain object debug messages */
#define msg_EnableObjectPrinting(a,b) __msg_EnableObjectPrinting(VLC_OBJECT(a),b)
#define msg_DisableObjectPrinting(a,b) __msg_DisableObjectPrinting(VLC_OBJECT(a),b)
VLC_EXPORT
(
void
,
__msg_EnableObjectPrinting
,
(
vlc_object_t
*
,
char
*
psz_object
)
);
VLC_EXPORT
(
void
,
__msg_DisableObjectPrinting
,
(
vlc_object_t
*
,
char
*
psz_object
)
);
/**
* @}
*/
...
...
src/libvlc-module.c
View file @
9f9d8982
...
...
@@ -166,6 +166,14 @@ static const char *const ppsz_snap_formats[] =
"This is the verbosity level (0=only errors and " \
"standard messages, 1=warnings, 2=debug).")
#define VERBOSE_OBJECTS_TEXT N_("Choose which objects should print debug " \
"message")
#define VERBOSE_OBJECTS_LONGTEXT N_( \
"This is a ',' separated string, each objects should be prefixed by " \
"a '+' or a '-' to respectively enable or disable it. The keyword " \
"'all' refers to all objects. Note, you still need to use -vvv " \
"to actually display debug message.")
#define QUIET_TEXT N_("Be quiet")
#define QUIET_LONGTEXT N_( \
"Turn off all warning and information messages.")
...
...
@@ -1958,6 +1966,8 @@ vlc_module_begin();
add_integer
(
"verbose"
,
0
,
NULL
,
VERBOSE_TEXT
,
VERBOSE_LONGTEXT
,
false
);
change_short
(
'v'
);
add_string
(
"verbose-objects"
,
0
,
NULL
,
VERBOSE_OBJECTS_TEXT
,
VERBOSE_OBJECTS_LONGTEXT
,
false
);
add_bool
(
"quiet"
,
0
,
NULL
,
QUIET_TEXT
,
QUIET_LONGTEXT
,
true
);
change_short
(
'q'
);
...
...
src/libvlc.c
View file @
9f9d8982
...
...
@@ -666,6 +666,28 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/*
* Message queue options
*/
char
*
psz_verbose_objects
=
config_GetPsz
(
p_libvlc
,
"verbose-objects"
);
if
(
psz_verbose_objects
)
{
char
*
psz_object
,
*
iter
=
psz_verbose_objects
;
while
(
(
psz_object
=
strsep
(
&
iter
,
","
))
)
{
switch
(
psz_object
[
0
]
)
{
printf
(
"%s
\n
"
,
psz_object
+
1
);
case
'+'
:
msg_EnableObjectPrinting
(
p_libvlc
,
psz_object
+
1
);
break
;
case
'-'
:
msg_DisableObjectPrinting
(
p_libvlc
,
psz_object
+
1
);
break
;
default:
msg_Err
(
p_libvlc
,
"verbose-objects usage:
\n
"
"--verbose-objects=+printthatobject,"
"-dontprintthatone
\n
"
"(keyword 'all' to applies to all objects)
\n
"
);
free
(
psz_verbose_objects
);
return
VLC_EGENERIC
;
}
}
free
(
psz_verbose_objects
);
}
var_Create
(
p_libvlc
,
"verbose"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
if
(
config_GetInt
(
p_libvlc
,
"quiet"
)
>
0
)
...
...
src/libvlc.h
View file @
9f9d8982
...
...
@@ -209,6 +209,8 @@ typedef struct libvlc_priv_t
msg_bank_t
msg_bank
;
///< The message bank
int
i_verbose
;
///< info messages
bool
b_color
;
///< color messages?
vlc_dictionary_t
msg_enabled_objects
;
///< Enabled objects
bool
msg_all_objects_enabled
;
///< Should we print all objects?
/* Timer stats */
vlc_mutex_t
timer_lock
;
///< Lock to protect timers
...
...
src/misc/messages.c
View file @
9f9d8982
...
...
@@ -96,6 +96,9 @@ void msg_Create (libvlc_int_t *p_libvlc)
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_libvlc
);
vlc_mutex_init
(
&
priv
->
msg_bank
.
lock
);
vlc_mutex_init
(
&
QUEUE
.
lock
);
vlc_dictionary_init
(
&
priv
->
msg_enabled_objects
,
0
);
priv
->
msg_all_objects_enabled
=
true
;
QUEUE
.
b_overflow
=
false
;
QUEUE
.
i_start
=
0
;
QUEUE
.
i_stop
=
0
;
...
...
@@ -127,6 +130,35 @@ void msg_Flush (libvlc_int_t *p_libvlc)
vlc_mutex_unlock
(
&
QUEUE
.
lock
);
}
/**
* Object Printing selection
*/
static
void
const
*
kObjectPrintingEnabled
=
(
void
*
)
1
;
static
void
const
*
kObjectPrintingDisabled
=
(
void
*
)
-
1
;
void
__msg_EnableObjectPrinting
(
vlc_object_t
*
p_this
,
char
*
psz_object
)
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_this
->
p_libvlc
);
vlc_mutex_lock
(
&
QUEUE
.
lock
);
if
(
!
strcmp
(
psz_object
,
"all"
)
)
priv
->
msg_all_objects_enabled
=
true
;
else
vlc_dictionary_insert
(
&
priv
->
msg_enabled_objects
,
psz_object
,
kObjectPrintingEnabled
);
vlc_mutex_unlock
(
&
QUEUE
.
lock
);
}
void
__msg_DisableObjectPrinting
(
vlc_object_t
*
p_this
,
char
*
psz_object
)
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_this
->
p_libvlc
);
vlc_mutex_lock
(
&
QUEUE
.
lock
);
if
(
!
strcmp
(
psz_object
,
"all"
)
)
priv
->
msg_all_objects_enabled
=
false
;
else
vlc_dictionary_insert
(
&
priv
->
msg_enabled_objects
,
psz_object
,
kObjectPrintingDisabled
);
vlc_mutex_unlock
(
&
QUEUE
.
lock
);
}
/**
* Destroy the message queues
*
...
...
@@ -151,6 +183,9 @@ void msg_Destroy (libvlc_int_t *p_libvlc)
#ifdef UNDER_CE
CloseHandle
(
QUEUE
.
logfile
);
#endif
vlc_dictionary_clear
(
&
priv
->
msg_enabled_objects
);
/* Destroy lock */
vlc_mutex_destroy
(
&
QUEUE
.
lock
);
vlc_mutex_destroy
(
&
priv
->
msg_bank
.
lock
);
...
...
@@ -567,6 +602,14 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
}
psz_object
=
p_item
->
psz_object_type
;
void
*
val
=
vlc_dictionary_value_for_key
(
&
priv
->
msg_enabled_objects
,
psz_object
);
if
(
val
==
kObjectPrintingDisabled
)
return
;
if
(
val
==
kObjectPrintingEnabled
)
/* Allowed */
;
else
if
(
!
priv
->
msg_all_objects_enabled
)
return
;
int
canc
=
vlc_savecancel
();
#ifdef UNDER_CE
...
...
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