#include <vlc_aout.h>
#include "aout_internal.h"
+#include <libvlc.h>
/*****************************************************************************
* FindFilter: find an audio filter for a specific transformation
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 );
}
/* 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)",
* @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)
#include <vlc_filter.h>
#include <vlc_arrays.h>
+#include <libvlc.h>
struct filter_chain_t
{
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 );
#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 * );
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 =
*****************************************************************************/
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;
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 )
{
{
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;
{
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;
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,
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" );
}
// 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" );
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,
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;
*/
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 )
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;
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 );
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 );
/* 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;
* 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 =
(((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 =