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
9d002286
Commit
9d002286
authored
May 25, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused FIND_PARENT
parent
ecc2c16b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
49 deletions
+18
-49
include/vlc_objects.h
include/vlc_objects.h
+0
-1
modules/lua/libs/objects.c
modules/lua/libs/objects.c
+2
-2
share/lua/README.txt
share/lua/README.txt
+3
-4
src/misc/objects.c
src/misc/objects.c
+13
-42
No files found.
include/vlc_objects.h
View file @
9d002286
...
...
@@ -41,7 +41,6 @@
#define VLC_OBJECT_GENERIC (-666)
/* Object search mode */
#define FIND_PARENT 0x0001
#define FIND_CHILD 0x0002
#define FIND_ANYWHERE 0x0003
...
...
modules/lua/libs/objects.c
View file @
9d002286
...
...
@@ -89,8 +89,7 @@ static int vlc_object_search_mode_from_string( const char *psz_name )
int
i_mode
;
const
char
*
psz_name
;
}
pp_modes
[]
=
{
{
FIND_PARENT
,
"parent"
},
{
FIND_CHILD
,
"child"
},
{
{
FIND_CHILD
,
"child"
},
{
FIND_ANYWHERE
,
"anywhere"
},
{
0
,
""
}
};
int
i
;
...
...
@@ -114,6 +113,7 @@ static int vlclua_object_find_name( lua_State *L )
const
char
*
psz_mode
=
luaL_checkstring
(
L
,
3
);
vlc_object_t
*
p_this
;
int
i_mode
=
vlc_object_search_mode_from_string
(
psz_mode
);
vlc_object_t
*
p_result
;
...
...
share/lua/README.txt
View file @
9d002286
...
...
@@ -223,10 +223,9 @@ object.playlist(): Get the playlist object.
object.libvlc(): Get the libvlc object.
object.find( object, type, mode ): Find an object of given type. mode can
be any of "parent", "child" and "anywhere". If set to "parent", it will
look in "object"'s parent objects. If set to "child" it will look in
"object"'s children. If set to "anywhere", it will look in all the
objects. If object is unset, the current module's object will be used.
be "child" and "anywhere". If set to "child" it will look in "object"'s
children. If set to "anywhere", it will look in all the objects. If
object is unset, the current module's object will be used.
Type can be: "libvlc", "playlist", "input", "decoder",
"vout", "aout", "packetizer", "generic".
This function is deprecated and slow and should be avoided.
...
...
src/misc/objects.c
View file @
9d002286
...
...
@@ -85,7 +85,6 @@
static
int
DumpCommand
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
vlc_object_t
*
FindParentName
(
vlc_object_t
*
,
const
char
*
);
static
vlc_object_t
*
FindChildName
(
vlc_object_internals_t
*
,
const
char
*
);
static
void
PrintObject
(
vlc_object_internals_t
*
,
const
char
*
);
static
void
DumpStructure
(
vlc_object_internals_t
*
,
unsigned
,
char
*
);
...
...
@@ -243,15 +242,10 @@ char *vlc_object_get_name(const vlc_object_t *obj)
}
/**
****************************************************************************
* Destroy a vlc object (Internal)
*
* This function destroys an object that has been previously allocated with
* vlc_object_create. The object's refcount must be zero and it must not be
* attached to other objects in any way.
* Destroys a VLC object once it has no more references.
*
* This function must be called with cancellation disabled (currently).
*
****************************************************************************
/
*/
static
void
vlc_object_destroy
(
vlc_object_t
*
p_this
)
{
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
...
...
@@ -455,19 +449,10 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this,
return
vlc_object_find_name
(
VLC_OBJECT
(
p_this
->
p_libvlc
),
psz_name
,
FIND_CHILD
);
assert
(
i_mode
==
FIND_CHILD
);
libvlc_lock
(
p_this
->
p_libvlc
);
vlc_mutex_lock
(
&
name_lock
);
switch
(
i_mode
)
{
case
FIND_PARENT
:
p_found
=
FindParentName
(
p_this
,
psz_name
);
break
;
case
FIND_CHILD
:
p_found
=
FindChildName
(
vlc_internals
(
p_this
),
psz_name
);
break
;
default:
assert
(
0
);
}
p_found
=
FindChildName
(
vlc_internals
(
p_this
),
psz_name
);
vlc_mutex_unlock
(
&
name_lock
);
libvlc_unlock
(
p_this
->
p_libvlc
);
return
p_found
;
...
...
@@ -491,10 +476,10 @@ void * vlc_object_hold( vlc_object_t *p_this )
}
#undef vlc_object_release
/**
***************************************************************************
* D
ecrement an object refcount
*
And destroy the object if its refcount reach zero
.
*
****************************************************************************
/
/**
* D
rops a reference to an object (decrements the reference count).
*
If the count reaches zero, the object is destroyed
.
*/
void
vlc_object_release
(
vlc_object_t
*
p_this
)
{
vlc_object_internals_t
*
internals
=
vlc_internals
(
p_this
);
...
...
@@ -557,12 +542,11 @@ void vlc_object_release( vlc_object_t *p_this )
#undef vlc_object_attach
/**
****************************************************************************
* attach object to a parent object
*****************************************************************************
* This function sets p_this as a child of p_parent, and p_parent as a parent
* of p_this.
*****************************************************************************/
* Exposes a VLC object in the hierarchy by attaching it to another object.
* @note Before variables can be inherited, an object must be attached.
* @param p_this object to expose
* @param p_parent parent object in the hierarchy
*/
void
vlc_object_attach
(
vlc_object_t
*
p_this
,
vlc_object_t
*
p_parent
)
{
if
(
!
p_this
)
return
;
...
...
@@ -761,19 +745,6 @@ void vlc_list_release( vlc_list_t *p_list )
/* Following functions are local */
static
vlc_object_t
*
FindParentName
(
vlc_object_t
*
p_this
,
const
char
*
name
)
{
for
(
vlc_object_t
*
parent
=
p_this
->
p_parent
;
parent
!=
NULL
;
parent
=
parent
->
p_parent
)
{
const
char
*
objname
=
vlc_internals
(
parent
)
->
psz_name
;
if
(
objname
&&
!
strcmp
(
objname
,
name
))
return
vlc_object_hold
(
parent
);
}
return
NULL
;
}
static
vlc_object_t
*
FindChildName
(
vlc_object_internals_t
*
priv
,
const
char
*
name
)
{
...
...
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