summaryrefslogtreecommitdiff
path: root/tools/element-templates/baseparse
blob: 01293f68a21f6a2ead7c8f79b8ee283b4e897d8d (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
% ClassName
GstBaseParse
% TYPE_CLASS_NAME
GST_TYPE_BASE_PARSE
% pkg-config
gstreamer-base-0.10
% includes
#include <gst/base/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