1 /*****************************************************************************
2 * output.m: MacOS X Output Dialog
3 *****************************************************************************
4 * Copyright (C) 2002-2013 VLC authors and VideoLAN
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Christophe Massiot <massiot@via.ecp.fr>
9 * Derk-Jan Hartman <thedj@users.sourceforge.net>
10 * Benjamin Pracht <bigben AT videolan DOT org>
11 * Felix Paul Kühne <fkuehne -at- videolan -dot- org>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 *****************************************************************************/
28 /*****************************************************************************
30 *****************************************************************************/
31 #include <stdlib.h> /* malloc(), free() */
37 /*****************************************************************************
38 * VLCOutput implementation
39 *****************************************************************************/
40 @implementation VLCOutput
41 @synthesize soutMRL=o_mrl;
46 o_mrl = [[NSArray alloc] init];
47 o_transcode = [[NSString alloc] init];
54 [o_transcode release];
58 - (void)setTranscode:(NSString *)o_transcode_string
60 [o_transcode autorelease];
61 o_transcode = [o_transcode_string copy];
68 [[NSNotificationCenter defaultCenter] addObserver: self
69 selector: @selector(outputInfoChanged:)
70 name: NSControlTextDidChangeNotification
71 object: o_file_field];
72 [[NSNotificationCenter defaultCenter] addObserver: self
73 selector: @selector(outputInfoChanged:)
74 name: NSControlTextDidChangeNotification
75 object: o_stream_address];
76 [[NSNotificationCenter defaultCenter] addObserver: self
77 selector: @selector(outputInfoChanged:)
78 name: NSControlTextDidChangeNotification
79 object: o_stream_port];
80 [[NSNotificationCenter defaultCenter] addObserver: self
81 selector: @selector(TTLChanged:)
82 name: NSControlTextDidChangeNotification
83 object: o_stream_ttl];
84 [[NSNotificationCenter defaultCenter] addObserver: self
85 selector: @selector(transcodeInfoChanged:)
86 name: NSControlTextDidChangeNotification
87 object: o_transcode_video_bitrate];
88 [[NSNotificationCenter defaultCenter] addObserver: self
89 selector: @selector(transcodeInfoChanged:)
90 name: NSControlTextDidChangeNotification
91 object: o_transcode_video_scale];
92 [[NSNotificationCenter defaultCenter] addObserver: self
93 selector: @selector(transcodeInfoChanged:)
94 name: NSControlTextDidChangeNotification
95 object: o_transcode_audio_bitrate];
96 [[NSNotificationCenter defaultCenter] addObserver: self
97 selector: @selector(transcodeInfoChanged:)
98 name: NSControlTextDidChangeNotification
99 object: o_transcode_audio_channels];
100 [[NSNotificationCenter defaultCenter] addObserver: self
101 selector: @selector(transcodeInfoChanged:)
102 name: NSControlTextDidChangeNotification
103 object: o_channel_name];
104 [[NSNotificationCenter defaultCenter] addObserver: self
105 selector: @selector(transcodeInfoChanged:)
106 name: NSControlTextDidChangeNotification
109 [o_mux_selector setAutoenablesItems: NO];
110 [self transcodeChanged:nil];
115 NSArray *o_muxers = [NSArray arrayWithObjects: @"MPEG TS", @"MPEG PS", @"MPEG 1",
116 @"Ogg", @"AVI", @"ASF", @"MPEG 4", @"Quicktime", @"Raw", nil];
117 NSArray *o_a_channels = [NSArray arrayWithObjects: @"1", @"2", @"4", @"6", nil];
118 NSArray *o_a_bitrates = [NSArray arrayWithObjects: @"16", @"32", @"64", @"96",
119 @"128", @"192", @"256", @"512", nil];
120 NSArray *o_v_bitrates = [NSArray arrayWithObjects: @"16", @"32", @"64", @"96",
121 @"128", @"192", @"256", @"384", @"512", @"768", @"1024", @"2048", @"3072", nil];
122 NSArray *o_v_scales = [NSArray arrayWithObjects: @"0.25",@"0.5",@"0.75",@"1",@"1.25",@"1.5",@"1.75",@"2",nil];
123 NSArray *o_a_codecs = [NSArray arrayWithObjects: @"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx ", nil];
124 NSArray *o_v_codecs = [NSArray arrayWithObjects: @"mp1v", @"mp2v", @"mp4v", @"DIV1",
125 @"DIV2", @"DIV3", @"h263", @"h264", @"WMV1", @"WMV2", @"MJPG", @"theo", nil];
127 [o_output_ckbox setTitle: _NS("Streaming/Saving:")];
128 [o_output_settings setTitle: _NS("Settings...")];
129 [o_btn_ok setTitle: _NS("OK")];
131 [o_options_lbl setTitle: _NS("Streaming and Transcoding Options")];
132 [o_display setTitle: _NS("Display the stream locally")];
133 [[o_method cellAtRow:0 column:0] setTitle: _NS("File")];
134 [[o_method cellAtRow:1 column:0] setTitle: _NS("Stream")];
135 [o_dump_chkbox setTitle: _NS("Dump raw input")];
136 [o_btn_browse setTitle: _NS("Browse...")];
137 [o_stream_address_lbl setStringValue: _NS("Address")];
138 [o_stream_port_lbl setStringValue: _NS("Port")];
139 [o_stream_ttl_lbl setStringValue: @"TTL"];
140 [[o_stream_type itemAtIndex: 0] setTitle: @"HTTP"];
141 [[o_stream_type itemAtIndex: 1] setTitle: @"MMSH"];
142 [[o_stream_type itemAtIndex: 2] setTitle: @"UDP"];
143 [[o_stream_type itemAtIndex: 3] setTitle: @"RTP"];
144 [o_stream_type_lbl setStringValue: _NS("Type")];
146 [o_mux_lbl setStringValue: _NS("Encapsulation Method")];
147 [o_mux_selector removeAllItems];
148 [o_mux_selector addItemsWithTitles: o_muxers];
150 [o_transcode_lbl setTitle: _NS("Transcoding options")];
151 [o_transcode_video_chkbox setTitle: _NS("Video")];
152 [o_transcode_video_selector removeAllItems];
153 [o_transcode_video_selector addItemsWithTitles: o_v_codecs];
154 [o_transcode_video_bitrate_lbl setStringValue: _NS("Bitrate (kb/s)")];
155 [o_transcode_video_bitrate removeAllItems];
156 [o_transcode_video_bitrate addItemsWithObjectValues: o_v_bitrates];
157 [o_transcode_video_scale_lbl setStringValue: _NS("Scale")];
158 [o_transcode_video_scale removeAllItems];
159 [o_transcode_video_scale addItemsWithObjectValues: o_v_scales];
160 [o_transcode_video_scale selectItemWithObjectValue: @"1"];
161 [o_transcode_audio_chkbox setTitle: _NS("Audio")];
162 [o_transcode_audio_selector removeAllItems];
163 [o_transcode_audio_selector addItemsWithTitles: o_a_codecs];
164 [o_transcode_audio_bitrate_lbl setStringValue: _NS("Bitrate (kb/s)")];
165 [o_transcode_audio_bitrate removeAllItems];
166 [o_transcode_audio_bitrate addItemsWithObjectValues: o_a_bitrates];
167 [o_transcode_audio_channels_lbl setStringValue: _NS("Channels")];
168 [o_transcode_audio_channels removeAllItems];
169 [o_transcode_audio_channels addItemsWithObjectValues: o_a_channels];
171 [o_misc_lbl setTitle: _NS("Stream Announcing")];
172 [o_sap_chkbox setTitle: _NS("SAP Announcement")];
173 [o_rtsp_chkbox setTitle: _NS("RTSP Announcement")];
174 [o_http_chkbox setTitle:_NS("HTTP Announcement")];
175 [o_file_chkbox setTitle:_NS("Export SDP as file")];
177 [o_channel_name_lbl setStringValue: _NS("Channel Name")];
178 [o_sdp_url_lbl setStringValue: _NS("SDP URL")];
181 - (IBAction)outputChanged:(id)sender;
183 if ([o_output_ckbox state] == NSOnState)
184 [o_output_settings setEnabled:YES];
186 [o_output_settings setEnabled:NO];
189 - (IBAction)outputSettings:(id)sender
191 [NSApp beginSheet: o_output_sheet
192 modalForWindow: o_open_panel
198 - (IBAction)outputCloseSheet:(id)sender
200 [o_output_sheet orderOut:sender];
201 [NSApp endSheet: o_output_sheet];
204 - (void)outputMethodChanged:(NSNotification *)o_notification
207 o_mode = [[o_method selectedCell] title];
209 [o_sap_chkbox setEnabled: NO];
210 [o_http_chkbox setEnabled: NO];
211 [o_rtsp_chkbox setEnabled: NO];
212 [o_file_chkbox setEnabled: NO];
213 [o_channel_name setEnabled: NO];
214 [o_sdp_url setEnabled: NO];
215 [[o_mux_selector itemAtIndex: 0] setEnabled: YES];
217 if ([o_mode isEqualToString: _NS("File")]) {
218 [o_file_field setEnabled: YES];
219 [o_btn_browse setEnabled: YES];
220 [o_dump_chkbox setEnabled: YES];
221 [o_stream_address setEnabled: NO];
222 [o_stream_port setEnabled: NO];
223 [o_stream_ttl setEnabled: NO];
224 [o_stream_port_stp setEnabled: NO];
225 [o_stream_ttl_stp setEnabled: NO];
226 [o_stream_type setEnabled: NO];
227 [o_mux_selector setEnabled: YES];
228 [[o_mux_selector itemAtIndex: 1] setEnabled: YES]; // MPEG PS
229 [[o_mux_selector itemAtIndex: 2] setEnabled: YES]; // MPEG 1
230 [[o_mux_selector itemAtIndex: 3] setEnabled: YES]; // Ogg
231 [[o_mux_selector itemAtIndex: 4] setEnabled: YES]; // AVI
232 [[o_mux_selector itemAtIndex: 5] setEnabled: YES]; // ASF
233 [[o_mux_selector itemAtIndex: 6] setEnabled: YES]; // MPEG 4
234 [[o_mux_selector itemAtIndex: 7] setEnabled: YES]; // QuickTime
235 [[o_mux_selector itemAtIndex: 8] setEnabled: YES]; // Raw
236 } else if ([o_mode isEqualToString: _NS("Stream")]) {
237 [o_file_field setEnabled: NO];
238 [o_dump_chkbox setEnabled: NO];
239 [o_btn_browse setEnabled: NO];
240 [o_stream_port setEnabled: YES];
241 [o_stream_port_stp setEnabled: YES];
242 [o_stream_type setEnabled: YES];
243 [o_mux_selector setEnabled: YES];
245 o_mode = [o_stream_type titleOfSelectedItem];
247 if ([o_mode isEqualToString: @"HTTP"]) {
248 [o_stream_address setEnabled: YES];
249 [o_stream_ttl setEnabled: NO];
250 [o_stream_ttl_stp setEnabled: NO];
251 [[o_mux_selector itemAtIndex: 1] setEnabled: YES];
252 [[o_mux_selector itemAtIndex: 2] setEnabled: YES];
253 [[o_mux_selector itemAtIndex: 3] setEnabled: YES];
254 [[o_mux_selector itemAtIndex: 4] setEnabled: NO];
255 [[o_mux_selector itemAtIndex: 5] setEnabled: YES];
256 [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
257 [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
258 [[o_mux_selector itemAtIndex: 8] setEnabled: YES];
259 } else if ([o_mode isEqualToString: @"MMSH"]) {
260 [o_stream_address setEnabled: YES];
261 [o_stream_ttl setEnabled: NO];
262 [o_stream_ttl_stp setEnabled: NO];
263 [[o_mux_selector itemAtIndex: 0] setEnabled: NO];
264 [[o_mux_selector itemAtIndex: 1] setEnabled: NO];
265 [[o_mux_selector itemAtIndex: 2] setEnabled: NO];
266 [[o_mux_selector itemAtIndex: 3] setEnabled: NO];
267 [[o_mux_selector itemAtIndex: 4] setEnabled: NO];
268 [[o_mux_selector itemAtIndex: 5] setEnabled: YES];
269 [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
270 [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
271 [[o_mux_selector itemAtIndex: 8] setEnabled: NO];
272 [o_mux_selector selectItemAtIndex: 5];
273 } else if ([o_mode isEqualToString: @"UDP"]) {
274 [o_stream_address setEnabled: YES];
275 [o_stream_ttl setEnabled: YES];
276 [o_stream_ttl_stp setEnabled: YES];
277 [[o_mux_selector itemAtIndex: 1] setEnabled: NO];
278 [[o_mux_selector itemAtIndex: 2] setEnabled: NO];
279 [[o_mux_selector itemAtIndex: 3] setEnabled: NO];
280 [[o_mux_selector itemAtIndex: 4] setEnabled: NO];
281 [[o_mux_selector itemAtIndex: 5] setEnabled: NO];
282 [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
283 [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
284 [[o_mux_selector itemAtIndex: 8] setEnabled: YES];
285 [o_sap_chkbox setEnabled: YES];
286 [o_channel_name setEnabled: YES];
287 } else if ([o_mode isEqualToString: @"RTP"]) {
288 [o_stream_address setEnabled: YES];
289 [o_stream_ttl setEnabled: YES];
290 [o_stream_ttl_stp setEnabled: YES];
291 [[o_mux_selector itemAtIndex: 0] setEnabled: NO];
292 [[o_mux_selector itemAtIndex: 1] setEnabled: NO];
293 [[o_mux_selector itemAtIndex: 2] setEnabled: NO];
294 [[o_mux_selector itemAtIndex: 3] setEnabled: NO];
295 [[o_mux_selector itemAtIndex: 4] setEnabled: NO];
296 [[o_mux_selector itemAtIndex: 5] setEnabled: NO];
297 [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
298 [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
299 [[o_mux_selector itemAtIndex: 8] setEnabled: YES];
300 [o_mux_selector selectItemAtIndex: 8];
301 [o_sap_chkbox setEnabled: YES];
302 [o_rtsp_chkbox setEnabled: YES];
303 [o_http_chkbox setEnabled: YES];
304 [o_file_chkbox setEnabled: YES];
305 [o_channel_name setEnabled: YES];
309 if (![[o_mux_selector selectedItem] isEnabled] && ![o_mode isEqualToString: @"RTP"])
310 [o_mux_selector selectItemAtIndex: 0];
311 else if (![[o_mux_selector selectedItem] isEnabled] && [o_mode isEqualToString: @"RTP"])
312 [o_mux_selector selectItemAtIndex: 8];
314 [self outputInfoChanged: nil];
317 - (void)outputInfoChanged:(NSNotification *)o_notification
319 NSString *o_mode, *o_mux, *o_mux_string;
320 NSMutableString *o_announce = [NSMutableString stringWithString:@""];
321 NSMutableString *o_mrl_string = [NSMutableString stringWithString:@":sout=#"];
322 NSArray *o_sout_options;
324 [o_mrl_string appendString: o_transcode];
325 if ([o_display state] == NSOnState)
326 [o_mrl_string appendString: @"duplicate{dst=display,dst="];
328 o_mode = [[o_method selectedCell] title];
329 o_mux = [o_mux_selector titleOfSelectedItem];
331 if ([o_mux isEqualToString: @"AVI"]) o_mux_string = @"avi";
332 else if ([o_mux isEqualToString: @"Ogg"]) o_mux_string = @"ogg";
333 else if ([o_mux isEqualToString: @"MPEG PS"]) o_mux_string = @"ps";
334 else if ([o_mux isEqualToString: @"MPEG 4"]) o_mux_string = @"mp4";
335 else if ([o_mux isEqualToString: @"MPEG 1"]) o_mux_string = @"mpeg1";
336 else if ([o_mux isEqualToString: @"Quicktime"]) o_mux_string = @"mov";
337 else if ([o_mux isEqualToString: @"ASF"]) o_mux_string = @"asf";
338 else if ([o_mux isEqualToString: @"Raw"]) o_mux_string = @"raw";
339 else o_mux_string = @"ts";
341 if ([o_mode isEqualToString: _NS("File")]) {
342 if ([o_dump_chkbox state] == NSOnState) {
343 NSMutableArray * o_sout_options;
344 o_sout_options = [NSArray arrayWithObjects:
346 [NSString stringWithFormat:
347 @":demuxdump-file=%@",
348 [o_file_field stringValue]],
350 [self setSoutMRL:o_sout_options];
353 [o_mrl_string appendFormat: @"standard{mux=%@,access=file{no-overwrite},dst=\"%@\"}", o_mux_string, [o_file_field stringValue]];
355 else if ([o_mode isEqualToString: _NS("Stream")]) {
356 o_mode = [o_stream_type titleOfSelectedItem];
358 if ([o_mode isEqualToString: @"HTTP"])
360 else if ([o_mode isEqualToString: @"MMSH"]) {
361 if ([o_mux isEqualToString: @"ASF"])
362 o_mux_string = @"asfh";
364 } else if ([o_mode isEqualToString: @"UDP"]) {
366 if ([o_sap_chkbox state] == NSOnState) {
367 if (![[o_channel_name stringValue] isEqualToString: @""])
368 [o_announce appendFormat:@",sap,name=%@", [o_channel_name stringValue]];
370 [o_announce appendFormat:@",sap"];
373 if (![o_mode isEqualToString: @"RTP"]) {
374 /* split up the hostname and the following path to paste the
375 * port correctly. Not need, if there isn't any path following the
377 NSArray * o_urlItems = [[o_stream_address stringValue] componentsSeparatedByString: @"/"];
378 NSMutableString * o_finalStreamAddress;
379 o_finalStreamAddress = [[NSMutableString alloc] init];
381 if ([o_urlItems count] == 1)
382 [o_finalStreamAddress appendFormat: @"\"%@:%@\"", [o_stream_address stringValue],[o_stream_port stringValue]];
384 [o_finalStreamAddress appendFormat: @"\"%@:%@", [o_urlItems objectAtIndex: 0], [o_stream_port stringValue]];
385 NSUInteger itemCount = [o_urlItems count];
386 for (NSUInteger x = 0; x < itemCount; x++)
387 [o_finalStreamAddress appendFormat: @"/%@", [o_urlItems objectAtIndex: x]];
388 [o_finalStreamAddress appendString: @"\""];
391 [o_mrl_string appendFormat:
392 @"standard{mux=%@,access=%@,dst=%@%@}",
393 o_mode, o_mux_string, o_finalStreamAddress, o_announce];
395 NSString * o_stream_name;
397 if (![[o_channel_name stringValue] isEqualToString: @""])
398 o_stream_name = [NSString stringWithFormat:@",name=%@", [o_channel_name stringValue]];
402 if ([o_sap_chkbox state] == NSOnState)
403 [o_announce appendString: @",sdp=sap"];
405 if ([o_rtsp_chkbox state] == NSOnState)
406 [o_announce appendFormat:@",sdp=\"rtsp://%@\"",[o_sdp_url stringValue]];
408 if ([o_http_chkbox state] == NSOnState)
409 [o_announce appendFormat:@",sdp=\"http://%@\"",[o_sdp_url stringValue]];
411 if ([o_file_chkbox state] == NSOnState)
412 [o_announce appendFormat:@",sdp=\"file://%@\"",[o_sdp_url stringValue]];
414 [o_mrl_string appendFormat:
415 @"rtp{mux=ts,dst=\"%@\",port=%@%@%@}",[o_stream_address stringValue],
416 [o_stream_port stringValue], o_stream_name, o_announce];
420 if ([o_display state] == NSOnState)
421 [o_mrl_string appendString: @"}"];
423 o_sout_options = [NSArray arrayWithObjects: o_mrl_string,nil];
424 [self setSoutMRL:o_sout_options];
427 - (void)TTLChanged:(NSNotification *)o_notification
429 intf_thread_t * p_intf = VLCIntf;
430 config_PutInt(p_intf, "ttl", [o_stream_ttl intValue]);
433 - (IBAction)outputFileBrowse:(id)sender
435 NSSavePanel *o_save_panel = [NSSavePanel savePanel];
436 NSString *o_mux_string;
437 if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"MPEG PS"])
438 o_mux_string = @"vob";
439 else if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"MPEG 1"])
440 o_mux_string = @"mpg";
441 else if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"AVI"])
442 o_mux_string = @"avi";
443 else if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"ASF"])
444 o_mux_string = @"asf";
445 else if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"Ogg"])
446 o_mux_string = @"ogm";
447 else if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"MPEG 4"])
448 o_mux_string = @"mp4";
449 else if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"Quicktime"])
450 o_mux_string = @"mov";
451 else if ([[o_mux_selector titleOfSelectedItem] isEqualToString: @"Raw"])
452 o_mux_string = @"raw";
454 o_mux_string = @"ts";
456 NSString * o_name = [NSString stringWithFormat: @"vlc-output.%@",
459 [o_save_panel setTitle: _NS("Save File")];
460 [o_save_panel setPrompt: _NS("Save")];
461 [o_save_panel setNameFieldStringValue: o_name];
463 if ([o_save_panel runModal] == NSFileHandlingPanelOKButton) {
464 [o_file_field setStringValue: [[o_save_panel URL] path]];
465 [self outputInfoChanged: nil];
469 - (IBAction)streamPortStepperChanged:(id)sender
471 [o_stream_port setIntValue: [o_stream_port_stp intValue]];
472 [self outputInfoChanged: nil];
475 - (IBAction)streamTTLStepperChanged:(id)sender
477 [o_stream_ttl setIntValue: [o_stream_ttl_stp intValue]];
478 [self TTLChanged:nil];
481 - (void)transcodeChanged:(NSNotification *)o_notification
483 if ([o_transcode_video_chkbox state] == NSOnState) {
484 [o_transcode_video_selector setEnabled: YES];
485 [o_transcode_video_bitrate setEnabled: YES];
486 [o_transcode_video_scale setEnabled: YES];
488 [o_transcode_video_selector setEnabled: NO];
489 [o_transcode_video_bitrate setEnabled: NO];
490 [o_transcode_video_scale setEnabled: NO];
492 if ([o_transcode_audio_chkbox state] == NSOnState) {
493 [o_transcode_audio_selector setEnabled: YES];
494 [o_transcode_audio_bitrate setEnabled: YES];
495 [o_transcode_audio_channels setEnabled: YES];
497 [o_transcode_audio_selector setEnabled: NO];
498 [o_transcode_audio_bitrate setEnabled: NO];
499 [o_transcode_audio_channels setEnabled: NO];
502 [self transcodeInfoChanged:nil];
505 - (void)transcodeInfoChanged:(NSNotification *)o_notification
507 NSMutableString *o_transcode_string = [NSMutableString stringWithCapacity:200];
509 if ([o_transcode_video_chkbox state] == NSOnState ||
510 [o_transcode_audio_chkbox state] == NSOnState) {
511 [o_transcode_string appendString:@"transcode{"];
512 if ([o_transcode_video_chkbox state] == NSOnState) {
513 [o_transcode_string appendFormat: @"vcodec=\"%@\",vb=\"%@\"" \
515 [o_transcode_video_selector titleOfSelectedItem],
516 [o_transcode_video_bitrate stringValue],
517 [o_transcode_video_scale stringValue]];
518 if ([o_transcode_audio_chkbox state] == NSOnState)
519 [o_transcode_string appendString: @","];
521 if ([o_transcode_audio_chkbox state] == NSOnState) {
522 [o_transcode_string appendFormat: @"acodec=\"%@\",ab=\"%@\"",
523 [o_transcode_audio_selector titleOfSelectedItem],
524 [o_transcode_audio_bitrate stringValue]];
525 if (![[o_transcode_audio_channels stringValue] isEqualToString: @""])
526 [o_transcode_string appendFormat: @",channels=\"%@\"", [o_transcode_audio_channels stringValue]];
528 [o_transcode_string appendString:@"}:"];
531 [o_transcode_string setString: @""];
533 [self setTranscode: o_transcode_string];
534 [self outputInfoChanged:nil];
537 - (IBAction)announceChanged:(id)sender
540 o_mode = [[o_stream_type selectedCell] title];
541 [o_channel_name setEnabled: [o_sap_chkbox state] ||
542 [o_mode isEqualToString: @"RTP"]];
544 if ([o_mode isEqualToString: @"RTP"]) {
545 /* if ([[sender title] isEqualToString: _NS("SAP Announcement")]) {
546 [o_rtsp_chkbox setState:NSOffState];
547 [o_http_chkbox setState:NSOffState];
549 if ([[sender title] isEqualToString:_NS("RTSP Announcement")]) {
550 // [o_sap_chkbox setState:NSOffState];
551 [o_http_chkbox setState:NSOffState];
552 [o_file_chkbox setState:NSOffState];
553 } else if ([[sender title] isEqualToString:_NS("HTTP Announcement")]) {
554 // [o_sap_chkbox setState:NSOffState];
555 [o_rtsp_chkbox setState:NSOffState];
556 [o_file_chkbox setState:NSOffState];
557 } else if ([[sender title] isEqualToString:_NS("Export SDP as file")]) {
558 [o_rtsp_chkbox setState:NSOffState];
559 [o_http_chkbox setState:NSOffState];
562 if ([o_rtsp_chkbox state] == NSOnState ||
563 [o_http_chkbox state] == NSOnState ||
564 [o_file_chkbox state] == NSOnState)
565 [o_sdp_url setEnabled: YES];
567 [o_sdp_url setEnabled: NO];
569 [self outputInfoChanged: nil];