Commit 1fe20800 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

core: set meaningful object type names

parent 03866185
......@@ -37,6 +37,7 @@
#include <vlc_aout.h>
#include "aout_internal.h"
#include <libvlc.h>
/*****************************************************************************
* FindFilter: find an audio filter for a specific transformation
......@@ -45,8 +46,11 @@ static aout_filter_t * FindFilter( aout_instance_t * p_aout,
const audio_sample_format_t * p_input_format,
const audio_sample_format_t * p_output_format )
{
aout_filter_t * p_filter = vlc_object_create( p_aout,
sizeof(aout_filter_t) );
static const char typename[] = "audio output";
aout_filter_t * p_filter;
p_filter = vlc_custom_create( p_aout, sizeof(*p_filter),
VLC_OBJECT_GENERIC, typename );
if ( p_filter == NULL ) return NULL;
vlc_object_attach( p_filter, p_aout );
......
......@@ -246,7 +246,9 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
}
/* Create a VLC object */
p_filter = vlc_object_create( p_aout, sizeof(aout_filter_t) );
static const char typename[] = "audio filter";
p_filter = vlc_custom_create( p_aout, sizeof(*p_filter),
VLC_OBJECT_GENERIC, typename );
if( p_filter == NULL )
{
msg_Err( p_aout, "cannot add user filter %s (skipped)",
......
......@@ -138,8 +138,10 @@ char *vlc_fix_readdir (const char *);
* @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);
__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)
/**
* libvlc_global_data_t (global variable)
......
......@@ -27,6 +27,7 @@
#include <vlc_filter.h>
#include <vlc_arrays.h>
#include <libvlc.h>
struct filter_chain_t
{
......@@ -132,8 +133,10 @@ static filter_t *filter_chain_AppendFilterInternal( filter_chain_t *p_chain,
const es_format_t *p_fmt_in,
const es_format_t *p_fmt_out )
{
static const char typename[] = "filter";
filter_t *p_filter =
vlc_object_create( p_chain->p_this, sizeof(filter_t) );
vlc_custom_create( p_chain->p_this, sizeof(filter_t),
VLC_OBJECT_GENERIC, typename );
if( !p_filter ) return NULL;
vlc_object_attach( p_filter, p_chain->p_this );
......
......@@ -44,6 +44,7 @@
#include <vlc_image.h>
#include <vlc_stream.h>
#include <vlc_charset.h>
#include <libvlc.h>
static picture_t *ImageRead( image_handler_t *, block_t *,
video_format_t *, video_format_t * );
......@@ -749,9 +750,11 @@ 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_object_create( p_this, sizeof(filter_t) );
p_filter = vlc_custom_create( p_this, sizeof(filter_t),
VLC_OBJECT_GENERIC, typename );
vlc_object_attach( p_filter, p_this );
p_filter->pf_vout_buffer_new =
......
......@@ -96,8 +96,8 @@ static void held_objects_destroy (void *);
*****************************************************************************/
static vlc_mutex_t structure_lock;
void *vlc_custom_create( vlc_object_t *p_this, size_t i_size,
int i_type, const char *psz_type )
void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size,
int i_type, const char *psz_type )
{
vlc_object_t *p_new;
vlc_object_internals_t *p_priv;
......
......@@ -164,7 +164,7 @@ int vlc_threads_init( void )
if( i_initializations == 0 )
{
p_root = vlc_custom_create( NULL, sizeof( *p_root ),
p_root = vlc_custom_create( (vlc_object_t *)NULL, sizeof( *p_root ),
VLC_OBJECT_GENERIC, "root" );
if( p_root == NULL )
{
......
......@@ -1365,8 +1365,9 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void
{
assert( p_update );
update_check_thread_t *p_uct = vlc_object_create( p_update->p_libvlc,
sizeof( update_check_thread_t ) );
update_check_thread_t *p_uct =
vlc_custom_create( p_update->p_libvlc, sizeof( *p_uct ),
VLC_OBJECT_GENERIC, "update check" );
if( !p_uct ) return;
p_uct->p_update = p_update;
......@@ -1446,8 +1447,9 @@ void update_Download( update_t *p_update, const char *psz_destdir )
{
assert( p_update );
update_download_thread_t *p_udt = vlc_object_create( p_update->p_libvlc,
sizeof( update_download_thread_t ) );
update_download_thread_t *p_udt =
vlc_custom_create( p_update->p_libvlc, sizeof( *p_udt ),
VLC_OBJECT_GENERIC, "update download" );
if( !p_udt )
return;
......
......@@ -170,8 +170,10 @@ void system_Configure( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv
if( GetLastError() != ERROR_ALREADY_EXISTS )
{
/* We are the 1st instance. */
static const char typename[] = "ipc helper";
vlc_object_t *p_helper =
(vlc_object_t *)vlc_object_create( p_this, sizeof(vlc_object_t) );
vlc_custom_create( p_this, sizeof(vlc_object_t),
VLC_OBJECT_GENERIC, typename );
/* Run the helper thread */
if( vlc_thread_create( p_helper, "IPC helper", IPCHelperThread,
......
......@@ -59,8 +59,10 @@ void __playlist_ThreadCreate( vlc_object_t *p_parent )
if( !p_playlist ) return;
// Preparse
p_playlist->p_preparse = vlc_object_create( p_playlist,
sizeof( playlist_preparse_t ) );
static const char ppname[] = "preparser";
p_playlist->p_preparse =
vlc_custom_create( p_playlist, sizeof( playlist_preparse_t ),
VLC_OBJECT_GENERIC, ppname );
if( !p_playlist->p_preparse )
{
msg_Err( p_playlist, "unable to create preparser" );
......@@ -83,8 +85,10 @@ void __playlist_ThreadCreate( vlc_object_t *p_parent )
}
// Secondary Preparse
p_playlist->p_fetcher = vlc_object_create( p_playlist,
sizeof( playlist_fetcher_t ) );
static const char fname[] = "fetcher";
p_playlist->p_fetcher =
vlc_custom_create( p_playlist, sizeof( playlist_fetcher_t ),
VLC_OBJECT_GENERIC, fname );
if( !p_playlist->p_fetcher )
{
msg_Err( p_playlist, "unable to create secondary preparser" );
......
......@@ -294,11 +294,13 @@ int sout_InputSendBuffer( sout_packetizer_input_t *p_input,
sout_access_out_t *sout_AccessOutNew( sout_instance_t *p_sout,
const char *psz_access, const char *psz_name )
{
static const char typename[] = "access out";
sout_access_out_t *p_access;
char *psz_next;
if( !( p_access = vlc_object_create( p_sout,
sizeof( sout_access_out_t ) ) ) )
p_access = vlc_custom_create( p_sout, sizeof( *p_access ),
VLC_OBJECT_GENERIC, typename );
if( !p_access )
return NULL;
psz_next = config_ChainCreate( &p_access->psz_access, &p_access->p_cfg,
......@@ -400,10 +402,12 @@ int sout_AccessOutControl (sout_access_out_t *access, int query, va_list args)
sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, char *psz_mux,
sout_access_out_t *p_access )
{
static const char typename[] = "mux";
sout_mux_t *p_mux;
char *psz_next;
p_mux = vlc_object_create( p_sout, sizeof( sout_mux_t ) );
p_mux = vlc_custom_create( p_sout, sizeof( *p_mux ), VLC_OBJECT_GENERIC,
typename);
if( p_mux == NULL )
return NULL;
......@@ -757,6 +761,7 @@ static void mrl_Clean( mrl_t *p_mrl )
*/
sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_chain )
{
static const char typename[] = "stream out";
sout_stream_t *p_stream;
if( !psz_chain )
......@@ -765,8 +770,8 @@ sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_chain )
return NULL;
}
p_stream = vlc_object_create( p_sout, sizeof( sout_stream_t ) );
p_stream = vlc_custom_create( p_sout, sizeof( *p_stream ),
VLC_OBJECT_GENERIC, typename );
if( !p_stream )
return NULL;
......
......@@ -1241,10 +1241,13 @@ static void ChromaCopyRgbInfo( es_format_t *p_fmt, picture_heap_t *p_heap )
static int ChromaCreate( vout_thread_t *p_vout )
{
static const char typename[] = "chroma";
filter_t *p_chroma;
/* Choose the best module */
p_chroma = p_vout->p_chroma = vlc_object_create( p_vout, sizeof(filter_t) );
p_chroma = p_vout->p_chroma =
vlc_custom_create( p_vout, sizeof(filter_t), VLC_OBJECT_GENERIC,
typename );
vlc_object_attach( p_chroma, p_vout );
......@@ -1512,8 +1515,10 @@ static int FilterCallback( vlc_object_t *p_this, char const *psz_cmd,
var_Get( p_input, "video-es", &val );
if( val.i_int >= 0 )
{
static const char typename[] = "kludge";
suxor_thread_t *p_suxor =
vlc_object_create( p_vout, sizeof(suxor_thread_t) );
vlc_custom_create( p_vout, sizeof(suxor_thread_t),
VLC_OBJECT_GENERIC, typename );
p_suxor->p_input = p_input;
p_vout->b_filter_change = true;
vlc_object_yield( p_input );
......
......@@ -527,7 +527,10 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
/* Load the blending module */
if( !p_spu->p_blend && p_region )
{
p_spu->p_blend = vlc_object_create( p_spu, sizeof(filter_t) );
static const char typename[] = "blend";
p_spu->p_blend =
vlc_custom_create( p_spu, sizeof(filter_t), VLC_OBJECT_GENERIC,
typename );
vlc_object_attach( p_spu->p_blend, p_spu );
p_spu->p_blend->fmt_out.video.i_x_offset =
p_spu->p_blend->fmt_out.video.i_y_offset = 0;
......@@ -546,9 +549,12 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
* probably want it sooner or later. */
if( !p_spu->p_text && p_region )
{
static const char typename[] = "spu text";
char *psz_modulename = NULL;
p_spu->p_text = vlc_object_create( p_spu, sizeof(filter_t) );
p_spu->p_text =
vlc_custom_create( p_spu, sizeof(filter_t), VLC_OBJECT_GENERIC,
typename );
vlc_object_attach( p_spu->p_text, p_spu );
p_spu->p_text->fmt_out.video.i_width =
......@@ -690,7 +696,10 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
(((pi_scale_width[ SCALE_DEFAULT ] > 0) || (pi_scale_height[ SCALE_DEFAULT ] > 0)) &&
((pi_scale_width[ SCALE_DEFAULT ] != 1000) || (pi_scale_height[ SCALE_DEFAULT ] != 1000)))) )
{
p_spu->p_scale = vlc_object_create( p_spu, sizeof(filter_t));
static const char typename[] = "scale";
p_spu->p_scale =
vlc_custom_create( p_spu, sizeof(filter_t), VLC_OBJECT_GENERIC,
typename );
vlc_object_attach( p_spu->p_scale, p_spu );
p_spu->p_scale->fmt_out.video.i_chroma =
p_spu->p_scale->fmt_in.video.i_chroma =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment