summaryrefslogtreecommitdiff
path: root/tools/element-templates/videofilter
blob: 5bc68ba248149e456ae935db50f45461f702743b (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
/* vim: set filetype=c: */
% ClassName
GstVideoFilter
% TYPE_CLASS_NAME
GST_TYPE_VIDEO_FILTER
% pads
srcpad-template-video
sinkpad-template-video
% pkg-config
gstreamer-video-1.0
% includes
#include <gst/video/video.h>
#include <gst/video/gstvideofilter.h>
% prototypes
static gboolean gst_replace_start (GstBaseTransform * trans);
static gboolean gst_replace_stop (GstBaseTransform * trans);
static gboolean gst_replace_set_info (GstVideoFilter * filter, GstCaps * incaps,
    GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info);
static GstFlowReturn gst_replace_transform_frame (GstVideoFilter * filter,
    GstVideoFrame * inframe, GstVideoFrame * outframe);
static GstFlowReturn gst_replace_transform_frame_ip (GstVideoFilter * filter,
    GstVideoFrame * frame);
% declare-class
  GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass);
  GstVideoFilterClass *video_filter_class = GST_VIDEO_FILTER_CLASS (klass);
% set-methods
  base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
  base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
  video_filter_class->set_info = GST_DEBUG_FUNCPTR (gst_replace_set_info);
  video_filter_class->transform_frame = GST_DEBUG_FUNCPTR (gst_replace_transform_frame);
  video_filter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (gst_replace_transform_frame_ip);
% methods
static gboolean
gst_replace_start (GstBaseTransform * trans)
{
  GstReplace *replace = GST_REPLACE (trans);

  GST_DEBUG_OBJECT (replace, "start");

  return TRUE;
}

static gboolean
gst_replace_stop (GstBaseTransform * trans)
{
  GstReplace *replace = GST_REPLACE (trans);

  GST_DEBUG_OBJECT (replace, "stop");

  return TRUE;
}

static gboolean
gst_replace_set_info (GstVideoFilter * filter, GstCaps * incaps,
    GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
{
  GstReplace *replace = GST_REPLACE (filter);

  GST_DEBUG_OBJECT (replace, "set_info");

  return TRUE;
}

/* transform */
static GstFlowReturn
gst_replace_transform_frame (GstVideoFilter * filter, GstVideoFrame * inframe,
    GstVideoFrame * outframe)
{
  GstReplace *replace = GST_REPLACE (filter);

  GST_DEBUG_OBJECT (replace, "transform_frame");

  return GST_FLOW_OK;
}

static GstFlowReturn
gst_replace_transform_frame_ip (GstVideoFilter * filter, GstVideoFrame * frame)
{
  GstReplace *replace = GST_REPLACE (filter);

  GST_DEBUG_OBJECT (replace, "transform_frame_ip");

  return GST_FLOW_OK;
}
% end