summaryrefslogtreecommitdiff
path: root/tools/element-templates/element
blob: 001f48762d7364cefe0d578966f6f02b068d19a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* vim: set filetype=c: */
% ClassName
GstElement
% TYPE_CLASS_NAME
GST_TYPE_ELEMENT
% pads
sinkpad srcpad
% pkg-config
gstreamer-0.10
% includes
#include <gst/gst.h>
% prototypes
static GstPad *gst_replace_request_new_pad (GstElement * element,
    GstPadTemplate * templ, const gchar * name);
static void gst_replace_release_pad (GstElement * element, GstPad * pad);
static GstStateChangeReturn
gst_replace_change_state (GstElement * element, GstStateChange transition);
static GstClock *gst_replace_provide_clock (GstElement * element);
static gboolean gst_replace_set_clock (GstElement * element, GstClock * clock);
static GstIndex *gst_replace_get_index (GstElement * element);
static void gst_replace_set_index (GstElement * element, GstIndex * index);
static gboolean gst_replace_send_event (GstElement * element, GstEvent * event);
static gboolean gst_replace_query (GstElement * element, GstQuery * query);
% declare-class
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
% set-methods
  element_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_replace_request_new_pad);
  element_class->release_pad = GST_DEBUG_FUNCPTR (gst_replace_release_pad);
  element_class->change_state = GST_DEBUG_FUNCPTR (gst_replace_change_state);
  element_class->provide_clock = GST_DEBUG_FUNCPTR (gst_replace_provide_clock);
  element_class->set_clock = GST_DEBUG_FUNCPTR (gst_replace_set_clock);
  element_class->get_index = GST_DEBUG_FUNCPTR (gst_replace_get_index);
  element_class->set_index = GST_DEBUG_FUNCPTR (gst_replace_set_index);
  element_class->send_event = GST_DEBUG_FUNCPTR (gst_replace_send_event);
  element_class->query = GST_DEBUG_FUNCPTR (gst_replace_query);
% methods


static GstPad *
gst_replace_request_new_pad (GstElement * element, GstPadTemplate * templ,
    const gchar * name)
{

  return NULL;
}

static void
gst_replace_release_pad (GstElement * element, GstPad * pad)
{

}

static GstStateChangeReturn
gst_replace_change_state (GstElement * element, GstStateChange transition)
{
  GstReplace *replace;
  GstStateChangeReturn ret;

  g_return_val_if_fail (GST_IS_REPLACE (element), GST_STATE_CHANGE_FAILURE);
  replace = GST_REPLACE (element);

  switch (transition) {
    case GST_STATE_CHANGE_NULL_TO_READY:
      break;
    case GST_STATE_CHANGE_READY_TO_PAUSED:
      break;
    case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
      break;
    default:
      break;
  }

  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);

  switch (transition) {
    case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
      break;
    case GST_STATE_CHANGE_PAUSED_TO_READY:
      break;
    case GST_STATE_CHANGE_READY_TO_NULL:
      break;
    default:
      break;
  }

  return ret;
}

static GstClock *
gst_replace_provide_clock (GstElement * element)
{

  return NULL;
}

static gboolean
gst_replace_set_clock (GstElement * element, GstClock * clock)
{

  return GST_ELEMENT_CLASS (parent_class)->set_clock (element, clock);
}

static GstIndex *
gst_replace_get_index (GstElement * element)
{

  return NULL;
}

static void
gst_replace_set_index (GstElement * element, GstIndex * index)
{

}

static gboolean
gst_replace_send_event (GstElement * element, GstEvent * event)
{

  return TRUE;
}

static gboolean
gst_replace_query (GstElement * element, GstQuery * query)
{

  return FALSE;
}
% end