[vlc-commits] chromecast: clean up variables
vlc/vlc-3.0 | branch: master | Thomas Guillem | Fri Feb 23 08:41:24 2018 +0100| [06e745afbf96d956462248e3e69998eb07ed3487] | committer: Thomas Guillem chromecast: clean up variables - Hide "video" option. This option should only be set by the core (via the renderer item). If a user doesn't want video, he could disable the video track now. - Remove mux/mime options: this code has only been tested for the default mime/mux, there is no point of changing it. - Remove translations for privates options. This make the chromecast advanced preferences more understandable. (cherry picked from commit 65472a29a3081cdb3950c8b1793124296624eb10) Signed-off-by: Thomas Guillem > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=06e745afbf96d956462248e3e69998eb07ed3487 --- modules/stream_out/chromecast/cast.cpp | 55 +- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp index 5bdb39ca59..51e9491f32 100644 --- a/modules/stream_out/chromecast/cast.cpp +++ b/modules/stream_out/chromecast/cast.cpp @@ -79,14 +79,10 @@ private: struct sout_stream_sys_t { -sout_stream_sys_t(httpd_host_t *httpd_host, intf_sys_t * const intf, bool has_video, int port, - const char *psz_default_muxer, const char *psz_default_mime) +sout_stream_sys_t(httpd_host_t *httpd_host, intf_sys_t * const intf, bool has_video, int port) : httpd_host(httpd_host) , access_out_live(httpd_host, intf, "/stream") , p_out(NULL) -, default_muxer(psz_default_muxer) -, default_mime(psz_default_mime) -, mime(psz_default_mime) , p_intf(intf) , b_supports_video(has_video) , i_port(port) @@ -123,8 +119,6 @@ struct sout_stream_sys_t sout_access_out_sys_t access_out_live; sout_stream_t *p_out; -const std::string default_muxer; -const std::string default_mime; std::stringmime; vlc_mutex_tlock; /* for input events cb */ @@ -172,7 +166,7 @@ static int AccessOpen(vlc_object_t *); static void AccessClose(vlc_object_t *); static const char *const ppsz_sout_options[] = { -"ip", "port", "http-port", "mux", "mime", "video", NULL +"ip", "port", "http-port", "video", NULL }; /* @@ -182,12 +176,6 @@ static const char *const ppsz_sout_options[] = { #define HTTP_PORT_TEXT N_("HTTP port") #define HTTP_PORT_LONGTEXT N_("This sets the HTTP port of the local server " \ "used to stream the media to the Chromecast.") -#define HAS_VIDEO_TEXT N_("Video") -#define HAS_VIDEO_LONGTEXT N_("The Chromecast receiver can receive video.") -#define MUX_TEXT N_("Muxer") -#define MUX_LONGTEXT N_("This sets the muxer used to stream to the Chromecast.") -#define MIME_TEXT N_("MIME content type") -#define MIME_LONGTEXT N_("This sets the media MIME content type sent to the Chromecast.") #define PERF_TEXT N_( "Performance warning" ) #define PERF_LONGTEXT N_( "Display a performance warning when transcoding" ) #define AUDIO_PASSTHROUGH_TEXT N_( "Enable Audio passthrough" ) @@ -243,14 +231,15 @@ vlc_module_begin () set_subcategory(SUBCAT_SOUT_STREAM) set_callbacks(Open, Close) -add_string(SOUT_CFG_PREFIX "ip", NULL, IP_ADDR_TEXT, IP_ADDR_LONGTEXT, false) +add_string(SOUT_CFG_PREFIX "ip", NULL, NULL, NULL, false) change_private() -add_integer(SOUT_CFG_PREFIX "port", CHROMECAST_CONTROL_PORT, PORT_TEXT, PORT_LONGTEXT, false) +add_integer(SOUT_CFG_PREFIX "port", CHROMECAST_CONTROL_PORT, NULL, NULL, false) +change_private() +add_bool(SOUT_CFG_PREFIX "video", true, NULL, NULL, false) change_private() add_integer(SOUT_CFG_PREFIX "http-port", HTTP_PORT, HTTP_PORT_TEXT, HTTP_PORT_LONGTEXT, false) -add_bool(SOUT_CFG_PREFIX "video", true, HAS_VIDEO_TEXT, HAS_VIDEO_LONGTEXT, false) -add_string(SOUT_CFG_PREFIX "mux", DEFAULT_MUXER, MUX_TEXT, MUX_LONGTEXT, false) -add_string(SOUT_CFG_PREFIX "mime", "video/x-matroska", MIME_TEXT, MIME_LONGTEXT, false) +add_obsolete_string(SOUT_CFG_PREFIX "mux") +add_obsolete_string(SOUT_CFG_PREFIX "mime") add_integer(SOUT_CFG_PREFIX "show-perf-warning", 1, PERF_TEXT, PERF_LONGTEXT, true ) change_private() add_bool(SOUT_CFG_PREFIX "audio-passthrough", false, AUDIO_PASSTHROUGH_TEXT, AUDIO_PASSTHROUGH_LONGTEXT, false ) @@ -1105,17 +1094,16 @@ bool sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream ) } ssout << "}:"; } -if ( !p_original_video && default_muxer == DEFAULT_MUXER ) +if ( !p_original_video ) mime = "audio/x-matroska"; else if ( i_codec_audio == VLC_CODEC_VORBIS && - i_codec_video == VLC_CODEC_VP8 && - default_muxer == DEFAULT_MUXER ) + i_c
[vlc-commits] chromecast: clean up variables
vlc | branch: master | Thomas Guillem | Fri Feb 23 08:41:24 2018 +0100| [65472a29a3081cdb3950c8b1793124296624eb10] | committer: Thomas Guillem chromecast: clean up variables - Hide "video" option. This option should only be set by the core (via the renderer item). If a user doesn't want video, he could disable the video track now. - Remove mux/mime options: this code has only been tested for the default mime/mux, there is no point of changing it. - Remove translations for privates options. This make the chromecast advanced preferences more understandable. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=65472a29a3081cdb3950c8b1793124296624eb10 --- modules/stream_out/chromecast/cast.cpp | 55 +- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp index 5bdb39ca59..51e9491f32 100644 --- a/modules/stream_out/chromecast/cast.cpp +++ b/modules/stream_out/chromecast/cast.cpp @@ -79,14 +79,10 @@ private: struct sout_stream_sys_t { -sout_stream_sys_t(httpd_host_t *httpd_host, intf_sys_t * const intf, bool has_video, int port, - const char *psz_default_muxer, const char *psz_default_mime) +sout_stream_sys_t(httpd_host_t *httpd_host, intf_sys_t * const intf, bool has_video, int port) : httpd_host(httpd_host) , access_out_live(httpd_host, intf, "/stream") , p_out(NULL) -, default_muxer(psz_default_muxer) -, default_mime(psz_default_mime) -, mime(psz_default_mime) , p_intf(intf) , b_supports_video(has_video) , i_port(port) @@ -123,8 +119,6 @@ struct sout_stream_sys_t sout_access_out_sys_t access_out_live; sout_stream_t *p_out; -const std::string default_muxer; -const std::string default_mime; std::stringmime; vlc_mutex_tlock; /* for input events cb */ @@ -172,7 +166,7 @@ static int AccessOpen(vlc_object_t *); static void AccessClose(vlc_object_t *); static const char *const ppsz_sout_options[] = { -"ip", "port", "http-port", "mux", "mime", "video", NULL +"ip", "port", "http-port", "video", NULL }; /* @@ -182,12 +176,6 @@ static const char *const ppsz_sout_options[] = { #define HTTP_PORT_TEXT N_("HTTP port") #define HTTP_PORT_LONGTEXT N_("This sets the HTTP port of the local server " \ "used to stream the media to the Chromecast.") -#define HAS_VIDEO_TEXT N_("Video") -#define HAS_VIDEO_LONGTEXT N_("The Chromecast receiver can receive video.") -#define MUX_TEXT N_("Muxer") -#define MUX_LONGTEXT N_("This sets the muxer used to stream to the Chromecast.") -#define MIME_TEXT N_("MIME content type") -#define MIME_LONGTEXT N_("This sets the media MIME content type sent to the Chromecast.") #define PERF_TEXT N_( "Performance warning" ) #define PERF_LONGTEXT N_( "Display a performance warning when transcoding" ) #define AUDIO_PASSTHROUGH_TEXT N_( "Enable Audio passthrough" ) @@ -243,14 +231,15 @@ vlc_module_begin () set_subcategory(SUBCAT_SOUT_STREAM) set_callbacks(Open, Close) -add_string(SOUT_CFG_PREFIX "ip", NULL, IP_ADDR_TEXT, IP_ADDR_LONGTEXT, false) +add_string(SOUT_CFG_PREFIX "ip", NULL, NULL, NULL, false) change_private() -add_integer(SOUT_CFG_PREFIX "port", CHROMECAST_CONTROL_PORT, PORT_TEXT, PORT_LONGTEXT, false) +add_integer(SOUT_CFG_PREFIX "port", CHROMECAST_CONTROL_PORT, NULL, NULL, false) +change_private() +add_bool(SOUT_CFG_PREFIX "video", true, NULL, NULL, false) change_private() add_integer(SOUT_CFG_PREFIX "http-port", HTTP_PORT, HTTP_PORT_TEXT, HTTP_PORT_LONGTEXT, false) -add_bool(SOUT_CFG_PREFIX "video", true, HAS_VIDEO_TEXT, HAS_VIDEO_LONGTEXT, false) -add_string(SOUT_CFG_PREFIX "mux", DEFAULT_MUXER, MUX_TEXT, MUX_LONGTEXT, false) -add_string(SOUT_CFG_PREFIX "mime", "video/x-matroska", MIME_TEXT, MIME_LONGTEXT, false) +add_obsolete_string(SOUT_CFG_PREFIX "mux") +add_obsolete_string(SOUT_CFG_PREFIX "mime") add_integer(SOUT_CFG_PREFIX "show-perf-warning", 1, PERF_TEXT, PERF_LONGTEXT, true ) change_private() add_bool(SOUT_CFG_PREFIX "audio-passthrough", false, AUDIO_PASSTHROUGH_TEXT, AUDIO_PASSTHROUGH_LONGTEXT, false ) @@ -1105,17 +1094,16 @@ bool sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream ) } ssout << "}:"; } -if ( !p_original_video && default_muxer == DEFAULT_MUXER ) +if ( !p_original_video ) mime = "audio/x-matroska"; else if ( i_codec_audio == VLC_CODEC_VORBIS && - i_codec_video == VLC_CODEC_VP8 && - default_muxer == DEFAULT_MUXER ) + i_codec_video == VLC_CODEC_VP8 ) mime = "video/webm"; else -mime = default_mime; +mime = "