[vlc-commits] chromecast: fix webm support
Thomas Guillem
git at videolan.org
Mon Feb 26 12:05:16 CET 2018
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb 23 13:36:29 2018 +0100| [5b4eff1eec4f98266870ad8fd34a8f9375936c07] | committer: Thomas Guillem
chromecast: fix webm support
VP9 and OPUS are webm. Also configure the muxer for webm.
(cherry picked from commit 79cc5199669369222531743302e1bc4b971c5cd9)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=5b4eff1eec4f98266870ad8fd34a8f9375936c07
---
modules/stream_out/chromecast/cast.cpp | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 695c3cc8f8..18c6f14d58 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -156,6 +156,7 @@ struct sout_stream_id_sys_t
static const vlc_fourcc_t DEFAULT_TRANSCODE_VIDEO = VLC_CODEC_H264;
static const char DEFAULT_MUXER[] = "avformat{mux=matroska,options={live=1}}";
+static const char DEFAULT_MUXER_WEBM[] = "avformat{mux=webm,options={live=1}}";
/*****************************************************************************
@@ -1097,16 +1098,29 @@ bool sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream )
}
ssout << "}:";
}
+
+ const bool is_webm = ( i_codec_audio == 0 || i_codec_audio == VLC_CODEC_VORBIS ||
+ i_codec_audio == VLC_CODEC_OPUS ) &&
+ ( i_codec_video == 0 || i_codec_video == VLC_CODEC_VP8 ||
+ i_codec_video == VLC_CODEC_VP9 );
+
if ( !p_original_video )
- mime = "audio/x-matroska";
- else if ( i_codec_audio == VLC_CODEC_VORBIS &&
- i_codec_video == VLC_CODEC_VP8 )
- mime = "video/webm";
+ {
+ if( is_webm )
+ mime = "audio/webm";
+ else
+ mime = "audio/x-matroska";
+ }
else
- mime = "video/x-matroska";
+ {
+ if ( is_webm )
+ mime = "video/webm";
+ else
+ mime = "video/x-matroska";
+ }
ssout << "chromecast-proxy:"
- << "std{mux=" << DEFAULT_MUXER
+ << "std{mux=" << ( is_webm ? DEFAULT_MUXER_WEBM : DEFAULT_MUXER )
<< ",access=chromecast-http}";
if ( !startSoutChain( p_stream, new_streams, ssout.str(),
More information about the vlc-commits
mailing list