| 1 |
/* vim: set filetype=c: */ |
| 2 |
% ClassName |
| 3 |
GstBaseParse |
| 4 |
% TYPE_CLASS_NAME |
| 5 |
GST_TYPE_BASE_PARSE |
| 6 |
% pads |
| 7 |
srcpad-simple |
| 8 |
sinkpad-simple |
| 9 |
% pkg-config |
| 10 |
gstreamer-base-1.0 |
| 11 |
% includes |
| 12 |
#include <gst/base/gstbaseparse.h> |
| 13 |
% prototypes |
| 14 |
static gboolean gst_replace_start (GstBaseParse * parse); |
| 15 |
static gboolean gst_replace_stop (GstBaseParse * parse); |
| 16 |
static gboolean gst_replace_set_sink_caps (GstBaseParse * parse, |
| 17 |
GstCaps * caps); |
| 18 |
static GstFlowReturn gst_replace_handle_frame (GstBaseParse * parse, |
| 19 |
GstBaseParseFrame * frame, gint * skipsize); |
| 20 |
static GstFlowReturn gst_replace_pre_push_frame (GstBaseParse * parse, |
| 21 |
GstBaseParseFrame * frame); |
| 22 |
static gboolean gst_replace_convert (GstBaseParse * parse, GstFormat src_format, |
| 23 |
gint64 src_value, GstFormat dest_format, gint64 * dest_value); |
| 24 |
static gboolean gst_replace_sink_event (GstBaseParse * parse, GstEvent * event); |
| 25 |
static gboolean gst_replace_src_event (GstBaseParse * parse, GstEvent * event); |
| 26 |
static GstCaps *gst_replace_get_sink_caps (GstBaseParse * parse, |
| 27 |
GstCaps * filter); |
| 28 |
static GstFlowReturn gst_replace_detect (GstBaseParse * parse, |
| 29 |
GstBuffer * buffer); |
| 30 |
% declare-class |
| 31 |
GstBaseParseClass *base_parse_class = GST_BASE_PARSE_CLASS (klass); |
| 32 |
% set-methods |
| 33 |
base_parse_class->start = GST_DEBUG_FUNCPTR (gst_replace_start); |
| 34 |
base_parse_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop); |
| 35 |
base_parse_class->set_sink_caps = GST_DEBUG_FUNCPTR (gst_replace_set_sink_caps); |
| 36 |
base_parse_class->handle_frame = GST_DEBUG_FUNCPTR (gst_replace_handle_frame); |
| 37 |
base_parse_class->pre_push_frame = GST_DEBUG_FUNCPTR (gst_replace_pre_push_frame); |
| 38 |
base_parse_class->convert = GST_DEBUG_FUNCPTR (gst_replace_convert); |
| 39 |
base_parse_class->sink_event = GST_DEBUG_FUNCPTR (gst_replace_sink_event); |
| 40 |
base_parse_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event); |
| 41 |
base_parse_class->get_sink_caps = GST_DEBUG_FUNCPTR (gst_replace_get_sink_caps); |
| 42 |
base_parse_class->detect = GST_DEBUG_FUNCPTR (gst_replace_detect); |
| 43 |
% methods |
| 44 |
static gboolean |
| 45 |
gst_replace_start (GstBaseParse * parse) |
| 46 |
{ |
| 47 |
GstReplace *replace = GST_REPLACE (parse); |
| 48 |
|
| 49 |
GST_DEBUG_OBJECT (replace, "start"); |
| 50 |
|
| 51 |
return TRUE; |
| 52 |
} |
| 53 |
|
| 54 |
static gboolean |
| 55 |
gst_replace_stop (GstBaseParse * parse) |
| 56 |
{ |
| 57 |
GstReplace *replace = GST_REPLACE (parse); |
| 58 |
|
| 59 |
GST_DEBUG_OBJECT (replace, "stop"); |
| 60 |
|
| 61 |
return TRUE; |
| 62 |
} |
| 63 |
|
| 64 |
static gboolean |
| 65 |
gst_replace_set_sink_caps (GstBaseParse * parse, GstCaps * caps) |
| 66 |
{ |
| 67 |
GstReplace *replace = GST_REPLACE (parse); |
| 68 |
|
| 69 |
GST_DEBUG_OBJECT (replace, "set_sink_caps"); |
| 70 |
|
| 71 |
return TRUE; |
| 72 |
} |
| 73 |
|
| 74 |
static GstFlowReturn |
| 75 |
gst_replace_handle_frame (GstBaseParse * parse, GstBaseParseFrame * frame, |
| 76 |
gint * skipsize) |
| 77 |
{ |
| 78 |
GstReplace *replace = GST_REPLACE (parse); |
| 79 |
|
| 80 |
GST_DEBUG_OBJECT (replace, "handle_frame"); |
| 81 |
|
| 82 |
return GST_FLOW_OK; |
| 83 |
} |
| 84 |
|
| 85 |
static GstFlowReturn |
| 86 |
gst_replace_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) |
| 87 |
{ |
| 88 |
GstReplace *replace = GST_REPLACE (parse); |
| 89 |
|
| 90 |
GST_DEBUG_OBJECT (replace, "pre_push_frame"); |
| 91 |
|
| 92 |
return GST_FLOW_OK; |
| 93 |
} |
| 94 |
|
| 95 |
static gboolean |
| 96 |
gst_replace_convert (GstBaseParse * parse, GstFormat src_format, |
| 97 |
gint64 src_value, GstFormat dest_format, gint64 * dest_value) |
| 98 |
{ |
| 99 |
GstReplace *replace = GST_REPLACE (parse); |
| 100 |
|
| 101 |
GST_DEBUG_OBJECT (replace, "convert"); |
| 102 |
|
| 103 |
return TRUE; |
| 104 |
} |
| 105 |
|
| 106 |
static gboolean |
| 107 |
gst_replace_sink_event (GstBaseParse * parse, GstEvent * event) |
| 108 |
{ |
| 109 |
GstReplace *replace = GST_REPLACE (parse); |
| 110 |
|
| 111 |
GST_DEBUG_OBJECT (replace, "sink_event"); |
| 112 |
|
| 113 |
return TRUE; |
| 114 |
} |
| 115 |
|
| 116 |
static gboolean |
| 117 |
gst_replace_src_event (GstBaseParse * parse, GstEvent * event) |
| 118 |
{ |
| 119 |
GstReplace *replace = GST_REPLACE (parse); |
| 120 |
|
| 121 |
GST_DEBUG_OBJECT (replace, "src_event"); |
| 122 |
|
| 123 |
return TRUE; |
| 124 |
} |
| 125 |
|
| 126 |
static GstCaps * |
| 127 |
gst_replace_get_sink_caps (GstBaseParse * parse, GstCaps * filter) |
| 128 |
{ |
| 129 |
GstReplace *replace = GST_REPLACE (parse); |
| 130 |
|
| 131 |
GST_DEBUG_OBJECT (replace, "get_sink_caps"); |
| 132 |
|
| 133 |
return NULL; |
| 134 |
} |
| 135 |
|
| 136 |
static GstFlowReturn |
| 137 |
gst_replace_detect (GstBaseParse * parse, GstBuffer * buffer) |
| 138 |
{ |
| 139 |
GstReplace *replace = GST_REPLACE (parse); |
| 140 |
|
| 141 |
GST_DEBUG_OBJECT (replace, "detect"); |
| 142 |
|
| 143 |
return GST_FLOW_OK; |
| 144 |
} |
| 145 |
% end |