summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2010-10-09 15:06:12 -0700
committerDavid Schleef <ds@schleef.org>2011-02-17 14:07:53 -0800
commit5a1132aaf1038d25ebad267e78063488eb147692 (patch)
treeb603a3add289b8b1b57fe80c40b64bc682e75d85 /tools
parentfa3ff9e5edddc9ade8b33aff33aeb81066c47c72 (diff)
downloadgstreamer-plugins-bad-5a1132aaf1038d25ebad267e78063488eb147692.tar.gz
element-maker: Add baseparse template
Diffstat (limited to 'tools')
-rw-r--r--tools/element-templates/baseparse109
1 files changed, 109 insertions, 0 deletions
diff --git a/tools/element-templates/baseparse b/tools/element-templates/baseparse
new file mode 100644
index 000000000..ff56b3ca4
--- /dev/null
+++ b/tools/element-templates/baseparse
@@ -0,0 +1,109 @@
+% ClassName
+GstBaseParse
+% TYPE_CLASS_NAME
+GST_TYPE_BASE_PARSE
+% pkg-config
+gstreamer-base-0.10
+% includes
+#include <gst/baseparse/gstbaseparse.h>
+% prototypes
+static gboolean gst_replace_start (GstBaseParse *parse);
+static gboolean gst_replace_stop (GstBaseParse *parse);
+static gboolean gst_replace_set_sink_caps (GstBaseParse *parse, GstCaps *caps);
+static gboolean gst_replace_check_valid_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame, guint *framesize, gint *skipsize);
+static GstFlowReturn gst_replace_parse_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame);
+static gboolean gst_replace_convert (GstBaseParse * parse,
+ GstFormat src_format, gint64 src_value, GstFormat dest_format,
+ gint64 * dest_value);
+static gboolean gst_replace_event (GstBaseParse *parse, GstEvent *event);
+static gboolean gst_replace_src_event (GstBaseParse *parse, GstEvent *event);
+static GstFlowReturn gst_replace_pre_push_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame);
+% declare-class
+ GstBaseParseClass *base_parse_class = GST_BASE_PARSE_CLASS (klass);
+% set-methods
+ base_parse_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
+ base_parse_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
+ base_parse_class->set_sink_caps = GST_DEBUG_FUNCPTR (gst_replace_set_sink_caps);
+ base_parse_class->check_valid_frame = GST_DEBUG_FUNCPTR (gst_replace_check_valid_frame);
+ base_parse_class->parse_frame = GST_DEBUG_FUNCPTR (gst_replace_parse_frame);
+ base_parse_class->pre_push_frame = GST_DEBUG_FUNCPTR (gst_replace_pre_push_frame);
+ base_parse_class->convert = GST_DEBUG_FUNCPTR (gst_replace_convert);
+ base_parse_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
+ base_parse_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
+% methods
+
+static gboolean
+gst_replace_start (GstBaseParse *parse)
+{
+ return TRUE;
+}
+
+static gboolean
+gst_replace_stop (GstBaseParse *parse)
+{
+ return TRUE;
+}
+
+static gboolean
+gst_replace_set_sink_caps (GstBaseParse *parse, GstCaps *caps)
+{
+ /* Called when sink caps are set */
+ return TRUE;
+}
+
+static gboolean
+gst_replace_check_valid_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame, guint *framesize, gint *skipsize)
+{
+ /* Called when processing incoming buffers. Function should check
+ whether the buffer contains a valid frame */
+ /* MUST implement */
+ return TRUE;
+}
+
+static GstFlowReturn
+gst_replace_parse_frame (GstBaseParse *parse,
+ GstBaseParseFrame *frame)
+{
+ /* Called when processing incoming buffers. Function should parse
+ a checked frame. */
+ /* MUST implement */
+ return GST_FLOW_OK;
+}
+
+static gboolean
+gst_replace_convert (GstBaseParse * parse, GstFormat src_format,
+ gint64 src_value, GstFormat dest_format, gint64 * dest_value)
+{
+ /* Convert between formats */
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_event (GstBaseParse *parse, GstEvent *event)
+{
+ /* Sink pad event handler */
+
+ return FALSE;
+}
+
+static gboolean
+gst_replace_src_event (GstBaseParse *parse, GstEvent *event)
+{
+ /* Src pad event handler */
+
+ return FALSE;
+}
+
+static GstFlowReturn
+gst_replace_pre_push_frame (GstBaseParse *parse, GstBaseParseFrame *frame)
+{
+
+ return GST_FLOW_OK;
+}
+
+% end