2004-01-11 21:52:10 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* Copyright (C) <2003> David Schleef <ds@schleef.org>
|
|
|
|
* Copyright (C) 2003 Arwed v. Merkatz <v.merkatz@gmx.net>
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
* Copyright (C) 2006 Mark Nauwelaerts <manauw@skynet.be>
|
2004-01-11 21:52:10 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file was (probably) generated from
|
|
|
|
* gstvideotemplate.c,v 1.12 2004/01/07 21:07:12 ds Exp
|
|
|
|
* and
|
|
|
|
* make_filter,v 1.6 2004/01/07 21:33:01 ds Exp
|
|
|
|
*/
|
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-gamma
|
|
|
|
*
|
|
|
|
* Performs gamma correction on a video stream.
|
2009-01-28 10:29:42 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
* <title>Example launch line</title>
|
2009-01-28 10:29:42 +00:00
|
|
|
* |[
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
* gst-launch videotestsrc ! gamma gamma=2.0 ! ffmpegcolorspace ! ximagesink
|
2009-01-28 10:29:42 +00:00
|
|
|
* ]| This pipeline will make the image "brighter".
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
* </refsect2>
|
|
|
|
*/
|
|
|
|
|
2004-01-11 21:52:10 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
#include "gstgamma.h"
|
2004-01-11 21:52:10 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
#include <gst/video/video.h>
|
2010-04-17 16:01:06 +00:00
|
|
|
#include <gst/controller/gstcontroller.h>
|
2004-01-11 21:52:10 +00:00
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gamma_debug);
|
|
|
|
#define GST_CAT_DEFAULT gamma_debug
|
2004-01-11 21:52:10 +00:00
|
|
|
|
2010-04-17 15:55:22 +00:00
|
|
|
/* GstGamma properties */
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_GAMMA
|
2004-05-21 22:39:30 +00:00
|
|
|
/* FILL ME */
|
2004-01-11 21:52:10 +00:00
|
|
|
};
|
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
#define DEFAULT_PROP_GAMMA 1
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_gamma_src_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2010-04-18 07:38:36 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV
|
|
|
|
("{ IYUV, I420, YV12, Y41B, Y42B, Y444, NV12, NV21 }"))
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_gamma_sink_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2010-04-18 07:38:36 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV
|
|
|
|
("{ IYUV, I420, YV12, Y41B, Y42B, Y444, NV12, NV21 }"))
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
);
|
2004-01-11 21:52:10 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_gamma_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_gamma_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2004-01-11 21:52:10 +00:00
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
static gboolean gst_gamma_set_caps (GstBaseTransform * base, GstCaps * incaps,
|
|
|
|
GstCaps * outcaps);
|
|
|
|
static GstFlowReturn gst_gamma_transform_ip (GstBaseTransform * transform,
|
|
|
|
GstBuffer * buf);
|
2004-01-11 21:52:10 +00:00
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
static void gst_gamma_calculate_tables (GstGamma * gamma);
|
2004-01-11 21:52:10 +00:00
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
GST_BOILERPLATE (GstGamma, gst_gamma, GstVideoFilter, GST_TYPE_VIDEO_FILTER);
|
2004-01-11 21:52:10 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gamma_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2010-03-18 13:31:35 +00:00
|
|
|
gst_element_class_set_details_simple (element_class, "Video gamma correction",
|
|
|
|
"Filter/Effect/Video",
|
|
|
|
"Adjusts gamma on a video stream", "Arwed v. Merkatz <v.merkatz@gmx.net");
|
2004-01-11 21:52:10 +00:00
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_gamma_sink_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_gamma_src_template));
|
2004-01-11 21:52:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
gst_gamma_class_init (GstGammaClass * g_class)
|
2004-01-11 21:52:10 +00:00
|
|
|
{
|
2010-04-17 15:55:22 +00:00
|
|
|
GObjectClass *gobject_class = (GObjectClass *) g_class;
|
|
|
|
GstBaseTransformClass *trans_class = (GstBaseTransformClass *) g_class;
|
2004-01-11 21:52:10 +00:00
|
|
|
|
2005-05-06 11:25:56 +00:00
|
|
|
gobject_class->set_property = gst_gamma_set_property;
|
|
|
|
gobject_class->get_property = gst_gamma_get_property;
|
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_GAMMA,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_double ("gamma", "Gamma", "gamma",
|
2010-04-17 15:55:22 +00:00
|
|
|
0.01, 10, DEFAULT_PROP_GAMMA,
|
2010-04-17 16:01:06 +00:00
|
|
|
GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
|
|
|
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_gamma_set_caps);
|
|
|
|
trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_gamma_transform_ip);
|
2004-01-11 21:52:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
gst_gamma_init (GstGamma * gamma, GstGammaClass * g_class)
|
2004-01-11 21:52:10 +00:00
|
|
|
{
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
/* properties */
|
|
|
|
gamma->gamma = DEFAULT_PROP_GAMMA;
|
2004-02-24 21:23:40 +00:00
|
|
|
gst_gamma_calculate_tables (gamma);
|
2004-01-11 21:52:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_gamma_set_property (GObject * object, guint prop_id, const GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2004-01-11 21:52:10 +00:00
|
|
|
{
|
2010-04-17 15:55:22 +00:00
|
|
|
GstGamma *gamma = GST_GAMMA (object);
|
2004-01-11 21:52:10 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-04-17 15:55:22 +00:00
|
|
|
case PROP_GAMMA:{
|
|
|
|
gdouble val = g_value_get_double (value);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (gamma, "Changing gamma from %lf to %lf", gamma->gamma,
|
|
|
|
val);
|
2010-04-17 16:01:06 +00:00
|
|
|
GST_OBJECT_LOCK (gamma);
|
2010-04-17 15:55:22 +00:00
|
|
|
gamma->gamma = val;
|
2004-02-24 21:23:40 +00:00
|
|
|
gst_gamma_calculate_tables (gamma);
|
2010-04-17 16:01:06 +00:00
|
|
|
GST_OBJECT_UNLOCK (gamma);
|
2004-02-24 21:23:40 +00:00
|
|
|
break;
|
2010-04-17 15:55:22 +00:00
|
|
|
}
|
2004-01-11 21:52:10 +00:00
|
|
|
default:
|
2009-10-02 10:15:59 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
2004-01-11 21:52:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_gamma_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2004-01-11 21:52:10 +00:00
|
|
|
{
|
2010-04-17 15:55:22 +00:00
|
|
|
GstGamma *gamma = GST_GAMMA (object);
|
2004-01-11 21:52:10 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
case PROP_GAMMA:
|
2004-01-11 21:52:10 +00:00
|
|
|
g_value_set_double (value, gamma->gamma);
|
2004-02-24 21:23:40 +00:00
|
|
|
break;
|
2004-01-11 21:52:10 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_gamma_calculate_tables (GstGamma * gamma)
|
2004-01-11 21:52:10 +00:00
|
|
|
{
|
2010-04-17 15:55:22 +00:00
|
|
|
gint n;
|
|
|
|
gdouble val;
|
|
|
|
gdouble exp;
|
2004-01-11 21:52:10 +00:00
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
if (gamma->gamma == 1.0) {
|
|
|
|
GST_BASE_TRANSFORM (gamma)->passthrough = TRUE;
|
2004-01-11 21:52:10 +00:00
|
|
|
return;
|
|
|
|
}
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
GST_BASE_TRANSFORM (gamma)->passthrough = FALSE;
|
2004-01-11 21:52:10 +00:00
|
|
|
|
|
|
|
exp = 1.0 / gamma->gamma;
|
|
|
|
for (n = 0; n < 256; n++) {
|
2004-03-14 22:34:33 +00:00
|
|
|
val = n / 255.0;
|
|
|
|
val = pow (val, exp);
|
2004-01-11 21:52:10 +00:00
|
|
|
val = 255.0 * val;
|
2010-04-17 15:55:22 +00:00
|
|
|
gamma->gamma_table[n] = (guint8) floor (val + 0.5);
|
2004-01-11 21:52:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-17 16:13:46 +00:00
|
|
|
static void
|
|
|
|
gst_gamma_planar_ip (GstGamma * gamma, guint8 * data)
|
|
|
|
{
|
2010-04-18 07:33:49 +00:00
|
|
|
gint i, j, height;
|
|
|
|
gint width, row_stride, row_wrap;
|
|
|
|
const guint8 *table = gamma->gamma_table;
|
2010-04-17 16:13:46 +00:00
|
|
|
|
|
|
|
data =
|
|
|
|
data + gst_video_format_get_component_offset (gamma->format, 0,
|
|
|
|
gamma->width, gamma->height);
|
2010-04-18 07:33:49 +00:00
|
|
|
|
|
|
|
width = gst_video_format_get_component_width (gamma->format, 0, gamma->width);
|
|
|
|
height = gst_video_format_get_component_height (gamma->format, 0,
|
2010-04-17 16:13:46 +00:00
|
|
|
gamma->height);
|
2010-04-18 07:33:49 +00:00
|
|
|
row_stride = gst_video_format_get_row_stride (gamma->format, 0, gamma->width);
|
|
|
|
row_wrap = row_stride - width;
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
2010-04-18 07:33:49 +00:00
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
*data = table[*data];
|
|
|
|
data++;
|
|
|
|
}
|
|
|
|
data += row_wrap;
|
|
|
|
}
|
2010-04-17 16:13:46 +00:00
|
|
|
}
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_gamma_set_caps (GstBaseTransform * base, GstCaps * incaps,
|
|
|
|
GstCaps * outcaps)
|
2004-02-24 21:23:40 +00:00
|
|
|
{
|
2010-04-17 15:55:22 +00:00
|
|
|
GstGamma *gamma = GST_GAMMA (base);
|
2004-02-24 21:23:40 +00:00
|
|
|
|
2010-04-17 15:55:22 +00:00
|
|
|
GST_DEBUG_OBJECT (gamma,
|
|
|
|
"setting caps: in %" GST_PTR_FORMAT " out %" GST_PTR_FORMAT, incaps,
|
|
|
|
outcaps);
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
2010-04-17 16:13:46 +00:00
|
|
|
if (!gst_video_format_parse_caps (incaps, &gamma->format, &gamma->width,
|
|
|
|
&gamma->height))
|
|
|
|
goto invalid_caps;
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
2010-04-17 16:13:46 +00:00
|
|
|
gamma->size =
|
|
|
|
gst_video_format_get_size (gamma->format, gamma->width, gamma->height);
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
2010-04-17 16:13:46 +00:00
|
|
|
switch (gamma->format) {
|
|
|
|
case GST_VIDEO_FORMAT_I420:
|
|
|
|
case GST_VIDEO_FORMAT_YV12:
|
2010-04-18 07:38:36 +00:00
|
|
|
case GST_VIDEO_FORMAT_Y41B:
|
|
|
|
case GST_VIDEO_FORMAT_Y42B:
|
|
|
|
case GST_VIDEO_FORMAT_Y444:
|
|
|
|
case GST_VIDEO_FORMAT_NV12:
|
|
|
|
case GST_VIDEO_FORMAT_NV21:
|
2010-04-17 16:13:46 +00:00
|
|
|
gamma->process = gst_gamma_planar_ip;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
goto invalid_caps;
|
|
|
|
break;
|
|
|
|
}
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
2010-04-17 16:13:46 +00:00
|
|
|
return TRUE;
|
2004-02-24 21:23:40 +00:00
|
|
|
|
2010-04-17 16:13:46 +00:00
|
|
|
invalid_caps:
|
|
|
|
GST_ERROR_OBJECT (gamma, "Invalid caps: %" GST_PTR_FORMAT, incaps);
|
|
|
|
return FALSE;
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_gamma_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
2004-02-24 21:23:40 +00:00
|
|
|
{
|
2010-04-17 15:55:22 +00:00
|
|
|
GstGamma *gamma = GST_GAMMA (base);
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
guint8 *data;
|
|
|
|
guint size;
|
2010-04-17 16:01:06 +00:00
|
|
|
GstClockTime timestamp, stream_time;
|
|
|
|
|
2010-04-17 16:13:46 +00:00
|
|
|
if (!gamma->process)
|
|
|
|
goto not_negotiated;
|
|
|
|
|
2010-04-17 16:01:06 +00:00
|
|
|
timestamp = GST_BUFFER_TIMESTAMP (outbuf);
|
|
|
|
stream_time =
|
|
|
|
gst_segment_to_stream_time (&base->segment, GST_FORMAT_TIME, timestamp);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (gamma, "sync to %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (timestamp));
|
|
|
|
|
|
|
|
if (GST_CLOCK_TIME_IS_VALID (stream_time))
|
|
|
|
gst_object_sync_values (G_OBJECT (gamma), stream_time);
|
2004-02-24 21:23:40 +00:00
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
if (base->passthrough)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
data = GST_BUFFER_DATA (outbuf);
|
|
|
|
size = GST_BUFFER_SIZE (outbuf);
|
|
|
|
|
|
|
|
if (size != gamma->size)
|
|
|
|
goto wrong_size;
|
|
|
|
|
2010-04-17 16:01:06 +00:00
|
|
|
GST_OBJECT_LOCK (gamma);
|
2010-04-17 16:13:46 +00:00
|
|
|
gamma->process (gamma, data);
|
2010-04-17 16:01:06 +00:00
|
|
|
GST_OBJECT_UNLOCK (gamma);
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
wrong_size:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (gamma, STREAM, FORMAT,
|
|
|
|
(NULL), ("Invalid buffer size %d, expected %d", size, gamma->size));
|
|
|
|
return GST_FLOW_ERROR;
|
2004-02-24 21:23:40 +00:00
|
|
|
}
|
2010-04-17 16:13:46 +00:00
|
|
|
not_negotiated:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (gamma, "Not negotiated yet");
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
}
|
2004-02-24 21:23:40 +00:00
|
|
|
}
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
|
|
|
GST_DEBUG_CATEGORY_INIT (gamma_debug, "gamma", 0, "gamma");
|
|
|
|
|
2010-04-17 16:01:06 +00:00
|
|
|
gst_controller_init (NULL, NULL);
|
|
|
|
|
gst/videofilter/: Port gamma filter to 0.10. Fixes #412704.
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* gst/videofilter/Makefile.am:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init),
(gst_gamma_class_init), (gst_gamma_init), (gst_gamma_set_property),
(gst_gamma_get_property), (gst_gamma_calculate_tables),
(oil_tablelookup_u8), (gst_gamma_set_caps),
(gst_gamma_planar411_ip), (gst_gamma_transform_ip), (plugin_init):
Port gamma filter to 0.10. Fixes #412704.
* tests/check/Makefile.am:
* tests/check/elements/videofilter.c: (setup_filter),
(cleanup_filter), (check_filter), (GST_START_TEST),
(videobalance_suite), (videoflip_suite), (gamma_suite), (main):
Add unit tests for videofilters.
2007-02-28 10:17:15 +00:00
|
|
|
return gst_element_register (plugin, "gamma", GST_RANK_NONE, GST_TYPE_GAMMA);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"gamma",
|
|
|
|
"Changes gamma on video images",
|
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|