mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-03 10:43:55 +00:00
gamma: Stop using liboil
The used liboil function is deprecated, only has a reference implementation and is more complex than what's needed here.
This commit is contained in:
parent
155e48fb90
commit
9f727ea05c
2 changed files with 18 additions and 12 deletions
|
@ -35,12 +35,10 @@ libgstvideobalance_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
libgstgamma_la_SOURCES = gstgamma.c
|
libgstgamma_la_SOURCES = gstgamma.c
|
||||||
libgstgamma_la_CFLAGS = $(GST_CFLAGS) $(GST_CONTROLLER_CFLAGS) \
|
libgstgamma_la_CFLAGS = $(GST_CFLAGS) $(GST_CONTROLLER_CFLAGS) \
|
||||||
$(GST_BASE_CFLAGS) \
|
$(GST_BASE_CFLAGS) \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS)
|
||||||
$(LIBOIL_CFLAGS)
|
|
||||||
libgstgamma_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_MAJORMINOR@ \
|
libgstgamma_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_MAJORMINOR@ \
|
||||||
$(GST_CONTROLLER_LIBS) \
|
$(GST_CONTROLLER_LIBS) \
|
||||||
$(GST_BASE_LIBS) $(GST_LIBS) \
|
$(GST_BASE_LIBS) $(GST_LIBS)
|
||||||
$(LIBOIL_LIBS)
|
|
||||||
libgstgamma_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(LIBM)
|
libgstgamma_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(LIBM)
|
||||||
libgstgamma_la_LIBTOOLFLAGS = --tag=disable-static
|
libgstgamma_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstgamma.h"
|
#include "gstgamma.h"
|
||||||
#include <liboil/liboil.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
@ -199,17 +198,27 @@ gst_gamma_calculate_tables (GstGamma * gamma)
|
||||||
static void
|
static void
|
||||||
gst_gamma_planar_ip (GstGamma * gamma, guint8 * data)
|
gst_gamma_planar_ip (GstGamma * gamma, guint8 * data)
|
||||||
{
|
{
|
||||||
gint size;
|
gint i, j, height;
|
||||||
|
gint width, row_stride, row_wrap;
|
||||||
|
const guint8 *table = gamma->gamma_table;
|
||||||
|
|
||||||
data =
|
data =
|
||||||
data + gst_video_format_get_component_offset (gamma->format, 0,
|
data + gst_video_format_get_component_offset (gamma->format, 0,
|
||||||
gamma->width, gamma->height);
|
gamma->width, gamma->height);
|
||||||
size =
|
|
||||||
gst_video_format_get_row_stride (gamma->format, 0,
|
|
||||||
gamma->width) * gst_video_format_get_component_height (gamma->format, 0,
|
|
||||||
gamma->height);
|
|
||||||
|
|
||||||
oil_tablelookup_u8 (data, 1, data, 1, gamma->gamma_table, 1, size);
|
width = gst_video_format_get_component_width (gamma->format, 0, gamma->width);
|
||||||
|
height = gst_video_format_get_component_height (gamma->format, 0,
|
||||||
|
gamma->height);
|
||||||
|
row_stride = gst_video_format_get_row_stride (gamma->format, 0, gamma->width);
|
||||||
|
row_wrap = row_stride - width;
|
||||||
|
|
||||||
|
for (i = 0; i < height; i++) {
|
||||||
|
for (j = 0; j < width; j++) {
|
||||||
|
*data = table[*data];
|
||||||
|
data++;
|
||||||
|
}
|
||||||
|
data += row_wrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -302,7 +311,6 @@ plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
GST_DEBUG_CATEGORY_INIT (gamma_debug, "gamma", 0, "gamma");
|
GST_DEBUG_CATEGORY_INIT (gamma_debug, "gamma", 0, "gamma");
|
||||||
|
|
||||||
oil_init ();
|
|
||||||
gst_controller_init (NULL, NULL);
|
gst_controller_init (NULL, NULL);
|
||||||
|
|
||||||
return gst_element_register (plugin, "gamma", GST_RANK_NONE, GST_TYPE_GAMMA);
|
return gst_element_register (plugin, "gamma", GST_RANK_NONE, GST_TYPE_GAMMA);
|
||||||
|
|
Loading…
Reference in a new issue