Commit ef198559 authored by Benjamin Pracht's avatar Benjamin Pracht

Added a RTP (New) stream outpu method for the rtp sout module. Still lot of...

Added a RTP (New) stream outpu method for the rtp sout module. Still lot of work in this dialog box.


parent eb83d508
...@@ -316,6 +316,7 @@ ...@@ -316,6 +316,7 @@
"o_display" = id; "o_display" = id;
"o_dump_chkbox" = id; "o_dump_chkbox" = id;
"o_file_field" = id; "o_file_field" = id;
"o_http_chkbox" = id;
"o_method" = id; "o_method" = id;
"o_misc_lbl" = id; "o_misc_lbl" = id;
"o_mux_lbl" = id; "o_mux_lbl" = id;
...@@ -325,7 +326,10 @@ ...@@ -325,7 +326,10 @@
"o_output_ckbox" = id; "o_output_ckbox" = id;
"o_output_settings" = id; "o_output_settings" = id;
"o_output_sheet" = id; "o_output_sheet" = id;
"o_rtsp_chkbox" = id;
"o_sap_chkbox" = id; "o_sap_chkbox" = id;
"o_sdp_url" = id;
"o_sdp_url_lbl" = id;
"o_slp_chkbox" = id; "o_slp_chkbox" = id;
"o_stream_address" = id; "o_stream_address" = id;
"o_stream_address_lbl" = id; "o_stream_address_lbl" = id;
......
...@@ -3,28 +3,28 @@ ...@@ -3,28 +3,28 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>391 199 505 517 0 0 1280 1002 </string> <string>539 187 505 517 0 0 1024 746 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key> <key>1617</key>
<string>693 686 104 149 0 0 1280 1002 </string> <string>542 480 104 149 0 0 1024 746 </string>
<key>29</key> <key>29</key>
<string>-9 958 419 44 0 0 1280 1002 </string> <string>366 655 419 44 0 0 1024 746 </string>
<key>915</key> <key>915</key>
<string>54 452 185 199 0 0 1024 746 </string> <string>54 452 185 199 0 0 1024 746 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>364.0</string> <string>362.0</string>
<key>IBLockedObjects</key> <key>IBLockedObjects</key>
<array> <array>
<integer>1789</integer> <integer>1789</integer>
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>1411</integer>
<integer>29</integer>
<integer>21</integer> <integer>21</integer>
<integer>1617</integer> <integer>1617</integer>
<integer>1647</integer>
<integer>29</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>7H63</string> <string>7H63</string>
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self initStrings]; [self initStrings];
[[NSNotificationCenter defaultCenter] addObserver: self [[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(outputInfoChanged:) selector: @selector(outputInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
...@@ -105,6 +105,10 @@ ...@@ -105,6 +105,10 @@
selector: @selector(transcodeInfoChanged:) selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: o_channel_name]; object: o_channel_name];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification
object: o_sdp_url];
[o_mux_selector setAutoenablesItems: NO]; [o_mux_selector setAutoenablesItems: NO];
[self transcodeChanged:nil]; [self transcodeChanged:nil];
...@@ -122,11 +126,11 @@ ...@@ -122,11 +126,11 @@
NSArray *o_a_codecs = [NSArray arrayWithObjects: @"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx ", 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", NSArray *o_v_codecs = [NSArray arrayWithObjects: @"mp1v", @"mp2v", @"mp4v", @"DIV1",
@"DIV2", @"DIV3", @"H263", @"I263", @"WMV1", @"WMV2", @"MJPG", @"theo", nil]; @"DIV2", @"DIV3", @"H263", @"I263", @"WMV1", @"WMV2", @"MJPG", @"theo", nil];
[o_output_ckbox setTitle: _NS("Advanced output:")]; [o_output_ckbox setTitle: _NS("Advanced output:")];
[o_output_settings setTitle: _NS("Settings...")]; [o_output_settings setTitle: _NS("Settings...")];
[o_btn_ok setTitle: _NS("OK")]; [o_btn_ok setTitle: _NS("OK")];
[o_options_lbl setTitle: _NS("Output Options")]; [o_options_lbl setTitle: _NS("Output Options")];
[o_display setTitle: _NS("Play locally")]; [o_display setTitle: _NS("Play locally")];
[[o_method cellAtRow:0 column:0] setTitle: _NS("File")]; [[o_method cellAtRow:0 column:0] setTitle: _NS("File")];
...@@ -140,12 +144,13 @@ ...@@ -140,12 +144,13 @@
[[o_stream_type itemAtIndex: 1] setTitle: @"MMSH"]; [[o_stream_type itemAtIndex: 1] setTitle: @"MMSH"];
[[o_stream_type itemAtIndex: 2] setTitle: @"UDP"]; [[o_stream_type itemAtIndex: 2] setTitle: @"UDP"];
[[o_stream_type itemAtIndex: 3] setTitle: @"RTP"]; [[o_stream_type itemAtIndex: 3] setTitle: @"RTP"];
[[o_stream_type itemAtIndex: 4] setTitle: @"RTP (New)"];
[o_stream_type_lbl setStringValue: _NS("Type")]; [o_stream_type_lbl setStringValue: _NS("Type")];
[o_mux_lbl setStringValue: _NS("Encapsulation Method")]; [o_mux_lbl setStringValue: _NS("Encapsulation Method")];
[o_mux_selector removeAllItems]; [o_mux_selector removeAllItems];
[o_mux_selector addItemsWithTitles: o_muxers]; [o_mux_selector addItemsWithTitles: o_muxers];
[o_transcode_lbl setTitle: _NS("Transcode options")]; [o_transcode_lbl setTitle: _NS("Transcode options")];
[o_transcode_video_chkbox setTitle: _NS("Video")]; [o_transcode_video_chkbox setTitle: _NS("Video")];
[o_transcode_video_selector removeAllItems]; [o_transcode_video_selector removeAllItems];
...@@ -162,11 +167,15 @@ ...@@ -162,11 +167,15 @@
[o_transcode_audio_channels_lbl setStringValue: _NS("Channels")]; [o_transcode_audio_channels_lbl setStringValue: _NS("Channels")];
[o_transcode_audio_channels removeAllItems]; [o_transcode_audio_channels removeAllItems];
[o_transcode_audio_channels addItemsWithObjectValues: o_a_channels]; [o_transcode_audio_channels addItemsWithObjectValues: o_a_channels];
[o_misc_lbl setTitle: _NS("Stream Announcing")]; [o_misc_lbl setTitle: _NS("Stream Announcing")];
[o_sap_chkbox setTitle: _NS("SAP announce")]; [o_sap_chkbox setTitle: _NS("SAP announce")];
[o_slp_chkbox setTitle: _NS("SLP announce")]; [o_slp_chkbox setTitle: _NS("SLP announce")];
[o_rtsp_chkbox setTitle: _NS("RTSP announce")];
[o_http_chkbox setTitle:_NS("HTTP announce")];
[o_channel_name_lbl setStringValue: _NS("Channel Name")]; [o_channel_name_lbl setStringValue: _NS("Channel Name")];
[o_sdp_url_lbl setStringValue: _NS("SDP file address")];
} }
- (IBAction)outputChanged:(id)sender; - (IBAction)outputChanged:(id)sender;
...@@ -200,10 +209,13 @@ ...@@ -200,10 +209,13 @@
{ {
NSString *o_mode; NSString *o_mode;
o_mode = [[o_method selectedCell] title]; o_mode = [[o_method selectedCell] title];
[o_sap_chkbox setEnabled: NO]; [o_sap_chkbox setEnabled: NO];
[o_slp_chkbox setEnabled: NO]; [o_slp_chkbox setEnabled: NO];
[o_http_chkbox setEnabled: NO];
[o_rtsp_chkbox setEnabled: NO];
[o_channel_name setEnabled: NO]; [o_channel_name setEnabled: NO];
[o_sdp_url setEnabled: NO];
[[o_mux_selector itemAtIndex: 0] setEnabled: YES]; [[o_mux_selector itemAtIndex: 0] setEnabled: YES];
if( [o_mode isEqualToString: _NS("File")] ) if( [o_mode isEqualToString: _NS("File")] )
...@@ -236,9 +248,9 @@ ...@@ -236,9 +248,9 @@
[o_stream_port_stp setEnabled: YES]; [o_stream_port_stp setEnabled: YES];
[o_stream_type setEnabled: YES]; [o_stream_type setEnabled: YES];
[o_mux_selector setEnabled: YES]; [o_mux_selector setEnabled: YES];
o_mode = [o_stream_type titleOfSelectedItem]; o_mode = [o_stream_type titleOfSelectedItem];
if( [o_mode isEqualToString: @"HTTP"] ) if( [o_mode isEqualToString: @"HTTP"] )
{ {
[o_stream_address setEnabled: YES]; [o_stream_address setEnabled: YES];
...@@ -267,6 +279,7 @@ ...@@ -267,6 +279,7 @@
[[o_mux_selector itemAtIndex: 6] setEnabled: NO]; [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
[[o_mux_selector itemAtIndex: 7] setEnabled: NO]; [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
[[o_mux_selector itemAtIndex: 8] setEnabled: NO]; [[o_mux_selector itemAtIndex: 8] setEnabled: NO];
[o_mux_selector selectItemAtIndex: 5];
} }
else if( [o_mode isEqualToString: @"UDP"] ) else if( [o_mode isEqualToString: @"UDP"] )
{ {
...@@ -299,11 +312,37 @@ ...@@ -299,11 +312,37 @@
[[o_mux_selector itemAtIndex: 7] setEnabled: NO]; [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
[[o_mux_selector itemAtIndex: 8] setEnabled: YES]; [[o_mux_selector itemAtIndex: 8] setEnabled: YES];
} }
else if( [o_mode isEqualToString: @"RTP (New)"] )
{
[o_stream_address setEnabled: YES];
[o_stream_ttl setEnabled: YES];
[o_stream_ttl_stp setEnabled: YES];
[[o_mux_selector itemAtIndex: 0] setEnabled: NO];
[[o_mux_selector itemAtIndex: 1] setEnabled: NO];
[[o_mux_selector itemAtIndex: 2] setEnabled: NO];
[[o_mux_selector itemAtIndex: 3] setEnabled: NO];
[[o_mux_selector itemAtIndex: 4] setEnabled: NO];
[[o_mux_selector itemAtIndex: 5] setEnabled: NO];
[[o_mux_selector itemAtIndex: 6] setEnabled: NO];
[[o_mux_selector itemAtIndex: 7] setEnabled: NO];
[[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_channel_name setEnabled: YES];
}
} }
if( ![[o_mux_selector selectedItem] isEnabled] )
if( ![[o_mux_selector selectedItem] isEnabled] && ![o_mode isEqualToString: @"RTP (New)"] )
{ {
[o_mux_selector selectItemAtIndex: 0]; [o_mux_selector selectItemAtIndex: 0];
} }
else if (![[o_mux_selector selectedItem] isEnabled] && [o_mode isEqualToString: @"RTP (New)"] )
{
[o_mux_selector selectItemAtIndex: 8];
}
[self outputInfoChanged: nil]; [self outputInfoChanged: nil];
} }
...@@ -352,7 +391,7 @@ ...@@ -352,7 +391,7 @@
{ {
o_mode = [o_stream_type titleOfSelectedItem]; o_mode = [o_stream_type titleOfSelectedItem];
o_announce = @""; o_announce = @"";
if ( [o_mode isEqualToString: @"HTTP"] ) if ( [o_mode isEqualToString: @"HTTP"] )
o_mode = @"http"; o_mode = @"http";
else if ( [o_mode isEqualToString: @"MMSH"] ) else if ( [o_mode isEqualToString: @"MMSH"] )
...@@ -382,11 +421,46 @@ ...@@ -382,11 +421,46 @@
} }
else if ( [o_mode isEqualToString: @"RTP"] ) else if ( [o_mode isEqualToString: @"RTP"] )
o_mode = @"rtp"; o_mode = @"rtp";
[o_mrl_string appendFormat: if ( ![o_mode isEqualToString: @"RTP (New)"] )
{
[o_mrl_string appendFormat:
@"std{access=%@,mux=%@,url=\"%@:%@\"%@}", @"std{access=%@,mux=%@,url=\"%@:%@\"%@}",
o_mode, o_mux_string, [o_stream_address stringValue], o_mode, o_mux_string, [o_stream_address stringValue],
[o_stream_port stringValue], o_announce]; [o_stream_port stringValue], 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 = @",sdp=sap";
}
else if ([o_rtsp_chkbox state] == NSOnState )
{
o_announce = [NSString stringWithFormat:@",sdp=\"rtsp://%@\"",[o_sdp_url stringValue]];
}
else if ([o_http_chkbox state] == NSOnState )
{
o_announce = [NSString stringWithFormat:@",sdp=\"http://%@\"",[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 ) if( [o_display state] == NSOnState )
{ {
...@@ -482,7 +556,7 @@ ...@@ -482,7 +556,7 @@
- (void)transcodeInfoChanged:(NSNotification *)o_notification - (void)transcodeInfoChanged:(NSNotification *)o_notification
{ {
NSMutableString *o_transcode_string; NSMutableString *o_transcode_string;
if( [o_transcode_video_chkbox state] == NSOnState || if( [o_transcode_video_chkbox state] == NSOnState ||
[o_transcode_audio_chkbox state] == NSOnState ) [o_transcode_audio_chkbox state] == NSOnState )
{ {
...@@ -499,6 +573,7 @@ ...@@ -499,6 +573,7 @@
} }
if ( [o_transcode_audio_chkbox state] == NSOnState ) if ( [o_transcode_audio_chkbox state] == NSOnState )
{ {
fprintf(stderr,"%s\n",[[o_transcode_audio_bitrate stringValue] cString]);
[o_transcode_string appendFormat: @"acodec=\"%@\",ab=\"%@\"", [o_transcode_string appendFormat: @"acodec=\"%@\",ab=\"%@\"",
[o_transcode_audio_selector titleOfSelectedItem], [o_transcode_audio_selector titleOfSelectedItem],
[o_transcode_audio_bitrate stringValue]]; [o_transcode_audio_bitrate stringValue]];
...@@ -515,7 +590,39 @@ ...@@ -515,7 +590,39 @@
- (IBAction)announceChanged:(id)sender - (IBAction)announceChanged:(id)sender
{ {
[o_channel_name setEnabled: [o_sap_chkbox state] || [o_slp_chkbox state]]; 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 (New)"]];
if ([o_mode isEqualToString: @"RTP (New)"])
{
if ([[sender title] isEqualToString: _NS("SAP announce")])
{
[o_rtsp_chkbox setState:NSOffState];
[o_http_chkbox setState:NSOffState];
}
else if ([[sender title] isEqualToString:_NS("RTSP announce")])
{
[o_sap_chkbox setState:NSOffState];
[o_http_chkbox setState:NSOffState];
}
else if ([[sender title] isEqualToString:_NS("HTTP announce")])
{
[o_sap_chkbox setState:NSOffState];
[o_rtsp_chkbox setState:NSOffState];
}
if ( [o_rtsp_chkbox state] == NSOnState ||
[o_http_chkbox state] == NSOnState)
{
[o_sdp_url setEnabled: YES];
}
else
{
[o_sdp_url setEnabled: NO];
}
}
[self outputInfoChanged: nil]; [self outputInfoChanged: nil];
} }
......
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