From 9ac4974df9c83c5feaffdcb58b0b5fe26118fce7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Saman Date: Sun, 30 Nov 2003 23:19:13 +0000 Subject: [PATCH 1/1] PDA Interface: - Coding Style - Added SAP/SLP to transcode tabpage - Reworking transcoding options for playlist --- modules/gui/pda/pda.glade | 455 ++++++++++++++++++++++++-------- modules/gui/pda/pda_callbacks.c | 203 ++++++++------ modules/gui/pda/pda_callbacks.h | 6 +- modules/gui/pda/pda_interface.c | 158 ++++++++--- modules/gui/pda/pda_support.c | 2 +- 5 files changed, 598 insertions(+), 226 deletions(-) diff --git a/modules/gui/pda/pda.glade b/modules/gui/pda/pda.glade index 5d984189c2..542bbfbd09 100644 --- a/modules/gui/pda/pda.glade +++ b/modules/gui/pda/pda.glade @@ -40,6 +40,7 @@ Rewind True pda-rewindb16x16.xpm + True @@ -108,6 +109,7 @@ About True vlc16x16.png + True @@ -128,6 +130,7 @@ 0.5 0 0 + True True @@ -340,7 +343,7 @@ True True 0 - udp://:1234 + True * True @@ -1760,7 +1763,7 @@ True - 11 + 14 2 False 0 @@ -1806,7 +1809,7 @@ True True 0 - + huffyuv True * True @@ -1819,7 +1822,7 @@ GTK_SELECTION_BROWSE - + True True huffyuv @@ -1827,90 +1830,58 @@ - - True - True - mpgv - - - - - + True True - mp4v + mp1v - + True True - h263 + mp2v - + True True - DIV1 - - - - - - True - True - DIV2 - - - - - - True - True - DIV3 - - - - - - True - True - I420 + mp4v - + True True - I422 + H263 - + True True - I444 + I263 - + True True - RV24 + WMV1 - + True True - YUY2 + WMV2 @@ -2179,7 +2150,7 @@ True True 0 - + 127.0.0.1 True * True @@ -2192,7 +2163,7 @@ GTK_SELECTION_BROWSE - + True True 127.0.0.1 @@ -2200,7 +2171,7 @@ - + True True localhost @@ -2208,7 +2179,7 @@ - + True True localhost.localdomain @@ -2216,7 +2187,7 @@ - + True True 239.0.0.42 @@ -2250,7 +2221,7 @@ True True 0 - + ps True * True @@ -2263,65 +2234,66 @@ GTK_SELECTION_BROWSE - + True True - udp + ps - - - - - 1 - 2 - 8 - 9 - - - - - - True - False - True - False - True - False + + + True + True + ts + + - - - True - True - True - True - 0 - - True - * - True - - + + + True + True + mpeg1 + + - - - True - GTK_SELECTION_BROWSE + + + True + True + avi + + - + True True - ts + ogg - + True True - rtp + mp4 + + + + + + True + True + mov + + + + + + True + True + asf @@ -2330,8 +2302,8 @@ 1 2 - 7 - 8 + 8 + 9 @@ -2374,7 +2346,7 @@ True True 0 - + alaw True * True @@ -2387,7 +2359,7 @@ GTK_SELECTION_BROWSE - + True True alaw @@ -2395,7 +2367,7 @@ - + True True ulaw @@ -2403,7 +2375,7 @@ - + True True mpga @@ -2411,12 +2383,28 @@ - + True True mp3 + + + + True + True + a52 + + + + + + True + True + vorb + + @@ -2538,6 +2526,263 @@ + + + + True + False + True + False + True + False + + + + True + True + True + True + 0 + udp + True + * + True + + + + + + + True + GTK_SELECTION_BROWSE + + + + True + True + udp + + + + + + True + True + display + + + + + + True + True + file + + + + + + True + True + http + + + + + + True + True + mmsh + + + + + + True + True + rtp + + + + + + True + True + http + + + + + + True + True + ftp + + + + + + + 1 + 2 + 7 + 8 + + + + + + + True + SAP Announce: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 11 + 12 + fill + + + + + + + True + True + enable + True + GTK_RELIEF_NORMAL + False + False + True + + + 1 + 2 + 11 + 12 + fill + + + + + + + True + True + enable + True + GTK_RELIEF_NORMAL + False + False + True + + + 1 + 2 + 12 + 13 + fill + + + + + + + True + SLP Announce: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 12 + 13 + fill + + + + + + + True + Announce Channel: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 13 + 14 + fill + + + + + + + True + False + True + False + True + False + + + + True + True + True + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + + 1 + 2 + 13 + 14 + + + diff --git a/modules/gui/pda/pda_callbacks.c b/modules/gui/pda/pda_callbacks.c index 0d98402819..ef8930bfd3 100644 --- a/modules/gui/pda/pda_callbacks.c +++ b/modules/gui/pda/pda_callbacks.c @@ -2,7 +2,7 @@ * pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin. ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: pda_callbacks.c,v 1.20 2003/11/30 21:21:20 jpsaman Exp $ + * $Id: pda_callbacks.c,v 1.21 2003/11/30 23:19:13 jpsaman Exp $ * * Authors: Jean-Paul Saman * @@ -538,11 +538,11 @@ void onAddFileToPlaylist(GtkButton *button, gpointer user_data) void NetworkBuildMRL(GtkEditable *editable, gpointer user_data) { intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(editable) ); - GtkSpinButton *networkPort = NULL; - GtkEntry *entryMRL = NULL; - GtkEntry *networkType = NULL; - GtkEntry *networkAddress = NULL; - GtkEntry *networkProtocol = NULL; + GtkSpinButton *p_networkPort = NULL; + GtkEntry *p_entryMRL = NULL; + GtkEntry *p_networkType = NULL; + GtkEntry *p_networkAddress = NULL; + GtkEntry *p_networkProtocol = NULL; const gchar *psz_mrlNetworkType; const gchar *psz_mrlAddress; const gchar *psz_mrlProtocol; @@ -550,17 +550,17 @@ void NetworkBuildMRL(GtkEditable *editable, gpointer user_data) char text[VLC_MAX_MRL]; int i_pos = 0; - entryMRL = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryMRL" ); + p_entryMRL = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryMRL" ); - networkType = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkType" ); - networkAddress = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkAddress" ); - networkPort = (GtkSpinButton*) lookup_widget( GTK_WIDGET(editable), "entryNetworkPort" ); - networkProtocol = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkProtocolType" ); + p_networkType = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkType" ); + p_networkAddress = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkAddress" ); + p_networkPort = (GtkSpinButton*) lookup_widget( GTK_WIDGET(editable), "entryNetworkPort" ); + p_networkProtocol = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkProtocolType" ); - psz_mrlNetworkType = gtk_entry_get_text(GTK_ENTRY(networkType)); - psz_mrlAddress = gtk_entry_get_text(GTK_ENTRY(networkAddress)); - i_mrlPort = gtk_spin_button_get_value_as_int(networkPort); - psz_mrlProtocol = gtk_entry_get_text(GTK_ENTRY(networkProtocol)); + psz_mrlNetworkType = gtk_entry_get_text(GTK_ENTRY(p_networkType)); + psz_mrlAddress = gtk_entry_get_text(GTK_ENTRY(p_networkAddress)); + i_mrlPort = gtk_spin_button_get_value_as_int(p_networkPort); + psz_mrlProtocol = gtk_entry_get_text(GTK_ENTRY(p_networkProtocol)); /* Build MRL from parts ;-) */ i_pos = snprintf( &text[0], VLC_MAX_MRL, "%s://", (char*)psz_mrlProtocol); @@ -576,12 +576,10 @@ void NetworkBuildMRL(GtkEditable *editable, gpointer user_data) msg_Err( p_intf, "Media Resource Locator is truncated to: %s", text); } - gtk_entry_set_text(entryMRL,text); + gtk_entry_set_text(p_entryMRL,text); } -void -onAddNetworkPlaylist (GtkButton *button, - gpointer user_data) +void onAddNetworkPlaylist(GtkButton *button, gpointer user_data) { GtkEntry *p_mrl = NULL; const gchar *psz_mrl_name; @@ -590,15 +588,15 @@ onAddNetworkPlaylist (GtkButton *button, if (p_mrl) { psz_mrl_name = gtk_entry_get_text(p_mrl); - - PlaylistAddItem(GTK_WIDGET(button), (gchar *)psz_mrl_name, 0, 0); + if (psz_mrl_name != NULL) + { + PlaylistAddItem(GTK_WIDGET(button), (gchar *)psz_mrl_name, 0, 0); + } } } -void -onAddCameraToPlaylist (GtkButton *button, - gpointer user_data) +void onAddCameraToPlaylist(GtkButton *button, gpointer user_data) { intf_thread_t *p_intf = GtkGetIntf( button ); @@ -722,43 +720,30 @@ onAddCameraToPlaylist (GtkButton *button, } -gboolean -PlaylistEvent (GtkWidget *widget, - GdkEvent *event, - gpointer user_data) +gboolean PlaylistEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data) { return FALSE; } -void -onPlaylistColumnsChanged (GtkTreeView *treeview, - gpointer user_data) +void onPlaylistColumnsChanged(GtkTreeView *treeview, gpointer user_data) { } -gboolean -onPlaylistRowSelected (GtkTreeView *treeview, - gboolean start_editing, - gpointer user_data) +gboolean onPlaylistRowSelected(GtkTreeView *treeview, gboolean start_editing, gpointer user_data) { return FALSE; } -void -onPlaylistRow (GtkTreeView *treeview, - GtkTreePath *path, - GtkTreeViewColumn *column, - gpointer user_data) +void onPlaylistRow(GtkTreeView *treeview, GtkTreePath *path, + GtkTreeViewColumn *column, gpointer user_data) { } -void -onUpdatePlaylist (GtkButton *button, - gpointer user_data) +void onUpdatePlaylist(GtkButton *button, gpointer user_data) { intf_thread_t * p_intf = GtkGetIntf( button ); playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, @@ -790,9 +775,7 @@ onUpdatePlaylist (GtkButton *button, vlc_object_release( p_playlist ); } -void -onDeletePlaylist (GtkButton *button, - gpointer user_data) +void onDeletePlaylist(GtkButton *button, gpointer user_data) { intf_thread_t *p_intf = GtkGetIntf( button ); playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, @@ -859,9 +842,7 @@ onDeletePlaylist (GtkButton *button, } -void -onClearPlaylist (GtkButton *button, - gpointer user_data) +void onClearPlaylist(GtkButton *button, gpointer user_data) { intf_thread_t *p_intf = GtkGetIntf( button ); playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, @@ -895,9 +876,7 @@ onClearPlaylist (GtkButton *button, } -void -onPreferenceSave (GtkButton *button, - gpointer user_data) +void onPreferenceSave(GtkButton *button, gpointer user_data) { #if 0 intf_thread_t *p_intf = GtkGetIntf( button ); @@ -908,9 +887,7 @@ onPreferenceSave (GtkButton *button, } -void -onPreferenceApply (GtkButton *button, - gpointer user_data) +void onPreferenceApply(GtkButton *button, gpointer user_data) { #if 0 intf_thread_t *p_intf = GtkGetIntf( button ); @@ -920,9 +897,7 @@ onPreferenceApply (GtkButton *button, } -void -onPreferenceCancel (GtkButton *button, - gpointer user_data) +void onPreferenceCancel(GtkButton *button, gpointer user_data) { #if 0 intf_thread_t *p_intf = GtkGetIntf( button ); @@ -935,8 +910,7 @@ onPreferenceCancel (GtkButton *button, } -void onAddTranscodeToPlaylist (GtkButton *button, - gpointer user_data) +void onAddTranscodeToPlaylist(GtkButton *button, gpointer user_data) { intf_thread_t *p_intf = GtkGetIntf( button ); @@ -958,10 +932,16 @@ void onAddTranscodeToPlaylist (GtkButton *button, GtkEntry *p_entryStdAccess = NULL; GtkEntry *p_entryStdMuxer = NULL; GtkEntry *p_entryStdURL = NULL; + GtkEntry *p_entryStdAnnounce = NULL; GtkSpinButton *p_entryStdTTL = NULL; + GtkCheckButton *p_checkSAP = NULL; + GtkCheckButton *p_checkSLP = NULL; + const gchar *p_std_announce; const gchar *p_std_access; const gchar *p_std_muxer; const gchar *p_std_url; + gboolean b_sap_announce; + gboolean b_slp_announce; gint i_std_ttl; char **ppsz_options = NULL; /* list of options */ @@ -971,13 +951,13 @@ void onAddTranscodeToPlaylist (GtkButton *button, gchar mrl[7]; int i_pos; - ppsz_options = (char **) malloc(15 *sizeof(char*)); + ppsz_options = (char **) malloc(3 *sizeof(char*)); if (ppsz_options == NULL) { msg_Err(p_intf, "No memory to allocate for v4l options."); return; } - for (i=0; i<15; i++) + for (i=0; i<3; i++) { ppsz_options[i] = (char *) malloc(VLC_MAX_MRL * sizeof(char)); if (ppsz_options[i] == NULL) @@ -992,8 +972,8 @@ void onAddTranscodeToPlaylist (GtkButton *button, i_pos = snprintf( &mrl[0], VLC_MAX_MRL, "sout"); mrl[6] = '\0'; - - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "'#transcode{"); + /* option 1 */ + i_pos = snprintf( &ppsz_options[i_options][0], VLC_MAX_MRL, "sout='#transcode{"); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; p_entryVideoCodec = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryVideoCodec" ); @@ -1006,20 +986,20 @@ void onAddTranscodeToPlaylist (GtkButton *button, i_video_bitrate_tolerance = gtk_spin_button_get_value_as_int(p_entryVideoBitrateTolerance); i_video_keyframe_interval = gtk_spin_button_get_value_as_int(p_entryVideoKeyFrameInterval); - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "vcodec=%s,", (char*)p_video_codec ); + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "vcodec=%s,", (char*)p_video_codec ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "vb=%d,", (int)i_video_bitrate ); + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "vb=%d,", (int)i_video_bitrate ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "vt=%d,", (int)i_video_bitrate_tolerance ); + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "vt=%d,", (int)i_video_bitrate_tolerance ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "keyint=%d,", (int)i_video_keyframe_interval ); + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "keyint=%d,", (int)i_video_keyframe_interval ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; p_checkVideoDeinterlace = (GtkCheckButton*) lookup_widget( GTK_WIDGET(button), "checkVideoDeinterlace" ); b_video_deinterlace = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_checkVideoDeinterlace)); if (b_video_deinterlace) { - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "deinterlace," ); + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "deinterlace," ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; } p_entryAudioCodec = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryAudioCodec" ); @@ -1028,38 +1008,95 @@ void onAddTranscodeToPlaylist (GtkButton *button, p_audio_codec = gtk_entry_get_text(GTK_ENTRY(p_entryAudioCodec)); i_audio_bitrate = gtk_spin_button_get_value_as_int(p_entryAudioBitrate); - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "acodec=%s,", (char*)p_audio_codec ); + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "acodec=%s,", (char*)p_audio_codec ); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "ab=%d,", (int)i_audio_bitrate ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "ab=%d", (int)i_audio_bitrate ); + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "channels=1}"/*, (int)i_audio_channels*/ ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "}:std{" ); + /* option 2 */ + i_pos = 0; + i_pos = snprintf( &ppsz_options[i_options++][i_pos], VLC_MAX_MRL - i_pos, "dst=" ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; p_entryStdAccess = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryStdAccess" ); p_entryStdMuxer = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryStdMuxer" ); p_entryStdURL = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryStdURL" ); + p_entryStdAnnounce = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryAnnounceChannel" ); p_entryStdTTL = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryStdTTL" ); p_std_access = gtk_entry_get_text(GTK_ENTRY(p_entryStdAccess)); p_std_muxer = gtk_entry_get_text(GTK_ENTRY(p_entryStdMuxer)); p_std_url = gtk_entry_get_text(GTK_ENTRY(p_entryStdURL)); + p_std_announce = gtk_entry_get_text(GTK_ENTRY(p_entryStdAnnounce)); + b_sap_announce = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_checkSAP)); + b_slp_announce = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_checkSLP)); - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "access=%s,", (char*)p_std_access); - if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "mux=%s,", (char*)p_std_muxer); - if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "url=%s}'", (char*)p_std_url); - if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; -// i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "}'"); -// if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + if ( strncasecmp( (const char*)p_std_access, "display", 7 ) == 0) + { + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "%s,", (char*)p_std_access); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + } + else + { + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "std{access=%s,", (char*)p_std_access); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "mux=%s,", (char*)p_std_muxer); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "url=%s", (char*)p_std_url); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_std_ttl = gtk_spin_button_get_value_as_int(p_entryStdTTL); + if (strncasecmp( (const char*)p_std_access, "udp", 3)==0) + { + if (b_sap_announce) + { + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "sap=%s", (char*)p_std_announce); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + } + if (b_slp_announce) + { + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "slp=%s", (char*)p_std_announce); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + } + } + i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "}"); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; - i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "ttl=%d", (int)i_std_ttl); - if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + i_std_ttl = gtk_spin_button_get_value_as_int(p_entryStdTTL); + + i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "ttl=%d", (int)i_std_ttl); + if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; + } PlaylistAddItem(GTK_WIDGET(button), (gchar*) &mrl, ppsz_options, i_options); } + +void onEntryStdAccessChanged(GtkEditable *editable, gpointer user_data) +{ + intf_thread_t *p_intf = GtkGetIntf( editable ); + + GtkCheckButton *p_checkSAP = NULL; + GtkCheckButton *p_checkSLP = NULL; + GtkEntry *p_entryStdAccess = NULL; + const gchar *p_std_access; + gboolean b_announce = FALSE; + + p_entryStdAccess = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryStdAccess" ); + p_checkSAP = (GtkCheckButton*) lookup_widget( GTK_WIDGET(editable), "checkSAP" ); + p_checkSLP = (GtkCheckButton*) lookup_widget( GTK_WIDGET(editable), "checkSLP" ); + + if ( (p_std_access == NULL) || (p_checkSAP == NULL) || (p_checkSLP == NULL)) + { + msg_Err( p_intf, "Access, SAP and SLP widgets not found." ); + return; + } + p_std_access = gtk_entry_get_text(GTK_ENTRY(p_entryStdAccess)); + + b_announce = (strncasecmp( (const char*)p_std_access, "udp", 3) == 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(p_checkSAP), b_announce); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(p_checkSLP), b_announce); +} + diff --git a/modules/gui/pda/pda_callbacks.h b/modules/gui/pda/pda_callbacks.h index 820ac53e4a..6d3c188b1c 100644 --- a/modules/gui/pda/pda_callbacks.h +++ b/modules/gui/pda/pda_callbacks.h @@ -2,7 +2,7 @@ * callbacks.h : pda plugin for vlc ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: pda_callbacks.h,v 1.9 2003/11/18 20:36:40 jpsaman Exp $ + * $Id: pda_callbacks.h,v 1.10 2003/11/30 23:19:13 jpsaman Exp $ * * Authors: Jean-Paul Saman * @@ -144,3 +144,7 @@ void onAddTranscodeToPlaylist (GtkButton *button, gpointer user_data); + +void +onEntryStdAccessChanged (GtkEditable *editable, + gpointer user_data); diff --git a/modules/gui/pda/pda_interface.c b/modules/gui/pda/pda_interface.c index 6e2607c546..1bbd6019a7 100644 --- a/modules/gui/pda/pda_interface.c +++ b/modules/gui/pda/pda_interface.c @@ -148,9 +148,6 @@ create_pda (void) GtkWidget *comboStdMuxer; GList *comboStdMuxer_items = NULL; GtkWidget *entryStdMuxer; - GtkWidget *comboStdAccess; - GList *comboStdAccess_items = NULL; - GtkWidget *entryStdAccess; GtkObject *entryAudioBitrate_adj; GtkWidget *entryAudioBitrate; GtkWidget *comboAudioCodec; @@ -164,6 +161,16 @@ create_pda (void) GtkObject *entryVideoBitrate_adj; GtkWidget *entryVideoBitrate; GtkWidget *labelAudioBitrate; + GtkWidget *comboStdAccess; + GList *comboStdAccess_items = NULL; + GtkWidget *entryStdAccess; + GtkWidget *labelSAP; + GtkWidget *checkSAP; + GtkWidget *checkSLP; + GtkWidget *labelSLP_; + GtkWidget *labelAnounceChannel; + GtkWidget *comboAnnounceChannel; + GtkWidget *entryAnnounceChannel; GtkWidget *hbox14; GtkWidget *AddTranscodeToPlaylist; GtkWidget *Transcode; @@ -396,7 +403,6 @@ create_pda (void) gtk_widget_set_name (entryMRL, "entryMRL"); gtk_widget_show (entryMRL); gtk_widget_set_size_request (entryMRL, 158, 24); - gtk_entry_set_text (GTK_ENTRY (entryMRL), _("udp://:1234")); gtk_entry_set_activates_default (GTK_ENTRY (entryMRL), TRUE); hseparator15 = gtk_hseparator_new (); @@ -851,7 +857,7 @@ create_pda (void) gtk_widget_show (viewport5); gtk_container_add (GTK_CONTAINER (scrolledwindowTranscode), viewport5); - tableTranscode = gtk_table_new (11, 2, FALSE); + tableTranscode = gtk_table_new (14, 2, FALSE); gtk_widget_set_name (tableTranscode, "tableTranscode"); gtk_widget_show (tableTranscode); gtk_container_add (GTK_CONTAINER (viewport5), tableTranscode); @@ -874,23 +880,20 @@ create_pda (void) (GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL), (GtkAttachOptions) (0), 0, 0); comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("huffyuv")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("mpgv")); + comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("mp1v")); + comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("mp2v")); comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("mp4v")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("h263")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("DIV1")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("DIV2")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("DIV3")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("I420")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("I422")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("I444")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("RV24")); - comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("YUY2")); + comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("H263")); + comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("I263")); + comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("WMV1")); + comboVideoCodec_items = g_list_append (comboVideoCodec_items, (gpointer) _("WMV2")); gtk_combo_set_popdown_strings (GTK_COMBO (comboVideoCodec), comboVideoCodec_items); g_list_free (comboVideoCodec_items); entryVideoCodec = GTK_COMBO (comboVideoCodec)->entry; gtk_widget_set_name (entryVideoCodec, "entryVideoCodec"); gtk_widget_show (entryVideoCodec); + gtk_entry_set_text (GTK_ENTRY (entryVideoCodec), _("huffyuv")); gtk_entry_set_activates_default (GTK_ENTRY (entryVideoCodec), TRUE); labelVideoBitrate = gtk_label_new (_("Video Bitrate:")); @@ -1000,6 +1003,7 @@ create_pda (void) entryStdURL = GTK_COMBO (comboStdURL)->entry; gtk_widget_set_name (entryStdURL, "entryStdURL"); gtk_widget_show (entryStdURL); + gtk_entry_set_text (GTK_ENTRY (entryStdURL), _("127.0.0.1")); gtk_entry_set_activates_default (GTK_ENTRY (entryStdURL), TRUE); comboStdMuxer = gtk_combo_new (); @@ -1010,33 +1014,23 @@ create_pda (void) gtk_table_attach (GTK_TABLE (tableTranscode), comboStdMuxer, 1, 2, 8, 9, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("udp")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("ps")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("ts")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("mpeg1")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("avi")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("ogg")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("mp4")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("mov")); + comboStdMuxer_items = g_list_append (comboStdMuxer_items, (gpointer) _("asf")); gtk_combo_set_popdown_strings (GTK_COMBO (comboStdMuxer), comboStdMuxer_items); g_list_free (comboStdMuxer_items); entryStdMuxer = GTK_COMBO (comboStdMuxer)->entry; gtk_widget_set_name (entryStdMuxer, "entryStdMuxer"); gtk_widget_show (entryStdMuxer); + gtk_entry_set_text (GTK_ENTRY (entryStdMuxer), _("ps")); gtk_entry_set_activates_default (GTK_ENTRY (entryStdMuxer), TRUE); - comboStdAccess = gtk_combo_new (); - g_object_set_data (G_OBJECT (GTK_COMBO (comboStdAccess)->popwin), - "GladeParentKey", comboStdAccess); - gtk_widget_set_name (comboStdAccess, "comboStdAccess"); - gtk_widget_show (comboStdAccess); - gtk_table_attach (GTK_TABLE (tableTranscode), comboStdAccess, 1, 2, 7, 8, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("ts")); - comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("rtp")); - gtk_combo_set_popdown_strings (GTK_COMBO (comboStdAccess), comboStdAccess_items); - g_list_free (comboStdAccess_items); - - entryStdAccess = GTK_COMBO (comboStdAccess)->entry; - gtk_widget_set_name (entryStdAccess, "entryStdAccess"); - gtk_widget_show (entryStdAccess); - gtk_entry_set_activates_default (GTK_ENTRY (entryStdAccess), TRUE); - entryAudioBitrate_adj = gtk_adjustment_new (256, 0, 65535, 1, 10, 10); entryAudioBitrate = gtk_spin_button_new (GTK_ADJUSTMENT (entryAudioBitrate_adj), 1, 0); gtk_widget_set_name (entryAudioBitrate, "entryAudioBitrate"); @@ -1059,12 +1053,15 @@ create_pda (void) comboAudioCodec_items = g_list_append (comboAudioCodec_items, (gpointer) _("ulaw")); comboAudioCodec_items = g_list_append (comboAudioCodec_items, (gpointer) _("mpga")); comboAudioCodec_items = g_list_append (comboAudioCodec_items, (gpointer) _("mp3")); + comboAudioCodec_items = g_list_append (comboAudioCodec_items, (gpointer) _("a52")); + comboAudioCodec_items = g_list_append (comboAudioCodec_items, (gpointer) _("vorb")); gtk_combo_set_popdown_strings (GTK_COMBO (comboAudioCodec), comboAudioCodec_items); g_list_free (comboAudioCodec_items); entryAudioCodec = GTK_COMBO (comboAudioCodec)->entry; gtk_widget_set_name (entryAudioCodec, "entryAudioCodec"); gtk_widget_show (entryAudioCodec); + gtk_entry_set_text (GTK_ENTRY (entryAudioCodec), _("alaw")); gtk_entry_set_activates_default (GTK_ENTRY (entryAudioCodec), TRUE); checkVideoDeinterlace = gtk_check_button_new_with_mnemonic (_("enable")); @@ -1112,6 +1109,85 @@ create_pda (void) gtk_label_set_justify (GTK_LABEL (labelAudioBitrate), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelAudioBitrate), 0, 0.5); + comboStdAccess = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (comboStdAccess)->popwin), + "GladeParentKey", comboStdAccess); + gtk_widget_set_name (comboStdAccess, "comboStdAccess"); + gtk_widget_show (comboStdAccess); + gtk_table_attach (GTK_TABLE (tableTranscode), comboStdAccess, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("udp")); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("display")); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("file")); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("http")); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("mmsh")); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("rtp")); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("http")); + comboStdAccess_items = g_list_append (comboStdAccess_items, (gpointer) _("ftp")); + gtk_combo_set_popdown_strings (GTK_COMBO (comboStdAccess), comboStdAccess_items); + g_list_free (comboStdAccess_items); + + entryStdAccess = GTK_COMBO (comboStdAccess)->entry; + gtk_widget_set_name (entryStdAccess, "entryStdAccess"); + gtk_widget_show (entryStdAccess); + gtk_entry_set_text (GTK_ENTRY (entryStdAccess), _("udp")); + gtk_entry_set_activates_default (GTK_ENTRY (entryStdAccess), TRUE); + + labelSAP = gtk_label_new (_("SAP Announce:")); + gtk_widget_set_name (labelSAP, "labelSAP"); + gtk_widget_show (labelSAP); + gtk_table_attach (GTK_TABLE (tableTranscode), labelSAP, 0, 1, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (labelSAP), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (labelSAP), 0, 0.5); + + checkSAP = gtk_check_button_new_with_mnemonic (_("enable")); + gtk_widget_set_name (checkSAP, "checkSAP"); + gtk_widget_show (checkSAP); + gtk_table_attach (GTK_TABLE (tableTranscode), checkSAP, 1, 2, 11, 12, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + checkSLP = gtk_check_button_new_with_mnemonic (_("enable")); + gtk_widget_set_name (checkSLP, "checkSLP"); + gtk_widget_show (checkSLP); + gtk_table_attach (GTK_TABLE (tableTranscode), checkSLP, 1, 2, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + labelSLP_ = gtk_label_new (_("SLP Announce:")); + gtk_widget_set_name (labelSLP_, "labelSLP_"); + gtk_widget_show (labelSLP_); + gtk_table_attach (GTK_TABLE (tableTranscode), labelSLP_, 0, 1, 12, 13, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (labelSLP_), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (labelSLP_), 0, 0.5); + + labelAnounceChannel = gtk_label_new (_("Announce Channel:")); + gtk_widget_set_name (labelAnounceChannel, "labelAnounceChannel"); + gtk_widget_show (labelAnounceChannel); + gtk_table_attach (GTK_TABLE (tableTranscode), labelAnounceChannel, 0, 1, 13, 14, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (labelAnounceChannel), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (labelAnounceChannel), 0, 0.5); + + comboAnnounceChannel = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (comboAnnounceChannel)->popwin), + "GladeParentKey", comboAnnounceChannel); + gtk_widget_set_name (comboAnnounceChannel, "comboAnnounceChannel"); + gtk_widget_show (comboAnnounceChannel); + gtk_table_attach (GTK_TABLE (tableTranscode), comboAnnounceChannel, 1, 2, 13, 14, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + entryAnnounceChannel = GTK_COMBO (comboAnnounceChannel)->entry; + gtk_widget_set_name (entryAnnounceChannel, "entryAnnounceChannel"); + gtk_widget_show (entryAnnounceChannel); + hbox14 = gtk_hbox_new (FALSE, 0); gtk_widget_set_name (hbox14, "hbox14"); gtk_widget_show (hbox14); @@ -1319,6 +1395,9 @@ create_pda (void) g_signal_connect ((gpointer) AddCameraToPlaylist, "pressed", G_CALLBACK (onAddCameraToPlaylist), NULL); + g_signal_connect ((gpointer) entryStdAccess, "changed", + G_CALLBACK (onEntryStdAccessChanged), + NULL); g_signal_connect ((gpointer) AddTranscodeToPlaylist, "pressed", G_CALLBACK (onAddTranscodeToPlaylist), NULL); @@ -1452,8 +1531,6 @@ create_pda (void) GLADE_HOOKUP_OBJECT (pda, entryStdURL, "entryStdURL"); GLADE_HOOKUP_OBJECT (pda, comboStdMuxer, "comboStdMuxer"); GLADE_HOOKUP_OBJECT (pda, entryStdMuxer, "entryStdMuxer"); - GLADE_HOOKUP_OBJECT (pda, comboStdAccess, "comboStdAccess"); - GLADE_HOOKUP_OBJECT (pda, entryStdAccess, "entryStdAccess"); GLADE_HOOKUP_OBJECT (pda, entryAudioBitrate, "entryAudioBitrate"); GLADE_HOOKUP_OBJECT (pda, comboAudioCodec, "comboAudioCodec"); GLADE_HOOKUP_OBJECT (pda, entryAudioCodec, "entryAudioCodec"); @@ -1462,6 +1539,15 @@ create_pda (void) GLADE_HOOKUP_OBJECT (pda, entryVideoBitrateTolerance, "entryVideoBitrateTolerance"); GLADE_HOOKUP_OBJECT (pda, entryVideoBitrate, "entryVideoBitrate"); GLADE_HOOKUP_OBJECT (pda, labelAudioBitrate, "labelAudioBitrate"); + GLADE_HOOKUP_OBJECT (pda, comboStdAccess, "comboStdAccess"); + GLADE_HOOKUP_OBJECT (pda, entryStdAccess, "entryStdAccess"); + GLADE_HOOKUP_OBJECT (pda, labelSAP, "labelSAP"); + GLADE_HOOKUP_OBJECT (pda, checkSAP, "checkSAP"); + GLADE_HOOKUP_OBJECT (pda, checkSLP, "checkSLP"); + GLADE_HOOKUP_OBJECT (pda, labelSLP_, "labelSLP_"); + GLADE_HOOKUP_OBJECT (pda, labelAnounceChannel, "labelAnounceChannel"); + GLADE_HOOKUP_OBJECT (pda, comboAnnounceChannel, "comboAnnounceChannel"); + GLADE_HOOKUP_OBJECT (pda, entryAnnounceChannel, "entryAnnounceChannel"); GLADE_HOOKUP_OBJECT (pda, hbox14, "hbox14"); GLADE_HOOKUP_OBJECT (pda, AddTranscodeToPlaylist, "AddTranscodeToPlaylist"); GLADE_HOOKUP_OBJECT (pda, Transcode, "Transcode"); diff --git a/modules/gui/pda/pda_support.c b/modules/gui/pda/pda_support.c index 13d768099d..d00ebf049c 100644 --- a/modules/gui/pda/pda_support.c +++ b/modules/gui/pda/pda_support.c @@ -29,7 +29,7 @@ lookup_widget (GtkWidget *widget, else parent = widget->parent; if (!parent) - parent = g_object_get_data (G_OBJECT (widget), "GladeParentKey"); + parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); if (parent == NULL) break; widget = parent; -- 2.39.2