Changeset 48190fd306402746f081f290f0223642b1dfeecf

Show
Ignore:
Timestamp:
05/11/03 18:57:29 (5 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1068055049 +0000
git-parent:

[64336427c00672d4c2d15dbb6691e6d57a00e4e7]

git-author:
Gildas Bazin <gbazin@videolan.org> 1068055049 +0000
Message:

* src/input/input.c: honor the --demux config option (will be overriden if demux is specified in the MRL).

I'm not exactly sure this is wise as some users will surely fuck-up their preferences and force a specific demux...
but this also allows me to specifiy the demuxdump demux with an input option (very handy to include the demuxdump option in the streamout gui dialogs).

* src/misc/modules.c: changed module_Need() to use var_Get() instead of config_Get.

* modules/gui/wxwindows/*: moved the demuxdump option from the open dialog to the streamout dialog.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/demuxdump.c

    r091aff7 r48190fd  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: demuxdump.c,v 1.10 2003/09/07 22:48:29 fenrir Exp $ 
     5 * $Id: demuxdump.c,v 1.11 2003/11/05 17:57:29 gbazin Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    8080    input_thread_t      *p_input = (input_thread_t *)p_this; 
    8181    demux_sys_t         *p_demux; 
    82  
     82    vlc_value_t         val; 
    8383    char                *psz_name; 
    8484 
     
    9494    } 
    9595     
    96     psz_name = config_GetPsz( p_input, "demuxdump-file" ); 
     96    var_Create( p_input, "demuxdump-file", VLC_VAR_FILE|VLC_VAR_DOINHERIT ); 
     97    var_Get( p_input, "demuxdump-file", &val ); 
     98    psz_name = val.psz_string; 
    9799    if( !psz_name || !*psz_name ) 
    98100    { 
  • modules/gui/wxwindows/open.cpp

    r84b846b r48190fd  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: open.cpp,v 1.39 2003/10/29 17:32:54 zorglub Exp $ 
     5 * $Id: open.cpp,v 1.40 2003/11/05 17:57:29 gbazin Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    9292    SoutEnable_Event, 
    9393    SoutSettings_Event, 
    94  
    95     DemuxDump_Event, 
    96     DemuxDumpEnable_Event, 
    97     DemuxDumpBrowse_Event, 
    9894}; 
    9995 
     
    148144    EVT_BUTTON(SoutSettings_Event, OpenDialog::OnSoutSettings) 
    149145 
    150     /* Events generated by the demux dump buttons */ 
    151     EVT_CHECKBOX(DemuxDumpEnable_Event, OpenDialog::OnDemuxDumpEnable) 
    152     EVT_TEXT(DemuxDump_Event, OpenDialog::OnDemuxDumpChange) 
    153     EVT_BUTTON(DemuxDumpBrowse_Event, OpenDialog::OnDemuxDumpBrowse) 
    154  
    155146    /* Hide the window when the user closes the window */ 
    156147    EVT_CLOSE(OpenDialog::OnCancel) 
     
    185176    sout_dialog = NULL; 
    186177    subsfile_dialog = NULL; 
    187     demuxdump_dialog = NULL; 
    188178 
    189179    /* Create a panel to put everything in */ 
     
    217207 
    218208    wxFlexGridSizer *sout_sizer = NULL; 
    219     wxBoxSizer *demuxdump_sizer = NULL; 
    220209    wxStaticLine *static_line = NULL; 
    221  
    222     demuxdump_checkbox = NULL; 
    223     demuxdump_textctrl = NULL; 
    224210 
    225211    if( i_method == OPEN_NORMAL ) 
     
    249235        sout_sizer->Add( sout_button, 1, wxALIGN_LEFT | 
    250236                         wxALIGN_CENTER_VERTICAL ); 
    251  
    252         /* Create Demux Dump checkox */ 
    253         demuxdump_sizer = new wxBoxSizer( wxHORIZONTAL ); 
    254         demuxdump_checkbox = new wxCheckBox( panel, DemuxDumpEnable_Event, 
    255                                    wxU(_("Capture input stream")) ); 
    256         demuxdump_checkbox->SetToolTip( 
    257              wxU(_("Capture the stream you are playing to a file")) ); 
    258         demuxdump_textctrl = new wxTextCtrl( panel, DemuxDump_Event, wxT(""), 
    259                                              wxDefaultPosition, wxDefaultSize, 
    260                                              wxTE_PROCESS_ENTER ); 
    261        demuxdump_button = new wxButton( panel, DemuxDumpBrowse_Event, 
    262                                          wxU(_("Browse...")) ); 
    263  
    264         char *psz_demuxdump = config_GetPsz( p_intf, "demuxdump-file" ); 
    265         if( psz_demuxdump && *psz_demuxdump ) 
    266         { 
    267             demuxdump_textctrl->SetValue( wxU(psz_demuxdump) ); 
    268         } 
    269         if( psz_demuxdump ) free( psz_demuxdump ); 
    270  
    271         demuxdump_textctrl->Disable(); 
    272         demuxdump_button->Disable(); 
    273         demuxdump_sizer->Add( demuxdump_checkbox, 0, 
    274                                wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); 
    275         demuxdump_sizer->Add( demuxdump_button, 0, 
    276                               wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 10 ); 
    277         demuxdump_sizer->Add( demuxdump_textctrl, 1, wxRIGHT, 10 ); 
    278237 
    279238        /* Separation */ 
     
    336295    { 
    337296        panel_sizer->Add( sout_sizer, 0, wxALIGN_LEFT | wxALL, 5 ); 
    338         panel_sizer->Add( demuxdump_sizer, 0, wxEXPAND | wxALIGN_LEFT 
    339                           | wxALL, 5 ); 
    340297        panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 ); 
    341298    } 
     
    357314    if( sout_dialog ) delete sout_dialog; 
    358315    if( subsfile_dialog ) delete subsfile_dialog; 
    359     if( demuxdump_dialog ) delete demuxdump_dialog; 
    360316} 
    361317 
     
    640596    i_current_access_method = i_access_method; 
    641597 
    642     /* Check if the user asked for demuxdump */ 
    643     if( demuxdump_checkbox ) 
    644     { 
    645         if( demuxdump_checkbox->GetValue() ) 
    646         { 
    647             demux = wxT("/demuxdump"); 
    648         } 
    649     } 
    650598    switch( i_access_method ) 
    651599    { 
     
    1014962{ 
    1015963    subsfile_button->Enable( event.GetInt() != 0 ); 
    1016     if( demuxdump_checkbox ) 
    1017     { 
    1018         if( event.GetInt() && demuxdump_checkbox->IsChecked() ) 
    1019         { 
    1020             demuxdump_checkbox->SetValue( 0 ); 
    1021             wxCommandEvent event = wxCommandEvent( wxEVT_NULL ); 
    1022             event.SetInt( 0 ); 
    1023             OnDemuxDumpEnable( event ); 
    1024         } 
    1025     } 
    1026964} 
    1027965 
     
    1053991{ 
    1054992    sout_button->Enable( event.GetInt() != 0 ); 
    1055     if( event.GetInt() && demuxdump_checkbox->IsChecked() ) 
    1056     { 
    1057         demuxdump_checkbox->SetValue( 0 ); 
    1058         wxCommandEvent event = wxCommandEvent( wxEVT_NULL ); 
    1059         event.SetInt( 0 ); 
    1060         OnDemuxDumpEnable( event ); 
    1061     } 
    1062993} 
    1063994 
     
    10721003        sout_mrl = sout_dialog->GetOptions(); 
    10731004    } 
    1074 } 
    1075  
    1076 /***************************************************************************** 
    1077  * Demux dump event methods. 
    1078  *****************************************************************************/ 
    1079 void OpenDialog::OnDemuxDumpEnable( wxCommandEvent& event ) 
    1080 { 
    1081     demuxdump_textctrl->Enable( event.GetInt() != 0 ); 
    1082     demuxdump_button->Enable( event.GetInt() != 0 ); 
    1083  
    1084     if( event.GetInt() ) 
    1085     { 
    1086         sout_checkbox->SetValue( 0 ); 
    1087         subsfile_checkbox->SetValue( 0 ); 
    1088         wxCommandEvent event = wxCommandEvent( wxEVT_NULL ); 
    1089         event.SetInt( 0 ); 
    1090         OnSoutEnable( event ); 
    1091         OnSubsFileEnable( event ); 
    1092     } 
    1093  
    1094     UpdateMRL( i_current_access_method ); 
    1095 } 
    1096  
    1097 void OpenDialog::OnDemuxDumpBrowse( wxCommandEvent& WXUNUSED(event) ) 
    1098 { 
    1099     if( demuxdump_dialog == NULL ) 
    1100         demuxdump_dialog = new wxFileDialog( this, wxU(_("Save file")), 
    1101                                wxT(""), wxT(""), wxT("*"), wxSAVE ); 
    1102  
    1103     if( demuxdump_dialog && demuxdump_dialog->ShowModal() == wxID_OK ) 
    1104     { 
    1105         demuxdump_textctrl->SetValue( demuxdump_dialog->GetPath() ); 
    1106         wxCommandEvent event = wxCommandEvent( wxEVT_NULL ); 
    1107         OnDemuxDumpChange( event ); 
    1108     } 
    1109 } 
    1110  
    1111 void OpenDialog::OnDemuxDumpChange( wxCommandEvent& WXUNUSED(event) ) 
    1112 { 
    1113     config_PutPsz( p_intf, "demuxdump-file", 
    1114                    demuxdump_textctrl->GetValue().mb_str() ); 
    11151005} 
    11161006 
  • modules/gui/wxwindows/streamout.cpp

    rfe3f88c r48190fd  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: streamout.cpp,v 1.33 2003/10/27 22:13:36 gbazin Exp $ 
     5 * $Id: streamout.cpp,v 1.34 2003/11/05 17:57:29 gbazin Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    5656    FileBrowse_Event, 
    5757    FileName_Event, 
     58    FileDump_Event, 
    5859 
    5960    AccessType1_Event, AccessType2_Event, AccessType3_Event, 
     
    8889    EVT_TEXT(FileName_Event, SoutDialog::OnFileChange) 
    8990    EVT_BUTTON(FileBrowse_Event, SoutDialog::OnFileBrowse) 
     91    EVT_CHECKBOX(FileDump_Event, SoutDialog::OnFileDump) 
    9092 
    9193    EVT_TEXT(NetPort1_Event, SoutDialog::OnNetChange) 
     
    137139END_EVENT_TABLE() 
    138140 
     141#if 0 
     142/***************************************************************************** 
     143 * Demux dump event methods. 
     144 *****************************************************************************/ 
     145void OpenDialog::OnDemuxDumpEnable( wxCommandEvent& event ) 
     146{ 
     147    demuxdump_textctrl->Enable( event.GetInt() != 0 ); 
     148    demuxdump_button->Enable( event.GetInt() != 0 ); 
     149 
     150    if( event.GetInt() ) 
     151    { 
     152        sout_checkbox->SetValue( 0 ); 
     153        subsfile_checkbox->SetValue( 0 ); 
     154        wxCommandEvent event = wxCommandEvent( wxEVT_NULL ); 
     155        event.SetInt( 0 ); 
     156        OnSoutEnable( event ); 
     157        OnSubsFileEnable( event ); 
     158    } 
     159 
     160    UpdateMRL( i_current_access_method ); 
     161} 
     162 
     163void OpenDialog::OnDemuxDumpChange( wxCommandEvent& WXUNUSED(event) ) 
     164{ 
     165} 
     166#endif 
     167 
    139168/***************************************************************************** 
    140169 * Constructor. 
     
    172201 
    173202    /* Create the output encapsulation panel */ 
    174     wxPanel *encapsulation_panel = EncapsulationPanel( panel ); 
     203    encapsulation_panel = EncapsulationPanel( panel ); 
    175204 
    176205    /* Create the access output panel */ 
    177     wxPanel *access_panel = AccessPanel( panel ); 
     206    access_panel = AccessPanel( panel ); 
    178207 
    179208    /* Create the transcoding panel */ 
    180     wxPanel *transcoding_panel = TranscodingPanel( panel ); 
     209    transcoding_panel = TranscodingPanel( panel ); 
    181210 
    182211    /* Create the Misc panel */ 
    183     wxPanel *misc_panel = MiscPanel( panel ); 
     212    misc_panel = MiscPanel( panel ); 
    184213 
    185214    /* Separation */ 
     
    228257void SoutDialog::UpdateMRL() 
    229258{ 
     259    /* Check the demux dump option */ 
     260    if( dump_checkbox->IsChecked() ) 
     261    { 
     262        wxString dumpfile; 
     263 
     264        if( file_combo->GetValue().size() ) 
     265            dumpfile = wxT(" :demuxdump-file=\"") + 
     266                       file_combo->GetValue() + wxT("\""); 
     267        mrl_combo->SetValue( wxT(":demux=demuxdump") + dumpfile ); 
     268 
     269        return; 
     270    } 
     271 
    230272    /* Let's start with the transcode options */ 
    231273    wxString transcode; 
     
    405447 
    406448    /* File row */ 
    407     subpanel_sizer = new wxFlexGridSizer( 3, 1, 20 ); 
     449    subpanel_sizer = new wxFlexGridSizer( 3, 2, 20 ); 
    408450    label = new wxStaticText( access_subpanels[1], -1, wxU(_("Filename")) ); 
    409451    file_combo = new wxComboBox( access_subpanels[1], FileName_Event, wxT(""), 
     
    416458    subpanel_sizer->Add( browse_button, 0, 
    417459                         wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); 
     460    subpanel_sizer->Add( new wxPanel(access_subpanels[1], -1), 0, 
     461                         wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); 
     462    subpanel_sizer->Add( new wxPanel(access_subpanels[1], -1), 0, 
     463                         wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); 
     464    dump_checkbox = new wxCheckBox( access_subpanels[1], FileDump_Event, 
     465                                    wxU(_("Dump raw input")) ); 
     466    subpanel_sizer->Add( dump_checkbox, 0, 
     467                         wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxTOP, 5 ); 
    418468 
    419469    access_subpanels[1]->SetSizerAndFit( subpanel_sizer ); 
     
    818868} 
    819869 
     870void SoutDialog::OnFileDump( wxCommandEvent& event ) 
     871{ 
     872    misc_panel->Enable( !event.GetInt() ); 
     873    encapsulation_panel->Enable( !event.GetInt() ); 
     874    transcoding_panel->Enable( !event.GetInt() ); 
     875 
     876    for( int i = 0; i < ACCESS_OUT_NUM; i++ ) 
     877    { 
     878        if( i != FILE_ACCESS_OUT ) 
     879        { 
     880            access_subpanels[i]->Enable( !event.GetInt() ); 
     881            access_checkboxes[i]->Enable( !event.GetInt() ); 
     882        } 
     883    } 
     884 
     885    UpdateMRL(); 
     886} 
     887 
    820888/***************************************************************************** 
    821889 * Net access output event methods. 
  • modules/gui/wxwindows/wxwindows.h

    r84b846b r48190fd  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: wxwindows.h,v 1.66 2003/10/29 17:32:54 zorglub Exp $ 
     5 * $Id: wxwindows.h,v 1.67 2003/11/05 17:57:29 gbazin Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    352352    void OnSoutSettings( wxCommandEvent& WXUNUSED(event) ); 
    353353 
    354     /* Event handlers for the demux dump */ 
    355     void OnDemuxDumpEnable( wxCommandEvent& event ); 
    356     void OnDemuxDumpBrowse( wxCommandEvent& event ); 
    357     void OnDemuxDumpChange( wxCommandEvent& event ); 
    358  
    359354    DECLARE_EVENT_TABLE(); 
    360355 
     
    407402    SoutDialog *sout_dialog; 
    408403    wxArrayString sout_mrl; 
    409  
    410     /* Controls for the demux dump */ 
    411     wxTextCtrl *demuxdump_textctrl; 
    412     wxButton *demuxdump_button; 
    413     wxCheckBox *demuxdump_checkbox; 
    414     wxFileDialog *demuxdump_dialog; 
    415404}; 
    416405 
     
    550539    void OnFileChange( wxCommandEvent& event ); 
    551540    void OnFileBrowse( wxCommandEvent& event ); 
     541    void OnFileDump( wxCommandEvent& event ); 
    552542 
    553543    /* Event handlers for the net access output */ 
     
    576566 
    577567    /* Controls for the access outputs */ 
     568    wxPanel *access_panel; 
    578569    wxPanel *access_subpanels[ACCESS_OUT_NUM]; 
    579570    wxCheckBox *access_checkboxes[ACCESS_OUT_NUM]; 
     
    582573 
    583574    wxComboBox *file_combo; 
     575    wxCheckBox *dump_checkbox; 
    584576    wxSpinCtrl *net_ports[ACCESS_OUT_NUM]; 
    585577    wxTextCtrl *net_addrs[ACCESS_OUT_NUM]; 
    586578 
    587579    /* Controls for the SAP announces */ 
     580    wxPanel *misc_panel; 
    588581    wxPanel *misc_subpanels[MISC_SOUT_NUM]; 
    589582    wxCheckBox *sap_checkbox; 
     
    592585 
    593586    /* Controls for the encapsulation */ 
     587    wxPanel *encapsulation_panel; 
    594588    wxRadioButton *encapsulation_radios[ENCAPS_NUM]; 
    595589    int i_encapsulation_type; 
    596590 
    597591    /* Controls for transcoding */ 
     592    wxPanel *transcoding_panel; 
    598593    wxCheckBox *video_transc_checkbox; 
    599594    wxComboBox *video_codec_combo; 
  • src/input/input.c

    rea33ac4 r48190fd  
    55 ***************************************************************************** 
    66 * Copyright (C) 1998-2002 VideoLAN 
    7  * $Id: input.c,v 1.251 2003/11/04 02:23:11 fenrir Exp $ 
     7 * $Id: input.c,v 1.252 2003/11/05 17:57:29 gbazin Exp $ 
    88 * 
    99 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    707707 
    708708    /* Find and open appropriate demux module */ 
    709     p_input->p_demux = module_Need( p_input, "demux", 
    710                                     p_input->psz_demux ); 
     709    p_input->p_demux = 
     710        module_Need( p_input, "demux", 
     711                     (p_input->psz_demux && *p_input->psz_demux) ? 
     712                     p_input->psz_demux : "$demux" ); 
    711713 
    712714    if( p_input->p_demux == NULL ) 
     
    945947 
    946948    case VLC_VAR_STRING: 
     949    case VLC_VAR_MODULE: 
    947950    case VLC_VAR_FILE: 
    948951    case VLC_VAR_DIRECTORY: 
  • src/misc/configuration.c

    re53ac06 r48190fd  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: configuration.c,v 1.67 2003/11/05 00:39:17 gbazin Exp $ 
     5 * $Id: configuration.c,v 1.68 2003/11/05 17:57:29 gbazin Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    9696 
    9797    case CONFIG_ITEM_MODULE: 
     98        i_type = VLC_VAR_MODULE; 
     99        break; 
     100 
    98101    case CONFIG_ITEM_STRING: 
    99102        i_type = VLC_VAR_STRING; 
  • src/misc/modules.c

    r43a0fe3 r48190fd  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: modules.c,v 1.137 2003/10/07 09:32:48 gbazin Exp $ 
     5 * $Id: modules.c,v 1.138 2003/11/05 17:57:29 gbazin Exp $ 
    66 * 
    77 * Authors: Sam Hocevar <sam@zoy.org> 
     
    289289    if( psz_name && psz_name[0] == '$' ) 
    290290    { 
    291         psz_var = config_GetPsz( p_this, psz_name + 1 ); 
     291        vlc_value_t val; 
     292        var_Create( p_this, psz_name + 1, VLC_VAR_MODULE | VLC_VAR_DOINHERIT ); 
     293        var_Get( p_this, psz_name + 1, &val ); 
     294        psz_var = val.psz_string; 
    292295        psz_name = psz_var; 
    293296    } 
  • src/misc/variables.c

    r9097385 r48190fd  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: variables.c,v 1.33 2003/10/29 01:33:27 gbazin Exp $ 
     5 * $Id: variables.c,v 1.34 2003/11/05 17:57:29 gbazin Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    11571157        case VLC_VAR_DIRECTORY: 
    11581158        case VLC_VAR_STRING: 
     1159        case VLC_VAR_MODULE: 
    11591160            p_val->psz_string = config_GetPsz( p_this, psz_name ); 
    11601161            if( !p_val->psz_string ) p_val->psz_string = strdup("");