+
+static int CountChildren( vlc_object_t *p_this, int i_type )
+{
+ vlc_object_t *p_tmp;
+ int i, i_count = 0;
+
+ for( i = 0; i < p_this->i_children; i++ )
+ {
+ p_tmp = p_this->pp_children[i];
+
+ if( p_tmp->i_object_type == i_type )
+ {
+ i_count++;
+ }
+
+ if( p_tmp->i_children )
+ {
+ i_count += CountChildren( p_tmp, i_type );
+ }
+ }
+
+ return i_count;
+}
+
+static void ListChildren( vlc_list_t *p_list, vlc_object_t *p_this, int i_type )
+{
+ vlc_object_t *p_tmp;
+ int i;
+
+ for( i = 0; i < p_this->i_children; i++ )
+ {
+ p_tmp = p_this->pp_children[i];
+
+ if( p_tmp->i_object_type == i_type )
+ {
+ ListReplace( p_list, p_tmp, p_list->i_count++ );
+ }
+
+ if( p_tmp->i_children )
+ {
+ ListChildren( p_list, p_tmp, i_type );
+ }
+ }
+}