1 /*****************************************************************************
2 * renderer_common.hpp : renderer helper functions
3 *****************************************************************************
4 * Copyright © 2014-2018 VideoLAN
6 * Authors: Adrien Maglo <magsoft@videolan.org>
7 * Jean-Baptiste Kempf <jb@videolan.org>
8 * Steve Lhomme <robux4@videolabs.io>
9 * Shaleen Jain <shaleen@jain.sh>
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 #ifndef RENDERER_COMMON_H
27 #define RENDERER_COMMON_H
32 #include <vlc_common.h>
35 #define PERF_TEXT N_( "Performance warning" )
36 #define PERF_LONGTEXT N_( "Display a performance warning when transcoding" )
37 #define AUDIO_PASSTHROUGH_TEXT N_( "Enable Audio passthrough" )
38 #define AUDIO_PASSTHROUGH_LONGTEXT N_( "Disable if your receiver does not support Dolby®." )
39 #define CONVERSION_QUALITY_TEXT N_( "Conversion quality" )
40 #define CONVERSION_QUALITY_LONGTEXT N_( "Change conversion speed or quality." )
42 #if defined (__ANDROID__) || defined (__arm__) || (defined (TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
43 # define CONVERSION_QUALITY_DEFAULT CONVERSION_QUALITY_LOW
45 # define CONVERSION_QUALITY_DEFAULT CONVERSION_QUALITY_MEDIUM
48 #define RENDERER_CFG_PREFIX "sout-renderer-"
50 #define add_renderer_opts(prefix) \
51 add_integer(RENDERER_CFG_PREFIX "show-perf-warning", 1, \
52 PERF_TEXT, PERF_LONGTEXT, true ) \
54 add_bool(prefix "audio-passthrough", false, \
55 AUDIO_PASSTHROUGH_TEXT, AUDIO_PASSTHROUGH_LONGTEXT, false ) \
56 add_integer(prefix "conversion-quality", CONVERSION_QUALITY_DEFAULT, \
57 CONVERSION_QUALITY_TEXT, CONVERSION_QUALITY_LONGTEXT, false ); \
58 change_integer_list(conversion_quality_list, conversion_quality_list_text)
60 static const char *const conversion_quality_list_text
[] = {
61 N_( "High (high quality and high bandwidth)" ),
62 N_( "Medium (medium quality and medium bandwidth)" ),
63 N_( "Low (low quality and low bandwidth)" ),
64 N_( "Low CPU (low quality but high bandwidth)" ),
68 CONVERSION_QUALITY_HIGH
= 0,
69 CONVERSION_QUALITY_MEDIUM
= 1,
70 CONVERSION_QUALITY_LOW
= 2,
71 CONVERSION_QUALITY_LOWCPU
= 3,
74 static const int conversion_quality_list
[] = {
75 CONVERSION_QUALITY_HIGH
,
76 CONVERSION_QUALITY_MEDIUM
,
77 CONVERSION_QUALITY_LOW
,
78 CONVERSION_QUALITY_LOWCPU
,
82 vlc_sout_renderer_GetVcodecOption(sout_stream_t
*p_stream
,
83 std::vector
<vlc_fourcc_t
> codecs
,
84 vlc_fourcc_t
*out_codec
, const video_format_t
*p_vid
, int i_quality
);
86 #endif /* RENDERER_COMMON_H */