Commit 5851d9ab authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/streamout.cpp: updated the stream output dialog to use the new stream output syntax and features.
parent f6614cc4
...@@ -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.9 2003/05/12 17:33:19 gbazin Exp $ * $Id: streamout.cpp,v 1.10 2003/05/15 01:33:53 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -61,10 +61,12 @@ ...@@ -61,10 +61,12 @@
enum enum
{ {
FILE_ACCESS_OUT = 0, PLAY_ACCESS_OUT = 0,
FILE_ACCESS_OUT,
HTTP_ACCESS_OUT, HTTP_ACCESS_OUT,
UDP_ACCESS_OUT, UDP_ACCESS_OUT,
RTP_ACCESS_OUT RTP_ACCESS_OUT,
ACCESS_OUT_NUM
}; };
enum enum
...@@ -72,7 +74,9 @@ enum ...@@ -72,7 +74,9 @@ enum
TS_ENCAPSULATION = 0, TS_ENCAPSULATION = 0,
PS_ENCAPSULATION, PS_ENCAPSULATION,
AVI_ENCAPSULATION, AVI_ENCAPSULATION,
OGG_ENCAPSULATION MP4_ENCAPSULATION,
OGG_ENCAPSULATION,
ENCAPS_NUM
}; };
/***************************************************************************** /*****************************************************************************
...@@ -88,14 +92,17 @@ enum ...@@ -88,14 +92,17 @@ enum
FileBrowse_Event, FileBrowse_Event,
FileName_Event, FileName_Event,
AccessType_Event, AccessType1_Event, AccessType2_Event, AccessType3_Event,
AccessRadio1_Event, AccessRadio2_Event, AccessType4_Event, AccessType5_Event,
AccessRadio3_Event, AccessRadio4_Event,
NetPort_Event, NetPort_Event,
NetAddr_Event, NetAddr_Event,
EncapsulationRadio1_Event, EncapsulationRadio2_Event, EncapsulationRadio1_Event, EncapsulationRadio2_Event,
EncapsulationRadio3_Event, EncapsulationRadio4_Event, EncapsulationRadio3_Event, EncapsulationRadio4_Event,
EncapsulationRadio5_Event,
VideoTranscEnable_Event, VideoTranscCodec_Event, VideoTranscBitrate_Event,
AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
}; };
BEGIN_EVENT_TABLE(SoutDialog, wxDialog) BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
...@@ -104,10 +111,11 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog) ...@@ -104,10 +111,11 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, SoutDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, SoutDialog::OnCancel)
/* Events generated by the access output panel */ /* Events generated by the access output panel */
EVT_RADIOBUTTON(AccessRadio1_Event, SoutDialog::OnAccessTypeChange) EVT_CHECKBOX(AccessType1_Event, SoutDialog::OnAccessTypeChange)
EVT_RADIOBUTTON(AccessRadio2_Event, SoutDialog::OnAccessTypeChange) EVT_CHECKBOX(AccessType2_Event, SoutDialog::OnAccessTypeChange)
EVT_RADIOBUTTON(AccessRadio3_Event, SoutDialog::OnAccessTypeChange) EVT_CHECKBOX(AccessType3_Event, SoutDialog::OnAccessTypeChange)
EVT_RADIOBUTTON(AccessRadio4_Event, SoutDialog::OnAccessTypeChange) EVT_CHECKBOX(AccessType4_Event, SoutDialog::OnAccessTypeChange)
EVT_CHECKBOX(AccessType5_Event, SoutDialog::OnAccessTypeChange)
EVT_TEXT(FileName_Event, SoutDialog::OnFileChange) EVT_TEXT(FileName_Event, SoutDialog::OnFileChange)
EVT_BUTTON(FileBrowse_Event, SoutDialog::OnFileBrowse) EVT_BUTTON(FileBrowse_Event, SoutDialog::OnFileBrowse)
EVT_TEXT(NetPort_Event, SoutDialog::OnNetChange) EVT_TEXT(NetPort_Event, SoutDialog::OnNetChange)
...@@ -123,6 +131,16 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog) ...@@ -123,6 +131,16 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
SoutDialog::OnEncapsulationChange) SoutDialog::OnEncapsulationChange)
EVT_RADIOBUTTON(EncapsulationRadio4_Event, EVT_RADIOBUTTON(EncapsulationRadio4_Event,
SoutDialog::OnEncapsulationChange) SoutDialog::OnEncapsulationChange)
EVT_RADIOBUTTON(EncapsulationRadio5_Event,
SoutDialog::OnEncapsulationChange)
/* Events generated by the transcoding panel */
EVT_CHECKBOX(VideoTranscEnable_Event, SoutDialog::OnTranscodingEnable)
EVT_CHECKBOX(AudioTranscEnable_Event, SoutDialog::OnTranscodingEnable)
EVT_COMBOBOX(VideoTranscCodec_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(AudioTranscCodec_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(VideoTranscBitrate_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(AudioTranscBitrate_Event, SoutDialog::OnTranscodingChange)
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -161,10 +179,13 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -161,10 +179,13 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
mrl_sizer_sizer->Add( mrl_sizer, 1, wxEXPAND | wxALL, 5 ); mrl_sizer_sizer->Add( mrl_sizer, 1, wxEXPAND | wxALL, 5 );
/* Create the output encapsulation panel */ /* Create the output encapsulation panel */
encapsulation_panel = EncapsulationPanel( panel ); wxPanel *encapsulation_panel = EncapsulationPanel( panel );
/* Create the access output panel */ /* Create the access output panel */
access_panel = AccessPanel( panel ); wxPanel *access_panel = AccessPanel( panel );
/* Create the transcoding panel */
wxPanel *transcoding_panel = TranscodingPanel( panel );
/* Separation */ /* Separation */
wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK ); wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
...@@ -185,6 +206,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -185,6 +206,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 ); panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
panel_sizer->Add( access_panel, 1, wxEXPAND | wxALL, 5 ); panel_sizer->Add( access_panel, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( encapsulation_panel, 0, wxEXPAND | wxALL, 5 ); panel_sizer->Add( encapsulation_panel, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( transcoding_panel, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 ); panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM | panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM |
wxALL, 5 ); wxALL, 5 );
...@@ -207,47 +229,101 @@ SoutDialog::~SoutDialog() ...@@ -207,47 +229,101 @@ SoutDialog::~SoutDialog()
*****************************************************************************/ *****************************************************************************/
void SoutDialog::UpdateMRL() void SoutDialog::UpdateMRL()
{ {
wxString encapsulation; /* Let's start with the transcode options */
wxString transcode;
if( video_transc_checkbox->IsChecked() ||
audio_transc_checkbox->IsChecked() )
{
transcode = wxT("transcode{");
if( video_transc_checkbox->IsChecked() )
{
transcode += wxT("vcodec=") + video_codec_combo->GetValue();
transcode += wxT(",vb=") + video_bitrate_combo->GetValue();
if( audio_transc_checkbox->IsChecked() ) transcode += wxT(",");
}
if( audio_transc_checkbox->IsChecked() )
{
transcode += wxT("acodec=") + audio_codec_combo->GetValue();
transcode += wxT(",ab=") + audio_bitrate_combo->GetValue();
}
transcode += wxT("}");
}
/* Encapsulation */
wxString encapsulation;
switch( i_encapsulation_type ) switch( i_encapsulation_type )
{ {
case PS_ENCAPSULATION: case PS_ENCAPSULATION:
encapsulation = wxT("/ps"); encapsulation = wxT("ps");
break; break;
case AVI_ENCAPSULATION: case AVI_ENCAPSULATION:
encapsulation = wxT("/avi"); encapsulation = wxT("avi");
break; break;
case OGG_ENCAPSULATION: case OGG_ENCAPSULATION:
encapsulation = wxT("/ogg"); encapsulation = wxT("ogg");
break;
case MP4_ENCAPSULATION:
encapsulation = wxT("mp4");
break; break;
case TS_ENCAPSULATION: case TS_ENCAPSULATION:
default: default:
encapsulation = wxT("/ts"); encapsulation = wxT("ts");
break; break;
} }
switch( i_access_type ) /* Now continue with the duplicate option */
wxString dup_opts;
if( access_checkboxes[PLAY_ACCESS_OUT]->IsChecked() )
{ {
case FILE_ACCESS_OUT: dup_opts += wxT("dst=display");
mrl = wxT("file") + encapsulation + wxT(":") + file_combo->GetValue(); }
break; if( access_checkboxes[FILE_ACCESS_OUT]->IsChecked() )
{
case HTTP_ACCESS_OUT: if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
mrl = wxT("http") + encapsulation + wxT(":") + net_addr->GetLineText(0) dup_opts += wxT("dst=std{access=file,mux=");
+ wxString::Format( wxT(":%d"), net_port->GetValue() ); dup_opts += encapsulation + wxT(",url=");
break; dup_opts += file_combo->GetValue() + wxT("}");
}
if( access_checkboxes[HTTP_ACCESS_OUT]->IsChecked() )
{
if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
dup_opts += wxT("dst=std{access=http,mux=");
dup_opts += encapsulation + wxT(",url=");
dup_opts += net_addr->GetLineText(0);
dup_opts += wxString::Format( wxT(":%d"), net_port->GetValue() );
dup_opts += wxT("}");
}
if( access_checkboxes[UDP_ACCESS_OUT]->IsChecked() )
{
if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
dup_opts += wxT("dst=std{access=udp,mux=");
dup_opts += encapsulation + wxT(",url=");
dup_opts += net_addr->GetLineText(0);
dup_opts += wxString::Format( wxT(":%d"), net_port->GetValue() );
dup_opts += wxT("}");
}
if( access_checkboxes[UDP_ACCESS_OUT]->IsChecked() )
{
if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
dup_opts += wxT("dst=std{access=rtp,mux=");
dup_opts += encapsulation + wxT(",url=");
dup_opts += net_addr->GetLineText(0);
dup_opts += wxString::Format( wxT(":%d"), net_port->GetValue() );
dup_opts += wxT("}");
}
case UDP_ACCESS_OUT: wxString duplicate;
case RTP_ACCESS_OUT: if( !dup_opts.IsEmpty() )
mrl = ( i_access_type == UDP_ACCESS_OUT ) ? wxT("udp") : wxT("rtp"); {
mrl += encapsulation + wxT(":") + net_addr->GetLineText(0); if( !transcode.IsEmpty() ) duplicate = wxT(":");
if( net_port->GetValue() != config_GetInt( p_intf, "server-port" ) ) duplicate += wxT("duplicate{") + dup_opts + wxT("}");
{
mrl += wxString::Format( wxT(":%d"), net_port->GetValue() );
}
break;
} }
if( !transcode.IsEmpty() || !duplicate.IsEmpty() )
mrl = wxT("#") + transcode + duplicate;
else
mrl = wxT("");
mrl_combo->SetValue( mrl ); mrl_combo->SetValue( mrl );
} }
...@@ -259,37 +335,40 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent ) ...@@ -259,37 +335,40 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
wxFlexGridSizer *sizer = new wxFlexGridSizer( 2, 4, 20 ); wxFlexGridSizer *sizer = new wxFlexGridSizer( 2, 4, 20 );
wxStaticBox *panel_box = new wxStaticBox( panel, -1, wxStaticBox *panel_box = new wxStaticBox( panel, -1,
wxU(_("Output Method")) ); wxU(_("Output Methods")) );
wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box, wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
wxHORIZONTAL ); wxHORIZONTAL );
static const wxString access_output_array[] = static const wxString access_output_array[] =
{ {
wxU(_("Play locally")),
wxU(_("File")), wxU(_("File")),
wxU(_("HTTP")), wxU(_("HTTP")),
wxU(_("UDP")), wxU(_("UDP")),
wxU(_("RTP")) wxU(_("RTP"))
}; };
for( i=0; i<4; i++ ) for( i=0; i < ACCESS_OUT_NUM; i++ )
{ {
access_radios[i] = new wxRadioButton( panel, AccessRadio1_Event + i, access_checkboxes[i] = new wxCheckBox( panel, AccessType1_Event + i,
access_output_array[i], access_output_array[i] );
wxDefaultPosition, wxDefaultSize, access_subpanels[i] = new wxPanel( panel, -1 );
wxRB_SINGLE );
access_subpanels[i] = new wxPanel( panel, -1,
wxDefaultPosition, wxDefaultSize );
} }
/* File row */ /* Play locally row */
wxFlexGridSizer *subpanel_sizer; wxFlexGridSizer *subpanel_sizer;
wxStaticText *label; wxStaticText *label;
label = new wxStaticText( access_subpanels[0], -1, wxT("") );
subpanel_sizer = new wxFlexGridSizer( 1, 1, 20 );
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
access_subpanels[0]->SetSizerAndFit( subpanel_sizer );
/* File row */
subpanel_sizer = new wxFlexGridSizer( 3, 1, 20 ); subpanel_sizer = new wxFlexGridSizer( 3, 1, 20 );
label = new wxStaticText( access_subpanels[0], -1, wxU(_("Filename")) ); label = new wxStaticText( access_subpanels[1], -1, wxU(_("Filename")) );
file_combo = new wxComboBox( access_subpanels[0], FileName_Event, wxT(""), file_combo = new wxComboBox( access_subpanels[1], FileName_Event, wxT(""),
wxPoint(20,25), wxSize(200, -1), 0, NULL ); wxPoint(20,25), wxSize(200, -1), 0, NULL );
wxButton *browse_button = new wxButton( access_subpanels[0], wxButton *browse_button = new wxButton( access_subpanels[1],
FileBrowse_Event, wxU(_("Browse...")) ); FileBrowse_Event, wxU(_("Browse...")) );
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( file_combo, 1, subpanel_sizer->Add( file_combo, 1,
...@@ -297,37 +376,42 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent ) ...@@ -297,37 +376,42 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
subpanel_sizer->Add( browse_button, 0, subpanel_sizer->Add( browse_button, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
access_subpanels[0]->SetSizerAndFit( subpanel_sizer ); access_subpanels[1]->SetSizerAndFit( subpanel_sizer );
/* Net row */ /* Net rows */
subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 ); for( i=2; i < ACCESS_OUT_NUM; i++ )
label = new wxStaticText( access_subpanels[2], -1, wxU(_("Address")) ); {
net_addr = new wxTextCtrl( access_subpanels[2], NetAddr_Event, wxT(""), subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 );
wxDefaultPosition, wxSize( 200, -1 ), label = new wxStaticText( access_subpanels[i], -1, wxU(_("Address")) );
wxTE_PROCESS_ENTER); net_addr = new wxTextCtrl( access_subpanels[i], NetAddr_Event, wxT(""),
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); wxDefaultPosition, wxSize( 200, -1 ),
subpanel_sizer->Add( net_addr, 1, wxTE_PROCESS_ENTER);
wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); subpanel_sizer->Add( label, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
int val = config_GetInt( p_intf, "server-port" ); subpanel_sizer->Add( net_addr, 1, wxEXPAND |
label = new wxStaticText( access_subpanels[2], -1, wxU(_("Port")) ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
net_port = new wxSpinCtrl( access_subpanels[2], NetPort_Event,
wxString::Format(wxT("%d"), val), int val = config_GetInt( p_intf, "server-port" );
wxDefaultPosition, wxDefaultSize, label = new wxStaticText( access_subpanels[i], -1, wxU(_("Port")) );
wxSP_ARROW_KEYS, net_port = new wxSpinCtrl( access_subpanels[i], NetPort_Event,
0, 16000, val ); wxString::Format(wxT("%d"), val),
wxDefaultPosition, wxDefaultSize,
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); wxSP_ARROW_KEYS,
subpanel_sizer->Add( net_port, 0, 0, 16000, val );
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( label, 0,
access_subpanels[2]->SetSizerAndFit( subpanel_sizer ); wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( net_port, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
access_subpanels[i]->SetSizerAndFit( subpanel_sizer );
}
/* Stuff everything into the main panel */ /* Stuff everything into the main panel */
for( i=0; i<4; i++ ) for( i=0; i < ACCESS_OUT_NUM; i++ )
{ {
sizer->Add( access_radios[i], 0, sizer->Add( access_checkboxes[i], 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
sizer->Add( access_subpanels[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL sizer->Add( access_subpanels[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL
| wxALIGN_LEFT ); | wxALIGN_LEFT );
...@@ -337,6 +421,12 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent ) ...@@ -337,6 +421,12 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
/* Update access type panel */
for( i=1; i < ACCESS_OUT_NUM; i++ )
{
access_subpanels[i]->Disable();
}
return panel; return panel;
} }
...@@ -353,14 +443,15 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent ) ...@@ -353,14 +443,15 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
static const wxString encapsulation_array[] = static const wxString encapsulation_array[] =
{ {
wxU(_("MPEG TS")), wxT("MPEG TS"),
wxU(_("MPEG PS")), wxT("MPEG PS"),
wxU(_("AVI")), wxT("AVI"),
wxU(_("Ogg")) wxT("MP4/MOV"),
wxT("Ogg")
}; };
/* Stuff everything into the main panel */ /* Stuff everything into the main panel */
for( i=0; i<4; i++ ) for( i=0; i < ENCAPS_NUM; i++ )
{ {
encapsulation_radios[i] = encapsulation_radios[i] =
new wxRadioButton( panel, EncapsulationRadio1_Event + i, new wxRadioButton( panel, EncapsulationRadio1_Event + i,
...@@ -378,6 +469,122 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent ) ...@@ -378,6 +469,122 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
return panel; return panel;
} }
wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent )
{
wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
wxSize(200, 200) );
wxStaticBox *panel_box = new wxStaticBox( panel, -1,
wxU(_("Transcoding options")) );
wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
wxVERTICAL );
/* Create video transcoding checkox */
# define VCODECS_NUM 8
static const wxString vcodecs_array[] =
{
wxT("mpgv"),
wxT("mp4v"),
wxT("DIV1"),
wxT("DIV2"),
wxT("DIV3"),
wxT("H263"),
wxT("I263"),
wxT("WMV1"),
};
# define VBITRATES_NUM 9
static const wxString vbitrates_array[] =
{
wxT("3000"),
wxT("2000"),
wxT("1000"),
wxT("750"),
wxT("500"),
wxT("400"),
wxT("200"),
wxT("150"),
wxT("100")
};
wxFlexGridSizer *video_sizer = new wxFlexGridSizer( 4, 1, 20 );
video_transc_checkbox =
new wxCheckBox( panel, VideoTranscEnable_Event, wxU(_("Video codec")));
video_codec_combo =
new wxComboBox( panel, VideoTranscCodec_Event, wxT("mp4v"),
wxPoint(20,25), wxDefaultSize,
VCODECS_NUM, vcodecs_array, wxCB_READONLY );
wxStaticText *bitrate_label =
new wxStaticText( panel, -1, wxU(_("Bitrate (kb/s)")));
video_bitrate_combo =
new wxComboBox( panel, VideoTranscBitrate_Event, wxT("1000"),
wxPoint(20,25), wxDefaultSize,
VBITRATES_NUM, vbitrates_array );
video_sizer->Add( video_transc_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
video_sizer->Add( video_codec_combo, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
video_sizer->Add( bitrate_label, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
video_sizer->Add( video_bitrate_combo, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
/* Create audio transcoding checkox */
# define ACODECS_NUM 2
static const wxString acodecs_array[] =
{
wxT("mpga"),
wxT("a52")
};
# define ABITRATES_NUM 5
static const wxString abitrates_array[] =
{
wxT("512"),
wxT("256"),
wxT("192"),
wxT("128"),
wxT("96")
};
wxFlexGridSizer *audio_sizer = new wxFlexGridSizer( 4, 1, 20 );
audio_transc_checkbox =
new wxCheckBox( panel, AudioTranscEnable_Event, wxU(_("Audio codec")));
audio_codec_combo =
new wxComboBox( panel, AudioTranscCodec_Event, wxT("mpga"),
wxPoint(20,25), wxDefaultSize,
ACODECS_NUM, acodecs_array, wxCB_READONLY );
bitrate_label =
new wxStaticText( panel, -1, wxU(_("Bitrate (kb/s)")));
audio_bitrate_combo =
new wxComboBox( panel, AudioTranscBitrate_Event, wxT("192"),
wxPoint(20,25), wxDefaultSize,
ABITRATES_NUM, abitrates_array );
audio_sizer->Add( audio_transc_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
audio_sizer->Add( audio_codec_combo, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
audio_sizer->Add( bitrate_label, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
audio_sizer->Add( audio_bitrate_combo, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
/* Stuff everything into the main panel */
panel_sizer->Add( video_sizer, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel_sizer->Add( audio_sizer, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel->SetSizerAndFit( panel_sizer );
/* Update transcoding panel */
wxCommandEvent event( 0, VideoTranscEnable_Event );
event.SetInt( 0 );
OnTranscodingEnable( event );
event.SetId( AudioTranscEnable_Event );
OnTranscodingEnable( event );
return panel;
}
void SoutDialog::ParseMRL() void SoutDialog::ParseMRL()
{ {
/* Initialise MRL value */ /* Initialise MRL value */
...@@ -453,7 +660,7 @@ void SoutDialog::ParseMRL() ...@@ -453,7 +660,7 @@ void SoutDialog::ParseMRL()
/* Update access output panel */ /* Update access output panel */
wxCommandEvent dummy_event; wxCommandEvent dummy_event;
dummy_event.SetId( AccessRadio1_Event + i_access_type ); dummy_event.SetId( AccessType1_Event + i_access_type );
OnAccessTypeChange( dummy_event ); OnAccessTypeChange( dummy_event );
/* Update encapsulation output panel */ /* Update encapsulation output panel */
...@@ -485,49 +692,26 @@ void SoutDialog::OnMRLChange( wxCommandEvent& event ) ...@@ -485,49 +692,26 @@ void SoutDialog::OnMRLChange( wxCommandEvent& event )
void SoutDialog::OnAccessTypeChange( wxCommandEvent& event ) void SoutDialog::OnAccessTypeChange( wxCommandEvent& event )
{ {
int i; int i;
i_access_type = event.GetId() - AccessRadio1_Event; i_access_type = event.GetId() - AccessType1_Event;
access_subpanels[i_access_type]->Enable( event.GetInt() );
switch( i_access_type ) switch( i_access_type )
{ {
case FILE_ACCESS_OUT:
access_subpanels[0]->Enable();
access_subpanels[2]->Disable();
access_subpanels[3]->Disable();
for( i = 1; i < 4; i++ )
{
encapsulation_radios[i]->Enable();
}
break;
case HTTP_ACCESS_OUT:
access_subpanels[0]->Disable();
access_subpanels[2]->Enable();
access_subpanels[3]->Disable();
for( i = 1; i < 4; i++ )
{
encapsulation_radios[i]->Enable();
}
break;
case UDP_ACCESS_OUT: case UDP_ACCESS_OUT:
case RTP_ACCESS_OUT: case RTP_ACCESS_OUT:
access_subpanels[0]->Disable(); for( i = 1; i < ENCAPS_NUM; i++ )
access_subpanels[2]->Enable();
access_subpanels[3]->Enable();
for( i = 1; i < 4; i++ )
{ {
encapsulation_radios[i]->Disable(); encapsulation_radios[i]->Enable( !event.GetInt() );
}
if( event.GetInt() )
{
encapsulation_radios[TS_ENCAPSULATION]->SetValue(true);
i_encapsulation_type = TS_ENCAPSULATION;
} }
encapsulation_radios[TS_ENCAPSULATION]->SetValue(true);
i_encapsulation_type = TS_ENCAPSULATION;
break; break;
} }
for( i = 0; i < 4; i++ )
{
access_radios[i]->SetValue( event.GetId() == (AccessRadio1_Event+i) );
}
UpdateMRL(); UpdateMRL();
} }
...@@ -567,3 +751,28 @@ void SoutDialog::OnEncapsulationChange( wxCommandEvent& event ) ...@@ -567,3 +751,28 @@ void SoutDialog::OnEncapsulationChange( wxCommandEvent& event )
i_encapsulation_type = event.GetId() - EncapsulationRadio1_Event; i_encapsulation_type = event.GetId() - EncapsulationRadio1_Event;
UpdateMRL(); UpdateMRL();
} }
/*****************************************************************************
* Transcoding panel event methods.
*****************************************************************************/
void SoutDialog::OnTranscodingEnable( wxCommandEvent& event )
{
switch( event.GetId() )
{
case VideoTranscEnable_Event:
video_codec_combo->Enable( event.GetInt() );
video_bitrate_combo->Enable( event.GetInt() );
break;
case AudioTranscEnable_Event:
audio_codec_combo->Enable( event.GetInt() );
audio_bitrate_combo->Enable( event.GetInt() );
break;
}
UpdateMRL();
}
void SoutDialog::OnTranscodingChange( wxCommandEvent& event )
{
UpdateMRL();
}
...@@ -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.25 2003/05/13 22:59:16 gbazin Exp $ * $Id: wxwindows.h,v 1.26 2003/05/15 01:33:53 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -301,6 +301,7 @@ private: ...@@ -301,6 +301,7 @@ private:
void UpdateMRL(); void UpdateMRL();
wxPanel *AccessPanel( wxWindow* parent ); wxPanel *AccessPanel( wxWindow* parent );
wxPanel *EncapsulationPanel( wxWindow* parent ); wxPanel *EncapsulationPanel( wxWindow* parent );
wxPanel *TranscodingPanel( wxWindow* parent );
void ParseMRL(); void ParseMRL();
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
...@@ -319,18 +320,20 @@ private: ...@@ -319,18 +320,20 @@ private:
/* Event handlers for the encapsulation panel */ /* Event handlers for the encapsulation panel */
void OnEncapsulationChange( wxCommandEvent& event ); void OnEncapsulationChange( wxCommandEvent& event );
/* Event handlers for the transcoding panel */
void OnTranscodingEnable( wxCommandEvent& event );
void OnTranscodingChange( wxCommandEvent& event );
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
intf_thread_t *p_intf; intf_thread_t *p_intf;
wxWindow *p_parent; wxWindow *p_parent;
wxComboBox *mrl_combo; wxComboBox *mrl_combo;
wxPanel *access_panel;
wxPanel *encapsulation_panel;
/* Controls for the access outputs */ /* Controls for the access outputs */
wxPanel *access_subpanels[4]; wxPanel *access_subpanels[5];
wxRadioButton *access_radios[4]; wxCheckBox *access_checkboxes[5];
int i_access_type; int i_access_type;
...@@ -339,9 +342,16 @@ private: ...@@ -339,9 +342,16 @@ private:
wxTextCtrl *net_addr; wxTextCtrl *net_addr;
/* Controls for the encapsulation */ /* Controls for the encapsulation */
wxRadioButton *encapsulation_radios[4]; wxRadioButton *encapsulation_radios[5];
int i_encapsulation_type; int i_encapsulation_type;
/* Controls for transcoding */
wxCheckBox *video_transc_checkbox;
wxComboBox *video_codec_combo;
wxComboBox *audio_codec_combo;
wxCheckBox *audio_transc_checkbox;
wxComboBox *video_bitrate_combo;
wxComboBox *audio_bitrate_combo;
}; };
/* Subtitles File Dialog */ /* Subtitles File Dialog */
......
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