+ if( [o_sap_chkbox state] == NSOnState )
+ {
+ if ( ![[o_channel_name stringValue] isEqualToString: @""] )
+ [o_announce appendFormat:
+ @",sap,name=%@", [o_channel_name stringValue]];
+ else
+ [o_announce appendFormat:@",sap"];
+ }
+ }
+ 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=%@,dst=%@%@}",
+ o_mode, o_mux_string, o_finalStreamAddress, o_announce];
+ }
+ else
+ {
+ NSString * o_stream_name;
+
+ if (![[o_channel_name stringValue] isEqualToString: @""] )
+ {
+ o_stream_name = [NSString stringWithFormat:@",name=%@",
+ [o_channel_name stringValue]];
+ }
+ else
+ {
+ o_stream_name = @"";
+ }
+
+ if ( [o_sap_chkbox state] == NSOnState )
+ {
+ [o_announce appendString: @",sdp=sap"];
+ }
+ if ([o_rtsp_chkbox state] == NSOnState )
+ {
+ [o_announce appendFormat:@",sdp=\"rtsp://%@\"",[o_sdp_url stringValue]];
+
+ }
+ if ([o_http_chkbox state] == NSOnState )
+ {
+ [o_announce appendFormat:@",sdp=\"http://%@\"",[o_sdp_url stringValue]];
+ }
+ if ([o_file_chkbox state] == NSOnState )
+ {
+ [o_announce appendFormat:@",sdp=\"file://%@\"",[o_sdp_url stringValue]];
+ }
+ [o_mrl_string appendFormat:
+ @"rtp{dst=\"%@\",port=%@%@%@}",[o_stream_address stringValue],
+ [o_stream_port stringValue], o_stream_name, o_announce];
+ }
+
+ }
+ if( [o_display state] == NSOnState )
+ {
+ [o_mrl_string appendString: @"}"];