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
af4bb51c
Commit
af4bb51c
authored
May 21, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc: move object variables debug dump to variables.c
No functional changes
parent
5a5fa91d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
73 deletions
+77
-73
src/misc/objects.c
src/misc/objects.c
+1
-73
src/misc/variables.c
src/misc/variables.c
+75
-0
src/misc/variables.h
src/misc/variables.h
+1
-0
No files found.
src/misc/objects.c
View file @
af4bb51c
...
...
@@ -568,73 +568,6 @@ vlc_list_t *vlc_list_children( vlc_object_t *obj )
return
l
;
}
static
void
DumpVariable
(
const
void
*
data
,
const
VISIT
which
,
const
int
depth
)
{
if
(
which
!=
postorder
&&
which
!=
leaf
)
return
;
(
void
)
depth
;
const
variable_t
*
p_var
=
*
(
const
variable_t
**
)
data
;
const
char
*
psz_type
=
"unknown"
;
switch
(
p_var
->
i_type
&
VLC_VAR_TYPE
)
{
#define MYCASE( type, nice ) \
case VLC_VAR_ ## type: \
psz_type = nice; \
break;
MYCASE
(
VOID
,
"void"
);
MYCASE
(
BOOL
,
"bool"
);
MYCASE
(
INTEGER
,
"integer"
);
MYCASE
(
HOTKEY
,
"hotkey"
);
MYCASE
(
STRING
,
"string"
);
MYCASE
(
VARIABLE
,
"variable"
);
MYCASE
(
FLOAT
,
"float"
);
MYCASE
(
TIME
,
"time"
);
MYCASE
(
COORDS
,
"coords"
);
MYCASE
(
ADDRESS
,
"address"
);
#undef MYCASE
}
printf
(
" *-o
\"
%s
\"
(%s"
,
p_var
->
psz_name
,
psz_type
);
if
(
p_var
->
psz_text
)
printf
(
", %s"
,
p_var
->
psz_text
);
fputc
(
')'
,
stdout
);
if
(
p_var
->
i_type
&
VLC_VAR_HASCHOICE
)
fputs
(
", has choices"
,
stdout
);
if
(
p_var
->
i_type
&
VLC_VAR_ISCOMMAND
)
fputs
(
", command"
,
stdout
);
if
(
p_var
->
value_callbacks
.
i_entries
)
printf
(
", %d callbacks"
,
p_var
->
value_callbacks
.
i_entries
);
switch
(
p_var
->
i_type
&
VLC_VAR_CLASS
)
{
case
VLC_VAR_VOID
:
break
;
case
VLC_VAR_BOOL
:
printf
(
": %s"
,
p_var
->
val
.
b_bool
?
"true"
:
"false"
);
break
;
case
VLC_VAR_INTEGER
:
printf
(
": %"
PRId64
,
p_var
->
val
.
i_int
);
break
;
case
VLC_VAR_STRING
:
printf
(
":
\"
%s
\"
"
,
p_var
->
val
.
psz_string
);
break
;
case
VLC_VAR_FLOAT
:
printf
(
": %f"
,
p_var
->
val
.
f_float
);
break
;
case
VLC_VAR_TIME
:
printf
(
": %"
PRIi64
,
(
int64_t
)
p_var
->
val
.
i_time
);
break
;
case
VLC_VAR_COORDS
:
printf
(
": %"
PRId32
"x%"
PRId32
,
p_var
->
val
.
coords
.
x
,
p_var
->
val
.
coords
.
y
);
break
;
case
VLC_VAR_ADDRESS
:
printf
(
": %p"
,
p_var
->
val
.
p_address
);
break
;
}
fputc
(
'\n'
,
stdout
);
}
/*****************************************************************************
* DumpCommand: print the current vlc structure
*****************************************************************************
...
...
@@ -673,12 +606,7 @@ static int DumpCommand( vlc_object_t *p_this, char const *psz_cmd,
p_object
=
p_this
->
p_libvlc
?
VLC_OBJECT
(
p_this
->
p_libvlc
)
:
p_this
;
PrintObject
(
vlc_internals
(
p_object
),
""
);
vlc_mutex_lock
(
&
vlc_internals
(
p_object
)
->
var_lock
);
if
(
vlc_internals
(
p_object
)
->
var_root
==
NULL
)
puts
(
" `-o No variables"
);
else
twalk
(
vlc_internals
(
p_object
)
->
var_root
,
DumpVariable
);
vlc_mutex_unlock
(
&
vlc_internals
(
p_object
)
->
var_lock
);
DumpVariables
(
p_object
);
}
libvlc_unlock
(
p_this
->
p_libvlc
);
...
...
src/misc/variables.c
View file @
af4bb51c
...
...
@@ -1421,3 +1421,78 @@ void var_FreeList( vlc_value_t *p_val, vlc_value_t *p_val2 )
free
(
p_val2
->
p_list
);
}
}
static
void
DumpVariable
(
const
void
*
data
,
const
VISIT
which
,
const
int
depth
)
{
if
(
which
!=
postorder
&&
which
!=
leaf
)
return
;
(
void
)
depth
;
const
variable_t
*
var
=
*
(
const
variable_t
**
)
data
;
const
char
*
typename
=
"unknown"
;
switch
(
var
->
i_type
&
VLC_VAR_TYPE
)
{
case
VLC_VAR_VOID
:
typename
=
"void"
;
break
;
case
VLC_VAR_BOOL
:
typename
=
"bool"
;
break
;
case
VLC_VAR_INTEGER
:
typename
=
"integer"
;
break
;
case
VLC_VAR_HOTKEY
:
typename
=
"hotkey"
;
break
;
case
VLC_VAR_STRING
:
typename
=
"string"
;
break
;
case
VLC_VAR_VARIABLE
:
typename
=
"variable"
;
break
;
case
VLC_VAR_FLOAT
:
typename
=
"float"
;
break
;
case
VLC_VAR_TIME
:
typename
=
"time"
;
break
;
case
VLC_VAR_COORDS
:
typename
=
"coordinates"
;
break
;
case
VLC_VAR_ADDRESS
:
typename
=
"address"
;
break
;
default:
typename
=
"unknown"
;
break
;
}
printf
(
" *-o
\"
%s
\"
(%s"
,
var
->
psz_name
,
typename
);
if
(
var
->
psz_text
!=
NULL
)
printf
(
", %s"
,
var
->
psz_text
);
putchar
(
')'
);
if
(
var
->
i_type
&
VLC_VAR_HASCHOICE
)
fputs
(
", has choices"
,
stdout
);
if
(
var
->
i_type
&
VLC_VAR_ISCOMMAND
)
fputs
(
", command"
,
stdout
);
if
(
var
->
value_callbacks
.
i_entries
)
printf
(
", %d callbacks"
,
var
->
value_callbacks
.
i_entries
);
switch
(
var
->
i_type
&
VLC_VAR_CLASS
)
{
case
VLC_VAR_VOID
:
break
;
case
VLC_VAR_BOOL
:
printf
(
": %s"
,
var
->
val
.
b_bool
?
"true"
:
"false"
);
break
;
case
VLC_VAR_INTEGER
:
printf
(
": %"
PRId64
,
var
->
val
.
i_int
);
break
;
case
VLC_VAR_STRING
:
printf
(
":
\"
%s
\"
"
,
var
->
val
.
psz_string
);
break
;
case
VLC_VAR_FLOAT
:
printf
(
": %f"
,
var
->
val
.
f_float
);
break
;
case
VLC_VAR_TIME
:
printf
(
": %"
PRId64
,
var
->
val
.
i_time
);
break
;
case
VLC_VAR_COORDS
:
printf
(
": %"
PRId32
"x%"
PRId32
,
var
->
val
.
coords
.
x
,
var
->
val
.
coords
.
y
);
break
;
case
VLC_VAR_ADDRESS
:
printf
(
": %p"
,
var
->
val
.
p_address
);
break
;
}
putchar
(
'\n'
);
}
void
DumpVariables
(
vlc_object_t
*
obj
)
{
vlc_mutex_lock
(
&
vlc_internals
(
obj
)
->
var_lock
);
if
(
vlc_internals
(
obj
)
->
var_root
==
NULL
)
puts
(
" `-o No variables"
);
else
twalk
(
vlc_internals
(
obj
)
->
var_root
,
DumpVariable
);
vlc_mutex_unlock
(
&
vlc_internals
(
obj
)
->
var_lock
);
}
src/misc/variables.h
View file @
af4bb51c
...
...
@@ -56,6 +56,7 @@ struct vlc_object_internals
# define vlc_internals( obj ) (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
# define vlc_externals( priv ) ((vlc_object_t *)((priv) + 1))
void
DumpVariables
(
vlc_object_t
*
obj
);
typedef
struct
callback_entry_t
callback_entry_t
;
...
...
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