Commit 3f98fbe7 authored by zorglub's avatar zorglub
Browse files

Update muxers and codecs in wizard

parent 7851e1d6
......@@ -22,6 +22,12 @@
*****************************************************************************/
#define MUXERS_NUMBER 9
// Do not count dummy here !
#define VCODECS_NUMBER 13
#define ACODECS_NUMBER 9
#define MUX_PS 0
#define MUX_TS 1
#define MUX_MPEG 2
......@@ -31,6 +37,7 @@
#define MUX_AVI 6
#define MUX_MP4 7
#define MUX_MOV 8
#define MUX_WAV 9
/* Muxer / Codecs / Access_out compatibility tables */
......@@ -39,58 +46,72 @@ struct codec {
char *psz_display;
char *psz_codec;
char *psz_descr;
int muxers[9];
int muxers[MUXERS_NUMBER];
};
static struct codec vcodecs_array[] =
{
{ "MPEG-1 Video" , "mp1v" , N_("MPEG-1 Video codec"),
{MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_AVI, MUX_RAW, -1,-1,-1 } },
// {MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_AVI, MUX_RAW, -1,-1,-1 } },
{MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_RAW, -1,-1,-1,-1 } },
{ "MPEG-2 Video" , "mp2v" , N_("MPEG-2 Video codec"),
{MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_AVI, MUX_RAW, -1,-1,-1 } },
// {MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_AVI, MUX_RAW, -1,-1,-1 } },
{MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_RAW, -1,-1,-1,-1 } },
{ "MPEG-4 Video" , "mp4v" , N_("MPEG-4 Video codec"),
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_AVI,MUX_RAW, -1} },
// {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_AVI,MUX_RAW, -1} },
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_RAW, -1,-1} },
{ "DIVX 1" ,"DIV1",N_("DivX first version") ,
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
// {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
{ "DIVX 2" ,"DIV2",N_("DivX second version") ,
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
{ "DIVX 3" ,"DIV3",N_("DivX third version") ,
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
{ "H 263" , "H263" , N_("H263 is a video codec optimized for videoconference (low rates)") ,
{ MUX_TS, MUX_AVI, -1,-1,-1,-1,-1,-1,-1 } },
{ "H 264" , "H264" , N_("H264 is a new video codec") ,
{ MUX_TS, MUX_AVI, -1,-1,-1,-1,-1,-1,-1 } },
{ "I 263", "I263", N_("I263 is an Intel conferencing codec") ,
{ MUX_TS, MUX_AVI, -1,-1,-1,-1,-1,-1,-1 } },
{ "WMV 1" , "WMV1", N_("WMV (Windows Media Video) 1") ,
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
{ "WMV 2" , "WMV2", N_("WMV (Windows Media Video) 2") ,
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
{ "MJPEG" , "MJPG", N_("MJPEG consists of a series of JPEG pictures") ,
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
{MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
{ "Theora" , "theo", N_("Theora is a free general-purpose codec"),
{MUX_TS, -1,-1,-1,-1,-1,-1,-1,-1} },
{ "Dummy", "dummy", N_("Dummy codec (do not transcode)") ,
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_AVI,MUX_RAW,MUX_MOV}},
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_WAV,MUX_RAW,MUX_MOV}},
{ NULL,NULL,NULL , {-1,-1,-1,-1,-1,-1,-1,-1,-1}} /* Do not remove me */
};
static struct codec acodecs_array[] =
{
{ "MPEG Audio" , "mpga" , N_("The standard MPEG audio (1/2) format") ,
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
// {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_RAW, -1,-1,-1} },
{ "MP3" , "mp3" , N_("MPEG Audio Layer 3") ,
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
// {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_RAW, -1,-1, -1} },
{ "MPEG 4 Audio" , "mp4a" , N_("Audio format for MPEG4") ,
{MUX_TS, MUX_MP4, -1,-1,-1,-1,-1,-1,-1 } },
{ "A/52" , "a52" , N_("DVD audio format") ,
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
// {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_RAW, -1,-1,-1} },
{ "Vorbis" , "vorb" , N_("Vorbis is a free audio codec") ,
{MUX_OGG, -1,-1,-1,-1,-1,-1,-1,-1} },
{ "FLAC" , "flac" , N_("FLAC is a lossless audio codec") ,
{MUX_OGG , MUX_RAW, -1,-1,-1,-1,-1,-1,-1} },
{ "Speex" , "spx" , N_("A free audio codec dedicated to compression of voice") ,
{MUX_OGG, -1,-1,-1,-1,-1,-1,-1,-1} },
{ "Uncompressed, integer" , "s16l" , N_("Uncompressed audio samples"),
{MUX_WAV, -1,-1,-1,-1,-1,-1,-1,-1} },
{ "Uncompressed, floating" , "fl32" , N_("Uncompressed audio samples"),
{MUX_WAV, -1,-1,-1,-1,-1,-1,-1,-1} },
{ "Dummy", "dummy", N_("Dummy codec (do not transcode)") ,
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_AVI,MUX_RAW,MUX_MOV}},
// {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_AVI,MUX_RAW,MUX_MOV}},
{MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_RAW,MUX_MOV,MUX_WAV}},
{ NULL,NULL,NULL , {-1,-1,-1,-1,-1,-1,-1,-1,-1}} /* Do not remove me */
};
......@@ -99,7 +120,7 @@ struct method {
char *psz_method;
char *psz_descr;
char *psz_address;
int muxers[9];
int muxers[MUXERS_NUMBER];
};
static struct method methods_array[] =
......@@ -142,9 +163,10 @@ static struct encap encaps_array[] =
{ MUX_OGG, "ogg", "OGG", N_("OGG") },
{ MUX_RAW, "raw", "RAW", N_("RAW") },
{ MUX_ASF, "asf","ASF", N_("ASF") },
{ MUX_AVI, "avi","AVI", N_("AVI") },
// { MUX_AVI, "avi","AVI", N_("AVI") },
{ MUX_MP4, "mp4","MP4", N_("MPEG4") },
{ MUX_MOV, "mov","MOV", N_("MOV") },
{ MUX_WAV, "wav","WAV", N_("WAV") },
{ -1 , NULL,NULL , NULL } /* Do not remove me */
};
......
......@@ -576,7 +576,7 @@ wxPanel *SoutDialog::MiscPanel( wxWindow* parent )
wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
{
int i;
unsigned int i;
wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
wxSize(200, 200) );
......
......@@ -351,7 +351,7 @@ protected:
int i_mux;
int i_action;
void OnEncapChange(wxEvent& event);
wxRadioButton *encap_radios[9];
wxRadioButton *encap_radios[MUXERS_NUMBER];
WizardDialog *p_parent;
wxWizardPage *p_prev;
wxWizardPage *p_streaming_page;
......@@ -370,6 +370,7 @@ BEGIN_EVENT_TABLE(wizEncapPage, wxWizardPage)
EVT_RADIOBUTTON( EncapRadio7_Event, wizEncapPage::OnEncapChange)
EVT_RADIOBUTTON( EncapRadio8_Event, wizEncapPage::OnEncapChange)
EVT_RADIOBUTTON( EncapRadio9_Event, wizEncapPage::OnEncapChange)
EVT_RADIOBUTTON( EncapRadio10_Event, wizEncapPage::OnEncapChange)
END_EVENT_TABLE()
/* Additional settings for transcode */
......@@ -926,20 +927,20 @@ void wizTranscodeCodecPage::OnWizardPageChanging(wxWizardEvent& event)
/* Set the dummy codec ( accept all muxers ) if needed */
if( !video_combo->IsEnabled() )
{
i_video_codec = 12;
i_video_codec = VCODECS_NUMBER;
}
if( !audio_combo->IsEnabled() )
{
i_audio_codec = 7;
i_audio_codec = ACODECS_NUMBER;
}
((wizEncapPage *)GetNext())->SetPrev(this);
for( i = 0 ; i< 9 ; i++ )
for( i = 0 ; i< MUXERS_NUMBER ; i++ )
{
if( vcodecs_array[i_video_codec].muxers[i] != -1 )
{
for( j = 0 ; j< 9 ; j++ )
for( j = 0 ; j< MUXERS_NUMBER ; j++ )
{
if( acodecs_array[i_audio_codec].muxers[j] ==
vcodecs_array[i_video_codec].muxers[i] )
......@@ -1073,7 +1074,7 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event)
}
((wizEncapPage *)GetNext())->SetPrev(this);
for( i = 0 ; i< 9 ; i++ )
for( i = 0 ; i< MUXERS_NUMBER ; i++ )
{
if( methods_array[i_method].muxers[i] != -1 )
{
......@@ -1120,7 +1121,7 @@ wizEncapPage::wizEncapPage( wxWizard *parent ) : wxWizardPage(parent)
mainSizer->Add( 0,0,1 );
for( i = 0 ; i< 9 ; i++ )
for( i = 0 ; i< MUXERS_NUMBER ; i++ )
{
encap_radios[i] = new wxRadioButton( this, EncapRadio0_Event + i,
wxU( encaps_array[i].psz_encap ) );
......@@ -1144,7 +1145,7 @@ void wizEncapPage::OnWizardPageChanging(wxWizardEvent& event)
int i;
if( !event.GetDirection() )
{
for( i = 0 ; i< 9 ; i++ )
for( i = 0 ; i< MUXERS_NUMBER ; i++ )
{
encap_radios[i]->Disable();
}
......@@ -1177,7 +1178,7 @@ void wizEncapPage::OnEncapChange(wxEvent& event)
void wizEncapPage::EnableEncap( int encap )
{
int i;
for( i = 0 ; i< 9 ; i++)
for( i = 0 ; i< MUXERS_NUMBER ; i++)
{
if( encaps_array[i].id == encap )
{
......@@ -1519,36 +1520,36 @@ void WizardDialog::Run()
mrl, address);
msg_Dbg( p_intf,"Using %s (%i kbps) / %s (%i kbps),encap %s",
vcodec,vb,acodec,ab,mux);
int i_tr_size = 10; /* 10 = ab + vb */
i_tr_size += vcodec ? strlen(vcodec) : 0;
i_tr_size += acodec ? strlen(acodec) : 0;
int i_tr_size = 0 ; /* 10 = ab + vb */
i_tr_size += vcodec ? strlen(vcodec) + strlen("vcodec=") +strlen("vb="): 0;
i_tr_size += acodec ? strlen(acodec) + strlen("acodec=") +strlen("ab=") : 0;
char *psz_transcode = (char *)malloc( i_tr_size * sizeof(char));
if( vcodec || acodec )
{
fprintf( stderr, "snprintf returned %i\n",snprintf( psz_transcode, i_tr_size, "transcode{"));
fprintf(stderr, "step 1 : %s\n", psz_transcode);
sprintf( psz_transcode, "transcode{" );
}
else
{
snprintf( psz_transcode, i_tr_size, "%c", 0 );
snprintf( psz_transcode, 1 , "%c", 0 );
}
if( vcodec )
{
fprintf( stderr, "snprintf returned %i\n",snprintf( psz_transcode, i_tr_size, "%svcodec=%s,vb=%i",
psz_transcode, vcodec, vb ));
fprintf(stderr, "step 2 : %s\n", psz_transcode);
i_tr_size += 5 + strlen(vcodec);
snprintf( psz_transcode, i_tr_size , "%svcodec=%s,vb=%i",
psz_transcode, vcodec, vb );
}
if( acodec )
{
fprintf( stderr, "snprintf returned %i\n",snprintf( psz_transcode, i_tr_size, "%s%cacodec=%s,ab=%i",
psz_transcode, vcodec ? ',' : ' ', acodec, ab ));
fprintf(stderr, "step 3 : %s\n", psz_transcode);
i_tr_size += 6 + strlen(acodec);
/* FIXME */
sprintf( psz_transcode, "%s%cacodec=%s,ab=%i",
psz_transcode, vcodec ? ',' : ' ', acodec, ab );
}
if( vcodec || acodec )
{
snprintf( psz_transcode, i_tr_size, "%s}:", psz_transcode );
fprintf(stderr, "step 4 : %s\n", psz_transcode);
i_tr_size +=2;
sprintf( psz_transcode , "%s}:", psz_transcode );
}
i_size = 73 + strlen(mux) + strlen(address) + strlen(psz_transcode);
psz_opt = (char *)malloc( i_size * sizeof(char) );
......
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