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
30066f7b
Commit
30066f7b
authored
May 14, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recurse through the object tree instead of using the objects table
parent
ef626a5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
29 deletions
+20
-29
src/misc/objects.c
src/misc/objects.c
+20
-29
No files found.
src/misc/objects.c
View file @
30066f7b
...
@@ -78,7 +78,7 @@ static void SetAttachment ( vlc_object_t *, bool );
...
@@ -78,7 +78,7 @@ static void SetAttachment ( vlc_object_t *, bool );
static
vlc_list_t
*
NewList
(
int
);
static
vlc_list_t
*
NewList
(
int
);
static
void
ListReplace
(
vlc_list_t
*
,
vlc_object_t
*
,
int
);
static
void
ListReplace
(
vlc_list_t
*
,
vlc_object_t
*
,
int
);
/*static void ListAppend ( vlc_list_t *, vlc_object_t * );*/
static
void
ListAppend
(
vlc_list_t
*
,
vlc_object_t
*
);
static
int
CountChildren
(
vlc_object_t
*
,
int
);
static
int
CountChildren
(
vlc_object_t
*
,
int
);
static
void
ListChildren
(
vlc_list_t
*
,
vlc_object_t
*
,
int
);
static
void
ListChildren
(
vlc_list_t
*
,
vlc_object_t
*
,
int
);
...
@@ -959,6 +959,19 @@ void __vlc_object_detach( vlc_object_t *p_this )
...
@@ -959,6 +959,19 @@ void __vlc_object_detach( vlc_object_t *p_this )
vlc_mutex_unlock
(
&
structure_lock
);
vlc_mutex_unlock
(
&
structure_lock
);
}
}
static
void
vlc_tree_find
(
vlc_object_t
*
node
,
int
type
,
vlc_list_t
*
list
)
{
assert
(
node
);
vlc_assert_locked
(
&
structure_lock
);
if
(
node
->
i_object_type
==
type
)
ListAppend
(
list
,
node
);
for
(
int
i
=
0
;
i
<
node
->
i_children
;
i
++
)
vlc_tree_find
(
node
->
pp_children
[
i
],
type
,
list
);
}
/**
/**
****************************************************************************
****************************************************************************
* find a list typed objects and increment their refcount
* find a list typed objects and increment their refcount
...
@@ -969,7 +982,6 @@ void __vlc_object_detach( vlc_object_t *p_this )
...
@@ -969,7 +982,6 @@ void __vlc_object_detach( vlc_object_t *p_this )
vlc_list_t
*
__vlc_list_find
(
vlc_object_t
*
p_this
,
int
i_type
,
int
i_mode
)
vlc_list_t
*
__vlc_list_find
(
vlc_object_t
*
p_this
,
int
i_type
,
int
i_mode
)
{
{
vlc_list_t
*
p_list
;
vlc_list_t
*
p_list
;
vlc_object_t
**
pp_current
,
**
pp_end
;
int
i_count
=
0
,
i_index
=
0
;
int
i_count
=
0
,
i_index
=
0
;
libvlc_global_data_t
*
p_libvlc_global
=
vlc_global
();
libvlc_global_data_t
*
p_libvlc_global
=
vlc_global
();
...
@@ -979,31 +991,10 @@ vlc_list_t * __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
...
@@ -979,31 +991,10 @@ vlc_list_t * __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
switch
(
i_mode
&
0x000f
)
switch
(
i_mode
&
0x000f
)
{
{
case
FIND_ANYWHERE
:
case
FIND_ANYWHERE
:
pp_current
=
p_libvlc_global
->
pp_objects
;
p_list
=
NewList
(
0
);
pp_end
=
pp_current
+
p_libvlc_global
->
i_objects
;
if
(
p_list
!=
NULL
)
vlc_tree_find
(
VLC_OBJECT
(
p_libvlc_global
),
i_type
,
p_list
);
for
(
;
pp_current
<
pp_end
;
pp_current
++
)
break
;
{
if
(
vlc_internals
(
*
pp_current
)
->
b_attached
&&
(
*
pp_current
)
->
i_object_type
==
i_type
)
{
i_count
++
;
}
}
p_list
=
NewList
(
i_count
);
pp_current
=
p_libvlc_global
->
pp_objects
;
for
(
;
pp_current
<
pp_end
;
pp_current
++
)
{
if
(
vlc_internals
(
*
pp_current
)
->
b_attached
&&
(
*
pp_current
)
->
i_object_type
==
i_type
)
{
ListReplace
(
p_list
,
*
pp_current
,
i_index
);
if
(
i_index
<
i_count
)
i_index
++
;
}
}
break
;
case
FIND_CHILD
:
case
FIND_CHILD
:
i_count
=
CountChildren
(
p_this
,
i_type
);
i_count
=
CountChildren
(
p_this
,
i_type
);
...
@@ -1570,7 +1561,7 @@ static void ListReplace( vlc_list_t *p_list, vlc_object_t *p_object,
...
@@ -1570,7 +1561,7 @@ static void ListReplace( vlc_list_t *p_list, vlc_object_t *p_object,
return
;
return
;
}
}
/*
static void ListAppend( vlc_list_t *p_list, vlc_object_t *p_object )
static
void
ListAppend
(
vlc_list_t
*
p_list
,
vlc_object_t
*
p_object
)
{
{
if
(
p_list
==
NULL
)
if
(
p_list
==
NULL
)
{
{
...
@@ -1591,7 +1582,7 @@ static void ListReplace( vlc_list_t *p_list, vlc_object_t *p_object,
...
@@ -1591,7 +1582,7 @@ static void ListReplace( vlc_list_t *p_list, vlc_object_t *p_object,
p_list
->
i_count
++
;
p_list
->
i_count
++
;
return
;
return
;
}
*/
}
static
int
CountChildren
(
vlc_object_t
*
p_this
,
int
i_type
)
static
int
CountChildren
(
vlc_object_t
*
p_this
,
int
i_type
)
{
{
...
...
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