2003-07-02 05:22:47 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* Copyright (C) <2003> David Schleef <ds@schleef.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2003-07-02 05:22:47 +00:00
|
|
|
*/
|
|
|
|
|
2005-11-30 18:57:48 +00:00
|
|
|
/**
|
2005-12-01 01:29:46 +00:00
|
|
|
* SECTION:gstvideofilter
|
|
|
|
* @short_description: Base class for video filters
|
2005-11-30 18:57:48 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
|
|
|
* <para>
|
2006-03-14 11:11:59 +00:00
|
|
|
* Provides useful functions and a base class for video filters.
|
|
|
|
* </para>
|
|
|
|
* <para>
|
|
|
|
* The videofilter will by default enable QoS on the parent GstBaseTransform
|
|
|
|
* to implement frame dropping.
|
2005-11-30 18:57:48 +00:00
|
|
|
* </para>
|
|
|
|
* </refsect2>
|
|
|
|
*/
|
|
|
|
|
2003-11-07 12:47:02 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2003-07-02 05:22:47 +00:00
|
|
|
|
2004-07-27 21:51:32 +00:00
|
|
|
#include "gstvideofilter.h"
|
2003-07-02 05:22:47 +00:00
|
|
|
|
2009-06-16 17:38:17 +00:00
|
|
|
#include <gst/video/video.h>
|
2011-12-21 22:46:53 +00:00
|
|
|
#include <gst/video/gstvideometa.h>
|
|
|
|
#include <gst/video/gstvideopool.h>
|
2009-06-16 17:38:17 +00:00
|
|
|
|
2005-11-30 08:26:39 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_video_filter_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_video_filter_debug
|
2003-07-02 05:22:47 +00:00
|
|
|
|
2011-12-21 22:46:53 +00:00
|
|
|
#define gst_video_filter_parent_class parent_class
|
|
|
|
G_DEFINE_ABSTRACT_TYPE (GstVideoFilter, gst_video_filter,
|
|
|
|
GST_TYPE_BASE_TRANSFORM);
|
2003-07-02 05:22:47 +00:00
|
|
|
|
2012-02-28 15:16:22 +00:00
|
|
|
/* Answer the allocation query downstream. */
|
2011-12-21 22:46:53 +00:00
|
|
|
static gboolean
|
2012-02-22 14:27:59 +00:00
|
|
|
gst_video_filter_propose_allocation (GstBaseTransform * trans,
|
2012-03-01 16:34:28 +00:00
|
|
|
GstQuery * decide_query, GstQuery * query)
|
2011-12-21 22:46:53 +00:00
|
|
|
{
|
|
|
|
GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
|
2012-01-02 15:13:51 +00:00
|
|
|
GstVideoInfo info;
|
2011-12-21 22:46:53 +00:00
|
|
|
GstBufferPool *pool;
|
|
|
|
GstCaps *caps;
|
|
|
|
guint size;
|
|
|
|
|
2012-03-02 16:34:50 +00:00
|
|
|
if (!GST_BASE_TRANSFORM_CLASS (parent_class)->propose_allocation (trans,
|
|
|
|
decide_query, query))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* passthrough, we're done */
|
2012-03-01 16:34:28 +00:00
|
|
|
if (decide_query == NULL)
|
2012-03-02 16:34:50 +00:00
|
|
|
return TRUE;
|
2012-02-22 14:27:59 +00:00
|
|
|
|
2012-08-08 09:06:45 +00:00
|
|
|
gst_query_parse_allocation (query, &caps, NULL);
|
2011-12-21 22:46:53 +00:00
|
|
|
|
2012-01-02 15:13:51 +00:00
|
|
|
if (caps == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!gst_video_info_from_caps (&info, caps))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
size = GST_VIDEO_INFO_SIZE (&info);
|
2011-12-21 22:46:53 +00:00
|
|
|
|
2012-08-08 10:19:31 +00:00
|
|
|
if (gst_query_get_n_allocation_pools (query) == 0) {
|
2011-12-21 22:46:53 +00:00
|
|
|
GstStructure *structure;
|
2012-08-08 10:19:31 +00:00
|
|
|
GstAllocator *allocator = NULL;
|
2012-08-08 14:12:20 +00:00
|
|
|
GstAllocationParams params = { 0, 15, 0, 0, };
|
2012-08-08 10:19:31 +00:00
|
|
|
|
|
|
|
if (gst_query_get_n_allocation_params (query) > 0)
|
|
|
|
gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms);
|
|
|
|
else
|
|
|
|
gst_query_add_allocation_param (query, allocator, ¶ms);
|
2011-12-21 22:46:53 +00:00
|
|
|
|
|
|
|
pool = gst_video_buffer_pool_new ();
|
|
|
|
|
|
|
|
structure = gst_buffer_pool_get_config (pool);
|
2012-03-15 21:10:58 +00:00
|
|
|
gst_buffer_pool_config_set_params (structure, caps, size, 0, 0);
|
2012-08-08 10:19:31 +00:00
|
|
|
gst_buffer_pool_config_set_allocator (structure, allocator, ¶ms);
|
|
|
|
|
|
|
|
if (allocator)
|
|
|
|
gst_object_unref (allocator);
|
2012-03-15 21:10:58 +00:00
|
|
|
|
2011-12-21 22:46:53 +00:00
|
|
|
if (!gst_buffer_pool_set_config (pool, structure))
|
|
|
|
goto config_failed;
|
|
|
|
|
2012-08-08 09:06:45 +00:00
|
|
|
gst_query_add_allocation_pool (query, pool, size, 0, 0);
|
|
|
|
gst_object_unref (pool);
|
|
|
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
|
|
|
}
|
2003-07-02 05:22:47 +00:00
|
|
|
|
2011-12-21 22:46:53 +00:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
config_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (filter, "failed to set config");
|
|
|
|
gst_object_unref (pool);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* configure the allocation query that was answered downstream, we can configure
|
2012-02-28 15:16:22 +00:00
|
|
|
* some properties on it. Only called when not in passthrough mode. */
|
2011-12-21 22:46:53 +00:00
|
|
|
static gboolean
|
|
|
|
gst_video_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
|
2003-07-02 05:22:47 +00:00
|
|
|
{
|
2012-04-26 16:12:39 +00:00
|
|
|
GstBufferPool *pool = NULL;
|
|
|
|
GstStructure *config;
|
|
|
|
guint min, max, size;
|
|
|
|
gboolean update_pool;
|
2013-03-30 16:39:39 +00:00
|
|
|
GstCaps *outcaps = NULL;
|
2011-12-21 22:46:53 +00:00
|
|
|
|
2012-03-15 19:36:51 +00:00
|
|
|
if (gst_query_get_n_allocation_pools (query) > 0) {
|
2012-04-26 16:12:39 +00:00
|
|
|
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
|
|
|
|
|
|
|
|
update_pool = TRUE;
|
|
|
|
} else {
|
|
|
|
GstVideoInfo vinfo;
|
|
|
|
|
|
|
|
gst_query_parse_allocation (query, &outcaps, NULL);
|
|
|
|
gst_video_info_init (&vinfo);
|
|
|
|
gst_video_info_from_caps (&vinfo, outcaps);
|
|
|
|
size = vinfo.size;
|
|
|
|
min = max = 0;
|
|
|
|
update_pool = FALSE;
|
|
|
|
}
|
2011-12-21 22:46:53 +00:00
|
|
|
|
2012-04-26 16:12:39 +00:00
|
|
|
if (!pool)
|
|
|
|
pool = gst_video_buffer_pool_new ();
|
2011-12-21 22:46:53 +00:00
|
|
|
|
2012-04-26 16:12:39 +00:00
|
|
|
config = gst_buffer_pool_get_config (pool);
|
|
|
|
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
|
2013-03-30 16:39:39 +00:00
|
|
|
if (outcaps)
|
|
|
|
gst_buffer_pool_config_set_params (config, outcaps, size, 0, 0);
|
2012-04-26 16:12:39 +00:00
|
|
|
gst_buffer_pool_set_config (pool, config);
|
|
|
|
|
|
|
|
if (update_pool)
|
|
|
|
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);
|
|
|
|
else
|
|
|
|
gst_query_add_allocation_pool (query, pool, size, min, max);
|
|
|
|
|
|
|
|
gst_object_unref (pool);
|
2012-03-15 19:36:51 +00:00
|
|
|
|
2012-03-01 16:34:28 +00:00
|
|
|
return GST_BASE_TRANSFORM_CLASS (parent_class)->decide_allocation (trans,
|
|
|
|
query);
|
2011-12-21 22:46:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* our output size only depends on the caps, not on the input caps */
|
|
|
|
static gboolean
|
|
|
|
gst_video_filter_transform_size (GstBaseTransform * btrans,
|
|
|
|
GstPadDirection direction, GstCaps * caps, gsize size,
|
|
|
|
GstCaps * othercaps, gsize * othersize)
|
|
|
|
{
|
|
|
|
gboolean ret = TRUE;
|
|
|
|
GstVideoInfo info;
|
|
|
|
|
|
|
|
g_assert (size);
|
|
|
|
|
|
|
|
ret = gst_video_info_from_caps (&info, othercaps);
|
|
|
|
if (ret)
|
|
|
|
*othersize = info.size;
|
|
|
|
|
|
|
|
return ret;
|
2003-07-02 05:22:47 +00:00
|
|
|
}
|
|
|
|
|
2009-06-16 17:38:17 +00:00
|
|
|
static gboolean
|
|
|
|
gst_video_filter_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
|
2011-03-27 11:55:15 +00:00
|
|
|
gsize * size)
|
2009-06-16 17:38:17 +00:00
|
|
|
{
|
2011-06-17 07:21:27 +00:00
|
|
|
GstVideoInfo info;
|
2009-06-16 17:38:17 +00:00
|
|
|
|
2011-06-17 07:21:27 +00:00
|
|
|
if (!gst_video_info_from_caps (&info, caps)) {
|
2009-06-16 17:38:17 +00:00
|
|
|
GST_WARNING_OBJECT (btrans, "Failed to parse caps %" GST_PTR_FORMAT, caps);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-06-17 07:21:27 +00:00
|
|
|
*size = info.size;
|
2009-06-16 17:38:17 +00:00
|
|
|
|
2011-08-09 14:39:31 +00:00
|
|
|
GST_DEBUG_OBJECT (btrans, "Returning size %" G_GSIZE_FORMAT " bytes"
|
|
|
|
"for caps %" GST_PTR_FORMAT, *size, caps);
|
2009-06-16 17:38:17 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-12-21 22:46:53 +00:00
|
|
|
static gboolean
|
|
|
|
gst_video_filter_set_caps (GstBaseTransform * trans, GstCaps * incaps,
|
|
|
|
GstCaps * outcaps)
|
|
|
|
{
|
|
|
|
GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
|
|
|
|
GstVideoFilterClass *fclass;
|
|
|
|
GstVideoInfo in_info, out_info;
|
|
|
|
gboolean res;
|
|
|
|
|
|
|
|
/* input caps */
|
|
|
|
if (!gst_video_info_from_caps (&in_info, incaps))
|
|
|
|
goto invalid_caps;
|
|
|
|
|
|
|
|
/* output caps */
|
|
|
|
if (!gst_video_info_from_caps (&out_info, outcaps))
|
|
|
|
goto invalid_caps;
|
|
|
|
|
|
|
|
fclass = GST_VIDEO_FILTER_GET_CLASS (filter);
|
|
|
|
if (fclass->set_info)
|
|
|
|
res = fclass->set_info (filter, incaps, &in_info, outcaps, &out_info);
|
|
|
|
else
|
|
|
|
res = TRUE;
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
filter->in_info = in_info;
|
|
|
|
filter->out_info = out_info;
|
2012-02-03 16:10:12 +00:00
|
|
|
if (fclass->transform_frame == NULL)
|
|
|
|
gst_base_transform_set_in_place (trans, TRUE);
|
2012-04-14 09:26:28 +00:00
|
|
|
if (fclass->transform_frame_ip == NULL)
|
|
|
|
GST_BASE_TRANSFORM_CLASS (fclass)->transform_ip_on_passthrough = FALSE;
|
2011-12-21 22:46:53 +00:00
|
|
|
}
|
|
|
|
filter->negotiated = res;
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
invalid_caps:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (filter, "invalid caps");
|
|
|
|
filter->negotiated = FALSE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
|
|
|
|
GstBuffer * outbuf)
|
|
|
|
{
|
|
|
|
GstFlowReturn res;
|
|
|
|
GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
|
|
|
|
GstVideoFilterClass *fclass;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (!filter->negotiated))
|
|
|
|
goto unknown_format;
|
|
|
|
|
|
|
|
fclass = GST_VIDEO_FILTER_GET_CLASS (filter);
|
|
|
|
if (fclass->transform_frame) {
|
|
|
|
GstVideoFrame in_frame, out_frame;
|
|
|
|
|
2014-09-12 11:41:01 +00:00
|
|
|
if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf,
|
|
|
|
GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
|
2011-12-21 22:46:53 +00:00
|
|
|
goto invalid_buffer;
|
|
|
|
|
|
|
|
if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
|
2014-09-12 11:41:01 +00:00
|
|
|
GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
|
2011-12-21 22:46:53 +00:00
|
|
|
goto invalid_buffer;
|
|
|
|
|
|
|
|
res = fclass->transform_frame (filter, &in_frame, &out_frame);
|
|
|
|
|
|
|
|
gst_video_frame_unmap (&out_frame);
|
|
|
|
gst_video_frame_unmap (&in_frame);
|
2012-02-03 16:10:12 +00:00
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (trans, "no transform_frame vmethod");
|
2011-12-21 22:46:53 +00:00
|
|
|
res = GST_FLOW_OK;
|
2012-02-03 16:10:12 +00:00
|
|
|
}
|
2011-12-21 22:46:53 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
unknown_format:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (filter, CORE, NOT_IMPLEMENTED, (NULL),
|
|
|
|
("unknown format"));
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
}
|
|
|
|
invalid_buffer:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_WARNING (filter, CORE, NOT_IMPLEMENTED, (NULL),
|
|
|
|
("invalid video buffer received"));
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_video_filter_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
|
|
|
|
{
|
|
|
|
GstFlowReturn res;
|
|
|
|
GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
|
|
|
|
GstVideoFilterClass *fclass;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (!filter->negotiated))
|
|
|
|
goto unknown_format;
|
|
|
|
|
|
|
|
fclass = GST_VIDEO_FILTER_GET_CLASS (filter);
|
|
|
|
if (fclass->transform_frame_ip) {
|
|
|
|
GstVideoFrame frame;
|
2012-04-01 15:57:59 +00:00
|
|
|
GstMapFlags flags;
|
2011-12-21 22:46:53 +00:00
|
|
|
|
2014-09-12 11:41:01 +00:00
|
|
|
flags = GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
|
2012-04-01 15:57:59 +00:00
|
|
|
|
|
|
|
if (!gst_base_transform_is_passthrough (trans))
|
|
|
|
flags |= GST_MAP_WRITE;
|
|
|
|
|
|
|
|
if (!gst_video_frame_map (&frame, &filter->in_info, buf, flags))
|
2011-12-21 22:46:53 +00:00
|
|
|
goto invalid_buffer;
|
|
|
|
|
|
|
|
res = fclass->transform_frame_ip (filter, &frame);
|
|
|
|
|
|
|
|
gst_video_frame_unmap (&frame);
|
2012-02-03 16:10:12 +00:00
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (trans, "no transform_frame_ip vmethod");
|
2011-12-21 22:46:53 +00:00
|
|
|
res = GST_FLOW_OK;
|
2012-02-03 16:10:12 +00:00
|
|
|
}
|
2011-12-21 22:46:53 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
unknown_format:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (filter, CORE, NOT_IMPLEMENTED, (NULL),
|
|
|
|
("unknown format"));
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
}
|
|
|
|
invalid_buffer:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_WARNING (filter, CORE, NOT_IMPLEMENTED, (NULL),
|
|
|
|
("invalid video buffer received"));
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-21 21:54:49 +00:00
|
|
|
static gboolean
|
|
|
|
gst_video_filter_transform_meta (GstBaseTransform * trans, GstBuffer * inbuf,
|
|
|
|
GstMeta * meta, GstBuffer * outbuf)
|
|
|
|
{
|
|
|
|
const GstMetaInfo *info = meta->info;
|
|
|
|
const gchar *const *tags;
|
|
|
|
|
|
|
|
tags = gst_meta_api_type_get_tags (info->api);
|
|
|
|
|
|
|
|
if (tags && g_strv_length ((gchar **) tags) == 1
|
|
|
|
&& gst_meta_api_type_has_tag (info->api,
|
|
|
|
g_quark_from_string (GST_META_TAG_VIDEO_STR)))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return GST_BASE_TRANSFORM_CLASS (parent_class)->transform_meta (trans, inbuf,
|
|
|
|
meta, outbuf);
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
2011-12-21 22:46:53 +00:00
|
|
|
gst_video_filter_class_init (GstVideoFilterClass * g_class)
|
2003-07-02 05:22:47 +00:00
|
|
|
{
|
VideoFilter inherits from
Original commit message from CVS:
2005-11-23 Julien MOUTTE <julien@moutte.net>
* ext/cairo/gsttimeoverlay.c:
(gst_timeoverlay_update_font_height),
(gst_timeoverlay_set_caps), (gst_timeoverlay_get_unit_size),
(gst_timeoverlay_transform), (gst_timeoverlay_base_init),
(gst_timeoverlay_class_init), (gst_timeoverlay_init),
(gst_timeoverlay_get_type):
* ext/cairo/gsttimeoverlay.h:
* gst/debug/Makefile.am:
* gst/debug/gstnavigationtest.c:
(gst_navigationtest_handle_src_event),
(gst_navigationtest_get_unit_size),
(gst_navigationtest_set_caps),
(gst_navigationtest_transform),
(gst_navigationtest_change_state),
(gst_navigationtest_base_init), (gst_navigationtest_class_init),
(gst_navigationtest_init), (gst_navigationtest_get_type),
(plugin_init):
* gst/debug/gstnavigationtest.h:
* gst/effectv/Makefile.am:
* gst/effectv/gstaging.c: (gst_agingtv_set_caps),
(gst_agingtv_get_unit_size), (gst_agingtv_transform),
(gst_agingtv_base_init), (gst_agingtv_class_init),
(gst_agingtv_init), (gst_agingtv_get_type):
* gst/effectv/gstdice.c: (gst_dicetv_set_caps),
(gst_dicetv_get_unit_size), (gst_dicetv_transform),
(gst_dicetv_base_init), (gst_dicetv_class_init),
(gst_dicetv_init),
(gst_dicetv_get_type):
* gst/effectv/gstedge.c: (gst_edgetv_set_caps),
(gst_edgetv_get_unit_size), (gst_edgetv_transform),
(gst_edgetv_base_init), (gst_edgetv_class_init),
(gst_edgetv_init),
(gst_edgetv_get_type):
* gst/effectv/gsteffectv.c:
* gst/effectv/gsteffectv.h:
* gst/effectv/gstquark.c: (gst_quarktv_set_caps),
(gst_quarktv_get_unit_size), (fastrand),
(gst_quarktv_transform),
(gst_quarktv_change_state), (gst_quarktv_base_init),
(gst_quarktv_class_init), (gst_quarktv_init),
(gst_quarktv_get_type):
* gst/effectv/gstrev.c: (gst_revtv_set_caps),
(gst_revtv_get_unit_size), (gst_revtv_transform),
(gst_revtv_base_init), (gst_revtv_class_init), (gst_revtv_init),
(gst_revtv_get_type):
* gst/effectv/gstshagadelic.c: (gst_shagadelictv_set_caps),
(gst_shagadelictv_get_unit_size), (gst_shagadelictv_transform),
(gst_shagadelictv_base_init), (gst_shagadelictv_class_init),
(gst_shagadelictv_init), (gst_shagadelictv_get_type):
* gst/effectv/gstvertigo.c: (gst_vertigotv_set_caps),
(gst_vertigotv_get_unit_size), (gst_vertigotv_transform),
(gst_vertigotv_base_init), (gst_vertigotv_class_init),
(gst_vertigotv_init), (gst_vertigotv_get_type):
* gst/effectv/gstwarp.c: (gst_warptv_set_caps),
(gst_warptv_get_unit_size), (gst_warptv_transform),
(gst_warptv_base_init), (gst_warptv_class_init),
(gst_warptv_init),
(gst_warptv_get_type):
* gst/videofilter/Makefile.am:
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideobalance.h:
* gst/videofilter/gstvideofilter.c: (gst_videofilter_get_type),
(gst_videofilter_class_init), (gst_videofilter_init):
* gst/videofilter/gstvideofilter.h:
* gst/videofilter/gstvideoflip.c: (gst_videoflip_set_caps),
(gst_videoflip_transform_caps), (gst_videoflip_get_unit_size),
(gst_videoflip_flip), (gst_videoflip_transform),
(gst_videoflip_handle_src_event), (gst_videoflip_set_property),
(gst_videoflip_base_init), (gst_videoflip_class_init),
(gst_videoflip_init), (plugin_init), (gst_videoflip_get_type):
* gst/videofilter/gstvideoflip.h: VideoFilter inherits from
BaseTransform, it's just a place holder for now and every video
effect plugin has been ported to use BaseTransform features
directly. QuarkTV was fixed too (was broken), navigationtest
works
and best for the end, videoflip converts navigation events
depending
on flip method ! Fixes #320953
2005-11-23 15:50:51 +00:00
|
|
|
GstBaseTransformClass *trans_class;
|
2005-11-30 08:26:39 +00:00
|
|
|
GstVideoFilterClass *klass;
|
2003-07-02 05:22:47 +00:00
|
|
|
|
2005-11-30 08:26:39 +00:00
|
|
|
klass = (GstVideoFilterClass *) g_class;
|
VideoFilter inherits from
Original commit message from CVS:
2005-11-23 Julien MOUTTE <julien@moutte.net>
* ext/cairo/gsttimeoverlay.c:
(gst_timeoverlay_update_font_height),
(gst_timeoverlay_set_caps), (gst_timeoverlay_get_unit_size),
(gst_timeoverlay_transform), (gst_timeoverlay_base_init),
(gst_timeoverlay_class_init), (gst_timeoverlay_init),
(gst_timeoverlay_get_type):
* ext/cairo/gsttimeoverlay.h:
* gst/debug/Makefile.am:
* gst/debug/gstnavigationtest.c:
(gst_navigationtest_handle_src_event),
(gst_navigationtest_get_unit_size),
(gst_navigationtest_set_caps),
(gst_navigationtest_transform),
(gst_navigationtest_change_state),
(gst_navigationtest_base_init), (gst_navigationtest_class_init),
(gst_navigationtest_init), (gst_navigationtest_get_type),
(plugin_init):
* gst/debug/gstnavigationtest.h:
* gst/effectv/Makefile.am:
* gst/effectv/gstaging.c: (gst_agingtv_set_caps),
(gst_agingtv_get_unit_size), (gst_agingtv_transform),
(gst_agingtv_base_init), (gst_agingtv_class_init),
(gst_agingtv_init), (gst_agingtv_get_type):
* gst/effectv/gstdice.c: (gst_dicetv_set_caps),
(gst_dicetv_get_unit_size), (gst_dicetv_transform),
(gst_dicetv_base_init), (gst_dicetv_class_init),
(gst_dicetv_init),
(gst_dicetv_get_type):
* gst/effectv/gstedge.c: (gst_edgetv_set_caps),
(gst_edgetv_get_unit_size), (gst_edgetv_transform),
(gst_edgetv_base_init), (gst_edgetv_class_init),
(gst_edgetv_init),
(gst_edgetv_get_type):
* gst/effectv/gsteffectv.c:
* gst/effectv/gsteffectv.h:
* gst/effectv/gstquark.c: (gst_quarktv_set_caps),
(gst_quarktv_get_unit_size), (fastrand),
(gst_quarktv_transform),
(gst_quarktv_change_state), (gst_quarktv_base_init),
(gst_quarktv_class_init), (gst_quarktv_init),
(gst_quarktv_get_type):
* gst/effectv/gstrev.c: (gst_revtv_set_caps),
(gst_revtv_get_unit_size), (gst_revtv_transform),
(gst_revtv_base_init), (gst_revtv_class_init), (gst_revtv_init),
(gst_revtv_get_type):
* gst/effectv/gstshagadelic.c: (gst_shagadelictv_set_caps),
(gst_shagadelictv_get_unit_size), (gst_shagadelictv_transform),
(gst_shagadelictv_base_init), (gst_shagadelictv_class_init),
(gst_shagadelictv_init), (gst_shagadelictv_get_type):
* gst/effectv/gstvertigo.c: (gst_vertigotv_set_caps),
(gst_vertigotv_get_unit_size), (gst_vertigotv_transform),
(gst_vertigotv_base_init), (gst_vertigotv_class_init),
(gst_vertigotv_init), (gst_vertigotv_get_type):
* gst/effectv/gstwarp.c: (gst_warptv_set_caps),
(gst_warptv_get_unit_size), (gst_warptv_transform),
(gst_warptv_base_init), (gst_warptv_class_init),
(gst_warptv_init),
(gst_warptv_get_type):
* gst/videofilter/Makefile.am:
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideobalance.h:
* gst/videofilter/gstvideofilter.c: (gst_videofilter_get_type),
(gst_videofilter_class_init), (gst_videofilter_init):
* gst/videofilter/gstvideofilter.h:
* gst/videofilter/gstvideoflip.c: (gst_videoflip_set_caps),
(gst_videoflip_transform_caps), (gst_videoflip_get_unit_size),
(gst_videoflip_flip), (gst_videoflip_transform),
(gst_videoflip_handle_src_event), (gst_videoflip_set_property),
(gst_videoflip_base_init), (gst_videoflip_class_init),
(gst_videoflip_init), (plugin_init), (gst_videoflip_get_type):
* gst/videofilter/gstvideoflip.h: VideoFilter inherits from
BaseTransform, it's just a place holder for now and every video
effect plugin has been ported to use BaseTransform features
directly. QuarkTV was fixed too (was broken), navigationtest
works
and best for the end, videoflip converts navigation events
depending
on flip method ! Fixes #320953
2005-11-23 15:50:51 +00:00
|
|
|
trans_class = (GstBaseTransformClass *) klass;
|
2003-07-02 05:22:47 +00:00
|
|
|
|
2011-12-21 22:46:53 +00:00
|
|
|
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_filter_set_caps);
|
|
|
|
trans_class->propose_allocation =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_video_filter_propose_allocation);
|
|
|
|
trans_class->decide_allocation =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_video_filter_decide_allocation);
|
|
|
|
trans_class->transform_size =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_video_filter_transform_size);
|
2009-06-16 17:38:17 +00:00
|
|
|
trans_class->get_unit_size =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_video_filter_get_unit_size);
|
2011-12-21 22:46:53 +00:00
|
|
|
trans_class->transform = GST_DEBUG_FUNCPTR (gst_video_filter_transform);
|
|
|
|
trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_video_filter_transform_ip);
|
2013-08-21 21:54:49 +00:00
|
|
|
trans_class->transform_meta =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_video_filter_transform_meta);
|
2005-07-25 14:06:15 +00:00
|
|
|
|
2005-11-30 08:26:39 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_video_filter_debug, "videofilter", 0,
|
2005-07-25 14:06:15 +00:00
|
|
|
"videofilter");
|
2003-07-02 05:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-12-21 22:46:53 +00:00
|
|
|
gst_video_filter_init (GstVideoFilter * instance)
|
2003-07-02 05:22:47 +00:00
|
|
|
{
|
2005-11-30 08:26:39 +00:00
|
|
|
GstVideoFilter *videofilter = GST_VIDEO_FILTER (instance);
|
2003-11-08 02:52:41 +00:00
|
|
|
|
2005-11-30 08:26:39 +00:00
|
|
|
GST_DEBUG_OBJECT (videofilter, "gst_video_filter_init");
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2011-12-21 22:46:53 +00:00
|
|
|
videofilter->negotiated = FALSE;
|
2006-03-14 11:11:59 +00:00
|
|
|
/* enable QoS */
|
|
|
|
gst_base_transform_set_qos_enabled (GST_BASE_TRANSFORM (videofilter), TRUE);
|
2003-11-08 02:52:41 +00:00
|
|
|
}
|