Commit e92510e2 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: you can now specify input options in the stream output MRL as well.
* modules/misc/freetype.c: bail out if no font has been specified.
* modules/demux/util/sub.h: don't forget to detach the demuxsub object.
parent beab78a9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* sub.h * sub.h
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: sub.h,v 1.5 2003/07/23 23:05:25 gbazin Exp $ * $Id: sub.h,v 1.6 2003/07/24 21:50:28 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -148,6 +148,7 @@ static inline ...@@ -148,6 +148,7 @@ static inline
else else
{ {
msg_Warn( p_input, "failed to start subtitle demux" ); msg_Warn( p_input, "failed to start subtitle demux" );
vlc_object_detach( p_sub );
if( p_sub->p_module ) if( p_sub->p_module )
{ {
module_Unneed( p_sub, p_sub->p_module ); module_Unneed( p_sub, p_sub->p_module );
...@@ -193,12 +194,13 @@ static inline int subtitle_Seek( subtitle_demux_t *p_sub, mtime_t i_date ) ...@@ -193,12 +194,13 @@ static inline int subtitle_Seek( subtitle_demux_t *p_sub, mtime_t i_date )
static inline void subtitle_Close( subtitle_demux_t *p_sub ) static inline void subtitle_Close( subtitle_demux_t *p_sub )
{ {
msg_Info( p_sub, "subtitle stopped" ); msg_Info( p_sub, "subtitle stopped" );
if( p_sub->p_module )
{
module_Unneed( p_sub, p_sub->p_module );
}
if( p_sub ) if( p_sub )
{ {
vlc_object_detach( p_sub );
if( p_sub->p_module )
{
module_Unneed( p_sub, p_sub->p_module );
}
vlc_object_destroy( p_sub ); vlc_object_destroy( p_sub );
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.31 2003/07/24 17:31:59 gbazin Exp $ * $Id: open.cpp,v 1.32 2003/07/24 21:50:28 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -588,54 +588,6 @@ void OpenDialog::UpdateMRL( int i_access_method ) ...@@ -588,54 +588,6 @@ void OpenDialog::UpdateMRL( int i_access_method )
mrl_combo->SetValue( mrltemp ); mrl_combo->SetValue( mrltemp );
} }
wxArrayString OpenDialog::SeparateEntries( wxString entries )
{
vlc_bool_t b_quotes_mode = VLC_FALSE;
wxArrayString entries_array;
wxString entry;
wxStringTokenizer token( entries, wxT(" \t\r\n\""), wxTOKEN_RET_DELIMS );
while( token.HasMoreTokens() )
{
entry += token.GetNextToken();
if( entry.IsEmpty() ) continue;
if( !b_quotes_mode && entry.Last() == wxT('\"') )
{
/* Enters quotes mode */
entry.RemoveLast();
b_quotes_mode = VLC_TRUE;
}
else if( b_quotes_mode && entry.Last() == wxT('\"') )
{
/* Finished the quotes mode */
entry.RemoveLast();
if( !entry.IsEmpty() ) entries_array.Add( entry );
entry.Empty();
b_quotes_mode = VLC_FALSE;
}
else if( !b_quotes_mode && entry.Last() != wxT('\"') )
{
/* we found a non-quoted standalone string */
if( token.HasMoreTokens() ||
entry.Last() == wxT(' ') || entry.Last() == wxT('\t') ||
entry.Last() == wxT('\r') || entry.Last() == wxT('\n') )
entry.RemoveLast();
if( !entry.IsEmpty() ) entries_array.Add( entry );
entry.Empty();
}
else
{;}
}
if( !entry.IsEmpty() ) entries_array.Add( entry );
return entries_array;
}
/***************************************************************************** /*****************************************************************************
* Events methods. * Events methods.
*****************************************************************************/ *****************************************************************************/
...@@ -900,8 +852,7 @@ void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) ) ...@@ -900,8 +852,7 @@ void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) )
if( sout_dialog && sout_dialog->ShowModal() == wxID_OK ) if( sout_dialog && sout_dialog->ShowModal() == wxID_OK )
{ {
sout_mrl.Empty(); sout_mrl = sout_dialog->GetOptions();
sout_mrl.Add( wxString(wxT("sout=")) + sout_dialog->mrl );
} }
} }
...@@ -945,3 +896,54 @@ void OpenDialog::OnDemuxDumpChange( wxCommandEvent& WXUNUSED(event) ) ...@@ -945,3 +896,54 @@ void OpenDialog::OnDemuxDumpChange( wxCommandEvent& WXUNUSED(event) )
config_PutPsz( p_intf, "demuxdump-file", config_PutPsz( p_intf, "demuxdump-file",
demuxdump_textctrl->GetValue().mb_str() ); demuxdump_textctrl->GetValue().mb_str() );
} }
/*****************************************************************************
* Utility functions.
*****************************************************************************/
wxArrayString SeparateEntries( wxString entries )
{
vlc_bool_t b_quotes_mode = VLC_FALSE;
wxArrayString entries_array;
wxString entry;
wxStringTokenizer token( entries, wxT(" \t\r\n\""), wxTOKEN_RET_DELIMS );
while( token.HasMoreTokens() )
{
entry += token.GetNextToken();
if( entry.IsEmpty() ) continue;
if( !b_quotes_mode && entry.Last() == wxT('\"') )
{
/* Enters quotes mode */
entry.RemoveLast();
b_quotes_mode = VLC_TRUE;
}
else if( b_quotes_mode && entry.Last() == wxT('\"') )
{
/* Finished the quotes mode */
entry.RemoveLast();
if( !entry.IsEmpty() ) entries_array.Add( entry );
entry.Empty();
b_quotes_mode = VLC_FALSE;
}
else if( !b_quotes_mode && entry.Last() != wxT('\"') )
{
/* we found a non-quoted standalone string */
if( token.HasMoreTokens() ||
entry.Last() == wxT(' ') || entry.Last() == wxT('\t') ||
entry.Last() == wxT('\r') || entry.Last() == wxT('\n') )
entry.RemoveLast();
if( !entry.IsEmpty() ) entries_array.Add( entry );
entry.Empty();
}
else
{;}
}
if( !entry.IsEmpty() ) entries_array.Add( entry );
return entries_array;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc * streamout.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.26 2003/07/20 21:28:52 gbazin Exp $ * $Id: streamout.cpp,v 1.27 2003/07/24 21:50:28 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -49,10 +49,6 @@ ...@@ -49,10 +49,6 @@
#include <vlc/intf.h> #include <vlc/intf.h>
#if defined MODULE_NAME_IS_skins
# include "../skins/src/skin_common.h"
#endif
#include "wxwindows.h" #include "wxwindows.h"
#ifndef wxRB_SINGLE #ifndef wxRB_SINGLE
...@@ -249,6 +245,11 @@ SoutDialog::~SoutDialog() ...@@ -249,6 +245,11 @@ SoutDialog::~SoutDialog()
{ {
} }
wxArrayString SoutDialog::GetOptions()
{
return SeparateEntries( mrl_combo->GetValue() );
}
/***************************************************************************** /*****************************************************************************
* Private methods. * Private methods.
*****************************************************************************/ *****************************************************************************/
...@@ -361,7 +362,7 @@ void SoutDialog::UpdateMRL() ...@@ -361,7 +362,7 @@ void SoutDialog::UpdateMRL()
} }
if( !transcode.IsEmpty() || !duplicate.IsEmpty() ) if( !transcode.IsEmpty() || !duplicate.IsEmpty() )
mrl_combo->SetValue( wxT("#") + transcode + duplicate ); mrl_combo->SetValue( wxT(":sout=#") + transcode + duplicate );
else else
mrl_combo->SetValue( wxT("") ); mrl_combo->SetValue( wxT("") );
} }
...@@ -710,9 +711,7 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent ) ...@@ -710,9 +711,7 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent )
void SoutDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) void SoutDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
{ {
mrl_combo->Append( mrl_combo->GetValue() ); mrl_combo->Append( mrl_combo->GetValue() );
mrl = mrl_combo->GetValue();
EndModal( wxID_OK ); EndModal( wxID_OK );
} }
void SoutDialog::OnCancel( wxCommandEvent& WXUNUSED(event) ) void SoutDialog::OnCancel( wxCommandEvent& WXUNUSED(event) )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.48 2003/07/24 16:07:10 gbazin Exp $ * $Id: wxwindows.h,v 1.49 2003/07/24 21:50:28 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -65,7 +65,8 @@ class FileInfo; ...@@ -65,7 +65,8 @@ class FileInfo;
#endif #endif
#if !defined(MODULE_NAME_IS_skins) wxArrayString SeparateEntries( wxString );
/***************************************************************************** /*****************************************************************************
* intf_sys_t: description and status of wxwindows interface * intf_sys_t: description and status of wxwindows interface
*****************************************************************************/ *****************************************************************************/
...@@ -100,7 +101,6 @@ struct intf_sys_t ...@@ -100,7 +101,6 @@ struct intf_sys_t
wxMenu *p_popup_menu; wxMenu *p_popup_menu;
}; };
#endif /* !defined(MODULE_NAME_IS_skins) */
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
...@@ -259,7 +259,6 @@ private: ...@@ -259,7 +259,6 @@ private:
wxPanel *SatPanel( wxWindow* parent ); wxPanel *SatPanel( wxWindow* parent );
void UpdateMRL( int i_access_method ); void UpdateMRL( int i_access_method );
wxArrayString SeparateEntries( wxString );
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
void OnOk( wxCommandEvent& event ); void OnOk( wxCommandEvent& event );
...@@ -347,7 +346,7 @@ public: ...@@ -347,7 +346,7 @@ public:
SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent ); SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
virtual ~SoutDialog(); virtual ~SoutDialog();
wxString mrl; wxArrayString GetOptions();
private: private:
void UpdateMRL(); void UpdateMRL();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* freetype.c : Put text on the video, using freetype2 * freetype.c : Put text on the video, using freetype2
***************************************************************************** *****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN * Copyright (C) 2002, 2003 VideoLAN
* $Id: freetype.c,v 1.12 2003/07/24 19:30:27 sigmunau Exp $ * $Id: freetype.c,v 1.13 2003/07/24 21:50:28 gbazin Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -154,6 +154,10 @@ static int Create( vlc_object_t *p_this ) ...@@ -154,6 +154,10 @@ static int Create( vlc_object_t *p_this )
strcat( psz_fontfile, "\\fonts\\arial.ttf" ); strcat( psz_fontfile, "\\fonts\\arial.ttf" );
#elif SYS_DARWIN #elif SYS_DARWIN
strcpy( psz_fontfile, DEFAULT_FONT ); strcpy( psz_fontfile, DEFAULT_FONT );
#else
msg_Err( p_vout, "user didn't specify a font" );
free( p_vout->p_text_renderer_data );
return VLC_EGENERIC;
#endif #endif
} }
......
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