Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 1 | /* vim: set filetype=c: */ |
| 2 | % ClassName |
| 3 | GstVideoFilter |
| 4 | % TYPE_CLASS_NAME |
| 5 | GST_TYPE_VIDEO_FILTER |
| 6 | % pads |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 7 | srcpad-template-video |
| 8 | sinkpad-template-video |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 9 | % pkg-config |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 10 | gstreamer-video-1.0 |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 11 | % includes |
| 12 | #include <gst/video/video.h> |
| 13 | #include <gst/video/gstvideofilter.h> |
| 14 | % prototypes |
David Schleef | 5dec0ed | 2013-04-12 14:09:24 -0700 | [diff] [blame] | 15 | static gboolean gst_replace_start (GstBaseTransform * trans); |
| 16 | static gboolean gst_replace_stop (GstBaseTransform * trans); |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 17 | static gboolean gst_replace_set_info (GstVideoFilter * filter, GstCaps * incaps, |
| 18 | GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info); |
| 19 | static GstFlowReturn gst_replace_transform_frame (GstVideoFilter * filter, |
| 20 | GstVideoFrame * inframe, GstVideoFrame * outframe); |
| 21 | static GstFlowReturn gst_replace_transform_frame_ip (GstVideoFilter * filter, |
| 22 | GstVideoFrame * frame); |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 23 | % declare-class |
David Schleef | 5dec0ed | 2013-04-12 14:09:24 -0700 | [diff] [blame] | 24 | GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass); |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 25 | GstVideoFilterClass *video_filter_class = GST_VIDEO_FILTER_CLASS (klass); |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 26 | % set-methods |
David Schleef | 5dec0ed | 2013-04-12 14:09:24 -0700 | [diff] [blame] | 27 | base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start); |
| 28 | base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop); |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 29 | 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üller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 32 | % methods |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 33 | static gboolean |
David Schleef | 5dec0ed | 2013-04-12 14:09:24 -0700 | [diff] [blame] | 34 | gst_replace_start (GstBaseTransform * trans) |
| 35 | { |
| 36 | GstReplace *replace = GST_REPLACE (trans); |
| 37 | |
| 38 | GST_DEBUG_OBJECT (replace, "start"); |
| 39 | |
| 40 | return TRUE; |
| 41 | } |
| 42 | |
| 43 | static gboolean |
| 44 | gst_replace_stop (GstBaseTransform * trans) |
| 45 | { |
| 46 | GstReplace *replace = GST_REPLACE (trans); |
| 47 | |
| 48 | GST_DEBUG_OBJECT (replace, "stop"); |
| 49 | |
| 50 | return TRUE; |
| 51 | } |
| 52 | |
| 53 | static gboolean |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 54 | gst_replace_set_info (GstVideoFilter * filter, GstCaps * incaps, |
| 55 | GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 56 | { |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 57 | GstReplace *replace = GST_REPLACE (filter); |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 58 | |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 59 | GST_DEBUG_OBJECT (replace, "set_info"); |
| 60 | |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 61 | return TRUE; |
| 62 | } |
| 63 | |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 64 | /* transform */ |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 65 | static GstFlowReturn |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 66 | gst_replace_transform_frame (GstVideoFilter * filter, GstVideoFrame * inframe, |
| 67 | GstVideoFrame * outframe) |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 68 | { |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 69 | GstReplace *replace = GST_REPLACE (filter); |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 70 | |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 71 | GST_DEBUG_OBJECT (replace, "transform_frame"); |
| 72 | |
Tim-Philipp Müller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 73 | return GST_FLOW_OK; |
| 74 | } |
| 75 | |
David Schleef | b45a1df | 2013-03-14 23:57:06 -0700 | [diff] [blame] | 76 | static GstFlowReturn |
| 77 | gst_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üller | e504dc3 | 2012-03-17 15:16:29 +0000 | [diff] [blame] | 85 | % end |