• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* vim: set filetype=c: */
2% ClassName
3GstElement
4% TYPE_CLASS_NAME
5GST_TYPE_ELEMENT
6% pads
7sinkpad srcpad
8% pkg-config
9gstreamer-1.0
10% includes
11#include <gst/gst.h>
12% prototypes
13static GstPad *gst_replace_request_new_pad (GstElement * element,
14    GstPadTemplate * templ, const gchar * name);
15static void gst_replace_release_pad (GstElement * element, GstPad * pad);
16static GstStateChangeReturn
17gst_replace_change_state (GstElement * element, GstStateChange transition);
18static GstClock *gst_replace_provide_clock (GstElement * element);
19static gboolean gst_replace_set_clock (GstElement * element, GstClock * clock);
20static GstIndex *gst_replace_get_index (GstElement * element);
21static void gst_replace_set_index (GstElement * element, GstIndex * index);
22static gboolean gst_replace_send_event (GstElement * element, GstEvent * event);
23static gboolean gst_replace_query (GstElement * element, GstQuery * query);
24% declare-class
25  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
26% set-methods
27  element_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_replace_request_new_pad);
28  element_class->release_pad = GST_DEBUG_FUNCPTR (gst_replace_release_pad);
29  element_class->change_state = GST_DEBUG_FUNCPTR (gst_replace_change_state);
30  element_class->provide_clock = GST_DEBUG_FUNCPTR (gst_replace_provide_clock);
31  element_class->set_clock = GST_DEBUG_FUNCPTR (gst_replace_set_clock);
32  element_class->get_index = GST_DEBUG_FUNCPTR (gst_replace_get_index);
33  element_class->set_index = GST_DEBUG_FUNCPTR (gst_replace_set_index);
34  element_class->send_event = GST_DEBUG_FUNCPTR (gst_replace_send_event);
35  element_class->query = GST_DEBUG_FUNCPTR (gst_replace_query);
36% methods
37
38
39static GstPad *
40gst_replace_request_new_pad (GstElement * element, GstPadTemplate * templ,
41    const gchar * name)
42{
43
44  return NULL;
45}
46
47static void
48gst_replace_release_pad (GstElement * element, GstPad * pad)
49{
50
51}
52
53static GstStateChangeReturn
54gst_replace_change_state (GstElement * element, GstStateChange transition)
55{
56  GstReplace *replace;
57  GstStateChangeReturn ret;
58
59  g_return_val_if_fail (GST_IS_REPLACE (element), GST_STATE_CHANGE_FAILURE);
60  replace = GST_REPLACE (element);
61
62  switch (transition) {
63    case GST_STATE_CHANGE_NULL_TO_READY:
64      break;
65    case GST_STATE_CHANGE_READY_TO_PAUSED:
66      break;
67    case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
68      break;
69    default:
70      break;
71  }
72
73  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
74
75  switch (transition) {
76    case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
77      break;
78    case GST_STATE_CHANGE_PAUSED_TO_READY:
79      break;
80    case GST_STATE_CHANGE_READY_TO_NULL:
81      break;
82    default:
83      break;
84  }
85
86  return ret;
87}
88
89static GstClock *
90gst_replace_provide_clock (GstElement * element)
91{
92
93  return NULL;
94}
95
96static gboolean
97gst_replace_set_clock (GstElement * element, GstClock * clock)
98{
99
100  return GST_ELEMENT_CLASS (parent_class)->set_clock (element, clock);
101}
102
103static GstIndex *
104gst_replace_get_index (GstElement * element)
105{
106
107  return NULL;
108}
109
110static void
111gst_replace_set_index (GstElement * element, GstIndex * index)
112{
113
114}
115
116static gboolean
117gst_replace_send_event (GstElement * element, GstEvent * event)
118{
119
120  return TRUE;
121}
122
123static gboolean
124gst_replace_query (GstElement * element, GstQuery * query)
125{
126  GstReplace *replace = GST_REPLACE (element);
127  gboolean ret;
128
129  GST_DEBUG_OBJECT (replace, "query");
130
131  switch (GST_QUERY_TYPE (query)) {
132    default:
133      ret = GST_ELEMENT_CLASS (parent_class)->query (element, query);
134      break;
135  }
136
137  return ret;
138}
139% end
140