6 static GstCaps* gst_replace_src_getcaps (GstPad *pad);
7 static gboolean gst_replace_src_setcaps (GstPad *pad, GstCaps *caps);
8 static gboolean gst_replace_src_acceptcaps (GstPad *pad, GstCaps *caps);
9 static void gst_replace_src_fixatecaps (GstPad *pad, GstCaps *caps);
10 static gboolean gst_replace_src_activate (GstPad *pad);
11 static gboolean gst_replace_src_activatepush (GstPad *pad, gboolean active);
12 static gboolean gst_replace_src_activatepull (GstPad *pad, gboolean active);
13 static GstPadLinkReturn gst_replace_src_link (GstPad *pad, GstPad *peer);
14 static void gst_replace_src_unlink (GstPad *pad);
15 static GstFlowReturn gst_replace_src_getrange (GstPad *pad, guint64 offset, guint length,
17 static gboolean gst_replace_src_event (GstPad *pad, GstEvent *event);
18 static gboolean gst_replace_src_query (GstPad *pad, GstQuery *query);
19 static GstIterator * gst_replace_src_iterintlink (GstPad *pad);
22 static GstStaticPadTemplate gst_replace_src_template =
23 GST_STATIC_PAD_TEMPLATE ("src",
26 GST_STATIC_CAPS ("application/unknown")
30 gst_element_class_add_pad_template (element_class,
31 gst_static_pad_template_get (&gst_replace_src_template));
34 replace->srcpad = gst_pad_new_from_static_template (&gst_replace_src_template
37 gst_pad_set_getcaps_function (replace->srcpad,
38 GST_DEBUG_FUNCPTR(gst_replace_src_getcaps));
39 gst_pad_set_setcaps_function (replace->srcpad,
40 GST_DEBUG_FUNCPTR(gst_replace_src_setcaps));
41 gst_pad_set_acceptcaps_function (replace->srcpad,
42 GST_DEBUG_FUNCPTR(gst_replace_src_acceptcaps));
43 gst_pad_set_fixatecaps_function (replace->srcpad,
44 GST_DEBUG_FUNCPTR(gst_replace_src_fixatecaps));
45 gst_pad_set_activate_function (replace->srcpad,
46 GST_DEBUG_FUNCPTR(gst_replace_src_activate));
47 gst_pad_set_activatepush_function (replace->srcpad,
48 GST_DEBUG_FUNCPTR(gst_replace_src_activatepush));
49 gst_pad_set_activatepull_function (replace->srcpad,
50 GST_DEBUG_FUNCPTR(gst_replace_src_activatepull));
51 gst_pad_set_link_function (replace->srcpad,
52 GST_DEBUG_FUNCPTR(gst_replace_src_link));
53 gst_pad_set_unlink_function (replace->srcpad,
54 GST_DEBUG_FUNCPTR(gst_replace_src_unlink));
55 gst_pad_set_getrange_function (replace->srcpad,
56 GST_DEBUG_FUNCPTR(gst_replace_src_getrange));
57 gst_pad_set_event_function (replace->srcpad,
58 GST_DEBUG_FUNCPTR(gst_replace_src_event));
59 gst_pad_set_query_function (replace->srcpad,
60 GST_DEBUG_FUNCPTR(gst_replace_src_query));
61 gst_pad_set_iterate_internal_links_function (replace->srcpad,
62 GST_DEBUG_FUNCPTR(gst_replace_src_iterintlink));
63 gst_element_add_pad (GST_ELEMENT(replace), replace->srcpad);
69 gst_replace_src_getcaps (GstPad *pad)
74 replace = GST_REPLACE (gst_pad_get_parent (pad));
76 GST_DEBUG_OBJECT(replace, "getcaps");
78 caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
80 gst_object_unref (replace);
85 gst_replace_src_setcaps (GstPad *pad, GstCaps *caps)
89 replace = GST_REPLACE (gst_pad_get_parent (pad));
91 GST_DEBUG_OBJECT(replace, "setcaps");
94 gst_object_unref (replace);
99 gst_replace_src_acceptcaps (GstPad *pad, GstCaps *caps)
103 replace = GST_REPLACE (gst_pad_get_parent (pad));
105 GST_DEBUG_OBJECT(replace, "acceptcaps");
108 gst_object_unref (replace);
113 gst_replace_src_fixatecaps (GstPad *pad, GstCaps *caps)
117 replace = GST_REPLACE (gst_pad_get_parent (pad));
119 GST_DEBUG_OBJECT(replace, "fixatecaps");
122 gst_object_unref (replace);
126 gst_replace_src_activate (GstPad *pad)
131 replace = GST_REPLACE (gst_pad_get_parent (pad));
133 GST_DEBUG_OBJECT(replace, "activate");
135 if (gst_pad_check_pull_range (pad)) {
136 GST_DEBUG_OBJECT (pad, "activating pull");
137 ret = gst_pad_activate_pull (pad, TRUE);
139 GST_DEBUG_OBJECT (pad, "activating push");
140 ret = gst_pad_activate_push (pad, TRUE);
143 gst_object_unref (replace);
148 gst_replace_src_activatepush (GstPad *pad, gboolean active)
152 replace = GST_REPLACE (gst_pad_get_parent (pad));
154 GST_DEBUG_OBJECT(replace, "activatepush");
157 gst_object_unref (replace);
162 gst_replace_src_activatepull (GstPad *pad, gboolean active)
166 replace = GST_REPLACE (gst_pad_get_parent (pad));
168 GST_DEBUG_OBJECT(replace, "activatepull");
171 gst_object_unref (replace);
175 static GstPadLinkReturn
176 gst_replace_src_link (GstPad *pad, GstPad *peer)
180 replace = GST_REPLACE (gst_pad_get_parent (pad));
182 GST_DEBUG_OBJECT(replace, "link");
185 gst_object_unref (replace);
186 return GST_PAD_LINK_OK;
190 gst_replace_src_unlink (GstPad *pad)
194 replace = GST_REPLACE (gst_pad_get_parent (pad));
196 GST_DEBUG_OBJECT(replace, "unlink");
199 gst_object_unref (replace);
203 gst_replace_src_getrange (GstPad *pad, guint64 offset, guint length,
208 replace = GST_REPLACE (gst_pad_get_parent (pad));
210 GST_DEBUG_OBJECT(replace, "getrange");
213 gst_object_unref (replace);
218 gst_replace_src_event (GstPad *pad, GstEvent *event)
223 replace = GST_REPLACE (gst_pad_get_parent (pad));
225 GST_DEBUG_OBJECT(replace, "event");
227 switch (GST_EVENT_TYPE (event)) {
229 res = gst_pad_event_default (pad, event);
233 gst_object_unref (replace);
238 gst_replace_src_query (GstPad *pad, GstQuery *query)
243 replace = GST_REPLACE (gst_pad_get_parent (pad));
245 GST_DEBUG_OBJECT(replace, "query");
247 switch (GST_QUERY_TYPE(query)) {
249 res = gst_pad_query_default (pad, query);
253 gst_object_unref (replace);
258 gst_replace_src_iterintlink (GstPad *pad)
263 replace = GST_REPLACE (gst_pad_get_parent (pad));
265 GST_DEBUG_OBJECT(replace, "iterintlink");
267 iter = gst_pad_iterate_internal_links_default (pad);
269 gst_object_unref (replace);