gnl: Add the srcpad directly to GnlObject
[platform/upstream/gstreamer.git] / gnl / gnloperation.h
1 /* GStreamer
2  * Copyright (C) 2001 Wim Taymans <wim.taymans@chello.be>
3  *               2004 Edward Hervey <bilboed@bilboed.com>
4  *
5  * gnloperation.h: Header for base GnlOperation
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22
23
24 #ifndef __GNL_OPERATION_H__
25 #define __GNL_OPERATION_H__
26
27 #include <gst/gst.h>
28 #include "gnlobject.h"
29
30 G_BEGIN_DECLS
31 #define GNL_TYPE_OPERATION \
32   (gnl_operation_get_type())
33 #define GNL_OPERATION(obj) \
34   (G_TYPE_CHECK_INSTANCE_CAST((obj),GNL_TYPE_OPERATION,GnlOperation))
35 #define GNL_OPERATION_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST((klass),GNL_TYPE_OPERATION,GnlOperationClass))
37 #define GNL_IS_OPERATION(obj) \
38   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GNL_TYPE_OPERATION))
39 #define GNL_IS_OPERATION_CLASS(obj) \
40   (G_TYPE_CHECK_CLASS_TYPE((klass),GNL_TYPE_OPERATION))
41     struct _GnlOperation
42 {
43   GnlObject parent;
44
45   /* <private> */
46
47   /* num_sinks:
48    * Number of sink inputs of the controlled element.
49    * -1 if the sink pads are dynamic */
50   gint num_sinks;
51
52   /* TRUE if element has request pads */
53   gboolean dynamicsinks;
54
55   /* realsinks:
56    * Number of sink pads currently used on the contolled element. */
57   gint realsinks;
58
59   /* FIXME : We might need to use a lock to access this list */
60   GList * sinks;                /* The sink ghostpads */
61   
62   GstElement *element;          /* controlled element */
63
64   GstClockTime next_base_time;
65 };
66
67 struct _GnlOperationClass
68 {
69   GnlObjectClass parent_class;
70
71   void  (*input_priority_changed) (GnlOperation * operation, GstPad *pad, guint32 priority);
72 };
73
74 GstPad * get_unlinked_sink_ghost_pad (GnlOperation * operation);
75
76 void
77 gnl_operation_signal_input_priority_changed(GnlOperation * operation, GstPad *pad,
78                                             guint32 priority);
79
80 void gnl_operation_update_base_time (GnlOperation *operation,
81                                      GstClockTime timestamp);
82
83
84 /* normal GOperation stuff */
85 GType gnl_operation_get_type (void);
86
87 G_END_DECLS
88 #endif /* __GNL_OPERATION_H__ */