Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
64339830
Commit
64339830
authored
Dec 03, 2006
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "vars" command to display the list of variables owned by an object. (ex: vars 1)
parent
04405042
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
107 additions
and
30 deletions
+107
-30
src/misc/objects.c
src/misc/objects.c
+107
-30
No files found.
src/misc/objects.c
View file @
64339830
...
...
@@ -188,6 +188,8 @@ vlc_object_t *vlc_custom_create( vlc_object_t *p_this, size_t i_size,
var_AddCallback
(
p_new
,
"list"
,
DumpCommand
,
NULL
);
var_Create
(
p_new
,
"tree"
,
VLC_VAR_STRING
|
VLC_VAR_ISCOMMAND
);
var_AddCallback
(
p_new
,
"tree"
,
DumpCommand
,
NULL
);
var_Create
(
p_new
,
"vars"
,
VLC_VAR_STRING
|
VLC_VAR_ISCOMMAND
);
var_AddCallback
(
p_new
,
"vars"
,
DumpCommand
,
NULL
);
}
return
p_new
;
...
...
@@ -699,10 +701,34 @@ vlc_list_t * __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
static
int
DumpCommand
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
if
(
*
psz_cmd
==
'
t
'
)
if
(
*
psz_cmd
==
'
l
'
)
{
char
psz_foo
[
2
*
MAX_DUMPSTRUCTURE_DEPTH
+
1
];
vlc_object_t
*
p_object
;
vlc_mutex_lock
(
&
structure_lock
);
vlc_object_t
**
pp_current
,
**
pp_end
;
pp_current
=
p_this
->
p_libvlc_global
->
pp_objects
;
pp_end
=
pp_current
+
p_this
->
p_libvlc_global
->
i_objects
;
for
(
;
pp_current
<
pp_end
;
pp_current
++
)
{
if
(
(
*
pp_current
)
->
b_attached
)
{
PrintObject
(
*
pp_current
,
""
);
}
else
{
printf
(
" o %.8i %s (not attached)
\n
"
,
(
*
pp_current
)
->
i_object_id
,
(
*
pp_current
)
->
psz_object_type
);
}
}
vlc_mutex_unlock
(
&
structure_lock
);
}
else
{
vlc_object_t
*
p_object
=
NULL
;
if
(
*
newval
.
psz_string
)
{
...
...
@@ -713,47 +739,97 @@ static int DumpCommand( vlc_object_t *p_this, char const *psz_cmd,
return
VLC_ENOOBJ
;
}
}
else
{
p_object
=
p_this
->
p_libvlc
?
VLC_OBJECT
(
p_this
->
p_libvlc
)
:
p_this
;
}
vlc_mutex_lock
(
&
structure_lock
);
psz_foo
[
0
]
=
'|'
;
DumpStructure
(
p_object
,
0
,
psz_foo
);
if
(
*
psz_cmd
==
't'
)
{
char
psz_foo
[
2
*
MAX_DUMPSTRUCTURE_DEPTH
+
1
];
vlc_mutex_unlock
(
&
structure_lock
);
if
(
!
p_object
)
p_object
=
p_this
->
p_libvlc
?
VLC_OBJECT
(
p_this
->
p_libvlc
)
:
p_this
;
if
(
*
newval
.
psz_string
)
{
vlc_object_release
(
p_this
);
psz_foo
[
0
]
=
'|'
;
DumpStructure
(
p_object
,
0
,
psz_foo
);
}
}
else
if
(
*
psz_cmd
==
'l'
)
{
vlc_object_t
**
pp_current
,
**
pp_end
;
else
if
(
*
psz_cmd
==
'v'
)
{
int
i
;
vlc_mutex_lock
(
&
structure_lock
);
if
(
!
p_object
)
p_object
=
p_this
->
p_libvlc
?
VLC_OBJECT
(
p_this
->
p_libvlc
)
:
p_this
;
pp_current
=
p_this
->
p_libvlc_global
->
pp_objects
;
pp_end
=
pp_current
+
p_this
->
p_libvlc_global
->
i_objects
;
PrintObject
(
p_object
,
""
);
for
(
;
pp_current
<
pp_end
;
pp_current
++
)
{
if
(
(
*
pp_current
)
->
b_attached
)
for
(
i
=
0
;
i
<
p_object
->
i_vars
;
i
++
)
{
PrintObject
(
*
pp_current
,
""
);
}
else
{
printf
(
" o %.8i %s (not attached)
\n
"
,
(
*
pp_current
)
->
i_object_id
,
(
*
pp_current
)
->
psz_object_type
);
variable_t
*
p_var
=
p_object
->
p_vars
+
i
;
const
char
*
psz_type
=
"unknown"
;
switch
(
p_var
->
i_type
&
0x00ff
)
{
#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
(
MODULE
,
"module"
);
MYCASE
(
FILE
,
"file"
);
MYCASE
(
DIRECTORY
,
"directory"
);
MYCASE
(
VARIABLE
,
"variable"
);
MYCASE
(
FLOAT
,
"float"
);
MYCASE
(
TIME
,
"time"
);
MYCASE
(
ADDRESS
,
"address"
);
MYCASE
(
MUTEX
,
"mutex"
);
MYCASE
(
LIST
,
"list"
);
#undef MYCASE
}
printf
(
" %c-o
\"
%s
\"
(%s), %d callbacks: "
,
i
+
1
==
p_object
->
i_vars
?
'`'
:
'|'
,
p_var
->
psz_name
,
psz_type
,
p_var
->
i_entries
);
switch
(
p_var
->
i_type
&
0x00f0
)
{
case
VLC_VAR_VOID
:
case
VLC_VAR_MUTEX
:
printf
(
"not available"
);
break
;
case
VLC_VAR_BOOL
:
printf
(
p_var
->
val
.
b_bool
?
"true"
:
"false"
);
break
;
case
VLC_VAR_INTEGER
:
printf
(
"%d"
,
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
(
I64Fi
,
p_var
->
val
.
i_time
);
break
;
case
VLC_VAR_ADDRESS
:
printf
(
"%p"
,
p_var
->
val
.
p_address
);
break
;
case
VLC_VAR_LIST
:
printf
(
"TODO"
);
break
;
}
printf
(
"
\n
"
);
}
}
vlc_mutex_unlock
(
&
structure_lock
);
if
(
*
newval
.
psz_string
)
{
vlc_object_release
(
p_this
);
}
}
return
VLC_SUCCESS
;
...
...
@@ -971,6 +1047,7 @@ static void PrintObject( vlc_object_t *p_this, const char *psz_prefix )
psz_thread
[
29
]
=
'\0'
;
}
psz_parent
[
0
]
=
'\0'
;
if
(
p_this
->
p_parent
)
{
snprintf
(
psz_parent
,
20
,
", parent %i"
,
p_this
->
p_parent
->
i_object_id
);
...
...
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