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
f2bf5d58
Commit
f2bf5d58
authored
Aug 16, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare to privatize some members of VLC_COMMON_MEMBERS
parent
c2efb19c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
include/vlc_common.h
include/vlc_common.h
+3
-0
src/libvlc.h
src/libvlc.h
+11
-0
src/misc/objects.c
src/misc/objects.c
+14
-9
No files found.
include/vlc_common.h
View file @
f2bf5d58
...
...
@@ -525,6 +525,8 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
#include "vlc_threads.h"
typedef
struct
vlc_object_internals_t
vlc_object_internals_t
;
/*****************************************************************************
* Common structure members
*****************************************************************************/
...
...
@@ -535,6 +537,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
* these members are common for all vlc objects \
*/
\
/**@{*/
\
vlc_object_internals_t *p_internals; \
int i_object_id; \
int i_object_type; \
const char *psz_object_type; \
...
...
src/libvlc.h
View file @
f2bf5d58
...
...
@@ -83,4 +83,15 @@ static inline libvlc_global_data_t *__vlc_global( vlc_object_t *p_this )
extern
uint32_t
cpu_flags
;
uint32_t
CPUCapabilities
(
void
);
/* Private LibVLC data for each objects */
struct
vlc_object_internals_t
{
};
static
inline
vlc_object_internals_t
*
vlc_internals
(
vlc_object_t
*
obj
)
{
return
obj
->
p_internals
;
}
#endif
src/misc/objects.c
View file @
f2bf5d58
...
...
@@ -88,23 +88,30 @@ static void ListChildren ( vlc_list_t *, vlc_object_t *, int );
* Local structure lock
*****************************************************************************/
static
vlc_mutex_t
structure_lock
;
static
vlc_object_internals_t
global_internals
;
vlc_object_t
*
vlc_custom_create
(
vlc_object_t
*
p_this
,
size_t
i_size
,
int
i_type
,
const
char
*
psz_type
)
{
vlc_object_t
*
p_new
=
NULL
;
vlc_object_t
*
p_new
;
vlc_object_internals_t
*
p_priv
;
if
(
i_type
==
VLC_OBJECT_GLOBAL
)
{
p_new
=
p_this
;
p_priv
=
&
global_internals
;
memset
(
p_priv
,
0
,
sizeof
(
*
p_priv
)
);
}
else
{
p_new
=
malloc
(
i_size
);
if
(
!
p_new
)
return
NULL
;
memset
(
p_new
,
0
,
i_size
);
p_priv
=
calloc
(
1
,
sizeof
(
*
p_priv
)
+
i_size
);
if
(
p_priv
==
NULL
)
return
NULL
;
p_new
=
(
vlc_object_t
*
)(
p_priv
+
1
);
}
p_new
->
p_internals
=
p_priv
;
p_new
->
i_object_type
=
i_type
;
p_new
->
psz_object_type
=
psz_type
;
...
...
@@ -132,7 +139,7 @@ vlc_object_t *vlc_custom_create( vlc_object_t *p_this, size_t i_size,
if
(
!
p_new
->
p_vars
)
{
if
(
i_type
!=
VLC_OBJECT_GLOBAL
)
free
(
p_
new
);
free
(
p_
priv
);
return
NULL
;
}
...
...
@@ -336,6 +343,7 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
*****************************************************************************/
void
__vlc_object_destroy
(
vlc_object_t
*
p_this
)
{
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
int
i_delay
=
0
;
if
(
p_this
->
i_children
)
...
...
@@ -426,10 +434,7 @@ void __vlc_object_destroy( vlc_object_t *p_this )
/* global is not dynamically allocated by vlc_object_create */
if
(
p_this
->
i_object_type
!=
VLC_OBJECT_GLOBAL
)
{
free
(
p_this
);
p_this
=
NULL
;
}
free
(
p_priv
);
}
...
...
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