-static counter_t *GetCounter( stats_handler_t *p_handler, int i_object_id,
- const char *psz_name )
-{
- int i;
- return (counter_t *)vlc_HashRetrieve( p_handler->p_counters, p_handler->i_counters,
- i_object_id, psz_name );
-}
-
-
-static stats_handler_t *stats_HandlerGet( vlc_object_t *p_this )
-{
- stats_handler_t *p_handler = (stats_handler_t*)
- vlc_object_find( p_this->p_vlc, VLC_OBJECT_STATS,
- FIND_ANYWHERE );
- if( !p_handler )
- {
- p_handler = stats_HandlerCreate( p_this );
- if( !p_handler )
- {
- return NULL;
- }
- vlc_object_yield( p_handler );
- }
- return p_handler;
-}
-
-/**
- * Initialize statistics handler
- *
- * This function initializes the global statistics handler singleton,
- * \param p_this the parent VLC object
- */
-static stats_handler_t* stats_HandlerCreate( vlc_object_t *p_this )
-{
- stats_handler_t *p_handler;
-
- msg_Dbg( p_this, "creating statistics handler" );
-
- p_handler = (stats_handler_t*) vlc_object_create( p_this,
- VLC_OBJECT_STATS );
-
- if( !p_handler )
- {
- msg_Err( p_this, "out of memory" );
- return NULL;
- }
- p_handler->i_counters = 0;
- p_handler->p_counters = (hashtable_entry_t *) malloc( 5 * sizeof( variable_t ) );
-
- /// \bug is it p_vlc or p_libvlc ?
- vlc_object_attach( p_handler, p_this->p_vlc );
-
- return p_handler;
-}
-