vlc | branch: master | Shaleen Jain <shal...@jain.sh> | Thu Jan 17 10:41:39 2019 +0530| [ce8b76c4ecb2d4377024f5fc8da7918c29fcbee8] | committer: Thomas Guillem
sout: chromecast: fix regression Before commit ec61edc0d0292ab37bb1dbafb23a8aed49e966bb chromecast depended on vlc_sout_renderer_GetVcodecOption to signal the codec selected to transcode to. Achieve that by introducing an output parameter where the codec used is written. Signed-off-by: Thomas Guillem <tho...@gllm.fr> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce8b76c4ecb2d4377024f5fc8da7918c29fcbee8 --- modules/stream_out/chromecast/cast.cpp | 1 + modules/stream_out/dlna/dlna.cpp | 1 + modules/stream_out/renderer_common.cpp | 8 +++++--- modules/stream_out/renderer_common.hpp | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp index 627397894e..2837e2e361 100644 --- a/modules/stream_out/chromecast/cast.cpp +++ b/modules/stream_out/chromecast/cast.cpp @@ -1051,6 +1051,7 @@ bool sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream ) try { ssout << vlc_sout_renderer_GetVcodecOption( p_stream, { VLC_CODEC_H264, VLC_CODEC_VP8 }, + &i_codec_video, &p_original_video->video, i_quality ); new_transcoding_state |= TRANSCODING_VIDEO; } catch(const std::exception& e) { diff --git a/modules/stream_out/dlna/dlna.cpp b/modules/stream_out/dlna/dlna.cpp index 8716911b0c..da966442f5 100644 --- a/modules/stream_out/dlna/dlna.cpp +++ b/modules/stream_out/dlna/dlna.cpp @@ -439,6 +439,7 @@ int sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream ) try { ssout << vlc_sout_renderer_GetVcodecOption( p_stream, { i_codec_video }, + &i_codec_video, &p_original_video->video, i_quality ); } catch(const std::exception& e) { return VLC_EGENERIC ; diff --git a/modules/stream_out/renderer_common.cpp b/modules/stream_out/renderer_common.cpp index 1555d7bb46..77b6c8c747 100644 --- a/modules/stream_out/renderer_common.cpp +++ b/modules/stream_out/renderer_common.cpp @@ -81,7 +81,7 @@ std::map<vlc_fourcc_t, std::vector<venc_options>> opts = { std::string GetVencOption( sout_stream_t *p_stream, std::vector<vlc_fourcc_t> codecs, - const video_format_t *p_vid, int i_quality ) + vlc_fourcc_t *out_codec, const video_format_t *p_vid, int i_quality ) { for (vlc_fourcc_t codec : codecs) { auto opt = opts.find(codec); @@ -131,6 +131,7 @@ GetVencOption( sout_stream_t *p_stream, std::vector<vlc_fourcc_t> codecs, if( success ) { msg_Dbg( p_stream, "Converting video to %.4s", (const char*)&codec ); + *out_codec = codec; return ssvenc.str(); } } @@ -142,13 +143,14 @@ GetVencOption( sout_stream_t *p_stream, std::vector<vlc_fourcc_t> codecs, std::string vlc_sout_renderer_GetVcodecOption(sout_stream_t *p_stream, - std::vector<vlc_fourcc_t> codecs, const video_format_t *p_vid, int i_quality) + std::vector<vlc_fourcc_t> codecs, + vlc_fourcc_t *out_codec, const video_format_t *p_vid, int i_quality) { std::stringstream ssout; static const char video_maxres_hd[] = "maxwidth=1920,maxheight=1080"; static const char video_maxres_720p[] = "maxwidth=1280,maxheight=720"; - ssout << GetVencOption( p_stream, codecs, p_vid, i_quality ); + ssout << GetVencOption( p_stream, codecs, out_codec, p_vid, i_quality ); switch ( i_quality ) { diff --git a/modules/stream_out/renderer_common.hpp b/modules/stream_out/renderer_common.hpp index 808aa76ffb..46d09716b4 100644 --- a/modules/stream_out/renderer_common.hpp +++ b/modules/stream_out/renderer_common.hpp @@ -80,6 +80,7 @@ static const int conversion_quality_list[] = { std::string vlc_sout_renderer_GetVcodecOption(sout_stream_t *p_stream, - std::vector<vlc_fourcc_t> codecs, const video_format_t *p_vid, int i_quality); + std::vector<vlc_fourcc_t> codecs, + vlc_fourcc_t *out_codec, const video_format_t *p_vid, int i_quality); #endif /* RENDERER_COMMON_H */ _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits