1 /* vim: set filetype=c: */
11 #include <gst/base/gstpushsrc.h>
13 static GstCaps *gst_replace_get_caps (GstBaseSrc * src);
14 static gboolean gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps);
15 static gboolean gst_replace_negotiate (GstBaseSrc * src);
16 static gboolean gst_replace_newsegment (GstBaseSrc * src);
17 static gboolean gst_replace_start (GstBaseSrc * src);
18 static gboolean gst_replace_stop (GstBaseSrc * src);
20 gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
21 GstClockTime * start, GstClockTime * end);
22 static gboolean gst_replace_get_size (GstBaseSrc * src, guint64 * size);
23 static gboolean gst_replace_is_seekable (GstBaseSrc * src);
24 static gboolean gst_replace_unlock (GstBaseSrc * src);
25 static gboolean gst_replace_event (GstBaseSrc * src, GstEvent * event);
26 static gboolean gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment);
27 static gboolean gst_replace_query (GstBaseSrc * src, GstQuery * query);
28 static gboolean gst_replace_check_get_range (GstBaseSrc * src);
29 static void gst_replace_fixate (GstBaseSrc * src, GstCaps * caps);
30 static gboolean gst_replace_unlock_stop (GstBaseSrc * src);
32 gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
33 GstSegment * segment);
34 static GstFlowReturn gst_replace_create (GstPushSrc * src, GstBuffer ** buf);
36 GstBaseSrcClass *base_src_class = GST_BASE_SRC_CLASS (klass);
37 GstPushSrcClass *push_src_class = GST_PUSH_SRC_CLASS (klass);
39 base_src_class->get_caps = GST_DEBUG_FUNCPTR (gst_replace_get_caps);
40 base_src_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
41 base_src_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
42 base_src_class->newsegment = GST_DEBUG_FUNCPTR (gst_replace_newsegment);
43 base_src_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
44 base_src_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
45 base_src_class->get_times = GST_DEBUG_FUNCPTR (gst_replace_get_times);
46 base_src_class->get_size = GST_DEBUG_FUNCPTR (gst_replace_get_size);
47 base_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_replace_is_seekable);
48 base_src_class->unlock = GST_DEBUG_FUNCPTR (gst_replace_unlock);
49 base_src_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
50 base_src_class->do_seek = GST_DEBUG_FUNCPTR (gst_replace_do_seek);
51 base_src_class->query = GST_DEBUG_FUNCPTR (gst_replace_query);
52 base_src_class->check_get_range = GST_DEBUG_FUNCPTR (gst_replace_check_get_range);
53 base_src_class->fixate = GST_DEBUG_FUNCPTR (gst_replace_fixate);
54 base_src_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_replace_unlock_stop);
55 base_src_class->prepare_seek_segment = GST_DEBUG_FUNCPTR (gst_replace_prepare_seek_segment);
57 push_src_class->create = GST_DEBUG_FUNCPTR (gst_replace_create);
61 gst_replace_get_caps (GstBaseSrc * src)
63 GstReplace *replace = GST_REPLACE (src);
65 GST_DEBUG_OBJECT (replace, "get_caps");
71 gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps)
73 GstReplace *replace = GST_REPLACE (src);
75 GST_DEBUG_OBJECT (replace, "set_caps");
81 gst_replace_negotiate (GstBaseSrc * src)
83 GstReplace *replace = GST_REPLACE (src);
85 GST_DEBUG_OBJECT (replace, "negotiate");
91 gst_replace_newsegment (GstBaseSrc * src)
93 GstReplace *replace = GST_REPLACE (src);
95 GST_DEBUG_OBJECT (replace, "newsegment");
101 gst_replace_start (GstBaseSrc * src)
103 GstReplace *replace = GST_REPLACE (src);
105 GST_DEBUG_OBJECT (replace, "start");
111 gst_replace_stop (GstBaseSrc * src)
113 GstReplace *replace = GST_REPLACE (src);
115 GST_DEBUG_OBJECT (replace, "stop");
121 gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
122 GstClockTime * start, GstClockTime * end)
124 GstReplace *replace = GST_REPLACE (src);
126 GST_DEBUG_OBJECT (replace, "get_times");
130 gst_replace_get_size (GstBaseSrc * src, guint64 * size)
132 GstReplace *replace = GST_REPLACE (src);
134 GST_DEBUG_OBJECT (replace, "get_size");
140 gst_replace_is_seekable (GstBaseSrc * src)
142 GstReplace *replace = GST_REPLACE (src);
144 GST_DEBUG_OBJECT (replace, "is_seekable");
150 gst_replace_unlock (GstBaseSrc * src)
152 GstReplace *replace = GST_REPLACE (src);
154 GST_DEBUG_OBJECT (replace, "unlock");
160 gst_replace_event (GstBaseSrc * src, GstEvent * event)
162 GstReplace *replace = GST_REPLACE (src);
164 GST_DEBUG_OBJECT (replace, "event");
170 gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment)
172 GstReplace *replace = GST_REPLACE (src);
174 GST_DEBUG_OBJECT (replace, "do_seek");
180 gst_replace_query (GstBaseSrc * src, GstQuery * query)
182 GstReplace *replace = GST_REPLACE (src);
184 GST_DEBUG_OBJECT (replace, "query");
190 gst_replace_check_get_range (GstBaseSrc * src)
192 GstReplace *replace = GST_REPLACE (src);
194 GST_DEBUG_OBJECT (replace, "get_range");
200 gst_replace_fixate (GstBaseSrc * src, GstCaps * caps)
202 GstReplace *replace = GST_REPLACE (src);
204 GST_DEBUG_OBJECT (replace, "fixate");
208 gst_replace_unlock_stop (GstBaseSrc * src)
210 GstReplace *replace = GST_REPLACE (src);
212 GST_DEBUG_OBJECT (replace, "stop");
218 gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
219 GstSegment * segment)
221 GstReplace *replace = GST_REPLACE (src);
223 GST_DEBUG_OBJECT (replace, "seek_segment");
229 gst_replace_create (GstPushSrc * src, GstBuffer ** buf)