-static counter_t *GetCounter( stats_handler_t *p_handler, int i_object_id,
- unsigned int i_counter )
-{
- int i;
- uint64_t i_index = ((uint64_t) i_object_id << 32 ) + i_counter;
- for (i = 0 ; i < p_handler->i_counters ; i++ )
- {
- if( i_index == p_handler->pp_counters[i]->i_index )
- return p_handler->pp_counters[i];
- }
- return NULL;
-}
-
-
-static stats_handler_t *stats_HandlerGet( vlc_object_t *p_this )
-{
- stats_handler_t *p_handler = p_this->p_libvlc->p_stats;
- 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->pp_counters = NULL;
-
- /// \bug is it p_vlc or p_libvlc ?
- vlc_object_attach( p_handler, p_this->p_vlc );
-
- p_this->p_libvlc->p_stats = p_handler;
-
- return p_handler;
-}
-