dvbsuboverlay: some more minor clean-ups

This commit is contained in:
Tim-Philipp Müller 2011-01-05 13:44:04 +00:00
parent 43bfb0009a
commit ed8e27b237
3 changed files with 9 additions and 77 deletions

View file

@ -3,8 +3,8 @@ plugin_LTLIBRARIES = libgstdvbsuboverlay.la
libgstdvbsuboverlay_la_SOURCES = dvb-sub.c gstdvbsuboverlay.c
libgstdvbsuboverlay_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstdvbsuboverlay_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) -lgstvideo-@GST_MAJORMINOR@
libgstdvbsuboverlay_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_MAJORMINOR@ $(GST_LIBS)
libgstdvbsuboverlay_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstdvbsuboverlay_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS = gstdvbsuboverlay.h dvb-sub.h ffmpeg-colorspace.h
noinst_HEADERS = gstdvbsuboverlay.h dvb-sub.h

View file

@ -53,8 +53,6 @@ static void dvb_sub_init (void);
* and signalling the API user for new bitmaps to show on screen.
*/
#define MAX_NEG_CROP 1024
#define AYUV(y,u,v,a) (((a) << 24) | ((y) << 16) | ((u) << 8) | (v))
#define RGBA_TO_AYUV(r,g,b,a) (((a) << 24) | ((rgb_to_y(r,g,b)) << 16) | ((rgb_to_u(r,g,b)) << 8) | (rgb_to_v(r,g,b)))
@ -374,10 +372,6 @@ _dvb_sub_parse_page_segment (DvbSub * dvb_sub, guint16 page_id, guint8 * buf,
guint8 region_id;
guint8 page_state;
#ifndef GST_DISABLE_GST_DEBUG
static int counter = 0; /* FIXME: static counter? I think not.. */
#endif
if (buf_size < 1)
return;
@ -390,9 +384,8 @@ _dvb_sub_parse_page_segment (DvbSub * dvb_sub, guint16 page_id, guint8 * buf,
"Normal case", "ACQUISITION POINT", "Mode Change", "RESERVED"
};
++counter;
GST_DEBUG ("PAGE: %d: page_id = %u, length = %d, page_time_out = %u secs, "
"page_state = %s", counter, page_id, buf_size, dvb_sub->page_time_out,
GST_DEBUG ("PAGE: page_id = %u, length = %d, page_time_out = %u secs, "
"page_state = %s", page_id, buf_size, dvb_sub->page_time_out,
page_state_str[page_state]);
}
#endif
@ -433,8 +426,8 @@ _dvb_sub_parse_page_segment (DvbSub * dvb_sub, guint16 page_id, guint8 * buf,
dvb_sub->display_list = display;
dvb_sub->display_list_size++;
GST_LOG ("PAGE %d: REGION information: ID = %u, address = %ux%u",
counter, region_id, display->x_pos, display->y_pos);
GST_LOG ("PAGE: REGION information: ID = %u, address = %ux%u", region_id,
display->x_pos, display->y_pos);
}
while (tmp_display_list) {
@ -587,7 +580,7 @@ _dvb_sub_parse_clut_segment (DvbSub * dvb_sub, guint16 page_id, guint8 * buf,
clut = get_clut (dvb_sub, clut_id);
if (!clut) {
clut = g_slice_new (DVBSubCLUT); /* FIXME-MEMORY-LEAK: This seems to leak per valgrind */
clut = g_slice_new (DVBSubCLUT);
memcpy (clut, &default_clut, sizeof (DVBSubCLUT));
@ -1201,8 +1194,6 @@ _dvb_sub_parse_end_of_display_set (DvbSub * dvb_sub, guint16 page_id,
guint32 *clut_table;
int i;
static unsigned counter = 0; /* DEBUG use only *//* FIXME: get rid */
GST_DEBUG ("DISPLAY SET END: page_id = %u, length = %d", page_id, buf_size);
sub = g_slice_new0 (DVBSubtitles);
@ -1275,10 +1266,8 @@ _dvb_sub_parse_end_of_display_set (DvbSub * dvb_sub, guint16 page_id,
rect->pict.data = g_malloc (region->buf_size); /* FIXME: Can we use GSlice here? */
memcpy (rect->pict.data, region->pbuf, region->buf_size);
++counter;
GST_DEBUG ("DISPLAY: an object rect created: number %u, iteration %u, "
"pos: %d:%d, size: %dx%d", counter, i, rect->x, rect->y, rect->w,
rect->h);
GST_DEBUG ("DISPLAY: an object rect created: iteration %u, "
"pos: %d:%d, size: %dx%d", i, rect->x, rect->y, rect->w, rect->h);
GST_MEMDUMP ("rect->pict.data content", rect->pict.data, region->buf_size);

View file

@ -1,57 +0,0 @@
/*
* This file is copied from ffmpeg's libavcodec/colorspace.h
* for the YUV_TO_RGB{1,2}_CCIR macros.
* Original copyright header and contents follows:
*/
/*
* Colorspace conversion defines
* Copyright (c) 2001, 2002, 2003 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file libavcodec/colorspace.h
* Various defines for YUV<->RGB conversion
*/
#ifndef AVCODEC_COLORSPACE_H
#define AVCODEC_COLORSPACE_H
#define SCALEBITS 10
#define ONE_HALF (1 << (SCALEBITS - 1))
#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define YUV_TO_RGB1_CCIR(cb1, cr1)\
{\
cb = (cb1) - 128;\
cr = (cr1) - 128;\
r_add = FIX(1.40200*255.0/224.0) * cr + ONE_HALF;\
g_add = - FIX(0.34414*255.0/224.0) * cb - FIX(0.71414*255.0/224.0) * cr + \
ONE_HALF;\
b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
}
#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
{\
y = ((y1) - 16) * FIX(255.0/219.0);\
r = cm[(y + r_add) >> SCALEBITS];\
g = cm[(y + g_add) >> SCALEBITS];\
b = cm[(y + b_add) >> SCALEBITS];\
}
#endif /* AVCODEC_COLORSPACE_H */