Commit 0ca0b5f9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: implement RTP stream selection. Closes #2497, while #2496 is invalid...

macosx: implement RTP stream selection. Closes #2497, while #2496 is invalid as RTMP streams can easily opened by pasting the respective URL in the 'URL' field...
parent 639c76d8
......@@ -113,12 +113,16 @@
"o_net_http_url_lbl" = id;
"o_net_mode" = id;
"o_net_openUDP_btn" = id;
"o_net_udp_address_lbl" = id;
"o_net_udp_cancel_btn" = id;
"o_net_udp_mode_lbl" = id;
"o_net_udp_ok_btn" = id;
"o_net_udp_panel" = id;
"o_net_udp_port" = id;
"o_net_udp_port_lbl" = id;
"o_net_udp_port_stp" = id;
"o_net_udp_protocol_lbl" = id;
"o_net_udp_protocol_mat" = id;
"o_net_udpm_addr" = id;
"o_net_udpm_addr_lbl" = id;
"o_net_udpm_port" = id;
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>63 88 356 240 0 0 1280 778 </string>
<string>129 203 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
<key>2297</key>
......@@ -11,7 +11,7 @@
<key>2346</key>
<string>366 401 548 264 0 0 1280 778 </string>
<key>2837</key>
<string>353 532 573 94 0 0 1280 778 </string>
<string>353 528 573 94 0 0 1280 778 </string>
</dict>
<key>IBFramework Version</key>
<string>489.0</string>
......@@ -20,10 +20,10 @@
<key>IBOpenObjects</key>
<array>
<integer>2792</integer>
<integer>2346</integer>
<integer>636</integer>
<integer>2297</integer>
<integer>2837</integer>
<integer>2346</integer>
</array>
<key>IBSystem Version</key>
<string>9G55</string>
......
......@@ -67,10 +67,16 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
IBOutlet id o_disc_dvd_menus;
/* open network */
IBOutlet id o_net_help_lbl;
IBOutlet id o_net_help_udp_lbl;
IBOutlet id o_net_http_url;
IBOutlet id o_net_http_url_lbl;
IBOutlet id o_net_help_lbl;
/* open UDP stuff panel */
IBOutlet id o_net_help_udp_lbl;
IBOutlet id o_net_udp_protocol_mat;
IBOutlet id o_net_udp_protocol_lbl;
IBOutlet id o_net_udp_address_lbl;
IBOutlet id o_net_udp_mode_lbl;
IBOutlet id o_net_mode;
IBOutlet id o_net_openUDP_btn;
IBOutlet id o_net_udp_cancel_btn;
......
......@@ -194,9 +194,12 @@ static VLCOpen *_o_sharedMainInstance = nil;
[o_net_udp_cancel_btn setTitle: _NS("Cancel")];
[o_net_udp_ok_btn setTitle: _NS("Open")];
[o_net_openUDP_btn setTitle: _NS("Open RTP/UDP Stream")];
[o_net_udp_mode_lbl setStringValue: _NS("Mode")];
[o_net_udp_protocol_lbl setStringValue: _NS("Protocol")];
[o_net_udp_address_lbl setStringValue: _NS("Address")];
[[o_net_mode cellAtRow:0 column:0] setTitle: _NS("UDP/RTP")];
[[o_net_mode cellAtRow:1 column:0] setTitle: _NS("UDP/RTP Multicast")];
[[o_net_mode cellAtRow:0 column:0] setTitle: _NS("Unicast")];
[[o_net_mode cellAtRow:1 column:0] setTitle: _NS("Multicast")];
[o_net_udp_port setIntValue: config_GetInt( p_intf, "server-port" )];
[o_net_udp_port_stp setIntValue: config_GetInt( p_intf, "server-port" )];
......@@ -759,13 +762,15 @@ static VLCOpen *_o_sharedMainInstance = nil;
- (IBAction)openNetModeChanged:(id)sender
{
if( [[sender selectedCell] tag] == 0 )
[o_panel makeFirstResponder: o_net_udp_port];
else if ( [[sender selectedCell] tag] == 1 )
[o_panel makeFirstResponder: o_net_udpm_addr];
else
msg_Warn( p_intf, "Unknown sender tried to change UDP/RTP mode" );
if( sender == o_net_mode )
{
if( [[sender selectedCell] tag] == 0 )
[o_panel makeFirstResponder: o_net_udp_port];
else if ( [[sender selectedCell] tag] == 1 )
[o_panel makeFirstResponder: o_net_udpm_addr];
else
msg_Warn( p_intf, "Unknown sender tried to change UDP/RTP mode" );
}
[self openNetInfoChanged: nil];
}
......@@ -801,11 +806,14 @@ static VLCOpen *_o_sharedMainInstance = nil;
NSString *o_mode;
o_mode = [[o_net_mode selectedCell] title];
if( [o_mode isEqualToString: _NS("UDP/RTP")] )
if( [o_mode isEqualToString: _NS("Unicast")] )
{
int i_port = [o_net_udp_port intValue];
o_mrl_string = [NSString stringWithString: @"udp://"];
if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
o_mrl_string = [NSString stringWithString: @"udp://"];
else
o_mrl_string = [NSString stringWithString: @"rtp://"];
if( i_port != config_GetInt( p_intf, "server-port" ) )
{
......@@ -813,12 +821,15 @@ static VLCOpen *_o_sharedMainInstance = nil;
[o_mrl_string stringByAppendingFormat: @"@:%i", i_port];
}
}
else if( [o_mode isEqualToString: _NS("UDP/RTP Multicast")] )
else if( [o_mode isEqualToString: _NS("Multicast")] )
{
NSString *o_addr = [o_net_udpm_addr stringValue];
int i_port = [o_net_udpm_port intValue];
o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
else
o_mrl_string = [NSString stringWithFormat: @"rtp://@%@", o_addr];
if( i_port != config_GetInt( p_intf, "server-port" ) )
{
......@@ -849,6 +860,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
modalDelegate: self
didEndSelector: NULL
contextInfo: nil];
[self openNetInfoChanged: nil];
}
else if( sender == o_net_udp_cancel_btn )
{
......@@ -858,25 +870,31 @@ static VLCOpen *_o_sharedMainInstance = nil;
else if( sender == o_net_udp_ok_btn )
{
NSString *o_mrl_string = [NSString string];
if( [[[o_net_mode selectedCell] title] isEqualToString: _NS("UDP/RTP")] )
if( [[[o_net_mode selectedCell] title] isEqualToString: _NS("Unicast")] )
{
int i_port = [o_net_udp_port intValue];
o_mrl_string = [NSString stringWithString: @"udp://"];
if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
o_mrl_string = [NSString stringWithString: @"udp://"];
else
o_mrl_string = [NSString stringWithString: @"rtp://"];
if( i_port != config_GetInt( p_intf, "server-port" ) )
{
o_mrl_string =
[o_mrl_string stringByAppendingFormat: @"@:%i", i_port];
}
}
else if( [[[o_net_mode selectedCell] title] isEqualToString: _NS("UDP/RTP Multicast")] )
else if( [[[o_net_mode selectedCell] title] isEqualToString: _NS("Multicast")] )
{
NSString *o_addr = [o_net_udpm_addr stringValue];
int i_port = [o_net_udpm_port intValue];
o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
else
o_mrl_string = [NSString stringWithFormat: @"rtp://@%@", o_addr];
if( i_port != config_GetInt( p_intf, "server-port" ) )
{
o_mrl_string =
......
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