diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-12-22 02:51:03 +0400 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-12-22 02:51:03 +0400 |
commit | 2214657113a68430bdc5aaf186d4162d4b69f242 (patch) | |
tree | 8e0876f96ceaf080d6a98bd744fc259a9a849f6b /gst/effectv | |
parent | 4b8975f86704fe0e731bf84f5c60cd2f814bf7b4 (diff) |
update for videofilter changes.
Diffstat (limited to 'gst/effectv')
-rw-r--r-- | gst/effectv/gstaging.c | 73 | ||||
-rw-r--r-- | gst/effectv/gstaging.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstdice.c | 58 | ||||
-rw-r--r-- | gst/effectv/gstdice.h | 1 | ||||
-rw-r--r-- | gst/effectv/gstedge.c | 45 | ||||
-rw-r--r-- | gst/effectv/gstedge.h | 1 | ||||
-rw-r--r-- | gst/effectv/gstop.c | 70 | ||||
-rw-r--r-- | gst/effectv/gstop.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstquark.c | 70 | ||||
-rw-r--r-- | gst/effectv/gstquark.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstradioac.c | 79 | ||||
-rw-r--r-- | gst/effectv/gstradioac.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstrev.c | 73 | ||||
-rw-r--r-- | gst/effectv/gstrev.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstripple.c | 87 | ||||
-rw-r--r-- | gst/effectv/gstripple.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstshagadelic.c | 72 | ||||
-rw-r--r-- | gst/effectv/gstshagadelic.h | 2 | ||||
-rw-r--r-- | gst/effectv/gststreak.c | 67 | ||||
-rw-r--r-- | gst/effectv/gststreak.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstvertigo.c | 81 | ||||
-rw-r--r-- | gst/effectv/gstvertigo.h | 2 | ||||
-rw-r--r-- | gst/effectv/gstwarp.c | 76 | ||||
-rw-r--r-- | gst/effectv/gstwarp.h | 2 |
24 files changed, 243 insertions, 630 deletions
diff --git a/gst/effectv/gstaging.c b/gst/effectv/gstaging.c index d3c9da5ad..7b8f16ff3 100644 --- a/gst/effectv/gstaging.c +++ b/gst/effectv/gstaging.c @@ -87,28 +87,6 @@ GST_STATIC_PAD_TEMPLATE ("sink", G_DEFINE_TYPE (GstAgingTV, gst_agingtv, GST_TYPE_VIDEO_FILTER); -static gboolean -gst_agingtv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) -{ - GstAgingTV *filter = GST_AGINGTV (btrans); - GstVideoInfo info; - - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_ERROR_OBJECT (filter, "could not parse caps"); - return GST_FLOW_ERROR; - } -} - static void coloraging (guint32 * src, guint32 * dest, gint video_area, gint * c) { @@ -321,19 +299,19 @@ gst_agingtv_start (GstBaseTransform * trans) } static GstFlowReturn -gst_agingtv_transform (GstBaseTransform * trans, GstBuffer * in, - GstBuffer * out) +gst_agingtv_transform_frame (GstVideoFilter * filter, GstVideoFrame * in_frame, + GstVideoFrame * out_frame) { - GstAgingTV *agingtv = GST_AGINGTV (trans); - GstVideoFrame in_frame, out_frame; + GstAgingTV *agingtv = GST_AGINGTV (filter); gint area_scale; GstClockTime timestamp, stream_time; gint width, height, stride, video_size; guint32 *src, *dest; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (filter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (agingtv, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -341,20 +319,13 @@ gst_agingtv_transform (GstBaseTransform * trans, GstBuffer * in, if (GST_CLOCK_TIME_IS_VALID (stream_time)) gst_object_sync_values (GST_OBJECT (agingtv), stream_time); - if (!gst_video_frame_map (&in_frame, &agingtv->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &agingtv->info, out, GST_MAP_WRITE)) - goto invalid_out; - - - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); - stride = GST_VIDEO_FRAME_PLANE_STRIDE (&in_frame, 0); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); + stride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0); video_size = stride * height; - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); area_scale = width * height / 64 / 480; if (area_scale <= 0) @@ -371,23 +342,7 @@ gst_agingtv_transform (GstBaseTransform * trans, GstBuffer * in, if (area_scale > 1 && agingtv->dusts) dusts (dest, width, height, &agingtv->dust_interval, area_scale); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (agingtv, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (agingtv, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } } static void @@ -396,6 +351,7 @@ gst_agingtv_class_init (GstAgingTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_agingtv_set_property; gobject_class->get_property = gst_agingtv_get_property; @@ -430,9 +386,10 @@ gst_agingtv_class_init (GstAgingTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_agingtv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_agingtv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_agingtv_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_agingtv_start); + + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_agingtv_transform_frame); } static void diff --git a/gst/effectv/gstaging.h b/gst/effectv/gstaging.h index ec02f6672..604af5d18 100644 --- a/gst/effectv/gstaging.h +++ b/gst/effectv/gstaging.h @@ -62,8 +62,6 @@ struct _GstAgingTV GstVideoFilter videofilter; /* < private > */ - GstVideoInfo info; - gboolean color_aging; gboolean pits; gboolean dusts; diff --git a/gst/effectv/gstdice.c b/gst/effectv/gstdice.c index ca803b059..f3b47c19f 100644 --- a/gst/effectv/gstdice.c +++ b/gst/effectv/gstdice.c @@ -91,38 +91,25 @@ enum }; static gboolean -gst_dicetv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_dicetv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstDiceTV *filter = GST_DICETV (btrans); - GstVideoInfo info; - - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; + GstDiceTV *filter = GST_DICETV (vfilter); g_free (filter->dicemap); filter->dicemap = - (guint8 *) g_malloc (GST_VIDEO_INFO_WIDTH (&info) * - GST_VIDEO_INFO_WIDTH (&info)); + (guint8 *) g_malloc (GST_VIDEO_INFO_WIDTH (in_info) * + GST_VIDEO_INFO_WIDTH (in_info)); gst_dicetv_create_map (filter); - filter->info = info; - return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps"); - return FALSE; - } } static GstFlowReturn -gst_dicetv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) +gst_dicetv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, + GstVideoFrame * out_frame) { - GstDiceTV *filter = GST_DICETV (trans); - GstVideoFrame in_frame, out_frame; + GstDiceTV *filter = GST_DICETV (vfilter); guint32 *src, *dest; gint i, map_x, map_y, map_i, base, dx, dy, di; gint video_stride, g_cube_bits, g_cube_size; @@ -130,9 +117,10 @@ gst_dicetv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) GstClockTime timestamp, stream_time; const guint8 *dicemap; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (vfilter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -140,12 +128,9 @@ gst_dicetv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) if (GST_CLOCK_TIME_IS_VALID (stream_time)) gst_object_sync_values (GST_OBJECT (filter), stream_time); - gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ); - gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE); - - src = (guint32 *) GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = (guint32 *) GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); - video_stride = GST_VIDEO_FRAME_PLANE_STRIDE (&in_frame, 0); + src = (guint32 *) GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = (guint32 *) GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); + video_stride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0); GST_OBJECT_LOCK (filter); g_cube_bits = filter->g_cube_bits; @@ -211,9 +196,6 @@ gst_dicetv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) } GST_OBJECT_UNLOCK (filter); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; } @@ -222,9 +204,10 @@ gst_dicetv_create_map (GstDiceTV * filter) { gint x, y, i; gint width, height; + GstVideoInfo *info = &GST_VIDEO_FILTER (filter)->in_info; - width = GST_VIDEO_INFO_WIDTH (&filter->info); - height = GST_VIDEO_INFO_HEIGHT (&filter->info); + width = GST_VIDEO_INFO_WIDTH (info); + height = GST_VIDEO_INFO_HEIGHT (info); if (width <= 0 || height <= 0) return; @@ -295,7 +278,7 @@ gst_dicetv_class_init (GstDiceTVClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; - GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_dicetv_set_property; gobject_class->get_property = gst_dicetv_get_property; @@ -316,8 +299,9 @@ gst_dicetv_class_init (GstDiceTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_dicetv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_dicetv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_dicetv_transform); + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_dicetv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_dicetv_transform_frame); } static void diff --git a/gst/effectv/gstdice.h b/gst/effectv/gstdice.h index 0a5c3e613..0a6e5eecf 100644 --- a/gst/effectv/gstdice.h +++ b/gst/effectv/gstdice.h @@ -55,7 +55,6 @@ struct _GstDiceTV GstVideoFilter videofilter; /* < private > */ - GstVideoInfo info; guint8 *dicemap; gint g_cube_bits; diff --git a/gst/effectv/gstedge.c b/gst/effectv/gstedge.c index 5ba182e45..6d894b084 100644 --- a/gst/effectv/gstedge.c +++ b/gst/effectv/gstedge.c @@ -70,21 +70,15 @@ GST_STATIC_PAD_TEMPLATE ("sink", ); static gboolean -gst_edgetv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_edgetv_set_info (GstVideoFilter * filter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstEdgeTV *edgetv = GST_EDGETV (btrans); - GstVideoInfo info; + GstEdgeTV *edgetv = GST_EDGETV (filter); guint map_size; gint width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - edgetv->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); edgetv->map_width = width / 4; edgetv->map_height = height / 4; @@ -96,19 +90,13 @@ gst_edgetv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, edgetv->map = (guint32 *) g_malloc0 (map_size); return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (btrans, "could not parse caps"); - return FALSE; - } } static GstFlowReturn -gst_edgetv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) +gst_edgetv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, + GstVideoFrame * out_frame) { - GstEdgeTV *filter = GST_EDGETV (trans); + GstEdgeTV *filter = GST_EDGETV (vfilter); gint x, y, r, g, b; guint32 *src, *dest; guint32 p, q; @@ -117,20 +105,16 @@ gst_edgetv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) gint video_width_margin; guint32 *map; GstFlowReturn ret = GST_FLOW_OK; - GstVideoFrame in_frame, out_frame; map = filter->map; map_height = filter->map_height; map_width = filter->map_width; video_width_margin = filter->video_width_margin; - gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ); - gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE); - - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); - width = GST_VIDEO_FRAME_WIDTH (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); src += width * 4 + 4; dest += width * 4 + 4; @@ -244,6 +228,7 @@ gst_edgetv_class_init (GstEdgeTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->finalize = gst_edgetv_finalize; @@ -256,9 +241,11 @@ gst_edgetv_class_init (GstEdgeTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_edgetv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_edgetv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_edgetv_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_edgetv_start); + + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_edgetv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_edgetv_transform_frame); } static void diff --git a/gst/effectv/gstedge.h b/gst/effectv/gstedge.h index 469dc68c0..f906fa361 100644 --- a/gst/effectv/gstedge.h +++ b/gst/effectv/gstedge.h @@ -53,7 +53,6 @@ struct _GstEdgeTV GstVideoFilter videofilter; /* < private > */ - GstVideoInfo info; gint map_width, map_height; guint32 *map; gint video_width_margin; diff --git a/gst/effectv/gstop.c b/gst/effectv/gstop.c index 7d89ea1c4..6d01395bd 100644 --- a/gst/effectv/gstop.c +++ b/gst/effectv/gstop.c @@ -199,20 +199,21 @@ image_y_over (guint32 * src, guint8 * diff, gint y_threshold, gint video_area) } static GstFlowReturn -gst_optv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) +gst_optv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, + GstVideoFrame * out_frame) { - GstOpTV *filter = GST_OPTV (trans); + GstOpTV *filter = GST_OPTV (vfilter); guint32 *src, *dest; - GstVideoFrame in_frame, out_frame; gint8 *p; guint8 *diff; gint x, y, width, height; GstClockTime timestamp, stream_time; guint8 phase; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (vfilter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -223,17 +224,11 @@ gst_optv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) if (G_UNLIKELY (filter->opmap[0] == NULL)) return GST_FLOW_NOT_NEGOTIATED; - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; - - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); GST_OBJECT_LOCK (filter); switch (filter->mode) { @@ -266,40 +261,18 @@ gst_optv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) } GST_OBJECT_UNLOCK (filter); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } } static gboolean -gst_optv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_optv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstOpTV *filter = GST_OPTV (btrans); - GstVideoInfo info; + GstOpTV *filter = GST_OPTV (vfilter); gint i, width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); for (i = 0; i < 4; i++) { if (filter->opmap[i]) @@ -313,13 +286,6 @@ gst_optv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, filter->diff = g_new (guint8, width * height); return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } } static gboolean @@ -406,6 +372,7 @@ gst_optv_class_init (GstOpTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_optv_set_property; gobject_class->get_property = gst_optv_get_property; @@ -438,10 +405,11 @@ gst_optv_class_init (GstOpTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_optv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_optv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_optv_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_optv_start); + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_optv_set_info); + vfilter_class->transform_frame = GST_DEBUG_FUNCPTR (gst_optv_transform_frame); + initPalette (); } diff --git a/gst/effectv/gstop.h b/gst/effectv/gstop.h index d5e0fec85..4e948686a 100644 --- a/gst/effectv/gstop.h +++ b/gst/effectv/gstop.h @@ -53,8 +53,6 @@ struct _GstOpTV GstVideoFilter element; /* < private > */ - GstVideoInfo info; - gint mode; gint speed; guint threshold; diff --git a/gst/effectv/gstquark.c b/gst/effectv/gstquark.c index 4ae7ecb19..81998fe0a 100644 --- a/gst/effectv/gstquark.c +++ b/gst/effectv/gstquark.c @@ -78,49 +78,36 @@ GST_STATIC_PAD_TEMPLATE ("sink", ); static gboolean -gst_quarktv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_quarktv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstQuarkTV *filter = GST_QUARKTV (btrans); - GstVideoInfo info; + GstQuarkTV *filter = GST_QUARKTV (vfilter); gint width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); gst_quarktv_planetable_clear (filter); filter->area = width * height; return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } } static GstFlowReturn -gst_quarktv_transform (GstBaseTransform * trans, GstBuffer * in, - GstBuffer * out) +gst_quarktv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, + GstVideoFrame * out_frame) { - GstQuarkTV *filter = GST_QUARKTV (trans); + GstQuarkTV *filter = GST_QUARKTV (vfilter); gint area; guint32 *src, *dest; GstClockTime timestamp; GstBuffer **planetable; gint planes, current_plane; - GstVideoFrame in_frame, out_frame; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); timestamp = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (vfilter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -131,14 +118,8 @@ gst_quarktv_transform (GstBaseTransform * trans, GstBuffer * in, if (G_UNLIKELY (filter->planetable == NULL)) return GST_FLOW_WRONG_STATE; - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; - - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); GST_OBJECT_LOCK (filter); area = filter->area; @@ -148,7 +129,7 @@ gst_quarktv_transform (GstBaseTransform * trans, GstBuffer * in, if (planetable[current_plane]) gst_buffer_unref (planetable[current_plane]); - planetable[current_plane] = gst_buffer_ref (in); + planetable[current_plane] = gst_buffer_ref (in_frame->buffer); /* For each pixel */ while (--area) { @@ -169,23 +150,7 @@ gst_quarktv_transform (GstBaseTransform * trans, GstBuffer * in, filter->current_plane = planes - 1; GST_OBJECT_UNLOCK (filter); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } } static void @@ -298,6 +263,7 @@ gst_quarktv_class_init (GstQuarkTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_quarktv_set_property; gobject_class->get_property = gst_quarktv_get_property; @@ -318,9 +284,11 @@ gst_quarktv_class_init (GstQuarkTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_quarktv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_quarktv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_quarktv_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_quarktv_start); + + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_quarktv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_quarktv_transform_frame); } static void diff --git a/gst/effectv/gstquark.h b/gst/effectv/gstquark.h index e3fd17d9b..2b092ed98 100644 --- a/gst/effectv/gstquark.h +++ b/gst/effectv/gstquark.h @@ -53,8 +53,6 @@ struct _GstQuarkTV GstVideoFilter element; /* < private > */ - GstVideoInfo info; - gint area; gint planes; gint current_plane; diff --git a/gst/effectv/gstradioac.c b/gst/effectv/gstradioac.c index 57b6d5db3..a84f2ef20 100644 --- a/gst/effectv/gstradioac.c +++ b/gst/effectv/gstradioac.c @@ -233,9 +233,12 @@ blur (GstRadioacTV * filter) gint width; guint8 *p, *q; guint8 v; + GstVideoInfo *info; + + info = &GST_VIDEO_FILTER (filter)->in_info; width = filter->buf_width; - p = filter->blurzoombuf + GST_VIDEO_INFO_WIDTH (&filter->info) + 1; + p = filter->blurzoombuf + GST_VIDEO_INFO_WIDTH (info) + 1; q = p + filter->buf_area; for (y = filter->buf_height - 2; y > 0; y--) { @@ -315,21 +318,21 @@ image_bgsubtract_update_y (guint32 * src, gint16 * background, guint8 * diff, } static GstFlowReturn -gst_radioactv_transform (GstBaseTransform * trans, GstBuffer * in, - GstBuffer * out) +gst_radioactv_transform_frame (GstVideoFilter * vfilter, + GstVideoFrame * in_frame, GstVideoFrame * out_frame) { - GstRadioacTV *filter = GST_RADIOACTV (trans); + GstRadioacTV *filter = GST_RADIOACTV (vfilter); guint32 *src, *dest; - GstVideoFrame in_frame, out_frame; GstClockTime timestamp, stream_time; gint x, y, width, height; guint32 a, b; guint8 *diff, *p; guint32 *palette; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (filter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -337,27 +340,21 @@ gst_radioactv_transform (GstBaseTransform * trans, GstBuffer * in, if (GST_CLOCK_TIME_IS_VALID (stream_time)) gst_object_sync_values (GST_OBJECT (filter), stream_time); - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); - - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); GST_OBJECT_LOCK (filter); #if G_BYTE_ORDER == G_LITTLE_ENDIAN - if (GST_VIDEO_FRAME_FORMAT (&in_frame) == GST_VIDEO_FORMAT_RGBx) { + if (GST_VIDEO_FRAME_FORMAT (in_frame) == GST_VIDEO_FORMAT_RGBx) { palette = &palettes[COLORS * filter->color]; } else { palette = &palettes[COLORS * swap_tab[filter->color]]; } #else - if (GST_VIDEO_FRAME_FORMAT (&in_frame) == GST_VIDEO_FORMAT_xBGR) { + if (GST_VIDEO_FRAME_FORMAT (in_frame) == GST_VIDEO_FORMAT_xBGR) { palette = &palettes[COLORS * filter->color]; } else { palette = &palettes[COLORS * swap_tab[filter->color]]; @@ -418,40 +415,18 @@ gst_radioactv_transform (GstBaseTransform * trans, GstBuffer * in, } GST_OBJECT_UNLOCK (filter); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } } static gboolean -gst_radioactv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_radioactv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstRadioacTV *filter = GST_RADIOACTV (btrans); - GstVideoInfo info; + GstRadioacTV *filter = GST_RADIOACTV (vfilter); gint width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); filter->buf_width_blocks = width / 32; if (filter->buf_width_blocks > 255) @@ -493,11 +468,6 @@ gst_radioactv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, return TRUE; /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } too_wide: { GST_DEBUG_OBJECT (filter, "frame too wide"); @@ -607,6 +577,7 @@ gst_radioactv_class_init (GstRadioacTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_radioactv_set_property; gobject_class->get_property = gst_radioactv_get_property; @@ -644,10 +615,12 @@ gst_radioactv_class_init (GstRadioacTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_radioactv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_radioactv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_radioactv_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_radioactv_start); + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_radioactv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_radioactv_transform_frame); + makePalette (); } diff --git a/gst/effectv/gstradioac.h b/gst/effectv/gstradioac.h index a7a787a2f..6771289b2 100644 --- a/gst/effectv/gstradioac.h +++ b/gst/effectv/gstradioac.h @@ -53,8 +53,6 @@ struct _GstRadioacTV GstVideoFilter element; /* < private > */ - GstVideoInfo info; - gint mode; gint color; guint interval; diff --git a/gst/effectv/gstrev.c b/gst/effectv/gstrev.c index 6dce8877f..315ce4a85 100644 --- a/gst/effectv/gstrev.c +++ b/gst/effectv/gstrev.c @@ -97,43 +97,22 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS (CAPS_STR) ); -static gboolean -gst_revtv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) -{ - GstRevTV *filter = GST_REVTV (btrans); - GstVideoInfo info; - - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } -} - static GstFlowReturn -gst_revtv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) +gst_revtv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, + GstVideoFrame * out_frame) { - GstRevTV *filter = GST_REVTV (trans); + GstRevTV *filter = GST_REVTV (vfilter); guint32 *src, *dest; gint width, height, sstride, dstride; guint32 *nsrc; gint y, x, R, G, B, yval; gint linespace, vscale; GstClockTime timestamp, stream_time; - GstVideoFrame in_frame, out_frame; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (vfilter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -141,19 +120,13 @@ gst_revtv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) if (GST_CLOCK_TIME_IS_VALID (stream_time)) gst_object_sync_values (GST_OBJECT (filter), stream_time); - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + sstride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); + dstride = GST_VIDEO_FRAME_PLANE_STRIDE (out_frame, 0); - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - sstride = GST_VIDEO_FRAME_PLANE_STRIDE (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); - dstride = GST_VIDEO_FRAME_PLANE_STRIDE (&out_frame, 0); - - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); /* Clear everything to black */ memset (dest, 0, dstride * height * sizeof (guint32)); @@ -181,23 +154,7 @@ gst_revtv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) } GST_OBJECT_UNLOCK (filter); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } } static void @@ -251,7 +208,7 @@ gst_revtv_class_init (GstRevTVClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; - GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_revtv_set_property; gobject_class->get_property = gst_revtv_get_property; @@ -278,8 +235,8 @@ gst_revtv_class_init (GstRevTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_revtv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_revtv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_revtv_transform); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_revtv_transform_frame); } static void diff --git a/gst/effectv/gstrev.h b/gst/effectv/gstrev.h index deb8dd13f..fc40d8cc8 100644 --- a/gst/effectv/gstrev.h +++ b/gst/effectv/gstrev.h @@ -69,8 +69,6 @@ struct _GstRevTV GstVideoFilter videofilter; /* < private > */ - GstVideoInfo info; - gint vgrabtime; gint vgrab; gint linespace; diff --git a/gst/effectv/gstripple.c b/gst/effectv/gstripple.c index 170fd3a65..c48a8fde6 100644 --- a/gst/effectv/gstripple.c +++ b/gst/effectv/gstripple.c @@ -139,9 +139,12 @@ image_bgset_y (guint32 * src, gint16 * background, gint video_area) static gint setBackground (GstRippleTV * filter, guint32 * src) { + GstVideoInfo *info; + + info = &GST_VIDEO_FILTER (filter)->in_info; + image_bgset_y (src, filter->background, - GST_VIDEO_INFO_WIDTH (&filter->info) * - GST_VIDEO_INFO_HEIGHT (&filter->info)); + GST_VIDEO_INFO_WIDTH (info) * GST_VIDEO_INFO_HEIGHT (info)); filter->bg_is_set = TRUE; return 0; @@ -182,9 +185,12 @@ motiondetect (GstRippleTV * filter, guint32 * src) gint width, height; gint *p, *q; gint x, y, h; + GstVideoInfo *info; - width = GST_VIDEO_INFO_WIDTH (&filter->info); - height = GST_VIDEO_INFO_HEIGHT (&filter->info); + info = &GST_VIDEO_FILTER (filter)->in_info; + + width = GST_VIDEO_INFO_WIDTH (info); + height = GST_VIDEO_INFO_HEIGHT (info); if (!filter->bg_is_set) setBackground (filter, src); @@ -304,12 +310,11 @@ raindrop (GstRippleTV * filter) } static GstFlowReturn -gst_rippletv_transform (GstBaseTransform * trans, GstBuffer * in, - GstBuffer * out) +gst_rippletv_transform_frame (GstVideoFilter * vfilter, + GstVideoFrame * in_frame, GstVideoFrame * out_frame) { - GstRippleTV *filter = GST_RIPPLETV (trans); + GstRippleTV *filter = GST_RIPPLETV (vfilter); guint32 *src, *dest; - GstVideoFrame in_frame, out_frame; gint x, y, i; gint dx, dy, o_dx; gint h, v; @@ -318,9 +323,10 @@ gst_rippletv_transform (GstBaseTransform * trans, GstBuffer * in, gint8 *vp; GstClockTime timestamp, stream_time; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (vfilter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -328,14 +334,8 @@ gst_rippletv_transform (GstBaseTransform * trans, GstBuffer * in, if (GST_CLOCK_TIME_IS_VALID (stream_time)) gst_object_sync_values (GST_OBJECT (filter), stream_time); - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; - - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); GST_OBJECT_LOCK (filter); /* impact from the motion or rain drop */ @@ -346,8 +346,8 @@ gst_rippletv_transform (GstBaseTransform * trans, GstBuffer * in, m_w = filter->map_w; m_h = filter->map_h; - v_w = GST_VIDEO_FRAME_WIDTH (&in_frame); - v_h = GST_VIDEO_FRAME_HEIGHT (&in_frame); + v_w = GST_VIDEO_FRAME_WIDTH (in_frame); + v_h = GST_VIDEO_FRAME_HEIGHT (in_frame); /* simulate surface wave */ @@ -441,41 +441,18 @@ gst_rippletv_transform (GstBaseTransform * trans, GstBuffer * in, } GST_OBJECT_UNLOCK (filter); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } - } static gboolean -gst_rippletv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_rippletv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstRippleTV *filter = GST_RIPPLETV (btrans); - GstVideoInfo info; + GstRippleTV *filter = GST_RIPPLETV (vfilter); gint width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); GST_OBJECT_LOCK (filter); filter->map_h = height / 2 + 1; @@ -505,13 +482,6 @@ gst_rippletv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, GST_OBJECT_UNLOCK (filter); return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } } static gboolean @@ -601,6 +571,7 @@ gst_rippletv_class_init (GstRippleTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_rippletv_set_property; gobject_class->get_property = gst_rippletv_get_property; @@ -628,10 +599,12 @@ gst_rippletv_class_init (GstRippleTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_rippletv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_rippletv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_rippletv_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_rippletv_start); + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_rippletv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_rippletv_transform_frame); + setTable (); } diff --git a/gst/effectv/gstripple.h b/gst/effectv/gstripple.h index 571db51d2..12242a230 100644 --- a/gst/effectv/gstripple.h +++ b/gst/effectv/gstripple.h @@ -53,8 +53,6 @@ struct _GstRippleTV GstVideoFilter element; /* < private > */ - GstVideoInfo info; - gint mode; gint16 *background; diff --git a/gst/effectv/gstshagadelic.c b/gst/effectv/gstshagadelic.c index 6e56430c6..dcc905a43 100644 --- a/gst/effectv/gstshagadelic.c +++ b/gst/effectv/gstshagadelic.c @@ -75,20 +75,14 @@ GST_STATIC_PAD_TEMPLATE ("sink", ); static gboolean -gst_shagadelictv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_shagadelictv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstShagadelicTV *filter = GST_SHAGADELICTV (btrans); - GstVideoInfo info; + GstShagadelicTV *filter = GST_SHAGADELICTV (vfilter); gint width, height, area; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); area = width * height; @@ -100,13 +94,6 @@ gst_shagadelictv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, gst_shagadelic_initialize (filter); return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } } static void @@ -119,9 +106,10 @@ gst_shagadelic_initialize (GstShagadelicTV * filter) double xx, yy; #endif gint width, height; + GstVideoInfo *info = &GST_VIDEO_FILTER (filter)->in_info; - width = GST_VIDEO_INFO_WIDTH (&filter->info); - height = GST_VIDEO_INFO_HEIGHT (&filter->info); + width = GST_VIDEO_INFO_WIDTH (info); + height = GST_VIDEO_INFO_HEIGHT (info); i = 0; for (y = 0; y < height * 2; y++) { @@ -171,28 +159,21 @@ gst_shagadelic_initialize (GstShagadelicTV * filter) } static GstFlowReturn -gst_shagadelictv_transform (GstBaseTransform * trans, GstBuffer * in, - GstBuffer * out) +gst_shagadelictv_transform_frame (GstVideoFilter * vfilter, + GstVideoFrame * in_frame, GstVideoFrame * out_frame) { - GstShagadelicTV *filter = GST_SHAGADELICTV (trans); + GstShagadelicTV *filter = GST_SHAGADELICTV (vfilter); guint32 *src, *dest; gint x, y; guint32 v; guint8 r, g, b; - GstVideoFrame in_frame, out_frame; gint width, height; - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); - - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { @@ -226,23 +207,7 @@ gst_shagadelictv_transform (GstBaseTransform * trans, GstBuffer * in, filter->bx += filter->bvx; filter->by += filter->bvy; - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } } static void @@ -266,7 +231,7 @@ gst_shagadelictv_class_init (GstShagadelicTVClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; - GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->finalize = gst_shagadelictv_finalize; @@ -280,8 +245,9 @@ gst_shagadelictv_class_init (GstShagadelicTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_shagadelictv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_shagadelictv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_shagadelictv_transform); + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_shagadelictv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_shagadelictv_transform_frame); } static void diff --git a/gst/effectv/gstshagadelic.h b/gst/effectv/gstshagadelic.h index b2731a261..43d964dc1 100644 --- a/gst/effectv/gstshagadelic.h +++ b/gst/effectv/gstshagadelic.h @@ -51,8 +51,6 @@ struct _GstShagadelicTV GstVideoFilter videofilter; /* < private > */ - GstVideoInfo info; - guint8 *ripple; guint8 *spiral; guint8 phase; diff --git a/gst/effectv/gststreak.c b/gst/effectv/gststreak.c index 9ae451aee..d0ddb76a3 100644 --- a/gst/effectv/gststreak.c +++ b/gst/effectv/gststreak.c @@ -78,29 +78,22 @@ GST_STATIC_PAD_TEMPLATE ("sink", static GstFlowReturn -gst_streaktv_transform (GstBaseTransform * trans, GstBuffer * in, - GstBuffer * out) +gst_streaktv_transform_frame (GstVideoFilter * vfilter, + GstVideoFrame * in_frame, GstVideoFrame * out_frame) { - GstStreakTV *filter = GST_STREAKTV (trans); + GstStreakTV *filter = GST_STREAKTV (vfilter); guint32 *src, *dest; - GstVideoFrame in_frame, out_frame; gint i, cf; gint video_area, width, height; guint32 **planetable = filter->planetable; gint plane = filter->plane; guint stride_mask, stride_shift, stride; - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; - - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); video_area = width * height; @@ -145,40 +138,18 @@ gst_streaktv_transform (GstBaseTransform * trans, GstBuffer * in, filter->plane = plane & (PLANES - 1); GST_OBJECT_UNLOCK (filter); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } } static gboolean -gst_streaktv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_streaktv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstStreakTV *filter = GST_STREAKTV (btrans); - GstVideoInfo info; + GstStreakTV *filter = GST_STREAKTV (vfilter); gint i, width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); if (filter->planebuffer) g_free (filter->planebuffer); @@ -189,13 +160,6 @@ gst_streaktv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, filter->planetable[i] = &filter->planebuffer[width * height * i]; return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } } static gboolean @@ -265,6 +229,7 @@ gst_streaktv_class_init (GstStreakTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_streaktv_set_property; gobject_class->get_property = gst_streaktv_get_property; @@ -287,9 +252,11 @@ gst_streaktv_class_init (GstStreakTVClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_streaktv_src_template)); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_streaktv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_streaktv_transform); trans_class->start = GST_DEBUG_FUNCPTR (gst_streaktv_start); + + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_streaktv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_streaktv_transform_frame); } static void diff --git a/gst/effectv/gststreak.h b/gst/effectv/gststreak.h index fb96cade9..55198f4dd 100644 --- a/gst/effectv/gststreak.h +++ b/gst/effectv/gststreak.h @@ -55,8 +55,6 @@ struct _GstStreakTV GstVideoFilter element; /* < private > */ - GstVideoInfo info; - gboolean feedback; guint32 *planebuffer; diff --git a/gst/effectv/gstvertigo.c b/gst/effectv/gstvertigo.c index 592231990..44906f5ff 100644 --- a/gst/effectv/gstvertigo.c +++ b/gst/effectv/gstvertigo.c @@ -75,20 +75,14 @@ GST_STATIC_PAD_TEMPLATE ("sink", ); static gboolean -gst_vertigotv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_vertigotv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstVertigoTV *filter = GST_VERTIGOTV (btrans); - GstVideoInfo info; + GstVertigoTV *filter = GST_VERTIGOTV (vfilter); gint area, width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); area = width * height; @@ -100,13 +94,6 @@ gst_vertigotv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, filter->phase = 0; return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } } static void @@ -117,11 +104,14 @@ gst_vertigotv_set_parms (GstVertigoTV * filter) double x, y; double dizz; gint width, height; + GstVideoInfo *info; dizz = sin (filter->phase) * 10 + sin (filter->phase * 1.9 + 5) * 5; - width = GST_VIDEO_INFO_WIDTH (&filter->info); - height = GST_VIDEO_INFO_HEIGHT (&filter->info); + info = &GST_VIDEO_FILTER (filter)->in_info; + + width = GST_VIDEO_INFO_WIDTH (info); + height = GST_VIDEO_INFO_HEIGHT (info); x = width / 2; y = height / 2; @@ -162,19 +152,19 @@ gst_vertigotv_set_parms (GstVertigoTV * filter) } static GstFlowReturn -gst_vertigotv_transform (GstBaseTransform * trans, GstBuffer * in, - GstBuffer * out) +gst_vertigotv_transform_frame (GstVideoFilter * vfilter, + GstVideoFrame * in_frame, GstVideoFrame * out_frame) { - GstVertigoTV *filter = GST_VERTIGOTV (trans); + GstVertigoTV *filter = GST_VERTIGOTV (vfilter); guint32 *src, *dest, *p; guint32 v; gint x, y, ox, oy, i, width, height, area, sstride, dstride; GstClockTime timestamp, stream_time; - GstVideoFrame in_frame, out_frame; - timestamp = GST_BUFFER_TIMESTAMP (in); + timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = - gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp); + gst_segment_to_stream_time (&GST_BASE_TRANSFORM (filter)->segment, + GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); @@ -182,19 +172,13 @@ gst_vertigotv_transform (GstBaseTransform * trans, GstBuffer * in, if (GST_CLOCK_TIME_IS_VALID (stream_time)) gst_object_sync_values (GST_OBJECT (filter), stream_time); - if (!gst_video_frame_map (&in_frame, &filter->info, in, GST_MAP_READ)) - goto invalid_in; - - if (!gst_video_frame_map (&out_frame, &filter->info, out, GST_MAP_WRITE)) - goto invalid_out; + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + sstride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); + dstride = GST_VIDEO_FRAME_PLANE_STRIDE (out_frame, 0); - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - sstride = GST_VIDEO_FRAME_PLANE_STRIDE (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); - dstride = GST_VIDEO_FRAME_PLANE_STRIDE (&out_frame, 0); - - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); area = width * height; @@ -234,20 +218,6 @@ gst_vertigotv_transform (GstBaseTransform * trans, GstBuffer * in, filter->alt_buffer = p; return GST_FLOW_OK; - - /* ERRORS */ -invalid_in: - { - GST_DEBUG_OBJECT (filter, "invalid input frame"); - return GST_FLOW_ERROR; - } -invalid_out: - { - GST_DEBUG_OBJECT (filter, "invalid output frame"); - gst_video_frame_unmap (&in_frame); - return GST_FLOW_ERROR; - } - } static gboolean @@ -316,6 +286,7 @@ gst_vertigotv_class_init (GstVertigoTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->set_property = gst_vertigotv_set_property; gobject_class->get_property = gst_vertigotv_get_property; @@ -340,8 +311,10 @@ gst_vertigotv_class_init (GstVertigoTVClass * klass) gst_static_pad_template_get (&gst_vertigotv_src_template)); trans_class->start = GST_DEBUG_FUNCPTR (gst_vertigotv_start); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_vertigotv_set_caps); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_vertigotv_transform); + + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_vertigotv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_vertigotv_transform_frame); } static void diff --git a/gst/effectv/gstvertigo.h b/gst/effectv/gstvertigo.h index 8e03da2e3..0081bf0e4 100644 --- a/gst/effectv/gstvertigo.h +++ b/gst/effectv/gstvertigo.h @@ -50,8 +50,6 @@ struct _GstVertigoTV GstVideoFilter videofilter; /* < private > */ - GstVideoInfo info; - guint32 *buffer; guint32 *current_buffer, *alt_buffer; gint dx, dy; diff --git a/gst/effectv/gstwarp.c b/gst/effectv/gstwarp.c index 80161a7b1..38d79d560 100644 --- a/gst/effectv/gstwarp.c +++ b/gst/effectv/gstwarp.c @@ -82,33 +82,20 @@ GST_STATIC_PAD_TEMPLATE ("sink", ); static gboolean -gst_warptv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, - GstCaps * outcaps) +gst_warptv_set_info (GstVideoFilter * vfilter, GstCaps * incaps, + GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) { - GstWarpTV *filter = GST_WARPTV (btrans); - GstVideoInfo info; + GstWarpTV *filter = GST_WARPTV (vfilter); gint width, height; - if (!gst_video_info_from_caps (&info, incaps)) - goto invalid_caps; - - filter->info = info; - - width = GST_VIDEO_INFO_WIDTH (&info); - height = GST_VIDEO_INFO_HEIGHT (&info); + width = GST_VIDEO_INFO_WIDTH (in_info); + height = GST_VIDEO_INFO_HEIGHT (in_info); g_free (filter->disttable); filter->disttable = g_malloc (width * height * sizeof (guint32)); initDistTable (filter, width, height); return TRUE; - - /* ERRORS */ -invalid_caps: - { - GST_DEBUG_OBJECT (filter, "invalid caps received"); - return FALSE; - } } static gint32 sintable[1024 + 256]; @@ -152,9 +139,10 @@ initDistTable (GstWarpTV * filter, gint width, gint height) } static GstFlowReturn -gst_warptv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) +gst_warptv_transform_frame (GstVideoFilter * filter, GstVideoFrame * in_frame, + GstVideoFrame * out_frame) { - GstWarpTV *warptv = GST_WARPTV (trans); + GstWarpTV *warptv = GST_WARPTV (filter); gint width, height; gint xw, yw, cw; gint32 c, i, x, y, dx, dy, maxx, maxy; @@ -162,19 +150,15 @@ gst_warptv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) gint32 *ctable; guint32 *src, *dest; gint sstride, dstride; - GstVideoFrame in_frame, out_frame; - gst_video_frame_map (&in_frame, &warptv->info, in, GST_MAP_READ); - gst_video_frame_map (&out_frame, &warptv->info, out, GST_MAP_WRITE); + src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); + dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); - src = GST_VIDEO_FRAME_PLANE_DATA (&in_frame, 0); - dest = GST_VIDEO_FRAME_PLANE_DATA (&out_frame, 0); + sstride = GST_VIDEO_FRAME_PLANE_STRIDE (in_frame, 0) / 4; + dstride = GST_VIDEO_FRAME_PLANE_STRIDE (out_frame, 0) / 4; - sstride = GST_VIDEO_FRAME_PLANE_STRIDE (&in_frame, 0) / 4; - dstride = GST_VIDEO_FRAME_PLANE_STRIDE (&out_frame, 0) / 4; - - width = GST_VIDEO_FRAME_WIDTH (&in_frame); - height = GST_VIDEO_FRAME_HEIGHT (&in_frame); + width = GST_VIDEO_FRAME_WIDTH (in_frame); + height = GST_VIDEO_FRAME_HEIGHT (in_frame); GST_OBJECT_LOCK (warptv); xw = (gint) (sin ((warptv->tval + 100) * M_PI / 128) * 30); @@ -222,9 +206,6 @@ gst_warptv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) warptv->tval = (warptv->tval + 1) & 511; GST_OBJECT_UNLOCK (warptv); - gst_video_frame_unmap (&in_frame); - gst_video_frame_unmap (&out_frame); - return GST_FLOW_OK; } @@ -238,26 +219,6 @@ gst_warptv_start (GstBaseTransform * trans) return TRUE; } -static gboolean -gst_wraptv_decide_allocation (GstBaseTransform * trans, GstQuery * query) -{ - GstBufferPool *pool = NULL; - guint size, min, max, prefix, alignment; - - gst_query_parse_allocation_params (query, &size, &min, &max, &prefix, - &alignment, &pool); - - if (pool) { - GstStructure *config; - - config = gst_buffer_pool_get_config (pool); - gst_buffer_pool_config_add_option (config, - GST_BUFFER_POOL_OPTION_VIDEO_META); - gst_buffer_pool_set_config (pool, config); - } - return TRUE; -} - static void gst_warptv_finalize (GObject * object) { @@ -275,6 +236,7 @@ gst_warptv_class_init (GstWarpTVClass * klass) GObjectClass *gobject_class = (GObjectClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass; + GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass; gobject_class->finalize = gst_warptv_finalize; @@ -289,10 +251,10 @@ gst_warptv_class_init (GstWarpTVClass * klass) gst_static_pad_template_get (&gst_warptv_src_template)); trans_class->start = GST_DEBUG_FUNCPTR (gst_warptv_start); - trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_warptv_set_caps); - trans_class->decide_allocation = - GST_DEBUG_FUNCPTR (gst_wraptv_decide_allocation); - trans_class->transform = GST_DEBUG_FUNCPTR (gst_warptv_transform); + + vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_warptv_set_info); + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_warptv_transform_frame); initSinTable (); } diff --git a/gst/effectv/gstwarp.h b/gst/effectv/gstwarp.h index 4c53499d0..3fe48b34b 100644 --- a/gst/effectv/gstwarp.h +++ b/gst/effectv/gstwarp.h @@ -50,8 +50,6 @@ struct _GstWarpTV GstVideoFilter videofilter; /* < private > */ - GstVideoInfo info; - gint32 *disttable; gint32 ctable[1024]; gint tval; |