Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
d8ab9e3d
Commit
d8ab9e3d
authored
Jul 11, 2011
by
Rémi Denis-Courmont
Browse files
Remove object type field
parent
3d3dfde1
Changes
39
Hide whitespace changes
Inline
Side-by-side
include/vlc_objects.h
View file @
d8ab9e3d
...
...
@@ -31,11 +31,6 @@
* @{
*/
/* Object types */
/* Please add new object types below -34 */
/* Please do not add new object types anyway */
#define VLC_OBJECT_GENERIC (-666)
/* Object flags */
#define OBJECT_FLAGS_NODBG 0x0001
#define OBJECT_FLAGS_QUIET 0x0002
...
...
src/audio_output/common.c
View file @
d8ab9e3d
...
...
@@ -51,8 +51,7 @@ aout_instance_t * __aout_New( vlc_object_t * p_parent )
aout_instance_t
*
p_aout
;
/* Allocate descriptor. */
p_aout
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_aout
),
VLC_OBJECT_GENERIC
,
"audio output"
);
p_aout
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_aout
),
"audio output"
);
if
(
p_aout
==
NULL
)
{
return
NULL
;
...
...
src/audio_output/filters.c
View file @
d8ab9e3d
...
...
@@ -55,8 +55,7 @@ static filter_t * FindFilter( aout_instance_t * p_aout,
static
const
char
typename
[]
=
"audio filter"
;
filter_t
*
p_filter
;
p_filter
=
vlc_custom_create
(
p_aout
,
sizeof
(
*
p_filter
),
VLC_OBJECT_GENERIC
,
typename
);
p_filter
=
vlc_custom_create
(
p_aout
,
sizeof
(
*
p_filter
),
typename
);
if
(
p_filter
==
NULL
)
return
NULL
;
...
...
src/audio_output/input.c
View file @
d8ab9e3d
...
...
@@ -265,9 +265,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
}
/* Create a VLC object */
static
const
char
typename
[]
=
"audio filter"
;
p_filter
=
vlc_custom_create
(
p_aout
,
sizeof
(
*
p_filter
),
VLC_OBJECT_GENERIC
,
typename
);
"audio filter"
);
if
(
p_filter
==
NULL
)
{
msg_Err
(
p_aout
,
"cannot add user filter %s (skipped)"
,
...
...
src/input/access.c
View file @
d8ab9e3d
...
...
@@ -54,7 +54,7 @@ access_t *__access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
const
char
*
psz_location
)
{
access_t
*
p_access
=
vlc_custom_create
(
p_obj
,
sizeof
(
*
p_access
),
VLC_OBJECT_GENERIC
,
"access"
);
"access"
);
if
(
p_access
==
NULL
)
return
NULL
;
...
...
src/input/decoder.c
View file @
d8ab9e3d
...
...
@@ -750,8 +750,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
decoder_owner_sys_t
*
p_owner
;
es_format_t
null_es_format
;
p_dec
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_dec
),
VLC_OBJECT_GENERIC
,
"decoder"
);
p_dec
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_dec
),
"decoder"
);
if
(
p_dec
==
NULL
)
return
NULL
;
...
...
@@ -826,8 +825,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
p_dec
->
b_need_packetized
&&
!
p_dec
->
fmt_in
.
b_packetized
)
{
p_owner
->
p_packetizer
=
vlc_custom_create
(
p_parent
,
sizeof
(
decoder_t
),
VLC_OBJECT_GENERIC
,
"packetizer"
);
vlc_custom_create
(
p_parent
,
sizeof
(
decoder_t
),
"packetizer"
);
if
(
p_owner
->
p_packetizer
)
{
es_format_Copy
(
&
p_owner
->
p_packetizer
->
fmt_in
,
...
...
src/input/demux.c
View file @
d8ab9e3d
...
...
@@ -62,9 +62,7 @@ demux_t *__demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
const
char
*
psz_location
,
stream_t
*
s
,
es_out_t
*
out
,
bool
b_quick
)
{
static
const
char
typename
[]
=
"demux"
;
demux_t
*
p_demux
=
vlc_custom_create
(
p_obj
,
sizeof
(
*
p_demux
),
VLC_OBJECT_GENERIC
,
typename
);
demux_t
*
p_demux
=
vlc_custom_create
(
p_obj
,
sizeof
(
*
p_demux
),
"demux"
);
const
char
*
psz_module
;
if
(
p_demux
==
NULL
)
return
NULL
;
...
...
@@ -334,7 +332,7 @@ decoder_t *demux_PacketizerNew( demux_t *p_demux, es_format_t *p_fmt, const char
{
decoder_t
*
p_packetizer
;
p_packetizer
=
vlc_custom_create
(
p_demux
,
sizeof
(
*
p_packetizer
),
VLC_OBJECT_GENERIC
,
"demux packetizer"
);
"demux packetizer"
);
if
(
!
p_packetizer
)
{
es_format_Clean
(
p_fmt
);
...
...
src/input/input.c
View file @
d8ab9e3d
...
...
@@ -292,17 +292,15 @@ input_item_t *input_GetItem( input_thread_t *p_input )
static
void
ObjectKillChildrens
(
input_thread_t
*
p_input
,
vlc_object_t
*
p_obj
)
{
vlc_list_t
*
p_list
;
int
i
;
/* FIXME ObjectKillChildrens seems a very bad idea in fact */
i
=
vlc_internals
(
p_obj
)
->
i_object_type
;
if
(
p_obj
==
VLC_OBJECT
(
p_input
->
p
->
p_sout
)
)
return
;
vlc_object_kill
(
p_obj
);
p_list
=
vlc_list_children
(
p_obj
);
for
(
i
=
0
;
i
<
p_list
->
i_count
;
i
++
)
for
(
int
i
=
0
;
i
<
p_list
->
i_count
;
i
++
)
ObjectKillChildrens
(
p_input
,
p_list
->
p_values
[
i
].
p_object
);
vlc_list_release
(
p_list
);
}
...
...
@@ -317,13 +315,11 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
const
char
*
psz_header
,
bool
b_quick
,
input_resource_t
*
p_resource
)
{
static
const
char
input_name
[]
=
"input"
;
input_thread_t
*
p_input
=
NULL
;
/* thread descriptor */
int
i
;
/* Allocate descriptor */
p_input
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_input
),
VLC_OBJECT_GENERIC
,
input_name
);
p_input
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_input
),
"input"
);
if
(
p_input
==
NULL
)
return
NULL
;
...
...
@@ -2742,8 +2738,7 @@ static void InputSourceMeta( input_thread_t *p_input,
return
;
demux_meta_t
*
p_demux_meta
=
vlc_custom_create
(
p_demux
,
sizeof
(
*
p_demux_meta
),
VLC_OBJECT_GENERIC
,
"demux meta"
);
vlc_custom_create
(
p_demux
,
sizeof
(
*
p_demux_meta
),
"demux meta"
);
if
(
!
p_demux_meta
)
return
;
p_demux_meta
->
p_demux
=
p_demux
;
...
...
src/input/meta.c
View file @
d8ab9e3d
...
...
@@ -263,8 +263,7 @@ exit:
int
input_item_WriteMeta
(
vlc_object_t
*
obj
,
input_item_t
*
p_item
)
{
meta_export_t
*
p_export
=
vlc_custom_create
(
obj
,
sizeof
(
*
p_export
),
VLC_OBJECT_GENERIC
,
"meta writer"
);
vlc_custom_create
(
obj
,
sizeof
(
*
p_export
),
"meta writer"
);
if
(
p_export
==
NULL
)
return
VLC_ENOMEM
;
p_export
->
p_item
=
p_item
;
...
...
src/input/stream.c
View file @
d8ab9e3d
...
...
@@ -208,8 +208,7 @@ static int ASeek( stream_t *s, uint64_t i_pos );
****************************************************************************/
stream_t
*
stream_CommonNew
(
vlc_object_t
*
p_obj
)
{
stream_t
*
s
=
(
stream_t
*
)
vlc_custom_create
(
p_obj
,
sizeof
(
*
s
),
VLC_OBJECT_GENERIC
,
"stream"
);
stream_t
*
s
=
(
stream_t
*
)
vlc_custom_create
(
p_obj
,
sizeof
(
*
s
),
"stream"
);
if
(
!
s
)
return
NULL
;
...
...
src/input/vlm.c
View file @
d8ab9e3d
...
...
@@ -131,7 +131,6 @@ vlm_t *vlm_New ( vlc_object_t *p_this )
{
vlm_t
*
p_vlm
=
NULL
,
**
pp_vlm
=
&
(
libvlc_priv
(
p_this
->
p_libvlc
)
->
p_vlm
);
char
*
psz_vlmconf
;
static
const
char
vlm_object_name
[]
=
"vlm daemon"
;
/* Avoid multiple creation */
vlc_mutex_lock
(
&
vlm_mutex
);
...
...
@@ -150,7 +149,7 @@ vlm_t *vlm_New ( vlc_object_t *p_this )
msg_Dbg
(
p_this
,
"creating VLM"
);
p_vlm
=
vlc_custom_create
(
p_this
->
p_libvlc
,
sizeof
(
*
p_vlm
),
VLC_OBJECT_GENERIC
,
vlm_object_name
);
"vlm daemon"
);
if
(
!
p_vlm
)
{
vlc_mutex_unlock
(
&
vlm_mutex
);
...
...
@@ -765,7 +764,7 @@ static int vlm_ControlMediaAdd( vlm_t *p_vlm, vlm_media_t *p_cfg, int64_t *p_id
if
(
p_cfg
->
b_vod
&&
!
p_vlm
->
p_vod
)
{
p_vlm
->
p_vod
=
vlc_custom_create
(
VLC_OBJECT
(
p_vlm
),
sizeof
(
vod_t
),
VLC_OBJECT_GENERIC
,
"vod server"
);
"vod server"
);
p_vlm
->
p_vod
->
p_module
=
module_need
(
p_vlm
->
p_vod
,
"vod server"
,
"$vod-server"
,
false
);
if
(
!
p_vlm
->
p_vod
->
p_module
)
{
...
...
src/interface/interface.c
View file @
d8ab9e3d
...
...
@@ -71,11 +71,9 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
{
libvlc_int_t
*
p_libvlc
=
p_this
->
p_libvlc
;
intf_thread_t
*
p_intf
;
static
const
char
psz_type
[]
=
"interface"
;
/* Allocate structure */
p_intf
=
vlc_custom_create
(
p_libvlc
,
sizeof
(
*
p_intf
),
VLC_OBJECT_GENERIC
,
psz_type
);
p_intf
=
vlc_custom_create
(
p_libvlc
,
sizeof
(
*
p_intf
),
"interface"
);
if
(
!
p_intf
)
return
VLC_ENOMEM
;
...
...
src/libvlc.c
View file @
d8ab9e3d
...
...
@@ -198,7 +198,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
/* Allocate a libvlc instance object */
p_libvlc
=
vlc_custom_create
(
(
vlc_object_t
*
)
NULL
,
sizeof
(
*
priv
),
VLC_OBJECT_GENERIC
,
"libvlc"
);
"libvlc"
);
if
(
p_libvlc
!=
NULL
)
i_instances
++
;
vlc_mutex_unlock
(
&
global_lock
);
...
...
src/libvlc.h
View file @
d8ab9e3d
...
...
@@ -106,15 +106,13 @@ void vlc_ExitDestroy( vlc_exit_t * );
*
* @param p_this an existing VLC object
* @param i_size byte size of the object structure
* @param i_type object type, usually VLC_OBJECT_CUSTOM
* @param psz_type object type name
* @return the created object, or NULL.
*/
extern
void
*
vlc_custom_create
(
vlc_object_t
*
p_this
,
size_t
i_size
,
int
i_type
,
const
char
*
psz_type
);
#define vlc_custom_create(o, s, t, n) \
vlc_custom_create(VLC_OBJECT(o), s, t, n)
vlc_custom_create
(
vlc_object_t
*
p_this
,
size_t
i_size
,
const
char
*
psz_type
);
#define vlc_custom_create(o, s, n) \
vlc_custom_create(VLC_OBJECT(o), s, n)
/**
* Assign a name to an object for vlc_object_find_name().
...
...
@@ -142,7 +140,6 @@ typedef struct vlc_object_internals vlc_object_internals_t;
struct
vlc_object_internals
{
int
i_object_type
;
/* Object type, deprecated */
char
*
psz_name
;
/* given name */
/* Object variables */
...
...
src/misc/filter.c
View file @
d8ab9e3d
...
...
@@ -33,8 +33,7 @@
filter_t
*
filter_NewBlend
(
vlc_object_t
*
p_this
,
const
video_format_t
*
p_dst_chroma
)
{
filter_t
*
p_blend
=
vlc_custom_create
(
p_this
,
sizeof
(
*
p_blend
),
VLC_OBJECT_GENERIC
,
"blend"
);
filter_t
*
p_blend
=
vlc_custom_create
(
p_this
,
sizeof
(
*
p_blend
),
"blend"
);
if
(
!
p_blend
)
return
NULL
;
...
...
@@ -119,8 +118,8 @@ video_splitter_t *video_splitter_New( vlc_object_t *p_this,
const
char
*
psz_name
,
const
video_format_t
*
p_fmt
)
{
video_splitter_t
*
p_splitter
=
vlc_custom_create
(
p_this
,
sizeof
(
*
p_splitter
),
VLC_OBJECT_GENERIC
,
"video splitter"
);
video_splitter_t
*
p_splitter
=
vlc_custom_create
(
p_this
,
sizeof
(
*
p_splitter
)
,
"video splitter"
);
if
(
!
p_splitter
)
return
NULL
;
...
...
src/misc/filter_chain.c
View file @
d8ab9e3d
...
...
@@ -373,8 +373,7 @@ static filter_t *filter_chain_AppendFilterInternal( filter_chain_t *p_chain,
const
es_format_t
*
p_fmt_out
)
{
chained_filter_t
*
p_chained
=
vlc_custom_create
(
p_chain
->
p_this
,
sizeof
(
*
p_chained
),
VLC_OBJECT_GENERIC
,
"filter"
);
vlc_custom_create
(
p_chain
->
p_this
,
sizeof
(
*
p_chained
),
"filter"
);
filter_t
*
p_filter
=
&
p_chained
->
filter
;
if
(
!
p_filter
)
return
NULL
;
...
...
src/misc/image.c
View file @
d8ab9e3d
...
...
@@ -656,8 +656,7 @@ static decoder_t *CreateDecoder( vlc_object_t *p_this, video_format_t *fmt )
{
decoder_t
*
p_dec
;
p_dec
=
vlc_custom_create
(
p_this
,
sizeof
(
*
p_dec
),
VLC_OBJECT_GENERIC
,
"image decoder"
);
p_dec
=
vlc_custom_create
(
p_this
,
sizeof
(
*
p_dec
),
"image decoder"
);
if
(
p_dec
==
NULL
)
return
NULL
;
...
...
@@ -781,11 +780,9 @@ static filter_t *CreateFilter( vlc_object_t *p_this, es_format_t *p_fmt_in,
video_format_t
*
p_fmt_out
,
const
char
*
psz_module
)
{
static
const
char
typename
[]
=
"filter"
;
filter_t
*
p_filter
;
p_filter
=
vlc_custom_create
(
p_this
,
sizeof
(
filter_t
),
VLC_OBJECT_GENERIC
,
typename
);
p_filter
=
vlc_custom_create
(
p_this
,
sizeof
(
filter_t
),
"filter"
);
p_filter
->
pf_video_buffer_new
=
(
picture_t
*
(
*
)(
filter_t
*
))
video_new_buffer
;
p_filter
->
pf_video_buffer_del
=
...
...
src/misc/media_library.c
View file @
d8ab9e3d
...
...
@@ -79,7 +79,7 @@ media_library_t *ml_Create( vlc_object_t *p_this, char *psz_name )
p_ml
=
(
media_library_t
*
)
vlc_custom_create
(
p_this
,
sizeof
(
media_library_t
),
VLC_OBJECT_GENERIC
,
"media-library"
);
"media-library"
);
if
(
!
p_ml
)
{
msg_Err
(
p_this
,
"unable to create media library object"
);
...
...
src/misc/objects.c
View file @
d8ab9e3d
...
...
@@ -108,7 +108,7 @@ static void libvlc_unlock (libvlc_int_t *p_libvlc)
#undef vlc_custom_create
void
*
vlc_custom_create
(
vlc_object_t
*
parent
,
size_t
length
,
int
type
,
const
char
*
typename
)
const
char
*
typename
)
{
/* NOTE:
* VLC objects are laid out as follow:
...
...
@@ -124,7 +124,6 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
vlc_object_internals_t
*
priv
=
malloc
(
sizeof
(
*
priv
)
+
length
);
if
(
unlikely
(
priv
==
NULL
))
return
NULL
;
priv
->
i_object_type
=
type
;
priv
->
psz_name
=
NULL
;
priv
->
var_root
=
NULL
;
vlc_mutex_init
(
&
priv
->
var_lock
);
...
...
@@ -193,7 +192,7 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
*/
void
*
vlc_object_create
(
vlc_object_t
*
p_this
,
size_t
i_size
)
{
return
vlc_custom_create
(
p_this
,
i_size
,
VLC_OBJECT_GENERIC
,
"generic"
);
return
vlc_custom_create
(
p_this
,
i_size
,
"generic"
);
}
#undef vlc_object_set_destructor
...
...
src/misc/probe.c
View file @
d8ab9e3d
...
...
@@ -31,8 +31,7 @@
void
*
vlc_probe
(
vlc_object_t
*
obj
,
const
char
*
capability
,
size_t
*
restrict
pcount
)
{
vlc_probe_t
*
probe
=
vlc_custom_create
(
obj
,
sizeof
(
*
probe
),
VLC_OBJECT_GENERIC
,
"probe"
);
vlc_probe_t
*
probe
=
vlc_custom_create
(
obj
,
sizeof
(
*
probe
),
"probe"
);
if
(
unlikely
(
probe
==
NULL
))
{
*
pcount
=
0
;
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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