2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * @short_description: Take data in and spit data out
23 * Filters take data in and spit data out. They are the main elements in a
25 * Filters have zero or more inputs and zero or more outputs. Filters are
26 * linked together to form filter graphs. A #GstFilter is the base class and is
27 * not very useful on its own.
29 #include "gst_private.h"
30 #include <gst/gstfilter.h>
34 * @list: a linked list
35 * @func: the function to execute for each item
36 * @first: flag to stop execution after a successful item
37 * @user_data: user data
39 * Iterates over the elements in @list, calling @func with the
40 * list item data for each item. If @func returns TRUE, @data is
41 * prepended to the list of results returned. If @first is true,
42 * the search is halted after the first result is found.
44 * Returns: the list of results
47 gst_filter_run (const GList * list, GstFilterFunc func, gboolean first,
50 const GList *walk = list;
55 gpointer data = walk->data;
57 walk = g_list_next (walk);
60 res = func (data, user_data);
63 result = g_list_prepend (result, data);