X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Foutput.m;h=b5a2399902a064dc719255305bca09c17a284321;hb=35cde3a5d3f0f0f104928ec2f0e8edf6d15961a3;hp=80f467a25637da821a9883332587b5da1eeb0024;hpb=efe357eb264b2c114a0761ae3312cdcfec1bc7f7;p=vlc diff --git a/modules/gui/macosx/output.m b/modules/gui/macosx/output.m index 80f467a256..b5a2399902 100644 --- a/modules/gui/macosx/output.m +++ b/modules/gui/macosx/output.m @@ -1,7 +1,7 @@ /***************************************************************************** * output.m: MacOS X Output Dialog ***************************************************************************** - * Copyright (C) 2002-2003 VideoLAN + * Copyright (C) 2002-2003 the VideoLAN team * $Id$ * * Authors: Jon Lech Johansen @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** @@ -41,7 +41,7 @@ - (id)init { self = [super init]; - o_mrl = [[NSString alloc] init]; + o_mrl = [[NSArray alloc] init]; o_transcode = [[NSString alloc] init]; return self; } @@ -53,13 +53,13 @@ [super dealloc]; } -- (void)setMRL:(NSString *)o_mrl_string +- (void)setMRL:(NSArray *)o_mrl_array { [o_mrl autorelease]; - o_mrl = [o_mrl_string copy]; + o_mrl = [o_mrl_array copy]; } -- (NSString *)getMRL +- (NSArray *)getMRL { return [o_mrl copy]; } @@ -131,7 +131,7 @@ NSArray *o_v_scales = [NSArray arrayWithObjects: @"0.25",@"0.5",@"0.75",@"1",@"1.25",@"1.5",@"1.75",@"2",nil]; NSArray *o_a_codecs = [NSArray arrayWithObjects: @"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx ", nil]; NSArray *o_v_codecs = [NSArray arrayWithObjects: @"mp1v", @"mp2v", @"mp4v", @"DIV1", - @"DIV2", @"DIV3", @"H263", @"I263", @"WMV1", @"WMV2", @"MJPG", @"theo", nil]; + @"DIV2", @"DIV3", @"h263", @"h264", @"WMV1", @"WMV2", @"MJPG", @"theo", nil]; [o_output_ckbox setTitle: _NS("Advanced output:")]; [o_output_settings setTitle: _NS("Settings...")]; @@ -179,7 +179,6 @@ [o_misc_lbl setTitle: _NS("Stream Announcing")]; [o_sap_chkbox setTitle: _NS("SAP announce")]; - [o_slp_chkbox setTitle: _NS("SLP announce")]; [o_rtsp_chkbox setTitle: _NS("RTSP announce")]; [o_http_chkbox setTitle:_NS("HTTP announce")]; [o_file_chkbox setTitle:_NS("Export SDP as file")]; @@ -221,7 +220,6 @@ o_mode = [[o_method selectedCell] title]; [o_sap_chkbox setEnabled: NO]; - [o_slp_chkbox setEnabled: NO]; [o_http_chkbox setEnabled: NO]; [o_rtsp_chkbox setEnabled: NO]; [o_file_chkbox setEnabled: NO]; @@ -306,7 +304,6 @@ [[o_mux_selector itemAtIndex: 7] setEnabled: NO]; [[o_mux_selector itemAtIndex: 8] setEnabled: YES]; [o_sap_chkbox setEnabled: YES]; - [o_slp_chkbox setEnabled: YES]; [o_channel_name setEnabled: YES]; } else if( [o_mode isEqualToString: @"RTP"] ) @@ -325,7 +322,6 @@ [[o_mux_selector itemAtIndex: 8] setEnabled: YES]; [o_mux_selector selectItemAtIndex: 8]; [o_sap_chkbox setEnabled: YES]; - [o_slp_chkbox setEnabled: NO]; [o_rtsp_chkbox setEnabled: YES]; [o_http_chkbox setEnabled: YES]; [o_file_chkbox setEnabled: YES]; @@ -349,6 +345,7 @@ NSString *o_mode, *o_mux, *o_mux_string; NSMutableString *o_announce = [NSMutableString stringWithString:@""]; NSMutableString *o_mrl_string = [NSMutableString stringWithString:@":sout=#"]; + NSArray *o_sout_options; [o_mrl_string appendString: o_transcode]; if( [o_display state] == NSOnState ) @@ -373,16 +370,21 @@ { if( [o_dump_chkbox state] == NSOnState ) { - o_mrl_string = [NSMutableString stringWithFormat: - @":demux=demuxdump :demuxdump-file=\"%@\"", - [o_file_field stringValue]]; - [self setMRL:o_mrl_string]; + NSMutableArray * o_sout_options; + o_sout_options = [NSArray arrayWithObjects: + [NSString stringWithString: + @":demux=dump"], + [NSString stringWithFormat: + @":demuxdump-file=%@", + [o_file_field stringValue]], + nil]; + [self setMRL:o_sout_options]; return; } else { [o_mrl_string appendFormat: - @"std{access=file,mux=%@,url=\"%@\"}", + @"std{access=file,mux=%@,dst=\"%@\"}", o_mux_string, [o_file_field stringValue]]; } } @@ -408,22 +410,40 @@ else [o_announce appendFormat:@",sap"]; } - if( [o_slp_chkbox state] == NSOnState ) - { - if ( ![[o_channel_name stringValue] isEqualToString: @""] ) - [o_announce appendFormat:@ - "slp,name=%@",[o_channel_name stringValue]]; - else - [o_announce appendString: @",slp"]; - } } if ( ![o_mode isEqualToString: @"RTP"] ) { - + /* split up the hostname and the following path to paste the + * port correctly. Not need, if there isn't any path following the + * hostname. */ + NSArray * o_urlItems = [[o_stream_address stringValue] \ + componentsSeparatedByString: @"/"]; + NSMutableString * o_finalStreamAddress; + o_finalStreamAddress = [[NSMutableString alloc] init]; + + if ([o_urlItems count] == 1) + { + [o_finalStreamAddress appendFormat: @"\"%@:%@\"", \ + [o_stream_address stringValue],[o_stream_port stringValue]]; + } + else + { + [o_finalStreamAddress appendFormat: @"\"%@:%@", [o_urlItems \ + objectAtIndex: 0], [o_stream_port stringValue]]; + unsigned int x; + x = 1; + while (x != [o_urlItems count]) + { + [o_finalStreamAddress appendFormat: @"/%@", [o_urlItems \ + objectAtIndex: x]]; + x = (x + 1); + } + [o_finalStreamAddress appendString: @"\""]; + } + [o_mrl_string appendFormat: - @"std{access=%@,mux=%@,url=\"%@:%@\"%@}", - o_mode, o_mux_string, [o_stream_address stringValue], - [o_stream_port stringValue], o_announce]; + @"std{access=%@,mux=%@,dst=%@%@}", + o_mode, o_mux_string, o_finalStreamAddress, o_announce]; } else { @@ -466,7 +486,8 @@ { [o_mrl_string appendString: @"}"]; } - [self setMRL:o_mrl_string]; + o_sout_options = [NSArray arrayWithObjects: o_mrl_string,nil]; + [self setMRL:o_sout_options]; } - (void)TTLChanged:(NSNotification *)o_notification @@ -565,7 +586,7 @@ o_transcode_string = [NSMutableString stringWithString:@"transcode{"]; if ( [o_transcode_video_chkbox state] == NSOnState ) { - [o_transcode_string appendFormat: @"vcodec=\"%@\",vb=\"%@\"" + [o_transcode_string appendFormat: @"vcodec=\"%@\",vb=\"%@\"" \ ",scale=\"%@\"", [o_transcode_video_selector titleOfSelectedItem], [o_transcode_video_bitrate stringValue], @@ -601,8 +622,8 @@ { NSString *o_mode; o_mode = [[o_stream_type selectedCell] title]; - [o_channel_name setEnabled: [o_sap_chkbox state] || [o_slp_chkbox state] - || [o_mode isEqualToString: @"RTP"]]; + [o_channel_name setEnabled: [o_sap_chkbox state] || + [o_mode isEqualToString: @"RTP"]]; if ([o_mode isEqualToString: @"RTP"]) {