blob: 5bc68ba248149e456ae935db50f45461f702743b [file] [log] [blame]
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +00001/* vim: set filetype=c: */
2% ClassName
3GstVideoFilter
4% TYPE_CLASS_NAME
5GST_TYPE_VIDEO_FILTER
6% pads
David Schleefb45a1df2013-03-14 23:57:06 -07007srcpad-template-video
8sinkpad-template-video
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +00009% pkg-config
David Schleefb45a1df2013-03-14 23:57:06 -070010gstreamer-video-1.0
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000011% includes
12#include <gst/video/video.h>
13#include <gst/video/gstvideofilter.h>
14% prototypes
David Schleef5dec0ed2013-04-12 14:09:24 -070015static gboolean gst_replace_start (GstBaseTransform * trans);
16static gboolean gst_replace_stop (GstBaseTransform * trans);
David Schleefb45a1df2013-03-14 23:57:06 -070017static gboolean gst_replace_set_info (GstVideoFilter * filter, GstCaps * incaps,
18 GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info);
19static GstFlowReturn gst_replace_transform_frame (GstVideoFilter * filter,
20 GstVideoFrame * inframe, GstVideoFrame * outframe);
21static GstFlowReturn gst_replace_transform_frame_ip (GstVideoFilter * filter,
22 GstVideoFrame * frame);
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000023% declare-class
David Schleef5dec0ed2013-04-12 14:09:24 -070024 GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass);
David Schleefb45a1df2013-03-14 23:57:06 -070025 GstVideoFilterClass *video_filter_class = GST_VIDEO_FILTER_CLASS (klass);
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000026% set-methods
David Schleef5dec0ed2013-04-12 14:09:24 -070027 base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
28 base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
David Schleefb45a1df2013-03-14 23:57:06 -070029 video_filter_class->set_info = GST_DEBUG_FUNCPTR (gst_replace_set_info);
30 video_filter_class->transform_frame = GST_DEBUG_FUNCPTR (gst_replace_transform_frame);
31 video_filter_class->transform_frame_ip = GST_DEBUG_FUNCPTR (gst_replace_transform_frame_ip);
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000032% methods
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000033static gboolean
David Schleef5dec0ed2013-04-12 14:09:24 -070034gst_replace_start (GstBaseTransform * trans)
35{
36 GstReplace *replace = GST_REPLACE (trans);
37
38 GST_DEBUG_OBJECT (replace, "start");
39
40 return TRUE;
41}
42
43static gboolean
44gst_replace_stop (GstBaseTransform * trans)
45{
46 GstReplace *replace = GST_REPLACE (trans);
47
48 GST_DEBUG_OBJECT (replace, "stop");
49
50 return TRUE;
51}
52
53static gboolean
David Schleefb45a1df2013-03-14 23:57:06 -070054gst_replace_set_info (GstVideoFilter * filter, GstCaps * incaps,
55 GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000056{
David Schleefb45a1df2013-03-14 23:57:06 -070057 GstReplace *replace = GST_REPLACE (filter);
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000058
David Schleefb45a1df2013-03-14 23:57:06 -070059 GST_DEBUG_OBJECT (replace, "set_info");
60
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000061 return TRUE;
62}
63
David Schleefb45a1df2013-03-14 23:57:06 -070064/* transform */
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000065static GstFlowReturn
David Schleefb45a1df2013-03-14 23:57:06 -070066gst_replace_transform_frame (GstVideoFilter * filter, GstVideoFrame * inframe,
67 GstVideoFrame * outframe)
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000068{
David Schleefb45a1df2013-03-14 23:57:06 -070069 GstReplace *replace = GST_REPLACE (filter);
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000070
David Schleefb45a1df2013-03-14 23:57:06 -070071 GST_DEBUG_OBJECT (replace, "transform_frame");
72
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000073 return GST_FLOW_OK;
74}
75
David Schleefb45a1df2013-03-14 23:57:06 -070076static GstFlowReturn
77gst_replace_transform_frame_ip (GstVideoFilter * filter, GstVideoFrame * frame)
78{
79 GstReplace *replace = GST_REPLACE (filter);
80
81 GST_DEBUG_OBJECT (replace, "transform_frame_ip");
82
83 return GST_FLOW_OK;
84}
Tim-Philipp Müllere504dc32012-03-17 15:16:29 +000085% end