[vlc-devel] [PATCH] libvlc: add subtitle file (*.srt...) handling

Tanguy Krotoff tkrotoff at gmail.com
Wed May 7 21:10:26 CEST 2008


That's true
Btw, libvlc_video_get_spu() and libvlc_video_set_spu() could be
renamed since spu term is not very "talkative".
I don't even know what abbreviation spu is...

I plan also to add a function like libvlc_video_clear_subtitle(), if
the user select a subtitle and then change his mind by clearing it.

On Wed, May 7, 2008 at 8:44 AM, Jean-Paul Saman <jpsaman at videolan.org> wrote:
> Wouldn't it be better to use the name: libvlc_video_set_subtitle_file
>  and libvlc_video_get_subtitle_file to keep it distinct from subtitles
>  embedded in the stream.
>
>  Gtz
>  Jean-Paul Saman.
>
>
>
>  Tanguy Krotoff wrote:
>  > ---
>  >  include/vlc/libvlc.h |   10 ++++++++++
>  >  src/control/video.c  |   16 ++++++++++++++++
>  >  2 files changed, 26 insertions(+), 0 deletions(-)
>  >
>  > diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
>  > index 18797ad..be44aa7 100644
>  > --- a/include/vlc/libvlc.h
>  > +++ b/include/vlc/libvlc.h
>  > @@ -517,6 +517,16 @@ VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_excepti
>  >  VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
>  >
>  >  /**
>  > + * Set new video subtitle file.
>  > + *
>  > + * \param p_mediaplayer the media player
>  > + * \param psz_subtitle new video subtitle file
>  > + * \param p_e an initialized exception pointer
>  > + * \return the success status (boolean)
>  > + */
>  > +VLC_PUBLIC_API int libvlc_video_set_subtitle( libvlc_media_player_t *, char *, libvlc_exception_t * );
>  > +
>  > +/**
>  >   * Get current crop filter geometry.
>  >   *
>  >   * \param p_mediaplayer the media player
>  > diff --git a/src/control/video.c b/src/control/video.c
>  > index ed49da7..c61ad16 100644
>  > --- a/src/control/video.c
>  > +++ b/src/control/video.c
>  > @@ -450,6 +450,22 @@ void libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu,
>  >      vlc_object_release( p_input_thread );
>  >  }
>  >
>  > +int libvlc_video_set_subtitle( libvlc_media_player_t *p_mi,
>  > +                                char *psz_subtitle,
>  > +                                libvlc_exception_t *p_e )
>  > +{
>  > +    input_thread_t *p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
>  > +    bool b_ret = false;
>  > +
>  > +    if( p_input_thread )
>  > +    {
>  > +        if( input_AddSubtitles( p_input_thread, psz_subtitle, true ) )
>  > +            b_ret = true;
>  > +        vlc_object_release( p_input_thread );
>  > +    }
>  > +    return b_ret;
>  > +}
>  > +
>  >  char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi,
>  >                                     libvlc_exception_t *p_e )
>  >  {
>
>  _______________________________________________
>  vlc-devel mailing list
>  To unsubscribe or modify your subscription options:
>  http://mailman.videolan.org/listinfo/vlc-devel
>


-- 
Tanguy Krotoff <tkrotoff at gmail.com>
+33 6 68 42 70 24



More information about the vlc-devel mailing list