Commit cf3bb5c0 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* ALL:

  - Removed all the RLE subtitle font code.
  - Removed the .rle and even older .psf font files.
  - Moved the filesubtitle code from spudec to subsdec.
  - spudec is again DVD only.
parent 1f4b5609
dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.39 2003/07/21 17:48:31 gbazin Exp $
dnl $Id: configure.ac,v 1.40 2003/07/22 20:49:10 hartman Exp $
AC_INIT(vlc,0.6.1-test1)
......@@ -768,7 +768,7 @@ dnl
#AX_ADD_BUILTINS([mpeg_video_old idct idctclassic motion])
AX_ADD_PLUGINS([dummy rc logger gestures memcpy])
AX_ADD_PLUGINS([es audio m4v mpeg_system ps ts avi asf aac mp4 rawdv])
AX_ADD_PLUGINS([mpeg_audio lpcm a52 dts cinepak])
AX_ADD_PLUGINS([spudec mpeg_audio lpcm a52 dts cinepak])
AX_ADD_PLUGINS([deinterlace invert adjust wall transform distort clone crop motionblur])
AX_ADD_PLUGINS([float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif dtstospdif fixed32tofloat32 fixed32tos16 s16tofixed32 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32])
AX_ADD_PLUGINS([trivial_resampler ugly_resampler linear_resampler bandlimited_resampler])
......@@ -1701,7 +1701,7 @@ then
AC_CHECK_HEADERS(QuickTime/QuickTime.h,
[ AX_ADD_BUILTINS([quicktime])
AX_ADD_LDFLAGS([quicktime],[-framework QuickTime -framework Carbon])
], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
fi
fi
......@@ -1951,11 +1951,11 @@ You also need to check that you have a libogg posterior to the 1.0 release.])],
fi
dnl
dnl spudec support
dnl subsdec support
dnl
AX_ADD_LDFLAGS([spudec],[${LIBICONV}])
AX_ADD_CPPFLAGS([spudec],[${INCICONV}])
AX_ADD_PLUGINS([spudec])
AX_ADD_LDFLAGS([subsdec],[${LIBICONV}])
AX_ADD_CPPFLAGS([subsdec],[${INCICONV}])
AX_ADD_PLUGINS([subsdec])
dnl
......@@ -3254,6 +3254,7 @@ AC_OUTPUT([
modules/codec/mpeg_video/idct/Makefile
modules/codec/mpeg_video/motion/Makefile
modules/codec/spudec/Makefile
modules/codec/subsdec/Makefile
modules/control/Makefile
modules/control/corba/Makefile
modules/control/lirc/Makefile
......
......@@ -2,7 +2,5 @@ SOURCES_spudec = \
spudec.c \
parse.c \
render.c \
text.c \
subtitler.c \
spudec.h \
$(NULL)
......@@ -2,7 +2,7 @@
* parse.c: SPU parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: parse.c,v 1.11 2003/03/09 19:25:08 gbazin Exp $
* $Id: parse.c,v 1.12 2003/07/22 20:49:10 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -166,6 +166,7 @@ void E_(ParsePacket)( spudec_thread_t *p_spudec )
vlc_mutex_lock( p_mutex );
UpdateSPU( p_spu, VLC_OBJECT(p_spu->p_sys->p_input) );
var_AddCallback( p_spu->p_sys->p_input,
"highlight", CropCallback, p_spu );
vlc_mutex_unlock( p_mutex );
......@@ -412,7 +413,7 @@ static int ParseControlSeq( spudec_thread_t *p_spudec,
msg_Err( p_spudec->p_fifo, "no `start display' command" );
}
if( p_spu->i_stop <= p_spu->i_start && !p_spu->b_ephemer )
if( !p_spu->i_stop <= p_spu->i_start && !p_spu->b_ephemer )
{
/* This subtitle will live for 5 seconds or until the next subtitle */
p_spu->i_stop = p_spu->i_start + (mtime_t)500 * 11000
......
......@@ -2,7 +2,7 @@
* render.c : SPU renderer
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: render.c,v 1.4 2002/11/06 21:48:24 gbazin Exp $
* $Id: render.c,v 1.5 2003/07/22 20:49:10 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Rudolf Cornelissen <rag.cornelissen@inter.nl.net>
......
......@@ -2,7 +2,7 @@
* spudec.c : SPU decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: spudec.c,v 1.23 2003/07/21 18:24:51 gbazin Exp $
* $Id: spudec.c,v 1.24 2003/07/22 20:49:10 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -40,36 +40,13 @@ static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( spudec_thread_t * );
static void EndThread ( spudec_thread_t * );
static vout_thread_t *FindVout( spudec_thread_t * );
static vout_thread_t *FindVout( spudec_thread_t *);
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
#define FONT_TEXT N_("Font used by the text subtitler")
#define FONT_LONGTEXT N_(\
"When the subtitles are coded in text form then, you can choose " \
"which font will be used to display them.")
#define DEFAULT_FONT "font-eutopiabold21.rle"
#define ENCODING_TEXT N_("subtitle text encoding")
#define ENCODING_LONGTEXT N_("change the encoding used in text subtitles")
vlc_module_begin();
add_category_hint( N_("subtitles"), NULL, VLC_TRUE );
#if defined(SYS_DARWIN) || defined(SYS_BEOS) \
|| (defined(WIN32) && !defined(UNDER_CE))
add_file( "spudec-font", NULL, NULL,
FONT_TEXT, FONT_LONGTEXT, VLC_TRUE );
#else
add_file( "spudec-font", "share/" DEFAULT_FONT, NULL,
FONT_TEXT, FONT_LONGTEXT, VLC_TRUE );
#endif
#if defined(HAVE_ICONV)
add_string( "spudec-encoding", "ISO-8859-1", NULL, ENCODING_TEXT,
ENCODING_LONGTEXT, VLC_FALSE );
#endif
set_description( _("subtitles decoder") );
set_description( _("DVD subtitles decoder") );
set_capability( "decoder", 50 );
set_callbacks( OpenDecoder, NULL );
vlc_module_end();
......@@ -85,8 +62,7 @@ static int OpenDecoder( vlc_object_t *p_this )
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('s','p','u',' ')
&& p_fifo->i_fourcc != VLC_FOURCC('s','p','u','b')
&& p_fifo->i_fourcc != VLC_FOURCC('s','u','b','t') )
&& p_fifo->i_fourcc != VLC_FOURCC('s','p','u','b') )
{
return VLC_EGENERIC;
}
......@@ -102,11 +78,6 @@ static int OpenDecoder( vlc_object_t *p_this )
static int RunDecoder( decoder_fifo_t * p_fifo )
{
spudec_thread_t * p_spudec;
subtitler_font_t * p_font = NULL;
char * psz_font;
#if 0
vout_thread_t * p_vout_backup = NULL;
#endif
/* Allocate the memory needed to store the thread's structure */
p_spudec = (spudec_thread_t *)malloc( sizeof(spudec_thread_t) );
......@@ -123,9 +94,6 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
*/
p_spudec->p_vout = NULL;
p_spudec->p_fifo = p_fifo;
#if defined(HAVE_ICONV)
p_spudec->iconv_handle = (iconv_t)-1;
#endif
/*
* Initialize thread and free configuration
......@@ -136,92 +104,6 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
* Main loop - it is not executed if an error occured during
* initialization
*/
if( p_fifo->i_fourcc == VLC_FOURCC('s','u','b','t') )
{
/* Here we are dealing with text subtitles */
#if defined(SYS_DARWIN) || defined(SYS_BEOS)
if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
{
char * psz_vlcpath = p_fifo->p_libvlc->psz_vlcpath;
psz_font = malloc( strlen(psz_vlcpath) + strlen("/share/")
+ strlen(DEFAULT_FONT) + 1 );
sprintf(psz_font, "%s/share/" DEFAULT_FONT, psz_vlcpath);
}
#elif defined(WIN32) && !defined(UNDER_CE)
if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
{
char * psz_vlcpath = p_fifo->p_libvlc->psz_vlcpath;
psz_font = malloc( strlen(psz_vlcpath) + strlen("\\share\\")
+ strlen(DEFAULT_FONT) + 1 );
sprintf(psz_font, "%s\\share\\" DEFAULT_FONT, psz_vlcpath);
}
#else
if( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
{
msg_Err( p_fifo, "no default font selected" );
p_spudec->p_fifo->b_error = VLC_TRUE;
}
#endif
#if defined(HAVE_ICONV)
p_spudec->iconv_handle = iconv_open( "UTF-8",
config_GetPsz( p_spudec->p_fifo, "spudec-encoding" ) );
if( p_spudec->iconv_handle == (iconv_t)-1 )
{
msg_Warn( p_spudec->p_fifo, "Unable to do requested conversion" );
}
#endif
while( (!p_spudec->p_fifo->b_die) && (!p_spudec->p_fifo->b_error) )
{
/* Find/Wait for a video output */
p_spudec->p_vout = FindVout( p_spudec );
if( p_spudec->p_vout )
{
#if 0
if( p_spudec->p_vout != p_vout_backup )
{
/* The vout has changed, we need to reload the fonts */
p_vout_backup = p_spudec->p_vout;
p_font = E_(subtitler_LoadFont)( p_spudec->p_vout,
psz_font );
if( p_font == NULL )
{
msg_Err( p_fifo, "unable to load font: %s", psz_font );
p_spudec->p_fifo->b_error = VLC_TRUE;
vlc_object_release( p_spudec->p_vout );
break;
}
}
#endif
E_(ParseText)( p_spudec, p_font );
vlc_object_release( p_spudec->p_vout );
}
}
if( psz_font ) free( psz_font );
if( p_font )
{
/* Find/Wait for a video output */
p_spudec->p_vout = FindVout( p_spudec );
if( p_spudec->p_vout )
{
E_(subtitler_UnloadFont)( p_spudec->p_vout, p_font );
vlc_object_release( p_spudec->p_vout );
}
}
}
else
{
/* Here we are dealing with sub-pictures subtitles*/
while( (!p_spudec->p_fifo->b_die) && (!p_spudec->p_fifo->b_error) )
{
if( E_(SyncPacket)( p_spudec ) )
......@@ -231,13 +113,12 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
/* Find/Wait for a video output */
p_spudec->p_vout = FindVout( p_spudec );
if( p_spudec->p_vout )
if( p_spudec->p_vout)
{
E_(ParsePacket)( p_spudec );
vlc_object_release( p_spudec->p_vout );
}
}
}
/*
* Error loop
......@@ -345,12 +226,8 @@ static void EndThread( spudec_thread_t *p_spudec )
}
}
}
#if defined(HAVE_ICONV)
if( p_spudec->iconv_handle != (iconv_t)-1 )
{
iconv_close( p_spudec->iconv_handle );
}
#endif
CloseBitstream( &p_spudec->bit_stream );
free( p_spudec );
}
/*****************************************************************************
* spudec.h : sub picture unit decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: spudec.h,v 1.6 2003/07/14 21:32:58 sigmunau Exp $
* $Id: spudec.h,v 1.7 2003/07/22 20:49:10 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -22,11 +21,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#if defined(HAVE_ICONV)
#include <iconv.h>
#endif
typedef struct spudec_thread_t spudec_thread_t;
struct subpicture_sys_t
......@@ -50,18 +44,6 @@ struct subpicture_sys_t
unsigned int i_x_start, i_y_start, i_x_end, i_y_end;
};
/*****************************************************************************
* subtitler_font_t : proportional font
*****************************************************************************/
typedef struct subtitler_font_s
{
unsigned int i_height; /* character height in pixels */
unsigned int i_width[256]; /* character widths in pixels */
unsigned int i_memory[256]; /* amount of memory used by character */
unsigned int * p_length[256]; /* line byte widths */
uint16_t ** p_offset[256]; /* pointer to RLE data */
} subtitler_font_t;
/*****************************************************************************
* spudec_thread_t : sub picture unit decoder thread descriptor
*****************************************************************************/
......@@ -89,9 +71,6 @@ struct spudec_thread_t
*/
unsigned int i_spu_size; /* size of current SPU packet */
unsigned int i_rle_size; /* size of the RLE part */
#if defined(HAVE_ICONV)
iconv_t iconv_handle; /* handle to iconv instance */
#endif
};
/*****************************************************************************
......@@ -120,9 +99,3 @@ void E_(ParsePacket) ( spudec_thread_t * );
void E_(RenderSPU) ( vout_thread_t *, picture_t *,
const subpicture_t * );
void E_(ParseText) ( spudec_thread_t *, subtitler_font_t * );
subtitler_font_t *E_(subtitler_LoadFont) ( vout_thread_t *, const char * );
void E_(subtitler_UnloadFont) ( vout_thread_t *, subtitler_font_t * );
void E_(subtitler_PlotSubtitle) ( vout_thread_t *, char *, subtitler_font_t *,
mtime_t, mtime_t );
This diff is collapsed.
/*****************************************************************************
* text.c: text subtitles parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: text.c,v 1.6 2003/07/14 21:32:58 sigmunau Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* memcpy(), memset() */
#include <vlc/vlc.h>
#include <vlc/vout.h>
#include <vlc/decoder.h>
#include <osd.h>
#include "spudec.h"
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
/*****************************************************************************
* ParseText: parse an text subtitle packet and send it to the video output
*****************************************************************************/
void E_(ParseText)( spudec_thread_t *p_spudec, subtitler_font_t *p_font )
{
char * psz_subtitle;
mtime_t i_pts, i_dts;
/* We cannot display a subpicture with no date */
i_pts = p_spudec->bit_stream.p_pes->i_pts;
i_dts = p_spudec->bit_stream.p_pes->i_dts;
if( i_pts == 0 )
{
/* Dump the packet */
NextDataPacket( p_spudec->p_fifo, &p_spudec->bit_stream );
msg_Warn( p_spudec->p_fifo, "subtitle without a date" );
return;
}
/* Check validity of packet data */
if( (p_spudec->bit_stream.p_data->p_payload_end
- p_spudec->bit_stream.p_data->p_payload_start) <= 0
|| (strlen(p_spudec->bit_stream.p_data->p_payload_start)
> (size_t)(p_spudec->bit_stream.p_data->p_payload_end
- p_spudec->bit_stream.p_data->p_payload_start)) )
{
/* Dump the packet */
NextDataPacket( p_spudec->p_fifo, &p_spudec->bit_stream );
msg_Warn( p_spudec->p_fifo, "invalid subtitle" );
return;
}
psz_subtitle = p_spudec->bit_stream.p_data->p_payload_start;
if( psz_subtitle[0] != '\0' )
{
#if defined(HAVE_ICONV)
char *psz_new_subtitle, *psz_convert_buffer_out, *psz_convert_buffer_in;
size_t ret, inbytes_left, outbytes_left;
psz_new_subtitle = malloc( 6 * strlen( psz_subtitle ) * sizeof(char) );
psz_convert_buffer_out = psz_new_subtitle;
psz_convert_buffer_in = psz_subtitle;
inbytes_left = strlen( psz_subtitle );
outbytes_left = 6 * inbytes_left;
ret = iconv( p_spudec->iconv_handle, &psz_convert_buffer_in, &inbytes_left, &psz_convert_buffer_out, &outbytes_left );
*psz_convert_buffer_out = '\0';
if( inbytes_left )
{
msg_Warn( p_spudec->p_fifo, "Something fishy happened during conversion" );
}
else
{
msg_Dbg( p_spudec->p_fifo, "reencoded \"%s\" into \"%s\"", psz_subtitle, psz_new_subtitle );
vout_ShowTextAbsolute( p_spudec->p_vout, psz_new_subtitle, NULL,
OSD_ALIGN_BOTTOM|OSD_ALIGN_LEFT, 20, 20,
i_pts, i_dts );
}
free( psz_new_subtitle );
#else
vout_ShowTextAbsolute( p_spudec->p_vout, psz_subtitle, NULL,
OSD_ALIGN_BOTTOM|OSD_ALIGN_LEFT, 20, 20,
i_pts, i_dts );
#endif
#if 0
subtitler_PlotSubtitle( p_spudec->p_vout,
psz_subtitle, p_font,
i_pts,
i_dts );
#endif
}
/* Prepare for next time. No need to check that
* p_spudec->bit_stream->p_data is valid since we check later on
* for b_die and b_error */
NextDataPacket( p_spudec->p_fifo, &p_spudec->bit_stream );
}
.deps
.dirstamp
*.lo
*.la
*.dll
*.dylib
*.sl
*.so
Makefile.am
Makefile.in
Makefile
SOURCES_subsdec = \
subsdec.c \
subsdec.h \
$(NULL)
This diff is collapsed.
/*****************************************************************************
* subsdec.h : sub picture unit decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: subsdec.h,v 1.1 2003/07/22 20:49:10 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#if defined(HAVE_ICONV)
#include <iconv.h>
#endif
typedef struct subsdec_thread_t subsdec_thread_t;
/*****************************************************************************
* subsdec_thread_t : sub picture unit decoder thread descriptor
*****************************************************************************/
struct subsdec_thread_t
{
/*
* Thread properties and locks
*/
vlc_thread_t thread_id; /* id for thread functions */
/*
* Input properties
*/
decoder_fifo_t * p_fifo; /* stores the PES stream data */
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
/*
* Output properties
*/
vout_thread_t * p_vout; /* needed to create the spu objects */
/*
* Private properties
*/
#if defined(HAVE_ICONV)
iconv_t iconv_handle; /* handle to iconv instance */
#endif
};
/*****************************************************************************
* Prototypes
*****************************************************************************/
int E_(SyncPacket) ( subsdec_thread_t * );
void E_(ParsePacket) ( subsdec_thread_t * );
void E_(ParseText) ( subsdec_thread_t * );
<html>
<head>
<title>VLC Media Player - Informations</title>
<title>VLC Media Player</title>
<vlc id="if" param1="url_param"/>
<meta http-equiv="refresh" content="0;URL=/" />
<vlc id="end" />
<vlc id="control" param1="stop,pause,previous,next,add,sout,play" />
<vlc id="set" param1="sout" param2="string" />
</head>
<body>
<h2><center><a href="http://www.videolan.org">VLC Media Player <vlc id="value" param1="version" /></a></center></h2>
<h2><center><a href="http://www.videolan.org">VLC Media Player <vlc id="value" param1="version" /></a> (http interface)</center></h2>
<hr/>
<td>
<form method="get" action="">
<input type="submit" name="control" value="stop" />
<input type="submit" name="control" value="pause" />
<input type="submit" name="control" value="previous" />
<input type="submit" name="control" value="next" />
<a href="info.html">infos</a>
</form>
</td>
<br />
<td>
<form method="get" action="" enctype="text/plain" >
<input type="text" name="mrl" size="40" />
<input type="submit" name="control" value="add" />
</form>
</td>
<td>
<form method="get" action="" enctype="text/plain" >
<input type="text" name="sout" size="30" value="<vlc id="get" param1="sout" param2="string" />" />
<input type="submit" name="control" value="sout" />
</form>
</td>
<hr/>
<vlc id="foreach" param1="cat" param2="informations" />
<p> <vlc id="value" param1="cat.name" />
<ul>
<vlc id="foreach" param1="info" param2="cat.info" />
<li> <vlc id="value" param1="info.name" /> : <vlc id="value" param1="info.value" /> </li>
<p>
<vlc id="foreach" param1="pl" param2="playlist" />
<vlc id="if" param1="pl.current" />
<b>
<vlc id="end" />
</ul>
<a href=?control=play&item=<vlc id="value" param1="pl.index" />><vlc id="value" param1="pl.index" /> - <vlc id="value" param1="pl.name" /></a> <br />
<vlc id="if" param1="pl.current" />
</b>
<vlc id="end" />
<vlc id="end" />
</p>
<hr/>
<p><vlc id="value" param1="copyright" /> </p>
<p> <vlc id="value" param1="copyright" /> </p>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment