Commit cf9e0c81 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

MKV USF subtitles support and other Subtitles improvements.

Patch by Bernie Purcell, with two small modifications by thedj.
parent c3ce1f59
...@@ -35,6 +35,7 @@ Input/Demuxers: ...@@ -35,6 +35,7 @@ Input/Demuxers:
Decoders: Decoders:
* VP60/VP61 codecs support * VP60/VP61 codecs support
* Teletext subtitles (telx) support * Teletext subtitles (telx) support
* MKV USF subtitles support
Video output: Video output:
* Adjust, Invert and Distort (now splitted into Wave, Ripple, Gradient * Adjust, Invert and Distort (now splitted into Wave, Ripple, Gradient
...@@ -43,6 +44,7 @@ Video output: ...@@ -43,6 +44,7 @@ Video output:
* Rewrite motion detection video filter * Rewrite motion detection video filter
* New extract video filter (extract Red, Green and Blue components from a video) * New extract video filter (extract Red, Green and Blue components from a video)
* New sharpen video filter (increase the contrast of adjacent pixels) * New sharpen video filter (increase the contrast of adjacent pixels)
* Enhancements to subtitles' renderer to support bold, italics and some HTML tags
Stream output: Stream output:
* UDP-Lite (requires OS support) for RTP/TS encapsulation * UDP-Lite (requires OS support) for RTP/TS encapsulation
......
...@@ -30,6 +30,7 @@ Basil Achermann <vlc at acherma dot com> - Patch to handle esc and space key eve ...@@ -30,6 +30,7 @@ Basil Achermann <vlc at acherma dot com> - Patch to handle esc and space key eve
Barak Ori <barakori at gmail dot com> - Bidi fixes Barak Ori <barakori at gmail dot com> - Bidi fixes
Benjamin Mironer <bmironer at noos.fr> - Mac OS X fixes Benjamin Mironer <bmironer at noos.fr> - Mac OS X fixes
Benoit Steiner <benny at via.ecp.fr> - MPEG system input, network input Benoit Steiner <benny at via.ecp.fr> - MPEG system input, network input
Bernie Purcell <b dot purcell at adbglobal dot com> - MKV USF subtitles support,HTML tags for subtitles and subtitles renderer enhancements
Bill <wenwuangel at hotmail .com> - memleak fixes Bill <wenwuangel at hotmail .com> - memleak fixes
Bill Eldridge <bill at rfa.org> - documentation Bill Eldridge <bill at rfa.org> - documentation
Bob Maguire <maguirer at rjmaguire dot com> - addition of some controls to the OSX interface Bob Maguire <maguirer at rjmaguire dot com> - addition of some controls to the OSX interface
......
...@@ -3948,6 +3948,9 @@ then ...@@ -3948,6 +3948,9 @@ then
VLC_ADD_PLUGINS([freetype]) VLC_ADD_PLUGINS([freetype])
VLC_ADD_CFLAGS([freetype],[`${FREETYPE_CONFIG} --cflags`]) VLC_ADD_CFLAGS([freetype],[`${FREETYPE_CONFIG} --cflags`])
VLC_ADD_LDFLAGS([freetype],[`${FREETYPE_CONFIG} --libs`]) VLC_ADD_LDFLAGS([freetype],[`${FREETYPE_CONFIG} --libs`])
AC_CHECK_HEADERS(fontconfig/fontconfig.h,
[VLC_ADD_CFLAGS([freetype],[-DHAVE_FONTCONFIG])
VLC_ADD_LDFLAGS([freetype],[-lfontconfig])])
AC_CHECK_HEADERS(Carbon/Carbon.h, AC_CHECK_HEADERS(Carbon/Carbon.h,
[VLC_ADD_LDFLAGS([freetype],[-framework Carbon])]) [VLC_ADD_LDFLAGS([freetype],[-framework Carbon])])
elif test "${enable_freetype}" = "yes" elif test "${enable_freetype}" = "yes"
......
...@@ -68,6 +68,8 @@ struct filter_t ...@@ -68,6 +68,8 @@ struct filter_t
subpicture_t * ( *pf_sub_filter ) ( filter_t *, mtime_t ); subpicture_t * ( *pf_sub_filter ) ( filter_t *, mtime_t );
int ( *pf_render_text ) ( filter_t *, subpicture_region_t *, int ( *pf_render_text ) ( filter_t *, subpicture_region_t *,
subpicture_region_t * ); subpicture_region_t * );
int ( *pf_render_html ) ( filter_t *, subpicture_region_t *,
subpicture_region_t * );
/* /*
* Buffers allocation * Buffers allocation
......
...@@ -213,6 +213,7 @@ struct subpicture_region_t ...@@ -213,6 +213,7 @@ struct subpicture_region_t
int i_align; /**< alignment within a region */ int i_align; /**< alignment within a region */
char *psz_text; /**< text string comprising this region */ char *psz_text; /**< text string comprising this region */
char *psz_html; /**< HTML version of subtitle (NULL = use psz_text) */
text_style_t *p_style; /* a description of the text style formatting */ text_style_t *p_style; /* a description of the text style formatting */
subpicture_region_t *p_next; /**< next region in the list */ subpicture_region_t *p_next; /**< next region in the list */
......
This diff is collapsed.
...@@ -2489,6 +2489,17 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -2489,6 +2489,17 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's', 'u', 'b', 't' ); tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's', 'u', 'b', 't' );
tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" ); tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
} }
else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/USF" ) )
{
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'u', 's', 'f', ' ' );
tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
if( tracks[i_track]->i_extra_data )
{
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra, tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
}
}
else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/SSA" ) || else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/SSA" ) ||
!strcmp( tracks[i_track]->psz_codec, "S_TEXT/ASS" ) || !strcmp( tracks[i_track]->psz_codec, "S_TEXT/ASS" ) ||
!strcmp( tracks[i_track]->psz_codec, "S_SSA" ) || !strcmp( tracks[i_track]->psz_codec, "S_SSA" ) ||
......
...@@ -35,6 +35,7 @@ int E_(OpenRenderer)( vlc_object_t *p_this ) ...@@ -35,6 +35,7 @@ int E_(OpenRenderer)( vlc_object_t *p_this )
{ {
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
p_filter->pf_render_text = RenderText; p_filter->pf_render_text = RenderText;
p_filter->pf_render_html = NULL;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
This diff is collapsed.
...@@ -145,6 +145,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -145,6 +145,7 @@ static int Create( vlc_object_t *p_this )
p_sys->i_height = p_filter->fmt_out.video.i_height; p_sys->i_height = p_filter->fmt_out.video.i_height;
p_filter->pf_render_text = RenderText; p_filter->pf_render_text = RenderText;
p_filter->pf_render_html = NULL;
p_filter->p_sys = p_sys; p_filter->p_sys = p_sys;
/* MUST call this before any RSVG funcs */ /* MUST call this before any RSVG funcs */
......
...@@ -184,6 +184,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -184,6 +184,7 @@ static int Create( vlc_object_t *p_this )
if( psz_fontfile ) free( psz_fontfile ); if( psz_fontfile ) free( psz_fontfile );
p_filter->pf_render_text = RenderText; p_filter->pf_render_text = RenderText;
p_filter->pf_render_html = NULL;
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
......
...@@ -629,14 +629,22 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt, ...@@ -629,14 +629,22 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
if( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') ) if( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') )
{ {
if( p_spu->p_text && p_spu->p_text->p_module && if( p_spu->p_text && p_spu->p_text->p_module )
p_spu->p_text->pf_render_text )
{ {
p_region->i_align = p_subpic->i_flags; p_region->i_align = p_subpic->i_flags;
if( p_spu->p_text->pf_render_html && p_region->psz_html )
{
p_spu->p_text->pf_render_html( p_spu->p_text,
p_region, p_region );
}
else if( p_spu->p_text->pf_render_text )
{
p_spu->p_text->pf_render_text( p_spu->p_text, p_spu->p_text->pf_render_text( p_spu->p_text,
p_region, p_region ); p_region, p_region );
} }
} }
}
/* Force palette if requested */ /* Force palette if requested */
if( p_spu->b_force_palette && VLC_FOURCC('Y','U','V','P') == if( p_spu->b_force_palette && VLC_FOURCC('Y','U','V','P') ==
......
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